diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java index 450c3c603c17..fb1bf7287622 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/AccountsInner.java @@ -130,10 +130,10 @@ interface AccountsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the AccountResourceInner object wrapped in ServiceResponse if successful. + * @return the AccountResourceInner object if successful. */ - public ServiceResponse create(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createAsync(resourceGroupName, accountName, parameters).toBlocking().last(); + public AccountResourceInner create(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().getBody(); } /** @@ -146,7 +146,7 @@ public ServiceResponse create(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createAsync(resourceGroupName, accountName, parameters), serviceCallback); + return ServiceCall.create(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } /** @@ -157,7 +157,24 @@ public ServiceCall createAsync(String resourceGroupName, S * @param parameters Additional parameters for account creation. * @return the observable for the request */ - public Observable> createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + public Observable createAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, AccountResourceInner>() { + @Override + public AccountResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the new Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -187,10 +204,10 @@ public Observable> createAsync(String reso * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AccountResourceInner object wrapped in {@link ServiceResponse} if successful. + * @return the AccountResourceInner object if successful. */ - public ServiceResponse beginCreate(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateAsync(resourceGroupName, accountName, parameters).toBlocking().single(); + public AccountResourceInner beginCreate(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().getBody(); } /** @@ -203,7 +220,24 @@ public ServiceResponse beginCreate(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateAsync(resourceGroupName, accountName, parameters), serviceCallback); + return ServiceCall.create(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Creates a new Batch account with the specified parameters. Existing accounts cannot be updated with this API and should instead be updated with the Update Batch Account API. + * + * @param resourceGroupName The name of the resource group that contains the new Batch account. + * @param accountName A name for the Batch account which must be unique within the region. Batch account names must be between 3 and 24 characters in length and must use only numbers and lowercase letters. This name is used as part of the DNS name that is used to access the Batch service in the region in which the account is created. For example: http://accountname.region.batch.azure.com/. + * @param parameters Additional parameters for account creation. + * @return the observable to the AccountResourceInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, AccountResourceInner>() { + @Override + public AccountResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -214,7 +248,7 @@ public ServiceCall beginCreateAsync(String resourceGroupNa * @param parameters Additional parameters for account creation. * @return the observable to the AccountResourceInner object */ - public Observable> beginCreateAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountCreateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -262,10 +296,10 @@ private ServiceResponse beginCreateDelegate(Response update(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return updateAsync(resourceGroupName, accountName, parameters).toBlocking().single(); + public AccountResourceInner update(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().getBody(); } /** @@ -278,7 +312,7 @@ public ServiceResponse update(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateAsync(resourceGroupName, accountName, parameters), serviceCallback); + return ServiceCall.create(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } /** @@ -289,7 +323,24 @@ public ServiceCall updateAsync(String resourceGroupName, S * @param parameters Additional parameters for account update. * @return the observable to the AccountResourceInner object */ - public Observable> updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { + public Observable updateAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, AccountResourceInner>() { + @Override + public AccountResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Updates the properties of an existing Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the account. + * @param parameters Additional parameters for account update. + * @return the observable to the AccountResourceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, BatchAccountUpdateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -336,10 +387,9 @@ private ServiceResponse updateDelegate(Response delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, accountName).toBlocking().last(); + public void delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().last().getBody(); } /** @@ -351,7 +401,23 @@ public ServiceResponse delete(String resourceGroupName, String accountName * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account to be deleted. + * @param accountName The name of the account to be deleted. + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -361,7 +427,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String accountNam * @param accountName The name of the account to be deleted. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String accountName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -386,10 +452,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, accountName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -401,7 +466,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String accoun * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Deletes the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account to be deleted. + * @param accountName The name of the account to be deleted. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String accountName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -411,7 +492,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String accou * @param accountName The name of the account to be deleted. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String accountName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -454,10 +535,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AccountResourceInner object wrapped in {@link ServiceResponse} if successful. + * @return the AccountResourceInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, accountName).toBlocking().single(); + public AccountResourceInner get(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -469,7 +550,7 @@ public ServiceResponse get(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** @@ -479,7 +560,23 @@ public ServiceCall getAsync(String resourceGroupName, Stri * @param accountName The name of the account. * @return the observable to the AccountResourceInner object */ - public Observable> getAsync(String resourceGroupName, String accountName) { + public Observable getAsync(String resourceGroupName, String accountName) { + return getWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, AccountResourceInner>() { + @Override + public AccountResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets information about the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the account. + * @return the observable to the AccountResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -519,17 +616,16 @@ private ServiceResponse getDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -553,15 +649,33 @@ public Observable>> call(String nextP /** * Gets information about the Batch accounts associated with the subscription. * - * @return the observable to the List<AccountResourceInner> object + * @return the observable to the PagedList<AccountResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets information about the Batch accounts associated with the subscription. + * + * @return the observable to the PagedList<AccountResourceInner> object */ - public Observable>> listAsync() { + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -569,7 +683,7 @@ public Observable>> call(ServiceRespo /** * Gets information about the Batch accounts associated with the subscription. * - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -606,17 +720,16 @@ private ServiceResponse> listDelegate(Response> listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -642,15 +755,34 @@ public Observable>> call(String nextP * Gets information about the Batch accounts associated within the specified resource group. * * @param resourceGroupName The name of the resource group whose Batch accounts to list. - * @return the observable to the List<AccountResourceInner> object + * @return the observable to the PagedList<AccountResourceInner> object */ - public Observable>> listByResourceGroupAsync(final String resourceGroupName) { + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets information about the Batch accounts associated within the specified resource group. + * + * @param resourceGroupName The name of the resource group whose Batch accounts to list. + * @return the observable to the PagedList<AccountResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { return listByResourceGroupSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listByResourceGroupNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -659,7 +791,7 @@ public Observable>> call(ServiceRespo * Gets information about the Batch accounts associated within the specified resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group whose Batch accounts to list. - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -700,10 +832,9 @@ private ServiceResponse> listByResourceGroupDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse synchronizeAutoStorageKeys(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return synchronizeAutoStorageKeysAsync(resourceGroupName, accountName).toBlocking().single(); + public void synchronizeAutoStorageKeys(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + synchronizeAutoStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -715,7 +846,23 @@ public ServiceResponse synchronizeAutoStorageKeys(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(synchronizeAutoStorageKeysAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(synchronizeAutoStorageKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Synchronizes access keys for the auto storage account configured for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName) { + return synchronizeAutoStorageKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -725,7 +872,7 @@ public ServiceCall synchronizeAutoStorageKeysAsync(String resourceGroupNam * @param accountName The name of the Batch account. * @return the {@link ServiceResponse} object if successful. */ - public Observable> synchronizeAutoStorageKeysAsync(String resourceGroupName, String accountName) { + public Observable> synchronizeAutoStorageKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -767,10 +914,10 @@ private ServiceResponse synchronizeAutoStorageKeysDelegate(Response regenerateKey(String resourceGroupName, String accountName, AccountKeyType keyName) throws CloudException, IOException, IllegalArgumentException { - return regenerateKeyAsync(resourceGroupName, accountName, keyName).toBlocking().single(); + public BatchAccountRegenerateKeyResultInner regenerateKey(String resourceGroupName, String accountName, AccountKeyType keyName) throws CloudException, IOException, IllegalArgumentException { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().getBody(); } /** @@ -783,7 +930,24 @@ public ServiceResponse regenerateKey(Strin * @return the {@link ServiceCall} object */ public ServiceCall regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName, final ServiceCallback serviceCallback) { - return ServiceCall.create(regenerateKeyAsync(resourceGroupName, accountName, keyName), serviceCallback); + return ServiceCall.create(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates the specified account key for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the account. + * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' + * @return the observable to the BatchAccountRegenerateKeyResultInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, BatchAccountRegenerateKeyResultInner>() { + @Override + public BatchAccountRegenerateKeyResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -794,7 +958,7 @@ public ServiceCall regenerateKeyAsync(Stri * @param keyName The type of account key to regenerate. Possible values include: 'Primary', 'Secondary' * @return the observable to the BatchAccountRegenerateKeyResultInner object */ - public Observable> regenerateKeyAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, AccountKeyType keyName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -841,10 +1005,10 @@ private ServiceResponse regenerateKeyDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BatchAccountListKeyResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the BatchAccountListKeyResultInner object if successful. */ - public ServiceResponse listKeys(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return listKeysAsync(resourceGroupName, accountName).toBlocking().single(); + public BatchAccountListKeyResultInner listKeys(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -856,7 +1020,7 @@ public ServiceResponse listKeys(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listKeysAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** @@ -866,7 +1030,23 @@ public ServiceCall listKeysAsync(String resource * @param accountName The name of the account. * @return the observable to the BatchAccountListKeyResultInner object */ - public Observable> listKeysAsync(String resourceGroupName, String accountName) { + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, BatchAccountListKeyResultInner>() { + @Override + public BatchAccountListKeyResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Lists the account keys for the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the account. + * @return the observable to the BatchAccountListKeyResultInner object + */ + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -907,17 +1087,16 @@ private ServiceResponse listKeysDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -944,15 +1123,34 @@ public Observable>> call(String nextP * Gets information about the Batch accounts associated with the subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<AccountResourceInner> object + * @return the observable to the PagedList<AccountResourceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets information about the Batch accounts associated with the subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<AccountResourceInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -961,7 +1159,7 @@ public Observable>> call(ServiceRespo * Gets information about the Batch accounts associated with the subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -995,17 +1193,16 @@ private ServiceResponse> listNextDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object if successful. */ - public ServiceResponse> listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1032,15 +1229,34 @@ public Observable>> call(String nextP * Gets information about the Batch accounts associated within the specified resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<AccountResourceInner> object + * @return the observable to the PagedList<AccountResourceInner> object */ - public Observable>> listByResourceGroupNextAsync(final String nextPageLink) { + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets information about the Batch accounts associated within the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<AccountResourceInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listByResourceGroupNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1049,7 +1265,7 @@ public Observable>> call(ServiceRespo * Gets information about the Batch accounts associated within the specified resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<AccountResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java index 8dc57fafb789..35ccdd891a63 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/ApplicationsInner.java @@ -118,10 +118,9 @@ interface ApplicationsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse activateApplicationPackage(String resourceGroupName, String accountName, String id, String version, String format) throws CloudException, IOException, IllegalArgumentException { - return activateApplicationPackageAsync(resourceGroupName, accountName, id, version, format).toBlocking().single(); + public void activateApplicationPackage(String resourceGroupName, String accountName, String id, String version, String format) throws CloudException, IOException, IllegalArgumentException { + activateApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, id, version, format).toBlocking().single().getBody(); } /** @@ -136,7 +135,26 @@ public ServiceResponse activateApplicationPackage(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall activateApplicationPackageAsync(String resourceGroupName, String accountName, String id, String version, String format, final ServiceCallback serviceCallback) { - return ServiceCall.create(activateApplicationPackageAsync(resourceGroupName, accountName, id, version, format), serviceCallback); + return ServiceCall.create(activateApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, id, version, format), serviceCallback); + } + + /** + * Activates the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param id The id of the application. + * @param version The version of the application to activate. + * @param format The format of the application package binary file. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable activateApplicationPackageAsync(String resourceGroupName, String accountName, String id, String version, String format) { + return activateApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, id, version, format).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -149,7 +167,7 @@ public ServiceCall activateApplicationPackageAsync(String resourceGroupNam * @param format The format of the application package binary file. * @return the {@link ServiceResponse} object if successful. */ - public Observable> activateApplicationPackageAsync(String resourceGroupName, String accountName, String id, String version, String format) { + public Observable> activateApplicationPackageWithServiceResponseAsync(String resourceGroupName, String accountName, String id, String version, String format) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -202,10 +220,10 @@ private ServiceResponse activateApplicationPackageDelegate(Response addApplication(String resourceGroupName, String accountName, String applicationId) throws CloudException, IOException, IllegalArgumentException { - return addApplicationAsync(resourceGroupName, accountName, applicationId).toBlocking().single(); + public ApplicationInner addApplication(String resourceGroupName, String accountName, String applicationId) throws CloudException, IOException, IllegalArgumentException { + return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().getBody(); } /** @@ -218,7 +236,24 @@ public ServiceResponse addApplication(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall addApplicationAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(addApplicationAsync(resourceGroupName, accountName, applicationId), serviceCallback); + return ServiceCall.create(addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @return the observable to the ApplicationInner object + */ + public Observable addApplicationAsync(String resourceGroupName, String accountName, String applicationId) { + return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -229,7 +264,7 @@ public ServiceCall addApplicationAsync(String resourceGroupNam * @param applicationId The id of the application. * @return the observable to the ApplicationInner object */ - public Observable> addApplicationAsync(String resourceGroupName, String accountName, String applicationId) { + public Observable> addApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -270,10 +305,10 @@ public Observable> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ApplicationInner object wrapped in {@link ServiceResponse} if successful. + * @return the ApplicationInner object if successful. */ - public ServiceResponse addApplication(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return addApplicationAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single(); + public ApplicationInner addApplication(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single().getBody(); } /** @@ -287,7 +322,25 @@ public ServiceResponse addApplication(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall addApplicationAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(addApplicationAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + return ServiceCall.create(addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + } + + /** + * Adds an application to the specified Batch account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @param parameters The parameters for the request. + * @return the observable to the ApplicationInner object + */ + public Observable addApplicationAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { + return addApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -299,7 +352,7 @@ public ServiceCall addApplicationAsync(String resourceGroupNam * @param parameters The parameters for the request. * @return the observable to the ApplicationInner object */ - public Observable> addApplicationAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { + public Observable> addApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, AddApplicationParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -346,10 +399,9 @@ private ServiceResponse addApplicationDelegate(Response deleteApplication(String resourceGroupName, String accountName, String applicationId) throws CloudException, IOException, IllegalArgumentException { - return deleteApplicationAsync(resourceGroupName, accountName, applicationId).toBlocking().single(); + public void deleteApplication(String resourceGroupName, String accountName, String applicationId) throws CloudException, IOException, IllegalArgumentException { + deleteApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().getBody(); } /** @@ -362,7 +414,24 @@ public ServiceResponse deleteApplication(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall deleteApplicationAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteApplicationAsync(resourceGroupName, accountName, applicationId), serviceCallback); + return ServiceCall.create(deleteApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); + } + + /** + * Deletes an application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteApplicationAsync(String resourceGroupName, String accountName, String applicationId) { + return deleteApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -373,7 +442,7 @@ public ServiceCall deleteApplicationAsync(String resourceGroupName, String * @param applicationId The id of the application. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteApplicationAsync(String resourceGroupName, String accountName, String applicationId) { + public Observable> deleteApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -418,10 +487,10 @@ private ServiceResponse deleteApplicationDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ApplicationInner object wrapped in {@link ServiceResponse} if successful. + * @return the ApplicationInner object if successful. */ - public ServiceResponse getApplication(String resourceGroupName, String accountName, String applicationId) throws CloudException, IOException, IllegalArgumentException { - return getApplicationAsync(resourceGroupName, accountName, applicationId).toBlocking().single(); + public ApplicationInner getApplication(String resourceGroupName, String accountName, String applicationId) throws CloudException, IOException, IllegalArgumentException { + return getApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).toBlocking().single().getBody(); } /** @@ -434,7 +503,7 @@ public ServiceResponse getApplication(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall getApplicationAsync(String resourceGroupName, String accountName, String applicationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getApplicationAsync(resourceGroupName, accountName, applicationId), serviceCallback); + return ServiceCall.create(getApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId), serviceCallback); } /** @@ -445,7 +514,24 @@ public ServiceCall getApplicationAsync(String resourceGroupNam * @param applicationId The id of the application. * @return the observable to the ApplicationInner object */ - public Observable> getApplicationAsync(String resourceGroupName, String accountName, String applicationId) { + public Observable getApplicationAsync(String resourceGroupName, String accountName, String applicationId) { + return getApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId).map(new Func1, ApplicationInner>() { + @Override + public ApplicationInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets information about the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @return the observable to the ApplicationInner object + */ + public Observable> getApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -492,10 +578,9 @@ private ServiceResponse getApplicationDelegate(Response updateApplication(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return updateApplicationAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single(); + public void updateApplication(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + updateApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).toBlocking().single().getBody(); } /** @@ -509,7 +594,25 @@ public ServiceResponse updateApplication(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall updateApplicationAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateApplicationAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + return ServiceCall.create(updateApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters), serviceCallback); + } + + /** + * Updates settings for the specified application. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @param parameters The parameters for the request. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable updateApplicationAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { + return updateApplicationWithServiceResponseAsync(resourceGroupName, accountName, applicationId, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -521,7 +624,7 @@ public ServiceCall updateApplicationAsync(String resourceGroupName, String * @param parameters The parameters for the request. * @return the {@link ServiceResponse} object if successful. */ - public Observable> updateApplicationAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { + public Observable> updateApplicationWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, UpdateApplicationParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -571,10 +674,10 @@ private ServiceResponse updateApplicationDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AddApplicationPackageResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the AddApplicationPackageResultInner object if successful. */ - public ServiceResponse addApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) throws CloudException, IOException, IllegalArgumentException { - return addApplicationPackageAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single(); + public AddApplicationPackageResultInner addApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) throws CloudException, IOException, IllegalArgumentException { + return addApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); } /** @@ -588,7 +691,7 @@ public ServiceResponse addApplicationPackage(S * @return the {@link ServiceCall} object */ public ServiceCall addApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(addApplicationPackageAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + return ServiceCall.create(addApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); } /** @@ -600,7 +703,25 @@ public ServiceCall addApplicationPackageAsync( * @param version The version of the application. * @return the observable to the AddApplicationPackageResultInner object */ - public Observable> addApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { + public Observable addApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { + return addApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, AddApplicationPackageResultInner>() { + @Override + public AddApplicationPackageResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates an application package record. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @param version The version of the application. + * @return the observable to the AddApplicationPackageResultInner object + */ + public Observable> addApplicationPackageWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -650,10 +771,9 @@ private ServiceResponse addApplicationPackageD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse deleteApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) throws CloudException, IOException, IllegalArgumentException { - return deleteApplicationPackageAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single(); + public void deleteApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) throws CloudException, IOException, IllegalArgumentException { + deleteApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); } /** @@ -667,7 +787,25 @@ public ServiceResponse deleteApplicationPackage(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall deleteApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteApplicationPackageAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + return ServiceCall.create(deleteApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + } + + /** + * Deletes an application package record and its associated binary file. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @param version The version of the application to delete. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { + return deleteApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -679,7 +817,7 @@ public ServiceCall deleteApplicationPackageAsync(String resourceGroupName, * @param version The version of the application to delete. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { + public Observable> deleteApplicationPackageWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -728,10 +866,10 @@ private ServiceResponse deleteApplicationPackageDelegate(Response getApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) throws CloudException, IOException, IllegalArgumentException { - return getApplicationPackageAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single(); + public GetApplicationPackageResultInner getApplicationPackage(String resourceGroupName, String accountName, String applicationId, String version) throws CloudException, IOException, IllegalArgumentException { + return getApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).toBlocking().single().getBody(); } /** @@ -745,7 +883,25 @@ public ServiceResponse getApplicationPackage(S * @return the {@link ServiceCall} object */ public ServiceCall getApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(getApplicationPackageAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + return ServiceCall.create(getApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version), serviceCallback); + } + + /** + * Gets information about the specified application package. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param applicationId The id of the application. + * @param version The version of the application. + * @return the observable to the GetApplicationPackageResultInner object + */ + public Observable getApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { + return getApplicationPackageWithServiceResponseAsync(resourceGroupName, accountName, applicationId, version).map(new Func1, GetApplicationPackageResultInner>() { + @Override + public GetApplicationPackageResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -757,7 +913,7 @@ public ServiceCall getApplicationPackageAsync( * @param version The version of the application. * @return the observable to the GetApplicationPackageResultInner object */ - public Observable> getApplicationPackageAsync(String resourceGroupName, String accountName, String applicationId, String version) { + public Observable> getApplicationPackageWithServiceResponseAsync(String resourceGroupName, String accountName, String applicationId, String version) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -805,17 +961,16 @@ private ServiceResponse getApplicationPackageD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String accountName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -843,15 +998,35 @@ public Observable>> call(String nextPageL * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the Batch account. - * @return the observable to the List<ApplicationInner> object + * @return the observable to the PagedList<ApplicationInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String accountName) { + public Observable> listAsync(final String resourceGroupName, final String accountName) { + return listWithServiceResponseAsync(resourceGroupName, accountName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName) { return listSinglePageAsync(resourceGroupName, accountName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -861,7 +1036,7 @@ public Observable>> call(ServiceResponse< * * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the Batch account. - * @return the List<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName) { if (resourceGroupName == null) { @@ -900,17 +1075,16 @@ public Observable>> call(Response> list(final String resourceGroupName, final String accountName, final Integer maxresults) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String accountName, final Integer maxresults) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, accountName, maxresults).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -940,15 +1114,36 @@ public Observable>> call(String nextPageL * @param resourceGroupName The name of the resource group that contains the Batch account. * @param accountName The name of the Batch account. * @param maxresults The maximum number of items to return in the response. - * @return the observable to the List<ApplicationInner> object + * @return the observable to the PagedList<ApplicationInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { + public Observable> listAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { + return listWithServiceResponseAsync(resourceGroupName, accountName, maxresults) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all of the applications in the specified account. + * + * @param resourceGroupName The name of the resource group that contains the Batch account. + * @param accountName The name of the Batch account. + * @param maxresults The maximum number of items to return in the response. + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { return listSinglePageAsync(resourceGroupName, accountName, maxresults) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -959,7 +1154,7 @@ public Observable>> call(ServiceResponse< ServiceResponse> * @param resourceGroupName The name of the resource group that contains the Batch account. ServiceResponse> * @param accountName The name of the Batch account. ServiceResponse> * @param maxresults The maximum number of items to return in the response. - * @return the List<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String accountName, final Integer maxresults) { if (resourceGroupName == null) { @@ -1002,17 +1197,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1039,15 +1233,34 @@ public Observable>> call(String nextPageL * Lists all of the applications in the specified account. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ApplicationInner> object + * @return the observable to the PagedList<ApplicationInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all of the applications in the specified account. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ApplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1056,7 +1269,7 @@ public Observable>> call(ServiceResponse< * Lists all of the applications in the specified account. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java index b55cc2454d3f..d7896f7b3c2e 100644 --- a/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java +++ b/azure-mgmt-batch/src/main/java/com/microsoft/azure/management/batch/implementation/SubscriptionsInner.java @@ -65,10 +65,10 @@ interface SubscriptionsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SubscriptionQuotasGetResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the SubscriptionQuotasGetResultInner object if successful. */ - public ServiceResponse getSubscriptionQuotas(String locationName) throws CloudException, IOException, IllegalArgumentException { - return getSubscriptionQuotasAsync(locationName).toBlocking().single(); + public SubscriptionQuotasGetResultInner getSubscriptionQuotas(String locationName) throws CloudException, IOException, IllegalArgumentException { + return getSubscriptionQuotasWithServiceResponseAsync(locationName).toBlocking().single().getBody(); } /** @@ -79,7 +79,7 @@ public ServiceResponse getSubscriptionQuotas(S * @return the {@link ServiceCall} object */ public ServiceCall getSubscriptionQuotasAsync(String locationName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSubscriptionQuotasAsync(locationName), serviceCallback); + return ServiceCall.create(getSubscriptionQuotasWithServiceResponseAsync(locationName), serviceCallback); } /** @@ -88,7 +88,22 @@ public ServiceCall getSubscriptionQuotasAsync( * @param locationName The desired region for the quotas. * @return the observable to the SubscriptionQuotasGetResultInner object */ - public Observable> getSubscriptionQuotasAsync(String locationName) { + public Observable getSubscriptionQuotasAsync(String locationName) { + return getSubscriptionQuotasWithServiceResponseAsync(locationName).map(new Func1, SubscriptionQuotasGetResultInner>() { + @Override + public SubscriptionQuotasGetResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets the Batch service quotas for the specified suscription. + * + * @param locationName The desired region for the quotas. + * @return the observable to the SubscriptionQuotasGetResultInner object + */ + public Observable> getSubscriptionQuotasWithServiceResponseAsync(String locationName) { if (locationName == null) { throw new IllegalArgumentException("Parameter locationName is required and cannot be null."); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetImpl.java index 85154eb84ce7..27ad41e5a9a0 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetImpl.java @@ -9,7 +9,6 @@ import com.microsoft.azure.management.compute.AvailabilitySet; import com.microsoft.azure.management.compute.InstanceViewStatus; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.microsoft.rest.ServiceResponse; import rx.Observable; import rx.functions.Func1; @@ -73,8 +72,8 @@ public List statuses() { @Override public AvailabilitySet refresh() throws Exception { - ServiceResponse response = client.get(this.resourceGroupName(), this.name()); - this.setInner(response.getBody()); + AvailabilitySetInner response = client.get(this.resourceGroupName(), this.name()); + this.setInner(response); this.idOfVMsInSet = null; return this; } @@ -102,10 +101,10 @@ public Observable applyAsync() { public Observable createResourceAsync() { final AvailabilitySetImpl self = this; return this.client.createOrUpdateAsync(resourceGroupName(), name(), inner()) - .map(new Func1, AvailabilitySet>() { + .map(new Func1() { @Override - public AvailabilitySet call(ServiceResponse availabilitySetInner) { - self.setInner(availabilitySetInner.getBody()); + public AvailabilitySet call(AvailabilitySetInner availabilitySetInner) { + self.setInner(availabilitySetInner); idOfVMsInSet = null; return self; } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java index 0559e0b50139..180f5f663df7 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsImpl.java @@ -13,7 +13,6 @@ import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupPagedList; import com.microsoft.rest.RestException; -import com.microsoft.rest.ServiceResponse; import java.io.IOException; import java.util.List; @@ -41,20 +40,20 @@ public PagedList list() throws CloudException, IOException { return new GroupPagedList(this.myManager.resourceManager().resourceGroups().list()) { @Override public List listNextGroup(String resourceGroupName) throws RestException, IOException { - return wrapList(innerCollection.list(resourceGroupName).getBody()); + return wrapList(innerCollection.list(resourceGroupName)); } }; } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.list(groupName).getBody()); + return wrapList(this.innerCollection.list(groupName)); } @Override public AvailabilitySetImpl getByGroup(String groupName, String name) throws CloudException, IOException { - ServiceResponse response = this.innerCollection.get(groupName, name); - return wrapModel(response.getBody()); + AvailabilitySetInner response = this.innerCollection.get(groupName, name); + return wrapModel(response); } @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java index f64437c0e203..7ca42ada6ca3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/AvailabilitySetsInner.java @@ -88,10 +88,10 @@ interface AvailabilitySetsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AvailabilitySetInner object wrapped in {@link ServiceResponse} if successful. + * @return the AvailabilitySetInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String name, AvailabilitySetInner parameters) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(resourceGroupName, name, parameters).toBlocking().single(); + public AvailabilitySetInner createOrUpdate(String resourceGroupName, String name, AvailabilitySetInner parameters) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().getBody(); } /** @@ -104,7 +104,7 @@ public ServiceResponse createOrUpdate(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String name, AvailabilitySetInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); } /** @@ -115,7 +115,24 @@ public ServiceCall createOrUpdateAsync(String resourceGrou * @param parameters Parameters supplied to the Create Availability Set operation. * @return the observable to the AvailabilitySetInner object */ - public Observable> createOrUpdateAsync(String resourceGroupName, String name, AvailabilitySetInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String name, AvailabilitySetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, AvailabilitySetInner>() { + @Override + public AvailabilitySetInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to create or update the availability set. + * + * @param resourceGroupName The name of the resource group. + * @param name Parameters supplied to the Create Availability Set operation. + * @param parameters Parameters supplied to the Create Availability Set operation. + * @return the observable to the AvailabilitySetInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, AvailabilitySetInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -161,10 +178,9 @@ private ServiceResponse createOrUpdateDelegate(Response delete(String resourceGroupName, String availabilitySetName) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(resourceGroupName, availabilitySetName).toBlocking().single(); + public void delete(String resourceGroupName, String availabilitySetName) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName).toBlocking().single().getBody(); } /** @@ -176,7 +192,7 @@ public ServiceResponse delete(String resourceGroupName, String availabilit * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String availabilitySetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, availabilitySetName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName), serviceCallback); } /** @@ -186,7 +202,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String availabili * @param availabilitySetName The name of the availability set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String resourceGroupName, String availabilitySetName) { + public Observable deleteAsync(String resourceGroupName, String availabilitySetName) { + return deleteWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to delete the availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String availabilitySetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -228,10 +260,10 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AvailabilitySetInner object wrapped in {@link ServiceResponse} if successful. + * @return the AvailabilitySetInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String availabilitySetName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, availabilitySetName).toBlocking().single(); + public AvailabilitySetInner get(String resourceGroupName, String availabilitySetName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, availabilitySetName).toBlocking().single().getBody(); } /** @@ -243,7 +275,23 @@ public ServiceResponse get(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String availabilitySetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, availabilitySetName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, availabilitySetName), serviceCallback); + } + + /** + * The operation to get the availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @return the observable to the AvailabilitySetInner object + */ + public Observable getAsync(String resourceGroupName, String availabilitySetName) { + return getWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1, AvailabilitySetInner>() { + @Override + public AvailabilitySetInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -253,7 +301,7 @@ public ServiceCall getAsync(String resourceGroupName, Stri * @param availabilitySetName The name of the availability set. * @return the observable to the AvailabilitySetInner object */ - public Observable> getAsync(String resourceGroupName, String availabilitySetName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String availabilitySetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -294,10 +342,10 @@ private ServiceResponse getDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<AvailabilitySetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<AvailabilitySetInner> object if successful. */ - public ServiceResponse> list(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return listAsync(resourceGroupName).toBlocking().single(); + public List list(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -308,7 +356,7 @@ public ServiceResponse> list(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall> listAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(resourceGroupName), serviceCallback); } /** @@ -317,7 +365,22 @@ public ServiceCall> listAsync(String resourceGroupNam * @param resourceGroupName The name of the resource group. * @return the observable to the List<AvailabilitySetInner> object */ - public Observable>> listAsync(String resourceGroupName) { + public Observable> listAsync(String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The operation to list the availability sets. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<AvailabilitySetInner> object + */ + public Observable>> listWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -357,10 +420,10 @@ private ServiceResponse> listDelegate(Response> listAvailableSizes(String resourceGroupName, String availabilitySetName) throws CloudException, IOException, IllegalArgumentException { - return listAvailableSizesAsync(resourceGroupName, availabilitySetName).toBlocking().single(); + public List listAvailableSizes(String resourceGroupName, String availabilitySetName) throws CloudException, IOException, IllegalArgumentException { + return listAvailableSizesWithServiceResponseAsync(resourceGroupName, availabilitySetName).toBlocking().single().getBody(); } /** @@ -372,7 +435,23 @@ public ServiceResponse> listAvailableSizes(String * @return the {@link ServiceCall} object */ public ServiceCall> listAvailableSizesAsync(String resourceGroupName, String availabilitySetName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAvailableSizesAsync(resourceGroupName, availabilitySetName), serviceCallback); + return ServiceCall.create(listAvailableSizesWithServiceResponseAsync(resourceGroupName, availabilitySetName), serviceCallback); + } + + /** + * Lists all available virtual machine sizes that can be used to create a new virtual machine in an existing availability set. + * + * @param resourceGroupName The name of the resource group. + * @param availabilitySetName The name of the availability set. + * @return the observable to the List<VirtualMachineSizeInner> object + */ + public Observable> listAvailableSizesAsync(String resourceGroupName, String availabilitySetName) { + return listAvailableSizesWithServiceResponseAsync(resourceGroupName, availabilitySetName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -382,7 +461,7 @@ public ServiceCall> listAvailableSizesAsync(String * @param availabilitySetName The name of the availability set. * @return the observable to the List<VirtualMachineSizeInner> object */ - public Observable>> listAvailableSizesAsync(String resourceGroupName, String availabilitySetName) { + public Observable>> listAvailableSizesWithServiceResponseAsync(String resourceGroupName, String availabilitySetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java index 36516c915a7a..169e7b333290 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/UsagesInner.java @@ -74,17 +74,16 @@ interface UsagesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object if successful. */ - public ServiceResponse> list(final String location) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String location) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -110,15 +109,34 @@ public Observable>> call(String nextPageLink) { * Lists compute usages for a subscription. * * @param location The location upon which resource usage is queried. - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> listAsync(final String location) { + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists compute usages for a subscription. + * + * @param location The location upon which resource usage is queried. + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { return listSinglePageAsync(location) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -127,7 +145,7 @@ public Observable>> call(ServiceResponse> * @param location The location upon which resource usage is queried. - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String location) { if (location == null) { @@ -167,17 +185,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -204,15 +221,34 @@ public Observable>> call(String nextPageLink) { * Lists compute usages for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists compute usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -221,7 +257,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java index 8cbc67c464b1..c3cc3f210be7 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionImagesInner.java @@ -77,10 +77,10 @@ interface VirtualMachineExtensionImagesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineExtensionImageInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineExtensionImageInner object if successful. */ - public ServiceResponse get(String location, String publisherName, String type, String version) throws CloudException, IOException, IllegalArgumentException { - return getAsync(location, publisherName, type, version).toBlocking().single(); + public VirtualMachineExtensionImageInner get(String location, String publisherName, String type, String version) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(location, publisherName, type, version).toBlocking().single().getBody(); } /** @@ -94,7 +94,7 @@ public ServiceResponse get(String location, S * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String location, String publisherName, String type, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(location, publisherName, type, version), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(location, publisherName, type, version), serviceCallback); } /** @@ -106,7 +106,25 @@ public ServiceCall getAsync(String location, * @param version the String value * @return the observable to the VirtualMachineExtensionImageInner object */ - public Observable> getAsync(String location, String publisherName, String type, String version) { + public Observable getAsync(String location, String publisherName, String type, String version) { + return getWithServiceResponseAsync(location, publisherName, type, version).map(new Func1, VirtualMachineExtensionImageInner>() { + @Override + public VirtualMachineExtensionImageInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets a virtual machine extension image. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @param version the String value + * @return the observable to the VirtualMachineExtensionImageInner object + */ + public Observable> getWithServiceResponseAsync(String location, String publisherName, String type, String version) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -154,10 +172,10 @@ private ServiceResponse getDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineExtensionImageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineExtensionImageInner> object if successful. */ - public ServiceResponse> listTypes(String location, String publisherName) throws CloudException, IOException, IllegalArgumentException { - return listTypesAsync(location, publisherName).toBlocking().single(); + public List listTypes(String location, String publisherName) throws CloudException, IOException, IllegalArgumentException { + return listTypesWithServiceResponseAsync(location, publisherName).toBlocking().single().getBody(); } /** @@ -169,7 +187,7 @@ public ServiceResponse> listTypes(String * @return the {@link ServiceCall} object */ public ServiceCall> listTypesAsync(String location, String publisherName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listTypesAsync(location, publisherName), serviceCallback); + return ServiceCall.create(listTypesWithServiceResponseAsync(location, publisherName), serviceCallback); } /** @@ -179,7 +197,23 @@ public ServiceCall> listTypesAsync(Strin * @param publisherName the String value * @return the observable to the List<VirtualMachineExtensionImageInner> object */ - public Observable>> listTypesAsync(String location, String publisherName) { + public Observable> listTypesAsync(String location, String publisherName) { + return listTypesWithServiceResponseAsync(location, publisherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of virtual machine extension image types. + * + * @param location the String value + * @param publisherName the String value + * @return the observable to the List<VirtualMachineExtensionImageInner> object + */ + public Observable>> listTypesWithServiceResponseAsync(String location, String publisherName) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -222,10 +256,10 @@ private ServiceResponse> listTypesDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineExtensionImageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineExtensionImageInner> object if successful. */ - public ServiceResponse> listVersions(String location, String publisherName, String type) throws CloudException, IOException, IllegalArgumentException { - return listVersionsAsync(location, publisherName, type).toBlocking().single(); + public List listVersions(String location, String publisherName, String type) throws CloudException, IOException, IllegalArgumentException { + return listVersionsWithServiceResponseAsync(location, publisherName, type).toBlocking().single().getBody(); } /** @@ -238,7 +272,7 @@ public ServiceResponse> listVersions(Str * @return the {@link ServiceCall} object */ public ServiceCall> listVersionsAsync(String location, String publisherName, String type, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listVersionsAsync(location, publisherName, type), serviceCallback); + return ServiceCall.create(listVersionsWithServiceResponseAsync(location, publisherName, type), serviceCallback); } /** @@ -249,7 +283,24 @@ public ServiceCall> listVersionsAsync(St * @param type the String value * @return the observable to the List<VirtualMachineExtensionImageInner> object */ - public Observable>> listVersionsAsync(String location, String publisherName, String type) { + public Observable> listVersionsAsync(String location, String publisherName, String type) { + return listVersionsWithServiceResponseAsync(location, publisherName, type).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @return the observable to the List<VirtualMachineExtensionImageInner> object + */ + public Observable>> listVersionsWithServiceResponseAsync(String location, String publisherName, String type) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -294,10 +345,10 @@ public Observable>> call * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineExtensionImageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineExtensionImageInner> object if successful. */ - public ServiceResponse> listVersions(String location, String publisherName, String type, String filter, Integer top, String orderby) throws CloudException, IOException, IllegalArgumentException { - return listVersionsAsync(location, publisherName, type, filter, top, orderby).toBlocking().single(); + public List listVersions(String location, String publisherName, String type, String filter, Integer top, String orderby) throws CloudException, IOException, IllegalArgumentException { + return listVersionsWithServiceResponseAsync(location, publisherName, type, filter, top, orderby).toBlocking().single().getBody(); } /** @@ -313,7 +364,27 @@ public ServiceResponse> listVersions(Str * @return the {@link ServiceCall} object */ public ServiceCall> listVersionsAsync(String location, String publisherName, String type, String filter, Integer top, String orderby, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listVersionsAsync(location, publisherName, type, filter, top, orderby), serviceCallback); + return ServiceCall.create(listVersionsWithServiceResponseAsync(location, publisherName, type, filter, top, orderby), serviceCallback); + } + + /** + * Gets a list of virtual machine extension image versions. + * + * @param location the String value + * @param publisherName the String value + * @param type the String value + * @param filter The filter to apply on the operation. + * @param top the Integer value + * @param orderby the String value + * @return the observable to the List<VirtualMachineExtensionImageInner> object + */ + public Observable> listVersionsAsync(String location, String publisherName, String type, String filter, Integer top, String orderby) { + return listVersionsWithServiceResponseAsync(location, publisherName, type, filter, top, orderby).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -327,7 +398,7 @@ public ServiceCall> listVersionsAsync(St * @param orderby the String value * @return the observable to the List<VirtualMachineExtensionImageInner> object */ - public Observable>> listVersionsAsync(String location, String publisherName, String type, String filter, Integer top, String orderby) { + public Observable>> listVersionsWithServiceResponseAsync(String location, String publisherName, String type, String filter, Integer top, String orderby) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java index 5edbc995e11f..8ac198723470 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineExtensionsInner.java @@ -89,10 +89,10 @@ interface VirtualMachineExtensionsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualMachineExtensionInner object wrapped in ServiceResponse if successful. + * @return the VirtualMachineExtensionInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().last(); + public VirtualMachineExtensionInner createOrUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().last().getBody(); } /** @@ -106,7 +106,7 @@ public ServiceResponse createOrUpdate(String resou * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters), serviceCallback); } /** @@ -118,7 +118,25 @@ public ServiceCall createOrUpdateAsync(String reso * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + @Override + public VirtualMachineExtensionInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -152,10 +170,10 @@ public Observable> createOrUpdateA * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineExtensionInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineExtensionInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().single(); + public VirtualMachineExtensionInner beginCreateOrUpdate(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).toBlocking().single().getBody(); } /** @@ -169,7 +187,25 @@ public ServiceResponse beginCreateOrUpdate(String * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters), serviceCallback); + } + + /** + * The operation to create or update the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be create or updated. + * @param vmExtensionName The name of the virtual machine extension. + * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. + * @return the observable to the VirtualMachineExtensionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, extensionParameters).map(new Func1, VirtualMachineExtensionInner>() { + @Override + public VirtualMachineExtensionInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -181,7 +217,7 @@ public ServiceCall beginCreateOrUpdateAsync(String * @param extensionParameters Parameters supplied to the Create Virtual Machine Extension operation. * @return the observable to the VirtualMachineExtensionInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName, VirtualMachineExtensionInner extensionParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -233,10 +269,9 @@ private ServiceResponse beginCreateOrUpdateDelegat * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().last(); + public void delete(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().last().getBody(); } /** @@ -249,7 +284,24 @@ public ServiceResponse delete(String resourceGroupName, String vmName, Str * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -260,7 +312,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String vmName, St * @param vmExtensionName The name of the virtual machine extension. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -289,10 +341,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().single().getBody(); } /** @@ -305,7 +356,24 @@ public ServiceResponse beginDelete(String resourceGroupName, String vmName * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); + } + + /** + * The operation to delete the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine where the extension should be deleted. + * @param vmExtensionName The name of the virtual machine extension. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -316,7 +384,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmNam * @param vmExtensionName The name of the virtual machine extension. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String vmName, String vmExtensionName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -362,10 +430,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineExtensionInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineExtensionInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().single(); + public VirtualMachineExtensionInner get(String resourceGroupName, String vmName, String vmExtensionName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).toBlocking().single().getBody(); } /** @@ -378,7 +446,24 @@ public ServiceResponse get(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String vmName, String vmExtensionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName), serviceCallback); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @return the observable to the VirtualMachineExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String vmName, String vmExtensionName) { + return getWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName).map(new Func1, VirtualMachineExtensionInner>() { + @Override + public VirtualMachineExtensionInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -389,7 +474,7 @@ public ServiceCall getAsync(String resourceGroupNa * @param vmExtensionName The name of the virtual machine extension. * @return the observable to the VirtualMachineExtensionInner object */ - public Observable> getAsync(String resourceGroupName, String vmName, String vmExtensionName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -430,10 +515,10 @@ public Observable> call(Response get(String resourceGroupName, String vmName, String vmExtensionName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, vmName, vmExtensionName, expand).toBlocking().single(); + public VirtualMachineExtensionInner get(String resourceGroupName, String vmName, String vmExtensionName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, expand).toBlocking().single().getBody(); } /** @@ -447,7 +532,25 @@ public ServiceResponse get(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String vmName, String vmExtensionName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, vmName, vmExtensionName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, expand), serviceCallback); + } + + /** + * The operation to get the extension. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine containing the extension. + * @param vmExtensionName The name of the virtual machine extension. + * @param expand The expand expression to apply on the operation. + * @return the observable to the VirtualMachineExtensionInner object + */ + public Observable getAsync(String resourceGroupName, String vmName, String vmExtensionName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, vmName, vmExtensionName, expand).map(new Func1, VirtualMachineExtensionInner>() { + @Override + public VirtualMachineExtensionInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -459,7 +562,7 @@ public ServiceCall getAsync(String resourceGroupNa * @param expand The expand expression to apply on the operation. * @return the observable to the VirtualMachineExtensionInner object */ - public Observable> getAsync(String resourceGroupName, String vmName, String vmExtensionName, String expand) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmName, String vmExtensionName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java index 776d2db66dcb..0883fb32b253 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInSkuImpl.java @@ -32,7 +32,7 @@ public PagedList list() throws CloudException, IOException this.sku.region().toString(), this.sku.publisher().name(), this.sku.offer().name(), - this.sku.name()).getBody()) { + this.sku.name())) { String version = inner.name(); images.add(new VirtualMachineImageImpl( this.sku.region(), @@ -44,7 +44,7 @@ public PagedList list() throws CloudException, IOException this.sku.publisher().name(), this.sku.offer().name(), this.sku.name(), - version).getBody())); + version))); } Page page = new Page() { @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java index 464031249259..8c61d1b978a3 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImagesInner.java @@ -86,10 +86,10 @@ interface VirtualMachineImagesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineImageInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineImageInner object if successful. */ - public ServiceResponse get(String location, String publisherName, String offer, String skus, String version) throws CloudException, IOException, IllegalArgumentException { - return getAsync(location, publisherName, offer, skus, version).toBlocking().single(); + public VirtualMachineImageInner get(String location, String publisherName, String offer, String skus, String version) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(location, publisherName, offer, skus, version).toBlocking().single().getBody(); } /** @@ -104,7 +104,7 @@ public ServiceResponse get(String location, String pub * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String location, String publisherName, String offer, String skus, String version, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(location, publisherName, offer, skus, version), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(location, publisherName, offer, skus, version), serviceCallback); } /** @@ -117,7 +117,26 @@ public ServiceCall getAsync(String location, String pu * @param version the String value * @return the observable to the VirtualMachineImageInner object */ - public Observable> getAsync(String location, String publisherName, String offer, String skus, String version) { + public Observable getAsync(String location, String publisherName, String offer, String skus, String version) { + return getWithServiceResponseAsync(location, publisherName, offer, skus, version).map(new Func1, VirtualMachineImageInner>() { + @Override + public VirtualMachineImageInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets a virtual machine image. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @param version the String value + * @return the observable to the VirtualMachineImageInner object + */ + public Observable> getWithServiceResponseAsync(String location, String publisherName, String offer, String skus, String version) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -170,10 +189,10 @@ private ServiceResponse getDelegate(Response> list(String location, String publisherName, String offer, String skus) throws CloudException, IOException, IllegalArgumentException { - return listAsync(location, publisherName, offer, skus).toBlocking().single(); + public List list(String location, String publisherName, String offer, String skus) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(location, publisherName, offer, skus).toBlocking().single().getBody(); } /** @@ -187,7 +206,25 @@ public ServiceResponse> list(String locat * @return the {@link ServiceCall} object */ public ServiceCall> listAsync(String location, String publisherName, String offer, String skus, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAsync(location, publisherName, offer, skus), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(location, publisherName, offer, skus), serviceCallback); + } + + /** + * Gets a list of virtual machine images. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @return the observable to the List<VirtualMachineImageResourceInner> object + */ + public Observable> listAsync(String location, String publisherName, String offer, String skus) { + return listWithServiceResponseAsync(location, publisherName, offer, skus).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -199,7 +236,7 @@ public ServiceCall> listAsync(String loca * @param skus the String value * @return the observable to the List<VirtualMachineImageResourceInner> object */ - public Observable>> listAsync(String location, String publisherName, String offer, String skus) { + public Observable>> listWithServiceResponseAsync(String location, String publisherName, String offer, String skus) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -248,10 +285,10 @@ public Observable>> call( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineImageResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineImageResourceInner> object if successful. */ - public ServiceResponse> list(String location, String publisherName, String offer, String skus, String filter, Integer top, String orderby) throws CloudException, IOException, IllegalArgumentException { - return listAsync(location, publisherName, offer, skus, filter, top, orderby).toBlocking().single(); + public List list(String location, String publisherName, String offer, String skus, String filter, Integer top, String orderby) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(location, publisherName, offer, skus, filter, top, orderby).toBlocking().single().getBody(); } /** @@ -268,7 +305,28 @@ public ServiceResponse> list(String locat * @return the {@link ServiceCall} object */ public ServiceCall> listAsync(String location, String publisherName, String offer, String skus, String filter, Integer top, String orderby, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAsync(location, publisherName, offer, skus, filter, top, orderby), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(location, publisherName, offer, skus, filter, top, orderby), serviceCallback); + } + + /** + * Gets a list of virtual machine images. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @param skus the String value + * @param filter The filter to apply on the operation. + * @param top the Integer value + * @param orderby the String value + * @return the observable to the List<VirtualMachineImageResourceInner> object + */ + public Observable> listAsync(String location, String publisherName, String offer, String skus, String filter, Integer top, String orderby) { + return listWithServiceResponseAsync(location, publisherName, offer, skus, filter, top, orderby).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -283,7 +341,7 @@ public ServiceCall> listAsync(String loca * @param orderby the String value * @return the observable to the List<VirtualMachineImageResourceInner> object */ - public Observable>> listAsync(String location, String publisherName, String offer, String skus, String filter, Integer top, String orderby) { + public Observable>> listWithServiceResponseAsync(String location, String publisherName, String offer, String skus, String filter, Integer top, String orderby) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -331,10 +389,10 @@ private ServiceResponse> listDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineImageResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineImageResourceInner> object if successful. */ - public ServiceResponse> listOffers(String location, String publisherName) throws CloudException, IOException, IllegalArgumentException { - return listOffersAsync(location, publisherName).toBlocking().single(); + public List listOffers(String location, String publisherName) throws CloudException, IOException, IllegalArgumentException { + return listOffersWithServiceResponseAsync(location, publisherName).toBlocking().single().getBody(); } /** @@ -346,7 +404,23 @@ public ServiceResponse> listOffers(String * @return the {@link ServiceCall} object */ public ServiceCall> listOffersAsync(String location, String publisherName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listOffersAsync(location, publisherName), serviceCallback); + return ServiceCall.create(listOffersWithServiceResponseAsync(location, publisherName), serviceCallback); + } + + /** + * Gets a list of virtual machine image offers. + * + * @param location the String value + * @param publisherName the String value + * @return the observable to the List<VirtualMachineImageResourceInner> object + */ + public Observable> listOffersAsync(String location, String publisherName) { + return listOffersWithServiceResponseAsync(location, publisherName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -356,7 +430,7 @@ public ServiceCall> listOffersAsync(Strin * @param publisherName the String value * @return the observable to the List<VirtualMachineImageResourceInner> object */ - public Observable>> listOffersAsync(String location, String publisherName) { + public Observable>> listOffersWithServiceResponseAsync(String location, String publisherName) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -397,10 +471,10 @@ private ServiceResponse> listOffersDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineImageResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineImageResourceInner> object if successful. */ - public ServiceResponse> listPublishers(String location) throws CloudException, IOException, IllegalArgumentException { - return listPublishersAsync(location).toBlocking().single(); + public List listPublishers(String location) throws CloudException, IOException, IllegalArgumentException { + return listPublishersWithServiceResponseAsync(location).toBlocking().single().getBody(); } /** @@ -411,7 +485,22 @@ public ServiceResponse> listPublishers(St * @return the {@link ServiceCall} object */ public ServiceCall> listPublishersAsync(String location, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listPublishersAsync(location), serviceCallback); + return ServiceCall.create(listPublishersWithServiceResponseAsync(location), serviceCallback); + } + + /** + * Gets a list of virtual machine image publishers. + * + * @param location the String value + * @return the observable to the List<VirtualMachineImageResourceInner> object + */ + public Observable> listPublishersAsync(String location) { + return listPublishersWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -420,7 +509,7 @@ public ServiceCall> listPublishersAsync(S * @param location the String value * @return the observable to the List<VirtualMachineImageResourceInner> object */ - public Observable>> listPublishersAsync(String location) { + public Observable>> listPublishersWithServiceResponseAsync(String location) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -460,10 +549,10 @@ private ServiceResponse> listPublishersDe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineImageResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineImageResourceInner> object if successful. */ - public ServiceResponse> listSkus(String location, String publisherName, String offer) throws CloudException, IOException, IllegalArgumentException { - return listSkusAsync(location, publisherName, offer).toBlocking().single(); + public List listSkus(String location, String publisherName, String offer) throws CloudException, IOException, IllegalArgumentException { + return listSkusWithServiceResponseAsync(location, publisherName, offer).toBlocking().single().getBody(); } /** @@ -476,7 +565,24 @@ public ServiceResponse> listSkus(String l * @return the {@link ServiceCall} object */ public ServiceCall> listSkusAsync(String location, String publisherName, String offer, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listSkusAsync(location, publisherName, offer), serviceCallback); + return ServiceCall.create(listSkusWithServiceResponseAsync(location, publisherName, offer), serviceCallback); + } + + /** + * Gets a list of virtual machine image skus. + * + * @param location the String value + * @param publisherName the String value + * @param offer the String value + * @return the observable to the List<VirtualMachineImageResourceInner> object + */ + public Observable> listSkusAsync(String location, String publisherName, String offer) { + return listSkusWithServiceResponseAsync(location, publisherName, offer).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -487,7 +593,7 @@ public ServiceCall> listSkusAsync(String * @param offer the String value * @return the observable to the List<VirtualMachineImageResourceInner> object */ - public Observable>> listSkusAsync(String location, String publisherName, String offer) { + public Observable>> listSkusWithServiceResponseAsync(String location, String publisherName, String offer) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java index 529cca60932a..8923a51e9b37 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineImpl.java @@ -48,7 +48,6 @@ import com.microsoft.azure.management.storage.StorageAccount; import com.microsoft.azure.management.storage.implementation.StorageManager; import com.microsoft.rest.RestException; -import com.microsoft.rest.ServiceResponse; import rx.Observable; import rx.functions.Func1; @@ -140,9 +139,9 @@ public VirtualMachineSize typeConvert(VirtualMachineSizeInner inner) { @Override public VirtualMachine refresh() throws Exception { - ServiceResponse response = + VirtualMachineInner response = this.client.get(this.resourceGroupName(), this.name()); - this.setInner(response.getBody()); + this.setInner(response); clearCachedRelatedResources(); initializeDataDisks(); return this; @@ -186,7 +185,7 @@ public void redeploy() throws CloudException, IOException, InterruptedException @Override public PagedList availableSizes() throws CloudException, IOException { PageImpl page = new PageImpl<>(); - page.setItems(this.client.listAvailableSizes(this.resourceGroupName(), this.name()).getBody()); + page.setItems(this.client.listAvailableSizes(this.resourceGroupName(), this.name())); page.setNextPageLink(null); return this.virtualMachineSizeConverter.convert(new PagedList(page) { @Override @@ -201,17 +200,17 @@ public String capture(String containerName, boolean overwriteVhd) throws CloudEx VirtualMachineCaptureParametersInner parameters = new VirtualMachineCaptureParametersInner(); parameters.withDestinationContainerName(containerName); parameters.withOverwriteVhds(overwriteVhd); - ServiceResponse captureResult = this.client.capture(this.resourceGroupName(), this.name(), parameters); + VirtualMachineCaptureResultInner captureResult = this.client.capture(this.resourceGroupName(), this.name(), parameters); ObjectMapper mapper = new ObjectMapper(); //Object to JSON string - return mapper.writeValueAsString(captureResult.getBody().output()); + return mapper.writeValueAsString(captureResult.output()); } @Override public VirtualMachineInstanceView refreshInstanceView() throws CloudException, IOException { this.virtualMachineInstanceView = this.client.get(this.resourceGroupName(), this.name(), - InstanceViewTypes.INSTANCE_VIEW).getBody().instanceView(); + InstanceViewTypes.INSTANCE_VIEW).instanceView(); return this.virtualMachineInstanceView; } @@ -863,10 +862,10 @@ public Observable call(StorageAccount storageAccount) handleNetworkSettings(); handleAvailabilitySettings(); return client.createOrUpdateAsync(resourceGroupName(), vmName, inner()) - .map(new Func1, VirtualMachine>() { + .map(new Func1() { @Override - public VirtualMachine call(ServiceResponse virtualMachineInner) { - self.setInner(virtualMachineInner.getBody()); + public VirtualMachine call(VirtualMachineInner virtualMachineInner) { + self.setInner(virtualMachineInner); clearCachedRelatedResources(); initializeDataDisks(); return self; diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java index 389e3eb0be93..25342bcf2b40 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineOffersImpl.java @@ -36,6 +36,6 @@ protected VirtualMachineOfferImpl wrapModel(VirtualMachineImageResourceInner inn @Override public PagedList list() throws CloudException, IllegalArgumentException, IOException { - return wrapList(innerCollection.listOffers(publisher.region().toString(), publisher.name()).getBody()); + return wrapList(innerCollection.listOffers(publisher.region().toString(), publisher.name())); } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java index 1c32f8e6d041..14155079ae99 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinePublishersImpl.java @@ -39,6 +39,6 @@ protected VirtualMachinePublisherImpl wrapModel(VirtualMachineImageResourceInner @Override public PagedList listByRegion(String regionName) throws CloudException, IOException { - return wrapList(innerCollection.listPublishers(regionName).getBody()); + return wrapList(innerCollection.listPublishers(regionName)); } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java index 6dd8513633db..7f6440659974 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetVMsInner.java @@ -136,10 +136,9 @@ interface VirtualMachineScaleSetVMsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse reimage(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return reimageAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last(); + public void reimage(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().getBody(); } /** @@ -152,7 +151,7 @@ public ServiceResponse reimage(String resourceGroupName, String vmScaleSet * @return the {@link ServiceCall} object */ public ServiceCall reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(reimageAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -163,7 +162,24 @@ public ServiceCall reimageAsync(String resourceGroupName, String vmScaleSe * @param instanceId The instance id of the virtual machine. * @return the observable for the request */ - public Observable> reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to re-image(update the version of the installed operating system) a virtual machine scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable for the request + */ + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -192,10 +208,9 @@ public Observable> reimageAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginReimage(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public void beginReimage(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -208,7 +223,7 @@ public ServiceResponse beginReimage(String resourceGroupName, String vmSca * @return the {@link ServiceCall} object */ public ServiceCall beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginReimageAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -219,7 +234,24 @@ public ServiceCall beginReimageAsync(String resourceGroupName, String vmSc * @param instanceId The instance id of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to re-image(update the version of the installed operating system) a virtual machine scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -265,10 +297,9 @@ private ServiceResponse beginReimageDelegate(Response respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deallocateAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last(); + public void deallocate(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().getBody(); } /** @@ -281,7 +312,24 @@ public ServiceResponse deallocate(String resourceGroupName, String vmScale * @return the {@link ServiceCall} object */ public ServiceCall deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deallocateAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Allows you to deallocate a virtual machine scale set virtual machine. Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable for the request + */ + public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -292,7 +340,7 @@ public ServiceCall deallocateAsync(String resourceGroupName, String vmScal * @param instanceId The instance id of the virtual machine. * @return the observable for the request */ - public Observable> deallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -321,10 +369,9 @@ public Observable> deallocateAsync(String resourceGroupNam * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDeallocate(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public void beginDeallocate(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -337,7 +384,7 @@ public ServiceResponse beginDeallocate(String resourceGroupName, String vm * @return the {@link ServiceCall} object */ public ServiceCall beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -348,7 +395,24 @@ public ServiceCall beginDeallocateAsync(String resourceGroupName, String v * @param instanceId The instance id of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to deallocate a virtual machine scale set virtual machine. Shuts down the virtual machine and releases the compute resources. You are not billed for the compute resources that this virtual machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -394,10 +458,9 @@ private ServiceResponse beginDeallocateDelegate(Response res * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last(); + public void delete(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().getBody(); } /** @@ -410,7 +473,24 @@ public ServiceResponse delete(String resourceGroupName, String vmScaleSetN * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Allows you to delete a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -421,7 +501,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String vmScaleSet * @param instanceId The instance id of the virtual machine. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -450,10 +530,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public void beginDelete(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -466,7 +545,7 @@ public ServiceResponse beginDelete(String resourceGroupName, String vmScal * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -477,7 +556,24 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmSca * @param instanceId The instance id of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to delete a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -524,10 +620,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineScaleSetVMInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineScaleSetVMInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public VirtualMachineScaleSetVMInner get(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -540,7 +636,24 @@ public ServiceResponse get(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Displays information about a virtual machine scale set virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable to the VirtualMachineScaleSetVMInner object + */ + public Observable getAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, VirtualMachineScaleSetVMInner>() { + @Override + public VirtualMachineScaleSetVMInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -551,7 +664,7 @@ public ServiceCall getAsync(String resourceGroupN * @param instanceId The instance id of the virtual machine. * @return the observable to the VirtualMachineScaleSetVMInner object */ - public Observable> getAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -597,10 +710,10 @@ private ServiceResponse getDelegate(Response getInstanceView(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public VirtualMachineScaleSetVMInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -613,7 +726,7 @@ public ServiceResponse getInstanceVie * @return the {@link ServiceCall} object */ public ServiceCall getInstanceViewAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getInstanceViewAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -624,7 +737,24 @@ public ServiceCall getInstanceViewAsy * @param instanceId The instance id of the virtual machine. * @return the observable to the VirtualMachineScaleSetVMInstanceViewInner object */ - public Observable> getInstanceViewAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable getInstanceViewAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, VirtualMachineScaleSetVMInstanceViewInner>() { + @Override + public VirtualMachineScaleSetVMInstanceViewInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Displays the status of a virtual machine scale set virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable to the VirtualMachineScaleSetVMInstanceViewInner object + */ + public Observable> getInstanceViewWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -669,17 +799,16 @@ private ServiceResponse getInstanceVi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetVMInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String virtualMachineScaleSetName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String virtualMachineScaleSetName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -707,15 +836,35 @@ public Observable>> call(Str * * @param resourceGroupName The name of the resource group. * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @return the observable to the List<VirtualMachineScaleSetVMInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetVMInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + public Observable> listAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @return the observable to the PagedList<VirtualMachineScaleSetVMInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { return listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -725,7 +874,7 @@ public Observable>> call(Ser * * @param resourceGroupName The name of the resource group. * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @return the List<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { if (resourceGroupName == null) { @@ -768,17 +917,16 @@ public Observable>> call(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetVMInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String virtualMachineScaleSetName, final String filter, final String select, final String expand) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String virtualMachineScaleSetName, final String filter, final String select, final String expand) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -812,15 +960,38 @@ public Observable>> call(Str * @param filter The filter to apply on the operation. * @param select The list parameters. * @param expand The expand expression to apply on the operation. - * @return the observable to the List<VirtualMachineScaleSetVMInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetVMInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String filter, final String select, final String expand) { + public Observable> listAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String filter, final String select, final String expand) { + return listWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all virtual machines in a VM scale sets. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param filter The filter to apply on the operation. + * @param select The list parameters. + * @param expand The expand expression to apply on the operation. + * @return the observable to the PagedList<VirtualMachineScaleSetVMInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String filter, final String select, final String expand) { return listSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, filter, select, expand) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -833,7 +1004,7 @@ public Observable>> call(Ser ServiceResponse> * @param filter The filter to apply on the operation. ServiceResponse> * @param select The list parameters. ServiceResponse> * @param expand The expand expression to apply on the operation. - * @return the List<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String filter, final String select, final String expand) { if (resourceGroupName == null) { @@ -879,10 +1050,9 @@ private ServiceResponse> listDelegate(R * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return powerOffAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last(); + public void powerOff(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().getBody(); } /** @@ -895,7 +1065,24 @@ public ServiceResponse powerOff(String resourceGroupName, String vmScaleSe * @return the {@link ServiceCall} object */ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(powerOffAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Allows you to power off (stop) a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable for the request + */ + public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -906,7 +1093,7 @@ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleS * @param instanceId The instance id of the virtual machine. * @return the observable for the request */ - public Observable> powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -935,10 +1122,9 @@ public Observable> powerOffAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public void beginPowerOff(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -951,7 +1137,7 @@ public ServiceResponse beginPowerOff(String resourceGroupName, String vmSc * @return the {@link ServiceCall} object */ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -962,7 +1148,24 @@ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmS * @param instanceId The instance id of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to power off (stop) a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1008,10 +1211,9 @@ private ServiceResponse beginPowerOffDelegate(Response respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse restart(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return restartAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last(); + public void restart(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().getBody(); } /** @@ -1024,7 +1226,7 @@ public ServiceResponse restart(String resourceGroupName, String vmScaleSet * @return the {@link ServiceCall} object */ public ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -1035,7 +1237,24 @@ public ServiceCall restartAsync(String resourceGroupName, String vmScaleSe * @param instanceId The instance id of the virtual machine. * @return the observable for the request */ - public Observable> restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable restartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to restart a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1064,10 +1283,9 @@ public Observable> restartAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public void beginRestart(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -1080,7 +1298,7 @@ public ServiceResponse beginRestart(String resourceGroupName, String vmSca * @return the {@link ServiceCall} object */ public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRestartAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -1091,7 +1309,24 @@ public ServiceCall beginRestartAsync(String resourceGroupName, String vmSc * @param instanceId The instance id of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to restart a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1137,10 +1372,9 @@ private ServiceResponse beginRestartDelegate(Response respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse start(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return startAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last(); + public void start(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().last().getBody(); } /** @@ -1153,7 +1387,7 @@ public ServiceResponse start(String resourceGroupName, String vmScaleSetNa * @return the {@link ServiceCall} object */ public ServiceCall startAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(startAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); } /** @@ -1164,7 +1398,24 @@ public ServiceCall startAsync(String resourceGroupName, String vmScaleSetN * @param instanceId The instance id of the virtual machine. * @return the observable for the request */ - public Observable> startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable startAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to start a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1193,10 +1444,9 @@ public Observable> startAsync(String resourceGroupName, St * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginStart(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return beginStartAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single(); + public void beginStart(String resourceGroupName, String vmScaleSetName, String instanceId) throws CloudException, IOException, IllegalArgumentException { + beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().getBody(); } /** @@ -1209,7 +1459,24 @@ public ServiceResponse beginStart(String resourceGroupName, String vmScale * @return the {@link ServiceCall} object */ public ServiceCall beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginStartAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + return ServiceCall.create(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId), serviceCallback); + } + + /** + * Allows you to start a virtual machine in a VM scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceId The instance id of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1220,7 +1487,7 @@ public ServiceCall beginStartAsync(String resourceGroupName, String vmScal * @param instanceId The instance id of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginStartAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1263,17 +1530,16 @@ private ServiceResponse beginStartDelegate(Response response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetVMInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1300,15 +1566,34 @@ public Observable>> call(Str * Lists all virtual machines in a VM scale sets. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualMachineScaleSetVMInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetVMInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all virtual machines in a VM scale sets. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualMachineScaleSetVMInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1317,7 +1602,7 @@ public Observable>> call(Ser * Lists all virtual machines in a VM scale sets. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetVMInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java index a8bf50739e36..47de6b0de9d1 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineScaleSetsInner.java @@ -181,10 +181,10 @@ interface VirtualMachineScaleSetsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualMachineScaleSetInner object wrapped in ServiceResponse if successful. + * @return the VirtualMachineScaleSetInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, name, parameters).toBlocking().last(); + public VirtualMachineScaleSetInner createOrUpdate(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().getBody(); } /** @@ -197,7 +197,7 @@ public ServiceResponse createOrUpdate(String resour * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); } /** @@ -208,7 +208,24 @@ public ServiceCall createOrUpdateAsync(String resou * @param parameters Parameters supplied to the Create Virtual Machine Scale Set operation. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, VirtualMachineScaleSetInner>() { + @Override + public VirtualMachineScaleSetInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to create or update a virtual machine scale set by providing parameters or a path to pre-configured parameter file. + * + * @param resourceGroupName The name of the resource group. + * @param name Parameters supplied to the Create Virtual Machine Scale Set operation. + * @param parameters Parameters supplied to the Create Virtual Machine Scale Set operation. + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -238,10 +255,10 @@ public Observable> createOrUpdateAs * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineScaleSetInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineScaleSetInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, name, parameters).toBlocking().single(); + public VirtualMachineScaleSetInner beginCreateOrUpdate(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().getBody(); } /** @@ -254,7 +271,24 @@ public ServiceResponse beginCreateOrUpdate(String r * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Allows you to create or update a virtual machine scale set by providing parameters or a path to pre-configured parameter file. + * + * @param resourceGroupName The name of the resource group. + * @param name Parameters supplied to the Create Virtual Machine Scale Set operation. + * @param parameters Parameters supplied to the Create Virtual Machine Scale Set operation. + * @return the observable to the VirtualMachineScaleSetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, VirtualMachineScaleSetInner>() { + @Override + public VirtualMachineScaleSetInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -265,7 +299,7 @@ public ServiceCall beginCreateOrUpdateAsync(String * @param parameters Parameters supplied to the Create Virtual Machine Scale Set operation. * @return the observable to the VirtualMachineScaleSetInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, VirtualMachineScaleSetInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -313,10 +347,9 @@ private ServiceResponse beginCreateOrUpdateDelegate * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse deallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deallocateAsync(resourceGroupName, vmScaleSetName).toBlocking().last(); + public void deallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().getBody(); } /** @@ -328,7 +361,7 @@ public ServiceResponse deallocate(String resourceGroupName, String vmScale * @return the {@link ServiceCall} object */ public ServiceCall deallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deallocateAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -338,7 +371,23 @@ public ServiceCall deallocateAsync(String resourceGroupName, String vmScal * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable for the request */ - public Observable> deallocateAsync(String resourceGroupName, String vmScaleSetName) { + public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to deallocate virtual machines in a virtual machine scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable for the request + */ + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -367,10 +416,9 @@ public Observable> deallocateAsync(String resourceGroupNam * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deallocateAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last(); + public void deallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().getBody(); } /** @@ -383,7 +431,7 @@ public ServiceResponse deallocate(String resourceGroupName, String vmScale * @return the {@link ServiceCall} object */ public ServiceCall deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(deallocateAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -394,7 +442,24 @@ public ServiceCall deallocateAsync(String resourceGroupName, String vmScal * @param instanceIds the virtual machine scale set instance ids. * @return the observable for the request */ - public Observable> deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable deallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to deallocate virtual machines in a virtual machine scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the observable for the request + */ + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -425,10 +490,9 @@ public Observable> deallocateAsync(String resourceGroupNam * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDeallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public void beginDeallocate(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -440,7 +504,23 @@ public ServiceResponse beginDeallocate(String resourceGroupName, String vm * @return the {@link ServiceCall} object */ public ServiceCall beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeallocateAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + } + + /** + * Allows you to deallocate virtual machines in a virtual machine scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -450,7 +530,7 @@ public ServiceCall beginDeallocateAsync(String resourceGroupName, String v * @param vmScaleSetName The name of the virtual machine scale set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeallocateAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -489,10 +569,9 @@ public Observable> call(Response response) { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDeallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { - return beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single(); + public void beginDeallocate(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().getBody(); } /** @@ -505,7 +584,24 @@ public ServiceResponse beginDeallocate(String resourceGroupName, String vm * @return the {@link ServiceCall} object */ public ServiceCall beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeallocateAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Allows you to deallocate virtual machines in a virtual machine scale set. Shuts down the virtual machines and releases the compute resources. You are not billed for the compute resources that this virtual machine scale set uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -516,7 +612,7 @@ public ServiceCall beginDeallocateAsync(String resourceGroupName, String v * @param instanceIds the virtual machine scale set instance ids. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeallocateAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -564,10 +660,9 @@ private ServiceResponse beginDeallocateDelegate(Response res * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, vmScaleSetName).toBlocking().last(); + public void delete(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().getBody(); } /** @@ -579,7 +674,7 @@ public ServiceResponse delete(String resourceGroupName, String vmScaleSetN * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -589,7 +684,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String vmScaleSet * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String vmScaleSetName) { + public Observable deleteAsync(String resourceGroupName, String vmScaleSetName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to delete a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -614,10 +725,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -629,7 +739,7 @@ public ServiceResponse beginDelete(String resourceGroupName, String vmScal * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -639,7 +749,23 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmSca * @param vmScaleSetName The name of the virtual machine scale set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { + public Observable beginDeleteAsync(String resourceGroupName, String vmScaleSetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to delete a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -682,10 +808,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineScaleSetInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineScaleSetInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public VirtualMachineScaleSetInner get(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -697,7 +823,7 @@ public ServiceResponse get(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -707,7 +833,23 @@ public ServiceCall getAsync(String resourceGroupNam * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable to the VirtualMachineScaleSetInner object */ - public Observable> getAsync(String resourceGroupName, String vmScaleSetName) { + public Observable getAsync(String resourceGroupName, String vmScaleSetName) { + return getWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, VirtualMachineScaleSetInner>() { + @Override + public VirtualMachineScaleSetInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Display information about a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable to the VirtualMachineScaleSetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -751,10 +893,9 @@ private ServiceResponse getDelegate(Response deleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last(); + public void deleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().getBody(); } /** @@ -767,7 +908,24 @@ public ServiceResponse deleteInstances(String resourceGroupName, String vm * @return the {@link ServiceCall} object */ public ServiceCall deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Allows you to delete virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the observable for the request + */ + public Observable deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return deleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -778,7 +936,7 @@ public ServiceCall deleteInstancesAsync(String resourceGroupName, String v * @param instanceIds the virtual machine scale set instance ids. * @return the observable for the request */ - public Observable> deleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> deleteInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -810,10 +968,9 @@ public Observable> deleteInstancesAsync(String resourceGro * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single(); + public void beginDeleteInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().getBody(); } /** @@ -826,7 +983,7 @@ public ServiceResponse beginDeleteInstances(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -837,7 +994,24 @@ public ServiceCall beginDeleteInstancesAsync(String resourceGroupName, Str * @param instanceIds the virtual machine scale set instance ids. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable beginDeleteInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginDeleteInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to delete virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -884,10 +1058,10 @@ private ServiceResponse beginDeleteInstancesDelegate(Response getInstanceView(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return getInstanceViewAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public VirtualMachineScaleSetInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -899,7 +1073,7 @@ public ServiceResponse getInstanceView( * @return the {@link ServiceCall} object */ public ServiceCall getInstanceViewAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getInstanceViewAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -909,7 +1083,23 @@ public ServiceCall getInstanceViewAsync * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable to the VirtualMachineScaleSetInstanceViewInner object */ - public Observable> getInstanceViewAsync(String resourceGroupName, String vmScaleSetName) { + public Observable getInstanceViewAsync(String resourceGroupName, String vmScaleSetName) { + return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, VirtualMachineScaleSetInstanceViewInner>() { + @Override + public VirtualMachineScaleSetInstanceViewInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Displays status of a virtual machine scale set instance. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable to the VirtualMachineScaleSetInstanceViewInner object + */ + public Observable> getInstanceViewWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -950,17 +1140,16 @@ private ServiceResponse getInstanceView * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -986,15 +1175,34 @@ public Observable>> call(Strin * Lists all virtual machine scale sets under a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<VirtualMachineScaleSetInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object + */ + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all virtual machine scale sets under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1003,7 +1211,7 @@ public Observable>> call(Servi * Lists all virtual machine scale sets under a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -1042,17 +1250,16 @@ private ServiceResponse> listDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1076,15 +1283,33 @@ public Observable>> call(Strin /** * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink property in the response to get the next page of Virtual Machine Scale Sets. Do this till nextLink is not null to fetch all the Virtual Machine Scale Sets. * - * @return the observable to the List<VirtualMachineScaleSetInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink property in the response to get the next page of Virtual Machine Scale Sets. Do this till nextLink is not null to fetch all the Virtual Machine Scale Sets. + * + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1092,7 +1317,7 @@ public Observable>> call(Servi /** * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink property in the response to get the next page of Virtual Machine Scale Sets. Do this till nextLink is not null to fetch all the Virtual Machine Scale Sets. * - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -1130,17 +1355,16 @@ private ServiceResponse> listAllDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetSkuInner> object if successful. */ - public ServiceResponse> listSkus(final String resourceGroupName, final String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + public PagedList listSkus(final String resourceGroupName, final String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSkusSinglePageAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1168,15 +1392,35 @@ public Observable>> call(St * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the virtual machine scale set. - * @return the observable to the List<VirtualMachineScaleSetSkuInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetSkuInner> object */ - public Observable>> listSkusAsync(final String resourceGroupName, final String vmScaleSetName) { + public Observable> listSkusAsync(final String resourceGroupName, final String vmScaleSetName) { + return listSkusWithServiceResponseAsync(resourceGroupName, vmScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Displays available skus for your virtual machine scale set including the minimum and maximum vm instances allowed for a particular sku. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable to the PagedList<VirtualMachineScaleSetSkuInner> object + */ + public Observable>> listSkusWithServiceResponseAsync(final String resourceGroupName, final String vmScaleSetName) { return listSkusSinglePageAsync(resourceGroupName, vmScaleSetName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listSkusNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1186,7 +1430,7 @@ public Observable>> call(Se * ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param vmScaleSetName The name of the virtual machine scale set. - * @return the List<VirtualMachineScaleSetSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSkusSinglePageAsync(final String resourceGroupName, final String vmScaleSetName) { if (resourceGroupName == null) { @@ -1231,10 +1475,9 @@ private ServiceResponse> listSkusDeleg * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return powerOffAsync(resourceGroupName, vmScaleSetName).toBlocking().last(); + public void powerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().getBody(); } /** @@ -1246,7 +1489,7 @@ public ServiceResponse powerOff(String resourceGroupName, String vmScaleSe * @return the {@link ServiceCall} object */ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(powerOffAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -1256,7 +1499,23 @@ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleS * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable for the request */ - public Observable> powerOffAsync(String resourceGroupName, String vmScaleSetName) { + public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to power off (stop) virtual machines in a virtual machine scale set. Note that resources are still attached and you are getting charged for the resources. Use deallocate to release resources. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable for the request + */ + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1285,10 +1544,9 @@ public Observable> powerOffAsync(String resourceGroupName, * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse powerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return powerOffAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last(); + public void powerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().getBody(); } /** @@ -1301,7 +1559,7 @@ public ServiceResponse powerOff(String resourceGroupName, String vmScaleSe * @return the {@link ServiceCall} object */ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(powerOffAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -1312,7 +1570,24 @@ public ServiceCall powerOffAsync(String resourceGroupName, String vmScaleS * @param instanceIds the virtual machine scale set instance ids. * @return the observable for the request */ - public Observable> powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable powerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to power off (stop) virtual machines in a virtual machine scale set. Note that resources are still attached and you are getting charged for the resources. Use deallocate to release resources. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the observable for the request + */ + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1343,10 +1618,9 @@ public Observable> powerOffAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public void beginPowerOff(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -1358,7 +1632,23 @@ public ServiceResponse beginPowerOff(String resourceGroupName, String vmSc * @return the {@link ServiceCall} object */ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginPowerOffAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + } + + /** + * Allows you to power off (stop) virtual machines in a virtual machine scale set. Note that resources are still attached and you are getting charged for the resources. Use deallocate to release resources. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1368,7 +1658,7 @@ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmS * @param vmScaleSetName The name of the virtual machine scale set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginPowerOffAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1407,10 +1697,9 @@ public Observable> call(Response response) { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginPowerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { - return beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single(); + public void beginPowerOff(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().getBody(); } /** @@ -1423,7 +1712,24 @@ public ServiceResponse beginPowerOff(String resourceGroupName, String vmSc * @return the {@link ServiceCall} object */ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginPowerOffAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Allows you to power off (stop) virtual machines in a virtual machine scale set. Note that resources are still attached and you are getting charged for the resources. Use deallocate to release resources. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1434,7 +1740,7 @@ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmS * @param instanceIds the virtual machine scale set instance ids. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginPowerOffAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1482,10 +1788,9 @@ private ServiceResponse beginPowerOffDelegate(Response respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse restart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return restartAsync(resourceGroupName, vmScaleSetName).toBlocking().last(); + public void restart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().getBody(); } /** @@ -1497,7 +1802,7 @@ public ServiceResponse restart(String resourceGroupName, String vmScaleSet * @return the {@link ServiceCall} object */ public ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -1507,7 +1812,23 @@ public ServiceCall restartAsync(String resourceGroupName, String vmScaleSe * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable for the request */ - public Observable> restartAsync(String resourceGroupName, String vmScaleSetName) { + public Observable restartAsync(String resourceGroupName, String vmScaleSetName) { + return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1536,10 +1857,9 @@ public Observable> restartAsync(String resourceGroupName, * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse restart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return restartAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last(); + public void restart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().getBody(); } /** @@ -1552,7 +1872,7 @@ public ServiceResponse restart(String resourceGroupName, String vmScaleSet * @return the {@link ServiceCall} object */ public ServiceCall restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -1563,7 +1883,24 @@ public ServiceCall restartAsync(String resourceGroupName, String vmScaleSe * @param instanceIds the virtual machine scale set instance ids. * @return the observable for the request */ - public Observable> restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable restartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return restartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1594,10 +1931,9 @@ public Observable> restartAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return beginRestartAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public void beginRestart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -1609,7 +1945,23 @@ public ServiceResponse beginRestart(String resourceGroupName, String vmSca * @return the {@link ServiceCall} object */ public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRestartAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); + } + + /** + * Allows you to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1619,7 +1971,7 @@ public ServiceCall beginRestartAsync(String resourceGroupName, String vmSc * @param vmScaleSetName The name of the virtual machine scale set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginRestartAsync(String resourceGroupName, String vmScaleSetName) { + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1658,10 +2010,9 @@ public Observable> call(Response response) { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginRestart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { - return beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single(); + public void beginRestart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().getBody(); } /** @@ -1674,7 +2025,24 @@ public ServiceResponse beginRestart(String resourceGroupName, String vmSca * @return the {@link ServiceCall} object */ public ServiceCall beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRestartAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Allows you to restart virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1685,7 +2053,7 @@ public ServiceCall beginRestartAsync(String resourceGroupName, String vmSc * @param instanceIds the virtual machine scale set instance ids. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginRestartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1733,10 +2101,9 @@ private ServiceResponse beginRestartDelegate(Response respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse start(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return startAsync(resourceGroupName, vmScaleSetName).toBlocking().last(); + public void start(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().getBody(); } /** @@ -1748,7 +2115,7 @@ public ServiceResponse start(String resourceGroupName, String vmScaleSetNa * @return the {@link ServiceCall} object */ public ServiceCall startAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(startAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(startWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -1758,7 +2125,23 @@ public ServiceCall startAsync(String resourceGroupName, String vmScaleSetN * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable for the request */ - public Observable> startAsync(String resourceGroupName, String vmScaleSetName) { + public Observable startAsync(String resourceGroupName, String vmScaleSetName) { + return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1787,10 +2170,9 @@ public Observable> startAsync(String resourceGroupName, St * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse start(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return startAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last(); + public void start(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().getBody(); } /** @@ -1803,7 +2185,7 @@ public ServiceResponse start(String resourceGroupName, String vmScaleSetNa * @return the {@link ServiceCall} object */ public ServiceCall startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(startAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -1814,7 +2196,24 @@ public ServiceCall startAsync(String resourceGroupName, String vmScaleSetN * @param instanceIds the virtual machine scale set instance ids. * @return the observable for the request */ - public Observable> startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable startAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1845,10 +2244,9 @@ public Observable> startAsync(String resourceGroupName, St * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginStart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return beginStartAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public void beginStart(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -1860,7 +2258,7 @@ public ServiceResponse beginStart(String resourceGroupName, String vmScale * @return the {@link ServiceCall} object */ public ServiceCall beginStartAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginStartAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -1870,7 +2268,23 @@ public ServiceCall beginStartAsync(String resourceGroupName, String vmScal * @param vmScaleSetName The name of the virtual machine scale set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginStartAsync(String resourceGroupName, String vmScaleSetName) { + public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1909,10 +2323,9 @@ public Observable> call(Response response) { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginStart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { - return beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single(); + public void beginStart(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().getBody(); } /** @@ -1925,7 +2338,24 @@ public ServiceResponse beginStart(String resourceGroupName, String vmScale * @return the {@link ServiceCall} object */ public ServiceCall beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginStartAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + } + + /** + * Allows you to start virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1936,7 +2366,7 @@ public ServiceCall beginStartAsync(String resourceGroupName, String vmScal * @param instanceIds the virtual machine scale set instance ids. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginStartAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1985,10 +2415,9 @@ private ServiceResponse beginStartDelegate(Response response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return updateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last(); + public void updateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().last().getBody(); } /** @@ -2001,7 +2430,7 @@ public ServiceResponse updateInstances(String resourceGroupName, String vm * @return the {@link ServiceCall} object */ public ServiceCall updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -2012,7 +2441,24 @@ public ServiceCall updateInstancesAsync(String resourceGroupName, String v * @param instanceIds the virtual machine scale set instance ids. * @return the observable for the request */ - public Observable> updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable updateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return updateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to manually upgrade virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the observable for the request + */ + public Observable> updateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2044,10 +2490,9 @@ public Observable> updateInstancesAsync(String resourceGro * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginUpdateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { - return beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single(); + public void beginUpdateInstances(String resourceGroupName, String vmScaleSetName, List instanceIds) throws CloudException, IOException, IllegalArgumentException { + beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).toBlocking().single().getBody(); } /** @@ -2060,7 +2505,7 @@ public ServiceResponse beginUpdateInstances(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginUpdateInstancesAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); + return ServiceCall.create(beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds), serviceCallback); } /** @@ -2071,7 +2516,24 @@ public ServiceCall beginUpdateInstancesAsync(String resourceGroupName, Str * @param instanceIds the virtual machine scale set instance ids. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + public Observable beginUpdateInstancesAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { + return beginUpdateInstancesWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceIds).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to manually upgrade virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @param instanceIds the virtual machine scale set instance ids. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginUpdateInstancesWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName, List instanceIds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2119,10 +2581,9 @@ private ServiceResponse beginUpdateInstancesDelegate(Response reimage(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return reimageAsync(resourceGroupName, vmScaleSetName).toBlocking().last(); + public void reimage(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().last().getBody(); } /** @@ -2134,7 +2595,7 @@ public ServiceResponse reimage(String resourceGroupName, String vmScaleSet * @return the {@link ServiceCall} object */ public ServiceCall reimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(reimageAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -2144,7 +2605,23 @@ public ServiceCall reimageAsync(String resourceGroupName, String vmScaleSe * @param vmScaleSetName The name of the virtual machine scale set. * @return the observable for the request */ - public Observable> reimageAsync(String resourceGroupName, String vmScaleSetName) { + public Observable reimageAsync(String resourceGroupName, String vmScaleSetName) { + return reimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to re-image(update the version of the installed operating system) virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the observable for the request + */ + public Observable> reimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2169,10 +2646,9 @@ public Observable> reimageAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginReimage(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { - return beginReimageAsync(resourceGroupName, vmScaleSetName).toBlocking().single(); + public void beginReimage(String resourceGroupName, String vmScaleSetName) throws CloudException, IOException, IllegalArgumentException { + beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().getBody(); } /** @@ -2184,7 +2660,7 @@ public ServiceResponse beginReimage(String resourceGroupName, String vmSca * @return the {@link ServiceCall} object */ public ServiceCall beginReimageAsync(String resourceGroupName, String vmScaleSetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginReimageAsync(resourceGroupName, vmScaleSetName), serviceCallback); + return ServiceCall.create(beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName), serviceCallback); } /** @@ -2194,7 +2670,23 @@ public ServiceCall beginReimageAsync(String resourceGroupName, String vmSc * @param vmScaleSetName The name of the virtual machine scale set. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginReimageAsync(String resourceGroupName, String vmScaleSetName) { + public Observable beginReimageAsync(String resourceGroupName, String vmScaleSetName) { + return beginReimageWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Allows you to re-image(update the version of the installed operating system) virtual machines in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param vmScaleSetName The name of the virtual machine scale set. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginReimageWithServiceResponseAsync(String resourceGroupName, String vmScaleSetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2234,17 +2726,16 @@ private ServiceResponse beginReimageDelegate(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2271,15 +2762,34 @@ public Observable>> call(Strin * Lists all virtual machine scale sets under a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualMachineScaleSetInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all virtual machine scale sets under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2288,7 +2798,7 @@ public Observable>> call(Servi * Lists all virtual machine scale sets under a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -2322,17 +2832,16 @@ private ServiceResponse> listNextDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2359,15 +2868,34 @@ public Observable>> call(Strin * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink property in the response to get the next page of Virtual Machine Scale Sets. Do this till nextLink is not null to fetch all the Virtual Machine Scale Sets. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualMachineScaleSetInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink property in the response to get the next page of Virtual Machine Scale Sets. Do this till nextLink is not null to fetch all the Virtual Machine Scale Sets. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualMachineScaleSetInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2376,7 +2904,7 @@ public Observable>> call(Servi * Lists all Virtual Machine Scale Sets in the subscription. Use nextLink property in the response to get the next page of Virtual Machine Scale Sets. Do this till nextLink is not null to fetch all the Virtual Machine Scale Sets. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -2410,17 +2938,16 @@ private ServiceResponse> listAllNextDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineScaleSetSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetSkuInner> object if successful. */ - public ServiceResponse> listSkusNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listSkusNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listSkusNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2447,15 +2974,34 @@ public Observable>> call(St * Displays available skus for your virtual machine scale set including the minimum and maximum vm instances allowed for a particular sku. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualMachineScaleSetSkuInner> object + * @return the observable to the PagedList<VirtualMachineScaleSetSkuInner> object */ - public Observable>> listSkusNextAsync(final String nextPageLink) { + public Observable> listSkusNextAsync(final String nextPageLink) { + return listSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Displays available skus for your virtual machine scale set including the minimum and maximum vm instances allowed for a particular sku. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualMachineScaleSetSkuInner> object + */ + public Observable>> listSkusNextWithServiceResponseAsync(final String nextPageLink) { return listSkusNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listSkusNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSkusNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2464,7 +3010,7 @@ public Observable>> call(Se * Displays available skus for your virtual machine scale set including the minimum and maximum vm instances allowed for a particular sku. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualMachineScaleSetSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineScaleSetSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSkusNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java index 0a19ad851936..c7303452c773 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesImpl.java @@ -38,6 +38,6 @@ protected VirtualMachineSizeImpl wrapModel(VirtualMachineSizeInner inner) { @Override public PagedList listByRegion(String regionName) throws CloudException, IOException { - return wrapList(innerCollection.list(regionName).getBody()); + return wrapList(innerCollection.list(regionName)); } } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java index f8f5494a8552..d75d3b18b908 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSizesInner.java @@ -66,10 +66,10 @@ interface VirtualMachineSizesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineSizeInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineSizeInner> object if successful. */ - public ServiceResponse> list(String location) throws CloudException, IOException, IllegalArgumentException { - return listAsync(location).toBlocking().single(); + public List list(String location) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(location).toBlocking().single().getBody(); } /** @@ -80,7 +80,7 @@ public ServiceResponse> list(String location) thro * @return the {@link ServiceCall} object */ public ServiceCall> listAsync(String location, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAsync(location), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(location), serviceCallback); } /** @@ -89,7 +89,22 @@ public ServiceCall> listAsync(String location, fin * @param location The location upon which virtual-machine-sizes is queried. * @return the observable to the List<VirtualMachineSizeInner> object */ - public Observable>> listAsync(String location) { + public Observable> listAsync(String location) { + return listWithServiceResponseAsync(location).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all available virtual machine sizes for a subscription in a location. + * + * @param location The location upon which virtual-machine-sizes is queried. + * @return the observable to the List<VirtualMachineSizeInner> object + */ + public Observable>> listWithServiceResponseAsync(String location) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java index 5fa4c5e41da9..b672af42fb56 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachineSkusImpl.java @@ -34,7 +34,7 @@ public PagedList list() throws CloudException, IOException { return wrapList(innerCollection.listSkus( offer.region().toString(), offer.publisher().name(), - offer.name()).getBody()); + offer.name())); } @Override diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java index 6ab462fddc54..29d8b0f494b9 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesImpl.java @@ -8,20 +8,19 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.microsoft.azure.CloudException; import com.microsoft.azure.PagedList; -import com.microsoft.azure.management.compute.VirtualMachine; -import com.microsoft.azure.management.compute.VirtualMachineSizes; -import com.microsoft.azure.management.compute.VirtualMachines; -import com.microsoft.azure.management.compute.StorageProfile; -import com.microsoft.azure.management.compute.OSDisk; import com.microsoft.azure.management.compute.DataDisk; -import com.microsoft.azure.management.compute.OSProfile; import com.microsoft.azure.management.compute.HardwareProfile; import com.microsoft.azure.management.compute.NetworkProfile; +import com.microsoft.azure.management.compute.OSDisk; +import com.microsoft.azure.management.compute.OSProfile; +import com.microsoft.azure.management.compute.StorageProfile; +import com.microsoft.azure.management.compute.VirtualMachine; +import com.microsoft.azure.management.compute.VirtualMachineSizes; +import com.microsoft.azure.management.compute.VirtualMachines; import com.microsoft.azure.management.network.implementation.NetworkManager; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; import com.microsoft.azure.management.storage.implementation.StorageManager; -import com.microsoft.rest.ServiceResponse; import java.io.IOException; import java.util.ArrayList; @@ -56,17 +55,17 @@ class VirtualMachinesImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(this.innerCollection.listAll().getBody()); + return wrapList(this.innerCollection.listAll()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.list(groupName).getBody()); + return wrapList(this.innerCollection.list(groupName)); } @Override public VirtualMachine getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.get(groupName, name).getBody()); + return wrapModel(this.innerCollection.get(groupName, name)); } @Override @@ -121,10 +120,10 @@ public String capture(String groupName, String name, VirtualMachineCaptureParametersInner parameters = new VirtualMachineCaptureParametersInner(); parameters.withDestinationContainerName(containerName); parameters.withOverwriteVhds(overwriteVhd); - ServiceResponse captureResult = this.innerCollection.capture(groupName, name, parameters); + VirtualMachineCaptureResultInner captureResult = this.innerCollection.capture(groupName, name, parameters); ObjectMapper mapper = new ObjectMapper(); //Object to JSON string - return mapper.writeValueAsString(captureResult.getBody().output()); + return mapper.writeValueAsString(captureResult.output()); } diff --git a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java index 62fedff61202..2f2ca09da5ac 100644 --- a/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java +++ b/azure-mgmt-compute/src/main/java/com/microsoft/azure/management/compute/implementation/VirtualMachinesInner.java @@ -168,10 +168,10 @@ interface VirtualMachinesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualMachineCaptureResultInner object wrapped in ServiceResponse if successful. + * @return the VirtualMachineCaptureResultInner object if successful. */ - public ServiceResponse capture(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return captureAsync(resourceGroupName, vmName, parameters).toBlocking().last(); + public VirtualMachineCaptureResultInner capture(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().getBody(); } /** @@ -184,7 +184,7 @@ public ServiceResponse capture(String resource * @return the {@link ServiceCall} object */ public ServiceCall captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(captureAsync(resourceGroupName, vmName, parameters), serviceCallback); + return ServiceCall.create(captureWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); } /** @@ -195,7 +195,24 @@ public ServiceCall captureAsync(String resourc * @param parameters Parameters supplied to the Capture Virtual Machine operation. * @return the observable for the request */ - public Observable> captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public Observable captureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + return captureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineCaptureResultInner>() { + @Override + public VirtualMachineCaptureResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @return the observable for the request + */ + public Observable> captureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -225,10 +242,10 @@ public Observable> captureAsyn * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineCaptureResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineCaptureResultInner object if successful. */ - public ServiceResponse beginCapture(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCaptureAsync(resourceGroupName, vmName, parameters).toBlocking().single(); + public VirtualMachineCaptureResultInner beginCapture(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().getBody(); } /** @@ -241,7 +258,7 @@ public ServiceResponse beginCapture(String res * @return the {@link ServiceCall} object */ public ServiceCall beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCaptureAsync(resourceGroupName, vmName, parameters), serviceCallback); + return ServiceCall.create(beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); } /** @@ -252,7 +269,24 @@ public ServiceCall beginCaptureAsync(String re * @param parameters Parameters supplied to the Capture Virtual Machine operation. * @return the observable to the VirtualMachineCaptureResultInner object */ - public Observable> beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + public Observable beginCaptureAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { + return beginCaptureWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineCaptureResultInner>() { + @Override + public VirtualMachineCaptureResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Capture Virtual Machine operation. + * @return the observable to the VirtualMachineCaptureResultInner object + */ + public Observable> beginCaptureWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineCaptureParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -301,10 +335,10 @@ private ServiceResponse beginCaptureDelegate(R * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualMachineInner object wrapped in ServiceResponse if successful. + * @return the VirtualMachineInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, vmName, parameters).toBlocking().last(); + public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().getBody(); } /** @@ -317,7 +351,24 @@ public ServiceResponse createOrUpdate(String resourceGroupN * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, vmName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); + } + + /** + * The operation to create or update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -328,7 +379,7 @@ public ServiceCall createOrUpdateAsync(String resourceGroup * @param parameters Parameters supplied to the Create Virtual Machine operation. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -358,10 +409,10 @@ public Observable> createOrUpdateAsync(Stri * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters).toBlocking().single(); + public VirtualMachineInner beginCreateOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().getBody(); } /** @@ -374,7 +425,24 @@ public ServiceResponse beginCreateOrUpdate(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, vmName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters), serviceCallback); + } + + /** + * The operation to create or update a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param parameters Parameters supplied to the Create Virtual Machine operation. + * @return the observable to the VirtualMachineInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -385,7 +453,7 @@ public ServiceCall beginCreateOrUpdateAsync(String resource * @param parameters Parameters supplied to the Create Virtual Machine operation. * @return the observable to the VirtualMachineInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String vmName, VirtualMachineInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -433,10 +501,9 @@ private ServiceResponse beginCreateOrUpdateDelegate(Respons * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, vmName).toBlocking().last(); + public void delete(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().getBody(); } /** @@ -448,7 +515,7 @@ public ServiceResponse delete(String resourceGroupName, String vmName) thr * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -458,7 +525,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String vmName, fi * @param vmName The name of the virtual machine. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String vmName) { + public Observable deleteAsync(String resourceGroupName, String vmName) { + return deleteWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -483,10 +566,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, vmName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -498,7 +580,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String vmName * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); + } + + /** + * The operation to delete a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String vmName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -508,7 +606,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String vmNam * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String vmName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -550,10 +648,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualMachineInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualMachineInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, vmName).toBlocking().single(); + public VirtualMachineInner get(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -565,7 +663,23 @@ public ServiceResponse get(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); + } + + /** + * The operation to get a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable to the VirtualMachineInner object + */ + public Observable getAsync(String resourceGroupName, String vmName) { + return getWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -575,7 +689,7 @@ public ServiceCall getAsync(String resourceGroupName, Strin * @param vmName The name of the virtual machine. * @return the observable to the VirtualMachineInner object */ - public Observable> getAsync(String resourceGroupName, String vmName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -612,10 +726,10 @@ public Observable> call(Response get(String resourceGroupName, String vmName, InstanceViewTypes expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, vmName, expand).toBlocking().single(); + public VirtualMachineInner get(String resourceGroupName, String vmName, InstanceViewTypes expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, vmName, expand).toBlocking().single().getBody(); } /** @@ -628,7 +742,7 @@ public ServiceResponse get(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String vmName, InstanceViewTypes expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, vmName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, vmName, expand), serviceCallback); } /** @@ -639,7 +753,24 @@ public ServiceCall getAsync(String resourceGroupName, Strin * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' * @return the observable to the VirtualMachineInner object */ - public Observable> getAsync(String resourceGroupName, String vmName, InstanceViewTypes expand) { + public Observable getAsync(String resourceGroupName, String vmName, InstanceViewTypes expand) { + return getWithServiceResponseAsync(resourceGroupName, vmName, expand).map(new Func1, VirtualMachineInner>() { + @Override + public VirtualMachineInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to get a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @param expand The expand expression to apply on the operation. Possible values include: 'instanceView' + * @return the observable to the VirtualMachineInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String vmName, InstanceViewTypes expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -682,10 +813,9 @@ private ServiceResponse getDelegate(Response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse deallocate(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deallocateAsync(resourceGroupName, vmName).toBlocking().last(); + public void deallocate(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deallocateWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().getBody(); } /** @@ -697,7 +827,23 @@ public ServiceResponse deallocate(String resourceGroupName, String vmName) * @return the {@link ServiceCall} object */ public ServiceCall deallocateAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deallocateAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(deallocateWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); + } + + /** + * Shuts down the Virtual Machine and releases the compute resources. You are not billed for the compute resources that this Virtual Machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable for the request + */ + public Observable deallocateAsync(String resourceGroupName, String vmName) { + return deallocateWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -707,7 +853,7 @@ public ServiceCall deallocateAsync(String resourceGroupName, String vmName * @param vmName The name of the virtual machine. * @return the observable for the request */ - public Observable> deallocateAsync(String resourceGroupName, String vmName) { + public Observable> deallocateWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -732,10 +878,9 @@ public Observable> deallocateAsync(String resourceGroupNam * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDeallocate(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return beginDeallocateAsync(resourceGroupName, vmName).toBlocking().single(); + public void beginDeallocate(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -747,7 +892,23 @@ public ServiceResponse beginDeallocate(String resourceGroupName, String vm * @return the {@link ServiceCall} object */ public ServiceCall beginDeallocateAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeallocateAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); + } + + /** + * Shuts down the Virtual Machine and releases the compute resources. You are not billed for the compute resources that this Virtual Machine uses. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeallocateAsync(String resourceGroupName, String vmName) { + return beginDeallocateWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -757,7 +918,7 @@ public ServiceCall beginDeallocateAsync(String resourceGroupName, String v * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeallocateAsync(String resourceGroupName, String vmName) { + public Observable> beginDeallocateWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -798,10 +959,9 @@ private ServiceResponse beginDeallocateDelegate(Response res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse generalize(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return generalizeAsync(resourceGroupName, vmName).toBlocking().single(); + public void generalize(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + generalizeWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -813,7 +973,7 @@ public ServiceResponse generalize(String resourceGroupName, String vmName) * @return the {@link ServiceCall} object */ public ServiceCall generalizeAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(generalizeAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(generalizeWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -823,7 +983,23 @@ public ServiceCall generalizeAsync(String resourceGroupName, String vmName * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> generalizeAsync(String resourceGroupName, String vmName) { + public Observable generalizeAsync(String resourceGroupName, String vmName) { + return generalizeWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Sets the state of the VM as Generalized. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> generalizeWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -863,17 +1039,16 @@ private ServiceResponse generalizeDelegate(Response response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -899,15 +1074,34 @@ public Observable>> call(String nextPa * The operation to list virtual machines under a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<VirtualMachineInner> object + * @return the observable to the PagedList<VirtualMachineInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The operation to list virtual machines under a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -916,7 +1110,7 @@ public Observable>> call(ServiceRespon * The operation to list virtual machines under a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -955,17 +1149,16 @@ private ServiceResponse> listDelegate(Response> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -989,15 +1182,33 @@ public Observable>> call(String nextPa /** * Gets the list of Virtual Machines in the subscription. Use nextLink property in the response to get the next page of Virtual Machines. Do this till nextLink is not null to fetch all the Virtual Machines. * - * @return the observable to the List<VirtualMachineInner> object + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the list of Virtual Machines in the subscription. Use nextLink property in the response to get the next page of Virtual Machines. Do this till nextLink is not null to fetch all the Virtual Machines. + * + * @return the observable to the PagedList<VirtualMachineInner> object */ - public Observable>> listAllAsync() { + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1005,7 +1216,7 @@ public Observable>> call(ServiceRespon /** * Gets the list of Virtual Machines in the subscription. Use nextLink property in the response to get the next page of Virtual Machines. Do this till nextLink is not null to fetch all the Virtual Machines. * - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -1043,10 +1254,10 @@ private ServiceResponse> listAllDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineSizeInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VirtualMachineSizeInner> object if successful. */ - public ServiceResponse> listAvailableSizes(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return listAvailableSizesAsync(resourceGroupName, vmName).toBlocking().single(); + public List listAvailableSizes(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + return listAvailableSizesWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -1058,7 +1269,7 @@ public ServiceResponse> listAvailableSizes(String * @return the {@link ServiceCall} object */ public ServiceCall> listAvailableSizesAsync(String resourceGroupName, String vmName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAvailableSizesAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(listAvailableSizesWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1068,7 +1279,23 @@ public ServiceCall> listAvailableSizesAsync(String * @param vmName The name of the virtual machine. * @return the observable to the List<VirtualMachineSizeInner> object */ - public Observable>> listAvailableSizesAsync(String resourceGroupName, String vmName) { + public Observable> listAvailableSizesAsync(String resourceGroupName, String vmName) { + return listAvailableSizesWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all available virtual machine sizes it can be resized to for a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable to the List<VirtualMachineSizeInner> object + */ + public Observable>> listAvailableSizesWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1112,10 +1339,9 @@ private ServiceResponse> listAvailableSizesDel * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse powerOff(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return powerOffAsync(resourceGroupName, vmName).toBlocking().last(); + public void powerOff(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + powerOffWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().getBody(); } /** @@ -1127,7 +1353,7 @@ public ServiceResponse powerOff(String resourceGroupName, String vmName) t * @return the {@link ServiceCall} object */ public ServiceCall powerOffAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(powerOffAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(powerOffWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1137,7 +1363,23 @@ public ServiceCall powerOffAsync(String resourceGroupName, String vmName, * @param vmName The name of the virtual machine. * @return the observable for the request */ - public Observable> powerOffAsync(String resourceGroupName, String vmName) { + public Observable powerOffAsync(String resourceGroupName, String vmName) { + return powerOffWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to power off (stop) a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable for the request + */ + public Observable> powerOffWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1162,10 +1404,9 @@ public Observable> powerOffAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginPowerOff(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return beginPowerOffAsync(resourceGroupName, vmName).toBlocking().single(); + public void beginPowerOff(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -1177,7 +1418,7 @@ public ServiceResponse beginPowerOff(String resourceGroupName, String vmNa * @return the {@link ServiceCall} object */ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginPowerOffAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1187,7 +1428,23 @@ public ServiceCall beginPowerOffAsync(String resourceGroupName, String vmN * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginPowerOffAsync(String resourceGroupName, String vmName) { + public Observable beginPowerOffAsync(String resourceGroupName, String vmName) { + return beginPowerOffWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to power off (stop) a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginPowerOffWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1229,10 +1486,9 @@ private ServiceResponse beginPowerOffDelegate(Response respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse restart(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return restartAsync(resourceGroupName, vmName).toBlocking().last(); + public void restart(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + restartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().getBody(); } /** @@ -1244,7 +1500,7 @@ public ServiceResponse restart(String resourceGroupName, String vmName) th * @return the {@link ServiceCall} object */ public ServiceCall restartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(restartWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1254,7 +1510,23 @@ public ServiceCall restartAsync(String resourceGroupName, String vmName, f * @param vmName The name of the virtual machine. * @return the observable for the request */ - public Observable> restartAsync(String resourceGroupName, String vmName) { + public Observable restartAsync(String resourceGroupName, String vmName) { + return restartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable for the request + */ + public Observable> restartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1279,10 +1551,9 @@ public Observable> restartAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginRestart(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return beginRestartAsync(resourceGroupName, vmName).toBlocking().single(); + public void beginRestart(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + beginRestartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -1294,7 +1565,7 @@ public ServiceResponse beginRestart(String resourceGroupName, String vmNam * @return the {@link ServiceCall} object */ public ServiceCall beginRestartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRestartAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(beginRestartWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1304,7 +1575,23 @@ public ServiceCall beginRestartAsync(String resourceGroupName, String vmNa * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginRestartAsync(String resourceGroupName, String vmName) { + public Observable beginRestartAsync(String resourceGroupName, String vmName) { + return beginRestartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to restart a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRestartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1346,10 +1633,9 @@ private ServiceResponse beginRestartDelegate(Response respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse start(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return startAsync(resourceGroupName, vmName).toBlocking().last(); + public void start(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + startWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().getBody(); } /** @@ -1361,7 +1647,7 @@ public ServiceResponse start(String resourceGroupName, String vmName) thro * @return the {@link ServiceCall} object */ public ServiceCall startAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(startAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(startWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1371,7 +1657,23 @@ public ServiceCall startAsync(String resourceGroupName, String vmName, fin * @param vmName The name of the virtual machine. * @return the observable for the request */ - public Observable> startAsync(String resourceGroupName, String vmName) { + public Observable startAsync(String resourceGroupName, String vmName) { + return startWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1396,10 +1698,9 @@ public Observable> startAsync(String resourceGroupName, St * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginStart(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return beginStartAsync(resourceGroupName, vmName).toBlocking().single(); + public void beginStart(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + beginStartWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -1411,7 +1712,7 @@ public ServiceResponse beginStart(String resourceGroupName, String vmName) * @return the {@link ServiceCall} object */ public ServiceCall beginStartAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginStartAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(beginStartWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1421,7 +1722,23 @@ public ServiceCall beginStartAsync(String resourceGroupName, String vmName * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginStartAsync(String resourceGroupName, String vmName) { + public Observable beginStartAsync(String resourceGroupName, String vmName) { + return beginStartWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to start a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1463,10 +1780,9 @@ private ServiceResponse beginStartDelegate(Response response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse redeploy(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return redeployAsync(resourceGroupName, vmName).toBlocking().last(); + public void redeploy(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + redeployWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().last().getBody(); } /** @@ -1478,7 +1794,7 @@ public ServiceResponse redeploy(String resourceGroupName, String vmName) t * @return the {@link ServiceCall} object */ public ServiceCall redeployAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(redeployAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(redeployWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1488,7 +1804,23 @@ public ServiceCall redeployAsync(String resourceGroupName, String vmName, * @param vmName The name of the virtual machine. * @return the observable for the request */ - public Observable> redeployAsync(String resourceGroupName, String vmName) { + public Observable redeployAsync(String resourceGroupName, String vmName) { + return redeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to redeploy a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the observable for the request + */ + public Observable> redeployWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1513,10 +1845,9 @@ public Observable> redeployAsync(String resourceGroupName, * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginRedeploy(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { - return beginRedeployAsync(resourceGroupName, vmName).toBlocking().single(); + public void beginRedeploy(String resourceGroupName, String vmName) throws CloudException, IOException, IllegalArgumentException { + beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).toBlocking().single().getBody(); } /** @@ -1528,7 +1859,7 @@ public ServiceResponse beginRedeploy(String resourceGroupName, String vmNa * @return the {@link ServiceCall} object */ public ServiceCall beginRedeployAsync(String resourceGroupName, String vmName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRedeployAsync(resourceGroupName, vmName), serviceCallback); + return ServiceCall.create(beginRedeployWithServiceResponseAsync(resourceGroupName, vmName), serviceCallback); } /** @@ -1538,7 +1869,23 @@ public ServiceCall beginRedeployAsync(String resourceGroupName, String vmN * @param vmName The name of the virtual machine. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginRedeployAsync(String resourceGroupName, String vmName) { + public Observable beginRedeployAsync(String resourceGroupName, String vmName) { + return beginRedeployWithServiceResponseAsync(resourceGroupName, vmName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The operation to redeploy a virtual machine. + * + * @param resourceGroupName The name of the resource group. + * @param vmName The name of the virtual machine. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginRedeployWithServiceResponseAsync(String resourceGroupName, String vmName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1578,17 +1925,16 @@ private ServiceResponse beginRedeployDelegate(Response respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1615,15 +1961,34 @@ public Observable>> call(String nextPa * The operation to list virtual machines under a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualMachineInner> object + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The operation to list virtual machines under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualMachineInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1632,7 +1997,7 @@ public Observable>> call(ServiceRespon * The operation to list virtual machines under a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1666,17 +2031,16 @@ private ServiceResponse> listNextDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1703,15 +2067,34 @@ public Observable>> call(String nextPa * Gets the list of Virtual Machines in the subscription. Use nextLink property in the response to get the next page of Virtual Machines. Do this till nextLink is not null to fetch all the Virtual Machines. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualMachineInner> object + * @return the observable to the PagedList<VirtualMachineInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the list of Virtual Machines in the subscription. Use nextLink property in the response to get the next page of Virtual Machines. Do this till nextLink is not null to fetch all the Virtual Machines. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualMachineInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1720,7 +2103,7 @@ public Observable>> call(ServiceRespon * Gets the list of Virtual Machines in the subscription. Use nextLink property in the response to get the next page of Virtual Machines. Do this till nextLink is not null to fetch all the Virtual Machines. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualMachineInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java index 83f1614c6302..d961d54e5b38 100644 --- a/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java +++ b/azure-mgmt-datalake-analytics/src/test/java/com/microsoft/azure/management/datalake/analytics/DataLakeAnalyticsAccountOperationsTests.java @@ -50,7 +50,7 @@ public static void setup() throws Exception { createParams.withLocation(location); createParams.withSku(new Sku().withName(SkuName.STANDARD_LRS)); storageManagementClient.storageAccounts().create(rgName, storageAcct, createParams); - storageAccessKey = storageManagementClient.storageAccounts().listKeys(rgName, storageAcct).getBody().keys().get(0).value(); + storageAccessKey = storageManagementClient.storageAccounts().listKeys(rgName, storageAcct).keys().get(0).value(); } @AfterClass diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySku.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySku.java index 490177be6d9a..72468472cae4 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySku.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySku.java @@ -14,14 +14,16 @@ */ public class VirtualNetworkGatewaySku { /** - * Gateway sku name -Basic/HighPerformance/Standard. Possible values - * include: 'Basic', 'HighPerformance', 'Standard'. + * Gateway sku name -Basic/HighPerformance/Standard/UltraPerformance. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance'. */ private VirtualNetworkGatewaySkuName name; /** - * Gateway sku tier -Basic/HighPerformance/Standard. Possible values - * include: 'Basic', 'HighPerformance', 'Standard'. + * Gateway sku tier -Basic/HighPerformance/Standard/UltraPerformance. + * Possible values include: 'Basic', 'HighPerformance', 'Standard', + * 'UltraPerformance'. */ private VirtualNetworkGatewaySkuTier tier; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuName.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuName.java index 147781a6e77a..9c84f01fd3b3 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuName.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuName.java @@ -23,6 +23,9 @@ public final class VirtualNetworkGatewaySkuName { /** Static value Standard for VirtualNetworkGatewaySkuName. */ public static final VirtualNetworkGatewaySkuName STANDARD = new VirtualNetworkGatewaySkuName("Standard"); + /** Static value UltraPerformance for VirtualNetworkGatewaySkuName. */ + public static final VirtualNetworkGatewaySkuName ULTRA_PERFORMANCE = new VirtualNetworkGatewaySkuName("UltraPerformance"); + private String value; /** diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuTier.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuTier.java index 7753ca56fa08..97103d5a01fd 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuTier.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/VirtualNetworkGatewaySkuTier.java @@ -23,6 +23,9 @@ public final class VirtualNetworkGatewaySkuTier { /** Static value Standard for VirtualNetworkGatewaySkuTier. */ public static final VirtualNetworkGatewaySkuTier STANDARD = new VirtualNetworkGatewaySkuTier("Standard"); + /** Static value UltraPerformance for VirtualNetworkGatewaySkuTier. */ + public static final VirtualNetworkGatewaySkuTier ULTRA_PERFORMANCE = new VirtualNetworkGatewaySkuTier("UltraPerformance"); + private String value; /** diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ApplicationGatewaysInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ApplicationGatewaysInner.java index 797cd22df76e..8ccbe1c3793e 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ApplicationGatewaysInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ApplicationGatewaysInner.java @@ -126,10 +126,9 @@ interface ApplicationGatewaysService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, applicationGatewayName).toBlocking().last(); + public void delete(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().getBody(); } /** @@ -141,7 +140,7 @@ public ServiceResponse delete(String resourceGroupName, String application * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); } /** @@ -151,7 +150,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String applicatio * @param applicationGatewayName The name of the application gateway. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String applicationGatewayName) { + public Observable deleteAsync(String resourceGroupName, String applicationGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete ApplicationGateway operation deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -176,10 +191,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, applicationGatewayName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().getBody(); } /** @@ -191,7 +205,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String applic * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * The delete ApplicationGateway operation deletes the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String applicationGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -201,7 +231,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String appli * @param applicationGatewayName The name of the application gateway. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String applicationGatewayName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -244,10 +274,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ApplicationGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the ApplicationGatewayInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, applicationGatewayName).toBlocking().single(); + public ApplicationGatewayInner get(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().getBody(); } /** @@ -259,7 +289,7 @@ public ServiceResponse get(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); } /** @@ -269,7 +299,23 @@ public ServiceCall getAsync(String resourceGroupName, S * @param applicationGatewayName The name of the application gateway. * @return the observable to the ApplicationGatewayInner object */ - public Observable> getAsync(String resourceGroupName, String applicationGatewayName) { + public Observable getAsync(String resourceGroupName, String applicationGatewayName) { + return getWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get ApplicationGateway operation retrieves information about the specified application gateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the observable to the ApplicationGatewayInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -313,10 +359,10 @@ private ServiceResponse getDelegate(Response createOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().last(); + public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().last().getBody(); } /** @@ -329,7 +375,24 @@ public ServiceResponse createOrUpdate(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * The Put ApplicationGateway operation creates/updates a ApplicationGateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the ApplicationGateway. + * @param parameters Parameters supplied to the create/delete ApplicationGateway operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -340,7 +403,7 @@ public ServiceCall createOrUpdateAsync(String resourceG * @param parameters Parameters supplied to the create/delete ApplicationGateway operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -370,10 +433,10 @@ public Observable> createOrUpdateAsync( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ApplicationGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the ApplicationGatewayInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single(); + public ApplicationGatewayInner beginCreateOrUpdate(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).toBlocking().single().getBody(); } /** @@ -386,7 +449,24 @@ public ServiceResponse beginCreateOrUpdate(String resou * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters), serviceCallback); + } + + /** + * The Put ApplicationGateway operation creates/updates a ApplicationGateway. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the ApplicationGateway. + * @param parameters Parameters supplied to the create/delete ApplicationGateway operation + * @return the observable to the ApplicationGatewayInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, applicationGatewayName, parameters).map(new Func1, ApplicationGatewayInner>() { + @Override + public ApplicationGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -397,7 +477,7 @@ public ServiceCall beginCreateOrUpdateAsync(String reso * @param parameters Parameters supplied to the create/delete ApplicationGateway operation * @return the observable to the ApplicationGatewayInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -443,17 +523,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -479,15 +558,34 @@ public Observable>> call(String ne * The List ApplicationGateway operation retrieves all the application gateways in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<ApplicationGatewayInner> object + * @return the observable to the PagedList<ApplicationGatewayInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ApplicationGateway operation retrieves all the application gateways in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -496,7 +594,7 @@ public Observable>> call(ServiceRe * The List ApplicationGateway operation retrieves all the application gateways in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -535,17 +633,16 @@ private ServiceResponse> listDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -569,15 +666,33 @@ public Observable>> call(String ne /** * The List ApplicationGateway operation retrieves all the application gateways in a subscription. * - * @return the observable to the List<ApplicationGatewayInner> object + * @return the observable to the PagedList<ApplicationGatewayInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ApplicationGateway operation retrieves all the application gateways in a subscription. + * + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -585,7 +700,7 @@ public Observable>> call(ServiceRe /** * The List ApplicationGateway operation retrieves all the application gateways in a subscription. * - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -624,10 +739,9 @@ private ServiceResponse> listAllDelegate(Respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse start(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return startAsync(resourceGroupName, applicationGatewayName).toBlocking().last(); + public void start(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().getBody(); } /** @@ -639,7 +753,7 @@ public ServiceResponse start(String resourceGroupName, String applicationG * @return the {@link ServiceCall} object */ public ServiceCall startAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(startAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(startWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); } /** @@ -649,7 +763,23 @@ public ServiceCall startAsync(String resourceGroupName, String application * @param applicationGatewayName The name of the application gateway. * @return the observable for the request */ - public Observable> startAsync(String resourceGroupName, String applicationGatewayName) { + public Observable startAsync(String resourceGroupName, String applicationGatewayName) { + return startWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Start ApplicationGateway operation starts application gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the observable for the request + */ + public Observable> startWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -674,10 +804,9 @@ public Observable> startAsync(String resourceGroupName, St * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginStart(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { - return beginStartAsync(resourceGroupName, applicationGatewayName).toBlocking().single(); + public void beginStart(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { + beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().getBody(); } /** @@ -689,7 +818,23 @@ public ServiceResponse beginStart(String resourceGroupName, String applica * @return the {@link ServiceCall} object */ public ServiceCall beginStartAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginStartAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); + } + + /** + * The Start ApplicationGateway operation starts application gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginStartAsync(String resourceGroupName, String applicationGatewayName) { + return beginStartWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -699,7 +844,7 @@ public ServiceCall beginStartAsync(String resourceGroupName, String applic * @param applicationGatewayName The name of the application gateway. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginStartAsync(String resourceGroupName, String applicationGatewayName) { + public Observable> beginStartWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -742,10 +887,9 @@ private ServiceResponse beginStartDelegate(Response response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse stop(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return stopAsync(resourceGroupName, applicationGatewayName).toBlocking().last(); + public void stop(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().last().getBody(); } /** @@ -757,7 +901,7 @@ public ServiceResponse stop(String resourceGroupName, String applicationGa * @return the {@link ServiceCall} object */ public ServiceCall stopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(stopAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); } /** @@ -767,7 +911,23 @@ public ServiceCall stopAsync(String resourceGroupName, String applicationG * @param applicationGatewayName The name of the application gateway. * @return the observable for the request */ - public Observable> stopAsync(String resourceGroupName, String applicationGatewayName) { + public Observable stopAsync(String resourceGroupName, String applicationGatewayName) { + return stopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The STOP ApplicationGateway operation stops application gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the observable for the request + */ + public Observable> stopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -792,10 +952,9 @@ public Observable> stopAsync(String resourceGroupName, Str * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginStop(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { - return beginStopAsync(resourceGroupName, applicationGatewayName).toBlocking().single(); + public void beginStop(String resourceGroupName, String applicationGatewayName) throws CloudException, IOException, IllegalArgumentException { + beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).toBlocking().single().getBody(); } /** @@ -807,7 +966,7 @@ public ServiceResponse beginStop(String resourceGroupName, String applicat * @return the {@link ServiceCall} object */ public ServiceCall beginStopAsync(String resourceGroupName, String applicationGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginStopAsync(resourceGroupName, applicationGatewayName), serviceCallback); + return ServiceCall.create(beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName), serviceCallback); } /** @@ -817,7 +976,23 @@ public ServiceCall beginStopAsync(String resourceGroupName, String applica * @param applicationGatewayName The name of the application gateway. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginStopAsync(String resourceGroupName, String applicationGatewayName) { + public Observable beginStopAsync(String resourceGroupName, String applicationGatewayName) { + return beginStopWithServiceResponseAsync(resourceGroupName, applicationGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The STOP ApplicationGateway operation stops application gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param applicationGatewayName The name of the application gateway. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginStopWithServiceResponseAsync(String resourceGroupName, String applicationGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -858,17 +1033,16 @@ private ServiceResponse beginStopDelegate(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -895,15 +1069,34 @@ public Observable>> call(String ne * The List ApplicationGateway operation retrieves all the application gateways in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ApplicationGatewayInner> object + * @return the observable to the PagedList<ApplicationGatewayInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ApplicationGateway operation retrieves all the application gateways in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -912,7 +1105,7 @@ public Observable>> call(ServiceRe * The List ApplicationGateway operation retrieves all the application gateways in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -946,17 +1139,16 @@ private ServiceResponse> listNextDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -983,15 +1175,34 @@ public Observable>> call(String ne * The List ApplicationGateway operation retrieves all the application gateways in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ApplicationGatewayInner> object + * @return the observable to the PagedList<ApplicationGatewayInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ApplicationGateway operation retrieves all the application gateways in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ApplicationGatewayInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1000,7 +1211,7 @@ public Observable>> call(ServiceRe * The List ApplicationGateway operation retrieves all the application gateways in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ApplicationGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitAuthorizationsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitAuthorizationsInner.java index eb6d04d7a30d..3314682ab258 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitAuthorizationsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitAuthorizationsInner.java @@ -102,10 +102,9 @@ interface ExpressRouteCircuitAuthorizationsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String circuitName, String authorizationName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, circuitName, authorizationName).toBlocking().last(); + public void delete(String resourceGroupName, String circuitName, String authorizationName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().last().getBody(); } /** @@ -118,7 +117,7 @@ public ServiceResponse delete(String resourceGroupName, String circuitName * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); } /** @@ -129,7 +128,24 @@ public ServiceCall deleteAsync(String resourceGroupName, String circuitNam * @param authorizationName The name of the authorization. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + public Observable deleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete authorization operation deletes the specified authorization from the specified ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String circuitName, String authorizationName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String circuitName, String authorizationName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().getBody(); } /** @@ -174,7 +189,24 @@ public ServiceResponse beginDelete(String resourceGroupName, String circui * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * The delete authorization operation deletes the specified authorization from the specified ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -185,7 +217,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String circu * @param authorizationName The name of the authorization. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String circuitName, String authorizationName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -232,10 +264,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitAuthorizationInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitAuthorizationInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String circuitName, String authorizationName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single(); + public ExpressRouteCircuitAuthorizationInner get(String resourceGroupName, String circuitName, String authorizationName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).toBlocking().single().getBody(); } /** @@ -248,7 +280,24 @@ public ServiceResponse get(String resourc * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String circuitName, String authorizationName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName), serviceCallback); + } + + /** + * The GET authorization operation retrieves the specified authorization from the specified ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String authorizationName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -259,7 +308,7 @@ public ServiceCall getAsync(String resour * @param authorizationName The name of the authorization. * @return the observable to the ExpressRouteCircuitAuthorizationInner object */ - public Observable> getAsync(String resourceGroupName, String circuitName, String authorizationName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -307,10 +356,10 @@ private ServiceResponse getDelegate(Respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ExpressRouteCircuitAuthorizationInner object wrapped in ServiceResponse if successful. + * @return the ExpressRouteCircuitAuthorizationInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().last(); + public ExpressRouteCircuitAuthorizationInner createOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().last().getBody(); } /** @@ -324,7 +373,25 @@ public ServiceResponse createOrUpdate(Str * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * The Put Authorization operation creates/updates an authorization in the specified ExpressRouteCircuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create/update ExpressRouteCircuitAuthorization operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -336,7 +403,7 @@ public ServiceCall createOrUpdateAsync(St * @param authorizationParameters Parameters supplied to the create/update ExpressRouteCircuitAuthorization operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -370,10 +437,10 @@ public Observable> create * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitAuthorizationInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitAuthorizationInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single(); + public ExpressRouteCircuitAuthorizationInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).toBlocking().single().getBody(); } /** @@ -387,7 +454,25 @@ public ServiceResponse beginCreateOrUpdat * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters), serviceCallback); + } + + /** + * The Put Authorization operation creates/updates an authorization in the specified ExpressRouteCircuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param authorizationName The name of the authorization. + * @param authorizationParameters Parameters supplied to the create/update ExpressRouteCircuitAuthorization operation + * @return the observable to the ExpressRouteCircuitAuthorizationInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, authorizationName, authorizationParameters).map(new Func1, ExpressRouteCircuitAuthorizationInner>() { + @Override + public ExpressRouteCircuitAuthorizationInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -399,7 +484,7 @@ public ServiceCall beginCreateOrUpdateAsy * @param authorizationParameters Parameters supplied to the create/update ExpressRouteCircuitAuthorization operation * @return the observable to the ExpressRouteCircuitAuthorizationInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String authorizationName, ExpressRouteCircuitAuthorizationInner authorizationParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -449,17 +534,16 @@ private ServiceResponse beginCreateOrUpda * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String circuitName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String circuitName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -487,15 +571,35 @@ public Observable>> * * @param resourceGroupName The name of the resource group. * @param circuitName The name of the circuit. - * @return the observable to the List<ExpressRouteCircuitAuthorizationInner> object + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String circuitName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { return listSinglePageAsync(resourceGroupName, circuitName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -505,7 +609,7 @@ public Observable>> * ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param circuitName The name of the circuit. - * @return the List<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { if (resourceGroupName == null) { @@ -548,17 +652,16 @@ private ServiceResponse> listDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -585,15 +688,34 @@ public Observable>> * The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ExpressRouteCircuitAuthorizationInner> object + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ExpressRouteCircuitAuthorizationInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -602,7 +724,7 @@ public Observable>> * The List authorization operation retrieves all the authorizations in an ExpressRouteCircuit. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitAuthorizationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitPeeringsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitPeeringsInner.java index f871f733ae76..185f29fe45ca 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitPeeringsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitPeeringsInner.java @@ -102,10 +102,9 @@ interface ExpressRouteCircuitPeeringsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, circuitName, peeringName).toBlocking().last(); + public void delete(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().last().getBody(); } /** @@ -118,7 +117,7 @@ public ServiceResponse delete(String resourceGroupName, String circuitName * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); } /** @@ -129,7 +128,24 @@ public ServiceCall deleteAsync(String resourceGroupName, String circuitNam * @param peeringName The name of the peering. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + public Observable deleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete peering operation deletes the specified peering from the ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, circuitName, peeringName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().getBody(); } /** @@ -174,7 +189,24 @@ public ServiceResponse beginDelete(String resourceGroupName, String circui * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * The delete peering operation deletes the specified peering from the ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -185,7 +217,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String circu * @param peeringName The name of the peering. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String circuitName, String peeringName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -232,10 +264,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitPeeringInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitPeeringInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, circuitName, peeringName).toBlocking().single(); + public ExpressRouteCircuitPeeringInner get(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().getBody(); } /** @@ -248,7 +280,24 @@ public ServiceResponse get(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + } + + /** + * The GET peering operation retrieves the specified authorization from the ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName, String peeringName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -259,7 +308,7 @@ public ServiceCall getAsync(String resourceGrou * @param peeringName The name of the peering. * @return the observable to the ExpressRouteCircuitPeeringInner object */ - public Observable> getAsync(String resourceGroupName, String circuitName, String peeringName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -307,10 +356,10 @@ private ServiceResponse getDelegate(Response createOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().last(); + public ExpressRouteCircuitPeeringInner createOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().last().getBody(); } /** @@ -324,7 +373,25 @@ public ServiceResponse createOrUpdate(String re * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * The Put Peering operation creates/updates an peering in the specified ExpressRouteCircuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create/update ExpressRouteCircuit Peering operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -336,7 +403,7 @@ public ServiceCall createOrUpdateAsync(String r * @param peeringParameters Parameters supplied to the create/update ExpressRouteCircuit Peering operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -370,10 +437,10 @@ public Observable> createOrUpda * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitPeeringInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitPeeringInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single(); + public ExpressRouteCircuitPeeringInner beginCreateOrUpdate(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).toBlocking().single().getBody(); } /** @@ -387,7 +454,25 @@ public ServiceResponse beginCreateOrUpdate(Stri * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters), serviceCallback); + } + + /** + * The Put Peering operation creates/updates an peering in the specified ExpressRouteCircuits. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route circuit. + * @param peeringName The name of the peering. + * @param peeringParameters Parameters supplied to the create/update ExpressRouteCircuit Peering operation + * @return the observable to the ExpressRouteCircuitPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).map(new Func1, ExpressRouteCircuitPeeringInner>() { + @Override + public ExpressRouteCircuitPeeringInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -399,7 +484,7 @@ public ServiceCall beginCreateOrUpdateAsync(Str * @param peeringParameters Parameters supplied to the create/update ExpressRouteCircuit Peering operation * @return the observable to the ExpressRouteCircuitPeeringInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -449,17 +534,16 @@ private ServiceResponse beginCreateOrUpdateDele * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String circuitName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String circuitName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, circuitName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -487,15 +571,35 @@ public Observable>> call(S * * @param resourceGroupName The name of the resource group. * @param circuitName The name of the circuit. - * @return the observable to the List<ExpressRouteCircuitPeeringInner> object + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String circuitName) { + return listWithServiceResponseAsync(resourceGroupName, circuitName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List peering operation retrieves all the peerings in an ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String circuitName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String circuitName) { return listSinglePageAsync(resourceGroupName, circuitName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -505,7 +609,7 @@ public Observable>> call(S * ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param circuitName The name of the circuit. - * @return the List<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String circuitName) { if (resourceGroupName == null) { @@ -548,17 +652,16 @@ private ServiceResponse> listDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitPeeringInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -585,15 +688,34 @@ public Observable>> call(S * The List peering operation retrieves all the peerings in an ExpressRouteCircuit. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ExpressRouteCircuitPeeringInner> object + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List peering operation retrieves all the peerings in an ExpressRouteCircuit. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ExpressRouteCircuitPeeringInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -602,7 +724,7 @@ public Observable>> call(S * The List peering operation retrieves all the peerings in an ExpressRouteCircuit. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitPeeringInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitsInner.java index 443d82b2009a..3019ec44955e 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteCircuitsInner.java @@ -142,10 +142,9 @@ interface ExpressRouteCircuitsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, circuitName).toBlocking().last(); + public void delete(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().last().getBody(); } /** @@ -157,7 +156,7 @@ public ServiceResponse delete(String resourceGroupName, String circuitName * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, circuitName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); } /** @@ -167,7 +166,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String circuitNam * @param circuitName The name of the express route Circuit. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String circuitName) { + public Observable deleteAsync(String resourceGroupName, String circuitName) { + return deleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete ExpressRouteCircuit operation deletes the specified ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route Circuit. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -192,10 +207,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, circuitName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().getBody(); } /** @@ -207,7 +221,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String circui * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, circuitName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * The delete ExpressRouteCircuit operation deletes the specified ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the express route Circuit. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String circuitName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -217,7 +247,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String circu * @param circuitName The name of the express route Circuit. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String circuitName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String circuitName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -260,10 +290,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, circuitName).toBlocking().single(); + public ExpressRouteCircuitInner get(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().getBody(); } /** @@ -275,7 +305,23 @@ public ServiceResponse get(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, circuitName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * The Get ExpressRouteCircuit operation retrieves information about the specified ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable getAsync(String resourceGroupName, String circuitName) { + return getWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -285,7 +331,7 @@ public ServiceCall getAsync(String resourceGroupName, * @param circuitName The name of the circuit. * @return the observable to the ExpressRouteCircuitInner object */ - public Observable> getAsync(String resourceGroupName, String circuitName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String circuitName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -329,10 +375,10 @@ private ServiceResponse getDelegate(Response createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, circuitName, parameters).toBlocking().last(); + public ExpressRouteCircuitInner createOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().last().getBody(); } /** @@ -345,7 +391,24 @@ public ServiceResponse createOrUpdate(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, circuitName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); + } + + /** + * The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create/delete ExpressRouteCircuit operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -356,7 +419,7 @@ public ServiceCall createOrUpdateAsync(String resource * @param parameters Parameters supplied to the create/delete ExpressRouteCircuit operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -386,10 +449,10 @@ public Observable> createOrUpdateAsync * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters).toBlocking().single(); + public ExpressRouteCircuitInner beginCreateOrUpdate(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).toBlocking().single().getBody(); } /** @@ -402,7 +465,7 @@ public ServiceResponse beginCreateOrUpdate(String reso * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, circuitName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters), serviceCallback); } /** @@ -413,7 +476,24 @@ public ServiceCall beginCreateOrUpdateAsync(String res * @param parameters Parameters supplied to the create/delete ExpressRouteCircuit operation * @return the observable to the ExpressRouteCircuitInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, parameters).map(new Func1, ExpressRouteCircuitInner>() { + @Override + public ExpressRouteCircuitInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put ExpressRouteCircuit operation creates/updates a ExpressRouteCircuit. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param parameters Parameters supplied to the create/delete ExpressRouteCircuit operation + * @return the observable to the ExpressRouteCircuitInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String circuitName, ExpressRouteCircuitInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -463,10 +543,10 @@ private ServiceResponse beginCreateOrUpdateDelegate(Re * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ExpressRouteCircuitsArpTableListResultInner object wrapped in ServiceResponse if successful. + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. */ - public ServiceResponse listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last(); + public ExpressRouteCircuitsArpTableListResultInner listArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().getBody(); } /** @@ -480,7 +560,25 @@ public ServiceResponse listArpTable * @return the {@link ServiceCall} object */ public ServiceCall listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { - return ServiceCall.create(listArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + return ServiceCall.create(listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * The ListArpTable from ExpressRouteCircuit operation retrieves the currently advertised arp table associated with the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @return the observable for the request + */ + public Observable listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -492,7 +590,7 @@ public ServiceCall listArpTableAsyn * @param devicePath The path of the device. * @return the observable for the request */ - public Observable> listArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + public Observable> listArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -525,10 +623,10 @@ public Observable> * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitsArpTableListResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitsArpTableListResultInner object if successful. */ - public ServiceResponse beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException { - return beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single(); + public ExpressRouteCircuitsArpTableListResultInner beginListArpTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().getBody(); } /** @@ -542,7 +640,7 @@ public ServiceResponse beginListArp * @return the {@link ServiceCall} object */ public ServiceCall beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginListArpTableAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + return ServiceCall.create(beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); } /** @@ -554,7 +652,25 @@ public ServiceCall beginListArpTabl * @param devicePath The path of the device. * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object */ - public Observable> beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + public Observable beginListArpTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListArpTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsArpTableListResultInner>() { + @Override + public ExpressRouteCircuitsArpTableListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The ListArpTable from ExpressRouteCircuit operation retrieves the currently advertised arp table associated with the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @return the observable to the ExpressRouteCircuitsArpTableListResultInner object + */ + public Observable> beginListArpTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -606,10 +722,10 @@ private ServiceResponse beginListAr * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ExpressRouteCircuitsRoutesTableListResultInner object wrapped in ServiceResponse if successful. + * @return the ExpressRouteCircuitsRoutesTableListResultInner object if successful. */ - public ServiceResponse listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last(); + public ExpressRouteCircuitsRoutesTableListResultInner listRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().getBody(); } /** @@ -623,7 +739,7 @@ public ServiceResponse listRoute * @return the {@link ServiceCall} object */ public ServiceCall listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { - return ServiceCall.create(listRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + return ServiceCall.create(listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); } /** @@ -635,7 +751,25 @@ public ServiceCall listRoutesTab * @param devicePath The path of the device. * @return the observable for the request */ - public Observable> listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + public Observable listRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised routes table associated with the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @return the observable for the request + */ + public Observable> listRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -668,10 +802,10 @@ public Observable beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException { - return beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single(); + public ExpressRouteCircuitsRoutesTableListResultInner beginListRoutesTable(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().getBody(); } /** @@ -685,7 +819,25 @@ public ServiceResponse beginList * @return the {@link ServiceCall} object */ public ServiceCall beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginListRoutesTableAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + return ServiceCall.create(beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised routes table associated with the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object + */ + public Observable beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -697,7 +849,7 @@ public ServiceCall beginListRout * @param devicePath The path of the device. * @return the observable to the ExpressRouteCircuitsRoutesTableListResultInner object */ - public Observable> beginListRoutesTableAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + public Observable> beginListRoutesTableWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -749,10 +901,10 @@ private ServiceResponse beginLis * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object wrapped in ServiceResponse if successful. + * @return the ExpressRouteCircuitsRoutesTableSummaryListResultInner object if successful. */ - public ServiceResponse listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last(); + public ExpressRouteCircuitsRoutesTableSummaryListResultInner listRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().last().getBody(); } /** @@ -766,7 +918,25 @@ public ServiceResponse li * @return the {@link ServiceCall} object */ public ServiceCall listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { - return ServiceCall.create(listRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + return ServiceCall.create(listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised routes table associated with the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @return the observable for the request + */ + public Observable listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return listRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -778,7 +948,7 @@ public ServiceCall listRo * @param devicePath The path of the device. * @return the observable for the request */ - public Observable> listRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + public Observable> listRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -811,10 +981,10 @@ public Observable beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException { - return beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single(); + public ExpressRouteCircuitsRoutesTableSummaryListResultInner beginListRoutesTableSummary(String resourceGroupName, String circuitName, String peeringName, String devicePath) throws CloudException, IOException, IllegalArgumentException { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).toBlocking().single().getBody(); } /** @@ -828,7 +998,25 @@ public ServiceResponse be * @return the {@link ServiceCall} object */ public ServiceCall beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginListRoutesTableSummaryAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + return ServiceCall.create(beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath), serviceCallback); + } + + /** + * The ListRoutesTable from ExpressRouteCircuit operation retrieves the currently advertised routes table associated with the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @param devicePath The path of the device. + * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object + */ + public Observable beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + return beginListRoutesTableSummaryWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, devicePath).map(new Func1, ExpressRouteCircuitsRoutesTableSummaryListResultInner>() { + @Override + public ExpressRouteCircuitsRoutesTableSummaryListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -840,7 +1028,7 @@ public ServiceCall beginL * @param devicePath The path of the device. * @return the observable to the ExpressRouteCircuitsRoutesTableSummaryListResultInner object */ - public Observable> beginListRoutesTableSummaryAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { + public Observable> beginListRoutesTableSummaryWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName, String devicePath) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -889,10 +1077,10 @@ private ServiceResponse b * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitStatsInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitStatsInner object if successful. */ - public ServiceResponse getStats(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException { - return getStatsAsync(resourceGroupName, circuitName).toBlocking().single(); + public ExpressRouteCircuitStatsInner getStats(String resourceGroupName, String circuitName) throws CloudException, IOException, IllegalArgumentException { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).toBlocking().single().getBody(); } /** @@ -904,7 +1092,23 @@ public ServiceResponse getStats(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall getStatsAsync(String resourceGroupName, String circuitName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getStatsAsync(resourceGroupName, circuitName), serviceCallback); + return ServiceCall.create(getStatsWithServiceResponseAsync(resourceGroupName, circuitName), serviceCallback); + } + + /** + * The List stats ExpressRouteCircuit operation retrieves all the stats from a ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable getStatsAsync(String resourceGroupName, String circuitName) { + return getStatsWithServiceResponseAsync(resourceGroupName, circuitName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -914,7 +1118,7 @@ public ServiceCall getStatsAsync(String resourceG * @param circuitName The name of the circuit. * @return the observable to the ExpressRouteCircuitStatsInner object */ - public Observable> getStatsAsync(String resourceGroupName, String circuitName) { + public Observable> getStatsWithServiceResponseAsync(String resourceGroupName, String circuitName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -957,10 +1161,10 @@ private ServiceResponse getStatsDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ExpressRouteCircuitStatsInner object wrapped in {@link ServiceResponse} if successful. + * @return the ExpressRouteCircuitStatsInner object if successful. */ - public ServiceResponse getPeeringStats(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException { - return getPeeringStatsAsync(resourceGroupName, circuitName, peeringName).toBlocking().single(); + public ExpressRouteCircuitStatsInner getPeeringStats(String resourceGroupName, String circuitName, String peeringName) throws CloudException, IOException, IllegalArgumentException { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).toBlocking().single().getBody(); } /** @@ -973,7 +1177,7 @@ public ServiceResponse getPeeringStats(String res * @return the {@link ServiceCall} object */ public ServiceCall getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getPeeringStatsAsync(resourceGroupName, circuitName, peeringName), serviceCallback); + return ServiceCall.create(getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName), serviceCallback); } /** @@ -984,7 +1188,24 @@ public ServiceCall getPeeringStatsAsync(String re * @param peeringName The name of the peering. * @return the observable to the ExpressRouteCircuitStatsInner object */ - public Observable> getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + public Observable getPeeringStatsAsync(String resourceGroupName, String circuitName, String peeringName) { + return getPeeringStatsWithServiceResponseAsync(resourceGroupName, circuitName, peeringName).map(new Func1, ExpressRouteCircuitStatsInner>() { + @Override + public ExpressRouteCircuitStatsInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The List stats ExpressRouteCircuit operation retrieves all the stats from a ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param circuitName The name of the circuit. + * @param peeringName The name of the peering. + * @return the observable to the ExpressRouteCircuitStatsInner object + */ + public Observable> getPeeringStatsWithServiceResponseAsync(String resourceGroupName, String circuitName, String peeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1028,17 +1249,16 @@ private ServiceResponse getPeeringStatsDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1064,15 +1284,34 @@ public Observable>> call(String n * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<ExpressRouteCircuitInner> object + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<ExpressRouteCircuitInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1081,7 +1320,7 @@ public Observable>> call(ServiceR * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -1120,17 +1359,16 @@ private ServiceResponse> listDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1154,15 +1392,33 @@ public Observable>> call(String n /** * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a subscription. * - * @return the observable to the List<ExpressRouteCircuitInner> object + * @return the observable to the PagedList<ExpressRouteCircuitInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a subscription. + * + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1170,7 +1426,7 @@ public Observable>> call(ServiceR /** * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a subscription. * - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -1207,17 +1463,16 @@ private ServiceResponse> listAllDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1244,15 +1499,34 @@ public Observable>> call(String n * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ExpressRouteCircuitInner> object + * @return the observable to the PagedList<ExpressRouteCircuitInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1261,7 +1535,7 @@ public Observable>> call(ServiceR * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1295,17 +1569,16 @@ private ServiceResponse> listNextDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1332,15 +1605,34 @@ public Observable>> call(String n * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ExpressRouteCircuitInner> object + * @return the observable to the PagedList<ExpressRouteCircuitInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ExpressRouteCircuitInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1349,7 +1641,7 @@ public Observable>> call(ServiceR * The List ExpressRouteCircuit operation retrieves all the ExpressRouteCircuits in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteCircuitInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteServiceProvidersInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteServiceProvidersInner.java index 4fe4e3014521..7891dbb853d4 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteServiceProvidersInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/ExpressRouteServiceProvidersInner.java @@ -73,17 +73,16 @@ interface ExpressRouteServiceProvidersService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -107,15 +106,33 @@ public Observable>> call( /** * The List ExpressRouteServiceProvider operation retrieves all the available ExpressRouteServiceProviders. * - * @return the observable to the List<ExpressRouteServiceProviderInner> object + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ExpressRouteServiceProvider operation retrieves all the available ExpressRouteServiceProviders. + * + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -123,7 +140,7 @@ public Observable>> call( /** * The List ExpressRouteServiceProvider operation retrieves all the available ExpressRouteServiceProviders. * - * @return the List<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -160,17 +177,16 @@ private ServiceResponse> listDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteServiceProviderInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -197,15 +213,34 @@ public Observable>> call( * The List ExpressRouteServiceProvider operation retrieves all the available ExpressRouteServiceProviders. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ExpressRouteServiceProviderInner> object + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List ExpressRouteServiceProvider operation retrieves all the available ExpressRouteServiceProviders. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ExpressRouteServiceProviderInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -214,7 +249,7 @@ public Observable>> call( * The List ExpressRouteServiceProvider operation retrieves all the available ExpressRouteServiceProviders. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ExpressRouteServiceProviderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java index acb3c6e6c073..68a0fa12b2f6 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancerImpl.java @@ -5,13 +5,6 @@ */ package com.microsoft.azure.management.network.implementation; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.TreeMap; import com.microsoft.azure.SubResource; import com.microsoft.azure.management.network.Backend; import com.microsoft.azure.management.network.Frontend; @@ -23,19 +16,26 @@ import com.microsoft.azure.management.network.NetworkInterface; import com.microsoft.azure.management.network.NicIpConfiguration; import com.microsoft.azure.management.network.Probe; -import com.microsoft.azure.management.network.TcpProbe; import com.microsoft.azure.management.network.ProbeProtocol; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.PublicIpAddress.DefinitionStages.WithGroup; import com.microsoft.azure.management.network.SupportsNetworkInterfaces; +import com.microsoft.azure.management.network.TcpProbe; import com.microsoft.azure.management.network.TransportProtocol; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; import com.microsoft.azure.management.resources.fluentcore.model.Creatable; -import com.microsoft.rest.ServiceResponse; import rx.Observable; import rx.functions.Func1; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.TreeMap; + /** * Implementation of the LoadBalancer interface. */ @@ -80,9 +80,8 @@ class LoadBalancerImpl @Override public LoadBalancerImpl refresh() throws Exception { - ServiceResponse response = - this.innerCollection.get(this.resourceGroupName(), this.name()); - this.setInner(response.getBody()); + LoadBalancerInner response = this.innerCollection.get(this.resourceGroupName(), this.name()); + this.setInner(response); initializeFrontendsFromInner(); initializeProbesFromInner(); initializeBackendsFromInner(); @@ -106,10 +105,10 @@ public Observable createResourceAsync() { final LoadBalancer self = this; beforeCreating(); return this.innerCollection.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) - .flatMap(new Func1, Observable>() { + .flatMap(new Func1>() { @Override - public Observable call(ServiceResponse loadBalancerInner) { - setInner(loadBalancerInner.getBody()); + public Observable call(LoadBalancerInner loadBalancerInner) { + setInner(loadBalancerInner); try { afterCreating(); return Observable.just(self); diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java index 2887782f351b..1017e60977bc 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersImpl.java @@ -34,17 +34,17 @@ class LoadBalancersImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(this.innerCollection.listAll().getBody()); + return wrapList(this.innerCollection.listAll()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.list(groupName).getBody()); + return wrapList(this.innerCollection.list(groupName)); } @Override public LoadBalancerImpl getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.get(groupName, name).getBody()); + return wrapModel(this.innerCollection.get(groupName, name)); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersInner.java index 71a8f23b8231..6502f15a306d 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LoadBalancersInner.java @@ -109,10 +109,9 @@ interface LoadBalancersService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, loadBalancerName).toBlocking().last(); + public void delete(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().last().getBody(); } /** @@ -124,7 +123,7 @@ public ServiceResponse delete(String resourceGroupName, String loadBalance * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, loadBalancerName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); } /** @@ -134,7 +133,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String loadBalanc * @param loadBalancerName The name of the loadBalancer. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String loadBalancerName) { + public Observable deleteAsync(String resourceGroupName, String loadBalancerName) { + return deleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete LoadBalancer operation deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -159,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().getBody(); } /** @@ -174,7 +188,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String loadBa * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, loadBalancerName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); + } + + /** + * The delete LoadBalancer operation deletes the specified load balancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String loadBalancerName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -184,7 +214,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String loadB * @param loadBalancerName The name of the loadBalancer. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String loadBalancerName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -227,10 +257,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the LoadBalancerInner object wrapped in {@link ServiceResponse} if successful. + * @return the LoadBalancerInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, loadBalancerName).toBlocking().single(); + public LoadBalancerInner get(String resourceGroupName, String loadBalancerName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName).toBlocking().single().getBody(); } /** @@ -242,7 +272,7 @@ public ServiceResponse get(String resourceGroupName, String l * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String loadBalancerName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, loadBalancerName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, loadBalancerName), serviceCallback); } /** @@ -252,7 +282,23 @@ public ServiceCall getAsync(String resourceGroupName, String * @param loadBalancerName The name of the loadBalancer. * @return the observable to the LoadBalancerInner object */ - public Observable> getAsync(String resourceGroupName, String loadBalancerName) { + public Observable getAsync(String resourceGroupName, String loadBalancerName) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get LoadBalancer operation retrieves information about the specified LoadBalancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @return the observable to the LoadBalancerInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -289,10 +335,10 @@ public Observable> call(Response get(String resourceGroupName, String loadBalancerName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, loadBalancerName, expand).toBlocking().single(); + public LoadBalancerInner get(String resourceGroupName, String loadBalancerName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).toBlocking().single().getBody(); } /** @@ -305,7 +351,7 @@ public ServiceResponse get(String resourceGroupName, String l * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String loadBalancerName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, loadBalancerName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand), serviceCallback); } /** @@ -316,7 +362,24 @@ public ServiceCall getAsync(String resourceGroupName, String * @param expand expand references resources. * @return the observable to the LoadBalancerInner object */ - public Observable> getAsync(String resourceGroupName, String loadBalancerName, String expand) { + public Observable getAsync(String resourceGroupName, String loadBalancerName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, loadBalancerName, expand).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get LoadBalancer operation retrieves information about the specified LoadBalancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @param expand expand references resources. + * @return the observable to the LoadBalancerInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -360,10 +423,10 @@ private ServiceResponse getDelegate(Response re * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the LoadBalancerInner object wrapped in ServiceResponse if successful. + * @return the LoadBalancerInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last(); + public LoadBalancerInner createOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().last().getBody(); } /** @@ -376,7 +439,24 @@ public ServiceResponse createOrUpdate(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + } + + /** + * The Put LoadBalancer operation creates/updates a LoadBalancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @param parameters Parameters supplied to the create/delete LoadBalancer operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -387,7 +467,7 @@ public ServiceCall createOrUpdateAsync(String resourceGroupNa * @param parameters Parameters supplied to the create/delete LoadBalancer operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -417,10 +497,10 @@ public Observable> createOrUpdateAsync(String * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the LoadBalancerInner object wrapped in {@link ServiceResponse} if successful. + * @return the LoadBalancerInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single(); + public LoadBalancerInner beginCreateOrUpdate(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).toBlocking().single().getBody(); } /** @@ -433,7 +513,7 @@ public ServiceResponse beginCreateOrUpdate(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters), serviceCallback); } /** @@ -444,7 +524,24 @@ public ServiceCall beginCreateOrUpdateAsync(String resourceGr * @param parameters Parameters supplied to the create/delete LoadBalancer operation * @return the observable to the LoadBalancerInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, loadBalancerName, parameters).map(new Func1, LoadBalancerInner>() { + @Override + public LoadBalancerInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put LoadBalancer operation creates/updates a LoadBalancer. + * + * @param resourceGroupName The name of the resource group. + * @param loadBalancerName The name of the loadBalancer. + * @param parameters Parameters supplied to the create/delete LoadBalancer operation + * @return the observable to the LoadBalancerInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String loadBalancerName, LoadBalancerInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -489,17 +586,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LoadBalancerInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -523,15 +619,33 @@ public Observable>> call(String nextPage /** * The List loadBalancer operation retrieves all the load balancers in a subscription. * - * @return the observable to the List<LoadBalancerInner> object + * @return the observable to the PagedList<LoadBalancerInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List loadBalancer operation retrieves all the load balancers in a subscription. + * + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -539,7 +653,7 @@ public Observable>> call(ServiceResponse /** * The List loadBalancer operation retrieves all the load balancers in a subscription. * - * @return the List<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -576,17 +690,16 @@ private ServiceResponse> listAllDelegate(Response> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -612,15 +725,34 @@ public Observable>> call(String nextPage * The List loadBalancer operation retrieves all the load balancers in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<LoadBalancerInner> object + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List loadBalancer operation retrieves all the load balancers in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<LoadBalancerInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -629,7 +761,7 @@ public Observable>> call(ServiceResponse * The List loadBalancer operation retrieves all the load balancers in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -669,17 +801,16 @@ private ServiceResponse> listDelegate(Response> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -706,15 +837,34 @@ public Observable>> call(String nextPage * The List loadBalancer operation retrieves all the load balancers in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<LoadBalancerInner> object + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List loadBalancer operation retrieves all the load balancers in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<LoadBalancerInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -723,7 +873,7 @@ public Observable>> call(ServiceResponse * The List loadBalancer operation retrieves all the load balancers in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -757,17 +907,16 @@ private ServiceResponse> listAllNextDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LoadBalancerInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -794,15 +943,34 @@ public Observable>> call(String nextPage * The List loadBalancer operation retrieves all the load balancers in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<LoadBalancerInner> object + * @return the observable to the PagedList<LoadBalancerInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List loadBalancer operation retrieves all the load balancers in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<LoadBalancerInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -811,7 +979,7 @@ public Observable>> call(ServiceResponse * The List loadBalancer operation retrieves all the load balancers in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LoadBalancerInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LocalNetworkGatewaysInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LocalNetworkGatewaysInner.java index 3b1ca540e905..afe6f8c0570b 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LocalNetworkGatewaysInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/LocalNetworkGatewaysInner.java @@ -102,10 +102,10 @@ interface LocalNetworkGatewaysService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the LocalNetworkGatewayInner object wrapped in ServiceResponse if successful. + * @return the LocalNetworkGatewayInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last(); + public LocalNetworkGatewayInner createOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().last().getBody(); } /** @@ -118,7 +118,7 @@ public ServiceResponse createOrUpdate(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); } /** @@ -129,7 +129,24 @@ public ServiceCall createOrUpdateAsync(String resource * @param parameters Parameters supplied to the Begin Create or update Local Network Gateway operation through Network resource provider. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put LocalNetworkGateway operation creates/updates a local network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the Begin Create or update Local Network Gateway operation through Network resource provider. + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -159,10 +176,10 @@ public Observable> createOrUpdateAsync * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the LocalNetworkGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the LocalNetworkGatewayInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().single(); + public LocalNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).toBlocking().single().getBody(); } /** @@ -175,7 +192,7 @@ public ServiceResponse beginCreateOrUpdate(String reso * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters), serviceCallback); } /** @@ -186,7 +203,24 @@ public ServiceCall beginCreateOrUpdateAsync(String res * @param parameters Parameters supplied to the Begin Create or update Local Network Gateway operation through Network resource provider. * @return the observable to the LocalNetworkGatewayInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName, parameters).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put LocalNetworkGateway operation creates/updates a local network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @param parameters Parameters supplied to the Begin Create or update Local Network Gateway operation through Network resource provider. + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName, LocalNetworkGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -233,10 +267,10 @@ private ServiceResponse beginCreateOrUpdateDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the LocalNetworkGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the LocalNetworkGatewayInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String localNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single(); + public LocalNetworkGatewayInner get(String resourceGroupName, String localNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().getBody(); } /** @@ -248,7 +282,23 @@ public ServiceResponse get(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * The Get LocalNetworkGateway operation retrieves information about the specified local network gateway through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @return the observable to the LocalNetworkGatewayInner object + */ + public Observable getAsync(String resourceGroupName, String localNetworkGatewayName) { + return getWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, LocalNetworkGatewayInner>() { + @Override + public LocalNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -258,7 +308,7 @@ public ServiceCall getAsync(String resourceGroupName, * @param localNetworkGatewayName The name of the local network gateway. * @return the observable to the LocalNetworkGatewayInner object */ - public Observable> getAsync(String resourceGroupName, String localNetworkGatewayName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -301,10 +351,9 @@ private ServiceResponse getDelegate(Response delete(String resourceGroupName, String localNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last(); + public void delete(String resourceGroupName, String localNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().last().getBody(); } /** @@ -316,7 +365,23 @@ public ServiceResponse delete(String resourceGroupName, String localNetwor * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + } + + /** + * The Delete LocalNetworkGateway operation deletes the specified local network Gateway through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -326,7 +391,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String localNetwo * @param localNetworkGatewayName The name of the local network gateway. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String localNetworkGatewayName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -351,10 +416,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String localNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String localNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).toBlocking().single().getBody(); } /** @@ -366,7 +430,7 @@ public ServiceResponse beginDelete(String resourceGroupName, String localN * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName), serviceCallback); } /** @@ -376,7 +440,23 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String local * @param localNetworkGatewayName The name of the local network gateway. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName) { + public Observable beginDeleteAsync(String resourceGroupName, String localNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, localNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete LocalNetworkGateway operation deletes the specified local network Gateway through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param localNetworkGatewayName The name of the local network gateway. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String localNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -418,17 +498,16 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LocalNetworkGatewayInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -454,15 +533,34 @@ public Observable>> call(String n * The List LocalNetworkGateways operation retrieves all the local network gateways stored. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<LocalNetworkGatewayInner> object + * @return the observable to the PagedList<LocalNetworkGatewayInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List LocalNetworkGateways operation retrieves all the local network gateways stored. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -471,7 +569,7 @@ public Observable>> call(ServiceR * The List LocalNetworkGateways operation retrieves all the local network gateways stored. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -511,17 +609,16 @@ private ServiceResponse> listDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LocalNetworkGatewayInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -548,15 +645,34 @@ public Observable>> call(String n * The List LocalNetworkGateways operation retrieves all the local network gateways stored. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<LocalNetworkGatewayInner> object + * @return the observable to the PagedList<LocalNetworkGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List LocalNetworkGateways operation retrieves all the local network gateways stored. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<LocalNetworkGatewayInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -565,7 +681,7 @@ public Observable>> call(ServiceR * The List LocalNetworkGateways operation retrieves all the local network gateways stored. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<LocalNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkImpl.java index e44e7d20d9ef..e06656facca9 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkImpl.java @@ -8,7 +8,6 @@ import com.microsoft.azure.management.network.Network; import com.microsoft.azure.management.network.Subnet; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.microsoft.rest.ServiceResponse; import rx.Observable; import rx.functions.Func1; @@ -59,9 +58,8 @@ private void initializeSubnetsFromInner() { @Override public NetworkImpl refresh() throws Exception { - ServiceResponse response = - this.innerCollection.get(this.resourceGroupName(), this.name()); - this.setInner(response.getBody()); + VirtualNetworkInner response = this.innerCollection.get(this.resourceGroupName(), this.name()); + this.setInner(response); initializeSubnetsFromInner(); return this; } @@ -169,10 +167,10 @@ public Observable createResourceAsync() { final NetworkImpl self = this; beforeCreating(); return this.innerCollection.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) - .map(new Func1, Network>() { + .map(new Func1() { @Override - public Network call(ServiceResponse virtualNetworkInner) { - setInner(virtualNetworkInner.getBody()); + public Network call(VirtualNetworkInner virtualNetworkInner) { + setInner(virtualNetworkInner); initializeSubnetsFromInner(); return self; } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfaceImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfaceImpl.java index f4d6e1a88920..9e4f318ecdf4 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfaceImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfaceImpl.java @@ -21,7 +21,6 @@ import com.microsoft.azure.management.resources.fluentcore.model.Creatable; import com.microsoft.azure.management.resources.fluentcore.utils.ResourceNamer; import com.microsoft.azure.management.resources.fluentcore.utils.Utils; -import com.microsoft.rest.ServiceResponse; import rx.Observable; import rx.functions.Func1; @@ -77,9 +76,8 @@ class NetworkInterfaceImpl @Override public NetworkInterface refresh() throws Exception { - ServiceResponse response = - this.client.get(this.resourceGroupName(), this.name()); - this.setInner(response.getBody()); + NetworkInterfaceInner response = this.client.get(this.resourceGroupName(), this.name()); + this.setInner(response); clearCachedRelatedResources(); initializeNicIpConfigurations(); return this; @@ -371,10 +369,10 @@ public Observable createResourceAsync() { return this.client.createOrUpdateAsync(this.resourceGroupName(), this.nicName, this.inner()) - .map(new Func1, NetworkInterface>() { + .map(new Func1() { @Override - public NetworkInterface call(ServiceResponse networkInterfaceInner) { - self.setInner(networkInterfaceInner.getBody()); + public NetworkInterface call(NetworkInterfaceInner networkInterfaceInner) { + self.setInner(networkInterfaceInner); clearCachedRelatedResources(); initializeNicIpConfigurations(); return self; diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java index 615c5cebe1d1..45ff125bd78c 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesImpl.java @@ -31,17 +31,17 @@ class NetworkInterfacesImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(innerCollection.listAll().getBody()); + return wrapList(innerCollection.listAll()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(innerCollection.list(groupName).getBody()); + return wrapList(innerCollection.list(groupName)); } @Override public NetworkInterface getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.get(groupName, name).getBody()); + return wrapModel(this.innerCollection.get(groupName, name)); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesInner.java index 99dc9ecf50f0..9e8077df408a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkInterfacesInner.java @@ -146,10 +146,9 @@ interface NetworkInterfacesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, networkInterfaceName).toBlocking().last(); + public void delete(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().getBody(); } /** @@ -161,7 +160,7 @@ public ServiceResponse delete(String resourceGroupName, String networkInte * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); } /** @@ -171,7 +170,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String networkInt * @param networkInterfaceName The name of the network interface. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String networkInterfaceName) { + public Observable deleteAsync(String resourceGroupName, String networkInterfaceName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete netwokInterface operation deletes the specified netwokInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -196,10 +211,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().getBody(); } /** @@ -211,7 +225,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String networ * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * The delete netwokInterface operation deletes the specified netwokInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -221,7 +251,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String netwo * @param networkInterfaceName The name of the network interface. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String networkInterfaceName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -264,10 +294,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkInterfaceInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkInterfaceInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + public NetworkInterfaceInner get(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().getBody(); } /** @@ -279,7 +309,23 @@ public ServiceResponse get(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * The Get network interface operation retrieves information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -289,7 +335,7 @@ public ServiceCall getAsync(String resourceGroupName, Str * @param networkInterfaceName The name of the network interface. * @return the observable to the NetworkInterfaceInner object */ - public Observable> getAsync(String resourceGroupName, String networkInterfaceName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -326,10 +372,10 @@ public Observable> call(Response get(String resourceGroupName, String networkInterfaceName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single(); + public NetworkInterfaceInner get(String resourceGroupName, String networkInterfaceName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).toBlocking().single().getBody(); } /** @@ -342,7 +388,24 @@ public ServiceResponse get(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand), serviceCallback); + } + + /** + * The Get network interface operation retrieves information about the specified network interface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param expand expand references resources. + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getAsync(String resourceGroupName, String networkInterfaceName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -353,7 +416,7 @@ public ServiceCall getAsync(String resourceGroupName, Str * @param expand expand references resources. * @return the observable to the NetworkInterfaceInner object */ - public Observable> getAsync(String resourceGroupName, String networkInterfaceName, String expand) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -397,10 +460,10 @@ private ServiceResponse getDelegate(Response createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last(); + public NetworkInterfaceInner createOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().last().getBody(); } /** @@ -413,7 +476,7 @@ public ServiceResponse createOrUpdate(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); } /** @@ -424,7 +487,24 @@ public ServiceCall createOrUpdateAsync(String resourceGro * @param parameters Parameters supplied to the create/update NetworkInterface operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put NetworkInterface operation creates/updates a networkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create/update NetworkInterface operation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -454,10 +534,10 @@ public Observable> createOrUpdateAsync(St * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkInterfaceInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkInterfaceInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single(); + public NetworkInterfaceInner beginCreateOrUpdate(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).toBlocking().single().getBody(); } /** @@ -470,7 +550,24 @@ public ServiceResponse beginCreateOrUpdate(String resourc * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters), serviceCallback); + } + + /** + * The Put NetworkInterface operation creates/updates a networkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @param parameters Parameters supplied to the create/update NetworkInterface operation + * @return the observable to the NetworkInterfaceInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -481,7 +578,7 @@ public ServiceCall beginCreateOrUpdateAsync(String resour * @param parameters Parameters supplied to the create/update NetworkInterface operation * @return the observable to the NetworkInterfaceInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -529,17 +626,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) throws CloudException, IOException, IllegalArgumentException { + public PagedList listVirtualMachineScaleSetVMNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -569,15 +665,36 @@ public Observable>> call(String next * @param resourceGroupName The name of the resource group. * @param virtualMachineScaleSetName The name of the virtual machine scale set. * @param virtualmachineIndex The virtual machine index. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + return listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list network interface operation retrieves information about all network interfaces in a virtual machine from a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { return listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -588,7 +705,7 @@ public Observable>> call(ServiceResp ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. ServiceResponse> * @param virtualmachineIndex The virtual machine index. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex) { if (resourceGroupName == null) { @@ -635,17 +752,16 @@ private ServiceResponse> listVirtualMachineScale * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listVirtualMachineScaleSetNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName) throws CloudException, IOException, IllegalArgumentException { + public PagedList listVirtualMachineScaleSetNetworkInterfaces(final String resourceGroupName, final String virtualMachineScaleSetName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -673,15 +789,35 @@ public Observable>> call(String next * * @param resourceGroupName The name of the resource group. * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + return listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list network interface operation retrieves information about all network interfaces in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listVirtualMachineScaleSetNetworkInterfacesAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { + public Observable>> listVirtualMachineScaleSetNetworkInterfacesWithServiceResponseAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { return listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(resourceGroupName, virtualMachineScaleSetName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -691,7 +827,7 @@ public Observable>> call(ServiceResp * ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param virtualMachineScaleSetName The name of the virtual machine scale set. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listVirtualMachineScaleSetNetworkInterfacesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName) { if (resourceGroupName == null) { @@ -737,10 +873,10 @@ private ServiceResponse> listVirtualMachineScale * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkInterfaceInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkInterfaceInner object if successful. */ - public ServiceResponse getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { - return getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single(); + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).toBlocking().single().getBody(); } /** @@ -754,7 +890,25 @@ public ServiceResponse getVirtualMachineScaleSetNetworkIn * @return the {@link ServiceCall} object */ public ServiceCall getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), serviceCallback); + return ServiceCall.create(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName), serviceCallback); + } + + /** + * The Get network interface operation retrieves information about the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @return the observable to the NetworkInterfaceInner object + */ + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -766,7 +920,7 @@ public ServiceCall getVirtualMachineScaleSetNetworkInterf * @param networkInterfaceName The name of the network interface. * @return the observable to the NetworkInterfaceInner object */ - public Observable> getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -811,10 +965,10 @@ public Observable> call(Response getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single(); + public NetworkInterfaceInner getVirtualMachineScaleSetNetworkInterface(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).toBlocking().single().getBody(); } /** @@ -829,7 +983,7 @@ public ServiceResponse getVirtualMachineScaleSetNetworkIn * @return the {@link ServiceCall} object */ public ServiceCall getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getVirtualMachineScaleSetNetworkInterfaceAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), serviceCallback); + return ServiceCall.create(getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand), serviceCallback); } /** @@ -842,7 +996,26 @@ public ServiceCall getVirtualMachineScaleSetNetworkInterf * @param expand expand references resources. * @return the observable to the NetworkInterfaceInner object */ - public Observable> getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + public Observable getVirtualMachineScaleSetNetworkInterfaceAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { + return getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand).map(new Func1, NetworkInterfaceInner>() { + @Override + public NetworkInterfaceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get network interface operation retrieves information about the specified network interface in a virtual machine scale set. + * + * @param resourceGroupName The name of the resource group. + * @param virtualMachineScaleSetName The name of the virtual machine scale set. + * @param virtualmachineIndex The virtual machine index. + * @param networkInterfaceName The name of the network interface. + * @param expand expand references resources. + * @return the observable to the NetworkInterfaceInner object + */ + public Observable> getVirtualMachineScaleSetNetworkInterfaceWithServiceResponseAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -888,17 +1061,16 @@ private ServiceResponse getVirtualMachineScaleSetNetworkI * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -922,15 +1094,33 @@ public Observable>> call(String next /** * The List networkInterfaces operation retrieves all the networkInterfaces in a subscription. * - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List networkInterfaces operation retrieves all the networkInterfaces in a subscription. + * + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -938,7 +1128,7 @@ public Observable>> call(ServiceResp /** * The List networkInterfaces operation retrieves all the networkInterfaces in a subscription. * - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -975,17 +1165,16 @@ private ServiceResponse> listAllDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1011,15 +1200,34 @@ public Observable>> call(String next * The List networkInterfaces operation retrieves all the networkInterfaces in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List networkInterfaces operation retrieves all the networkInterfaces in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1028,7 +1236,7 @@ public Observable>> call(ServiceResp * The List networkInterfaces operation retrieves all the networkInterfaces in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -1070,10 +1278,10 @@ private ServiceResponse> listDelegate(Response getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).toBlocking().last(); + public EffectiveRouteListResultInner getEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().getBody(); } /** @@ -1085,7 +1293,23 @@ public ServiceResponse getEffectiveRouteTable(Str * @return the {@link ServiceCall} object */ public ServiceCall getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * The get effective routetable operation retrieves all the route tables applied on a networkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the observable for the request + */ + public Observable getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return getEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1095,7 +1319,7 @@ public ServiceCall getEffectiveRouteTableAsync(St * @param networkInterfaceName The name of the network interface. * @return the observable for the request */ - public Observable> getEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + public Observable> getEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1120,10 +1344,10 @@ public Observable> getEffectiveRo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the EffectiveRouteListResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the EffectiveRouteListResultInner object if successful. */ - public ServiceResponse beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { - return beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + public EffectiveRouteListResultInner beginGetEffectiveRouteTable(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().getBody(); } /** @@ -1135,7 +1359,23 @@ public ServiceResponse beginGetEffectiveRouteTabl * @return the {@link ServiceCall} object */ public ServiceCall beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginGetEffectiveRouteTableAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * The get effective routetable operation retrieves all the route tables applied on a networkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the observable to the EffectiveRouteListResultInner object + */ + public Observable beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + return beginGetEffectiveRouteTableWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveRouteListResultInner>() { + @Override + public EffectiveRouteListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1145,7 +1385,7 @@ public ServiceCall beginGetEffectiveRouteTableAsy * @param networkInterfaceName The name of the network interface. * @return the observable to the EffectiveRouteListResultInner object */ - public Observable> beginGetEffectiveRouteTableAsync(String resourceGroupName, String networkInterfaceName) { + public Observable> beginGetEffectiveRouteTableWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1189,10 +1429,10 @@ private ServiceResponse beginGetEffectiveRouteTab * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the EffectiveNetworkSecurityGroupListResultInner object wrapped in ServiceResponse if successful. + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. */ - public ServiceResponse listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).toBlocking().last(); + public EffectiveNetworkSecurityGroupListResultInner listEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().last().getBody(); } /** @@ -1204,7 +1444,23 @@ public ServiceResponse listEffecti * @return the {@link ServiceCall} object */ public ServiceCall listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); + } + + /** + * The list effective network security group operation retrieves all the network security groups applied on a networkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the observable for the request + */ + public Observable listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1214,7 +1470,7 @@ public ServiceCall listEffectiveNe * @param networkInterfaceName The name of the network interface. * @return the observable for the request */ - public Observable> listEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + public Observable> listEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1239,10 +1495,10 @@ public Observable> * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the EffectiveNetworkSecurityGroupListResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the EffectiveNetworkSecurityGroupListResultInner object if successful. */ - public ServiceResponse beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { - return beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName).toBlocking().single(); + public EffectiveNetworkSecurityGroupListResultInner beginListEffectiveNetworkSecurityGroups(String resourceGroupName, String networkInterfaceName) throws CloudException, IOException, IllegalArgumentException { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).toBlocking().single().getBody(); } /** @@ -1254,7 +1510,7 @@ public ServiceResponse beginListEf * @return the {@link ServiceCall} object */ public ServiceCall beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginListEffectiveNetworkSecurityGroupsAsync(resourceGroupName, networkInterfaceName), serviceCallback); + return ServiceCall.create(beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName), serviceCallback); } /** @@ -1264,7 +1520,23 @@ public ServiceCall beginListEffect * @param networkInterfaceName The name of the network interface. * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object */ - public Observable> beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + public Observable beginListEffectiveNetworkSecurityGroupsAsync(String resourceGroupName, String networkInterfaceName) { + return beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(resourceGroupName, networkInterfaceName).map(new Func1, EffectiveNetworkSecurityGroupListResultInner>() { + @Override + public EffectiveNetworkSecurityGroupListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The list effective network security group operation retrieves all the network security groups applied on a networkInterface. + * + * @param resourceGroupName The name of the resource group. + * @param networkInterfaceName The name of the network interface. + * @return the observable to the EffectiveNetworkSecurityGroupListResultInner object + */ + public Observable> beginListEffectiveNetworkSecurityGroupsWithServiceResponseAsync(String resourceGroupName, String networkInterfaceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1306,17 +1578,16 @@ private ServiceResponse beginListE * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listVirtualMachineScaleSetVMNetworkInterfacesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listVirtualMachineScaleSetVMNetworkInterfacesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1343,15 +1614,34 @@ public Observable>> call(String next * The list network interface operation retrieves information about all network interfaces in a virtual machine from a virtual machine scale set. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list network interface operation retrieves information about all network interfaces in a virtual machine from a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextAsync(final String nextPageLink) { + public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetVMNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1360,7 +1650,7 @@ public Observable>> call(ServiceResp * The list network interface operation retrieves information about all network interfaces in a virtual machine from a virtual machine scale set. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listVirtualMachineScaleSetVMNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1394,17 +1684,16 @@ private ServiceResponse> listVirtualMachineScale * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listVirtualMachineScaleSetNetworkInterfacesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listVirtualMachineScaleSetNetworkInterfacesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1431,15 +1720,34 @@ public Observable>> call(String next * The list network interface operation retrieves information about all network interfaces in a virtual machine scale set. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink) { + public Observable> listVirtualMachineScaleSetNetworkInterfacesNextAsync(final String nextPageLink) { + return listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list network interface operation retrieves information about all network interfaces in a virtual machine scale set. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(final String nextPageLink) { return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listVirtualMachineScaleSetNetworkInterfacesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1448,7 +1756,7 @@ public Observable>> call(ServiceResp * The list network interface operation retrieves information about all network interfaces in a virtual machine scale set. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listVirtualMachineScaleSetNetworkInterfacesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1482,17 +1790,16 @@ private ServiceResponse> listVirtualMachineScale * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1519,15 +1826,34 @@ public Observable>> call(String next * The List networkInterfaces operation retrieves all the networkInterfaces in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List networkInterfaces operation retrieves all the networkInterfaces in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1536,7 +1862,7 @@ public Observable>> call(ServiceResp * The List networkInterfaces operation retrieves all the networkInterfaces in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1570,17 +1896,16 @@ private ServiceResponse> listAllNextDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1607,15 +1932,34 @@ public Observable>> call(String next * The List networkInterfaces operation retrieves all the networkInterfaces in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NetworkInterfaceInner> object + * @return the observable to the PagedList<NetworkInterfaceInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List networkInterfaces operation retrieves all the networkInterfaces in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NetworkInterfaceInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1624,7 +1968,7 @@ public Observable>> call(ServiceResp * The List networkInterfaces operation retrieves all the networkInterfaces in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkInterfaceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkManagementClientImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkManagementClientImpl.java index ea64d530cc18..62ca97b891b5 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkManagementClientImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkManagementClientImpl.java @@ -491,10 +491,10 @@ interface NetworkManagementClientService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DnsNameAvailabilityResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the DnsNameAvailabilityResultInner object if successful. */ - public ServiceResponse checkDnsNameAvailability(String location) throws CloudException, IOException, IllegalArgumentException { - return checkDnsNameAvailabilityAsync(location).toBlocking().single(); + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location) throws CloudException, IOException, IllegalArgumentException { + return checkDnsNameAvailabilityWithServiceResponseAsync(location).toBlocking().single().getBody(); } /** @@ -505,7 +505,7 @@ public ServiceResponse checkDnsNameAvailability( * @return the {@link ServiceCall} object */ public ServiceCall checkDnsNameAvailabilityAsync(String location, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkDnsNameAvailabilityAsync(location), serviceCallback); + return ServiceCall.create(checkDnsNameAvailabilityWithServiceResponseAsync(location), serviceCallback); } /** @@ -514,7 +514,22 @@ public ServiceCall checkDnsNameAvailabilityAsync * @param location The location of the domain name * @return the observable to the DnsNameAvailabilityResultInner object */ - public Observable> checkDnsNameAvailabilityAsync(String location) { + public Observable checkDnsNameAvailabilityAsync(String location) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location).map(new Func1, DnsNameAvailabilityResultInner>() { + @Override + public DnsNameAvailabilityResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Checks whether a domain name in the cloudapp.net zone is available for use. + * + * @param location The location of the domain name + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable> checkDnsNameAvailabilityWithServiceResponseAsync(String location) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } @@ -547,10 +562,10 @@ public Observable> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DnsNameAvailabilityResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the DnsNameAvailabilityResultInner object if successful. */ - public ServiceResponse checkDnsNameAvailability(String location, String domainNameLabel) throws CloudException, IOException, IllegalArgumentException { - return checkDnsNameAvailabilityAsync(location, domainNameLabel).toBlocking().single(); + public DnsNameAvailabilityResultInner checkDnsNameAvailability(String location, String domainNameLabel) throws CloudException, IOException, IllegalArgumentException { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).toBlocking().single().getBody(); } /** @@ -562,7 +577,23 @@ public ServiceResponse checkDnsNameAvailability( * @return the {@link ServiceCall} object */ public ServiceCall checkDnsNameAvailabilityAsync(String location, String domainNameLabel, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkDnsNameAvailabilityAsync(location, domainNameLabel), serviceCallback); + return ServiceCall.create(checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel), serviceCallback); + } + + /** + * Checks whether a domain name in the cloudapp.net zone is available for use. + * + * @param location The location of the domain name + * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. + * @return the observable to the DnsNameAvailabilityResultInner object + */ + public Observable checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { + return checkDnsNameAvailabilityWithServiceResponseAsync(location, domainNameLabel).map(new Func1, DnsNameAvailabilityResultInner>() { + @Override + public DnsNameAvailabilityResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -572,7 +603,7 @@ public ServiceCall checkDnsNameAvailabilityAsync * @param domainNameLabel The domain name to be verified. It must conform to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. * @return the observable to the DnsNameAvailabilityResultInner object */ - public Observable> checkDnsNameAvailabilityAsync(String location, String domainNameLabel) { + public Observable> checkDnsNameAvailabilityWithServiceResponseAsync(String location, String domainNameLabel) { if (location == null) { throw new IllegalArgumentException("Parameter location is required and cannot be null."); } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupImpl.java index a583717406dd..b4f4684569da 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupImpl.java @@ -8,7 +8,6 @@ import com.microsoft.azure.management.network.NetworkSecurityGroup; import com.microsoft.azure.management.network.NetworkSecurityRule; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.microsoft.rest.ServiceResponse; import rx.Observable; import rx.functions.Func1; @@ -81,9 +80,8 @@ public NetworkSecurityRuleImpl defineRule(String name) { @Override public NetworkSecurityGroupImpl refresh() throws Exception { - ServiceResponse response = - this.innerCollection.get(this.resourceGroupName(), this.name()); - this.setInner(response.getBody()); + NetworkSecurityGroupInner response = this.innerCollection.get(this.resourceGroupName(), this.name()); + this.setInner(response); initializeRulesFromInner(); return this; } @@ -140,10 +138,10 @@ public Observable createResourceAsync() { final NetworkSecurityGroupImpl self = this; beforeCreating(); return this.innerCollection.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) - .map(new Func1, NetworkSecurityGroup>() { + .map(new Func1() { @Override - public NetworkSecurityGroup call(ServiceResponse networkSecurityGroupInner) { - self.setInner(networkSecurityGroupInner.getBody()); + public NetworkSecurityGroup call(NetworkSecurityGroupInner networkSecurityGroupInner) { + self.setInner(networkSecurityGroupInner); initializeRulesFromInner(); return self; } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java index afabbf5fd338..3e95c6a63ceb 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsImpl.java @@ -35,17 +35,17 @@ class NetworkSecurityGroupsImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(this.innerCollection.listAll().getBody()); + return wrapList(this.innerCollection.listAll()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.list(groupName).getBody()); + return wrapList(this.innerCollection.list(groupName)); } @Override public NetworkSecurityGroupImpl getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.get(groupName, name).getBody()); + return wrapModel(this.innerCollection.get(groupName, name)); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsInner.java index 8195db2be49e..4280a092e30a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworkSecurityGroupsInner.java @@ -109,10 +109,9 @@ interface NetworkSecurityGroupsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last(); + public void delete(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().last().getBody(); } /** @@ -124,7 +123,7 @@ public ServiceResponse delete(String resourceGroupName, String networkSecu * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); } /** @@ -134,7 +133,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String networkSec * @param networkSecurityGroupName The name of the network security group. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete NetworkSecurityGroup operation deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -159,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().getBody(); } /** @@ -174,7 +188,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String networ * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + } + + /** + * The Delete NetworkSecurityGroup operation deletes the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -184,7 +214,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String netwo * @param networkSecurityGroupName The name of the network security group. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -227,10 +257,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkSecurityGroupInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkSecurityGroupInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); + public NetworkSecurityGroupInner get(String resourceGroupName, String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single().getBody(); } /** @@ -242,7 +272,7 @@ public ServiceResponse get(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String networkSecurityGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName), serviceCallback); } /** @@ -252,7 +282,23 @@ public ServiceCall getAsync(String resourceGroupName, * @param networkSecurityGroupName The name of the network security group. * @return the observable to the NetworkSecurityGroupInner object */ - public Observable> getAsync(String resourceGroupName, String networkSecurityGroupName) { + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -289,10 +335,10 @@ public Observable> call(Response get(String resourceGroupName, String networkSecurityGroupName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, networkSecurityGroupName, expand).toBlocking().single(); + public NetworkSecurityGroupInner get(String resourceGroupName, String networkSecurityGroupName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).toBlocking().single().getBody(); } /** @@ -305,7 +351,7 @@ public ServiceResponse get(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String networkSecurityGroupName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, networkSecurityGroupName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand), serviceCallback); } /** @@ -316,7 +362,24 @@ public ServiceCall getAsync(String resourceGroupName, * @param expand expand references resources. * @return the observable to the NetworkSecurityGroupInner object */ - public Observable> getAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, expand).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get NetworkSecurityGroups operation retrieves information about the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param expand expand references resources. + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -360,10 +423,10 @@ private ServiceResponse getDelegate(Response createOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().last(); + public NetworkSecurityGroupInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().last().getBody(); } /** @@ -376,7 +439,24 @@ public ServiceResponse createOrUpdate(String resource * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + } + + /** + * The Put NetworkSecurityGroup operation creates/updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create/update Network Security Group operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -387,7 +467,7 @@ public ServiceCall createOrUpdateAsync(String resourc * @param parameters Parameters supplied to the create/update Network Security Group operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -417,10 +497,10 @@ public Observable> createOrUpdateAsyn * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkSecurityGroupInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkSecurityGroupInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().single(); + public NetworkSecurityGroupInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).toBlocking().single().getBody(); } /** @@ -433,7 +513,7 @@ public ServiceResponse beginCreateOrUpdate(String res * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters), serviceCallback); } /** @@ -444,7 +524,24 @@ public ServiceCall beginCreateOrUpdateAsync(String re * @param parameters Parameters supplied to the create/update Network Security Group operation * @return the observable to the NetworkSecurityGroupInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, parameters).map(new Func1, NetworkSecurityGroupInner>() { + @Override + public NetworkSecurityGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put NetworkSecurityGroup operation creates/updates a network security group in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param parameters Parameters supplied to the create/update Network Security Group operation + * @return the observable to the NetworkSecurityGroupInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, NetworkSecurityGroupInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -489,17 +586,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -523,15 +619,33 @@ public Observable>> call(String /** * The list NetworkSecurityGroups returns all network security groups in a subscription. * - * @return the observable to the List<NetworkSecurityGroupInner> object + * @return the observable to the PagedList<NetworkSecurityGroupInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list NetworkSecurityGroups returns all network security groups in a subscription. + * + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -539,7 +653,7 @@ public Observable>> call(Service /** * The list NetworkSecurityGroups returns all network security groups in a subscription. * - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -576,17 +690,16 @@ private ServiceResponse> listAllDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -612,15 +725,34 @@ public Observable>> call(String * The list NetworkSecurityGroups returns all network security groups in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<NetworkSecurityGroupInner> object + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list NetworkSecurityGroups returns all network security groups in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<NetworkSecurityGroupInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -629,7 +761,7 @@ public Observable>> call(Service * The list NetworkSecurityGroups returns all network security groups in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -669,17 +801,16 @@ private ServiceResponse> listDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -706,15 +837,34 @@ public Observable>> call(String * The list NetworkSecurityGroups returns all network security groups in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NetworkSecurityGroupInner> object + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list NetworkSecurityGroups returns all network security groups in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NetworkSecurityGroupInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -723,7 +873,7 @@ public Observable>> call(Service * The list NetworkSecurityGroups returns all network security groups in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -757,17 +907,16 @@ private ServiceResponse> listAllNextDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -794,15 +943,34 @@ public Observable>> call(String * The list NetworkSecurityGroups returns all network security groups in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NetworkSecurityGroupInner> object + * @return the observable to the PagedList<NetworkSecurityGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list NetworkSecurityGroups returns all network security groups in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NetworkSecurityGroupInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -811,7 +979,7 @@ public Observable>> call(Service * The list NetworkSecurityGroups returns all network security groups in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NetworkSecurityGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java index 64ee9a1ca481..b3cc00ca4908 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/NetworksImpl.java @@ -37,17 +37,17 @@ class NetworksImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(this.innerCollection.listAll().getBody()); + return wrapList(this.innerCollection.listAll()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.list(groupName).getBody()); + return wrapList(this.innerCollection.list(groupName)); } @Override public NetworkImpl getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.get(groupName, name).getBody()); + return wrapModel(this.innerCollection.get(groupName, name)); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIPAddressesInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIPAddressesInner.java index cdcba74cd2bc..62be22e6e6de 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIPAddressesInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIPAddressesInner.java @@ -109,10 +109,9 @@ interface PublicIPAddressesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, publicIpAddressName).toBlocking().last(); + public void delete(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().last().getBody(); } /** @@ -124,7 +123,7 @@ public ServiceResponse delete(String resourceGroupName, String publicIpAdd * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, publicIpAddressName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); } /** @@ -134,7 +133,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String publicIpAd * @param publicIpAddressName The name of the subnet. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String publicIpAddressName) { + public Observable deleteAsync(String resourceGroupName, String publicIpAddressName) { + return deleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete publicIpAddress operation deletes the specified publicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -159,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, publicIpAddressName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().getBody(); } /** @@ -174,7 +188,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String public * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, publicIpAddressName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); + } + + /** + * The delete publicIpAddress operation deletes the specified publicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -184,7 +214,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String publi * @param publicIpAddressName The name of the subnet. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String publicIpAddressName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -227,10 +257,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the PublicIPAddressInner object wrapped in {@link ServiceResponse} if successful. + * @return the PublicIPAddressInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, publicIpAddressName).toBlocking().single(); + public PublicIPAddressInner get(String resourceGroupName, String publicIpAddressName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, publicIpAddressName).toBlocking().single().getBody(); } /** @@ -242,7 +272,7 @@ public ServiceResponse get(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String publicIpAddressName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, publicIpAddressName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, publicIpAddressName), serviceCallback); } /** @@ -252,7 +282,23 @@ public ServiceCall getAsync(String resourceGroupName, Stri * @param publicIpAddressName The name of the subnet. * @return the observable to the PublicIPAddressInner object */ - public Observable> getAsync(String resourceGroupName, String publicIpAddressName) { + public Observable getAsync(String resourceGroupName, String publicIpAddressName) { + return getWithServiceResponseAsync(resourceGroupName, publicIpAddressName).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get publicIpAddress operation retrieves information about the specified pubicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -289,10 +335,10 @@ public Observable> call(Response get(String resourceGroupName, String publicIpAddressName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, publicIpAddressName, expand).toBlocking().single(); + public PublicIPAddressInner get(String resourceGroupName, String publicIpAddressName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).toBlocking().single().getBody(); } /** @@ -305,7 +351,7 @@ public ServiceResponse get(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String publicIpAddressName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, publicIpAddressName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand), serviceCallback); } /** @@ -316,7 +362,24 @@ public ServiceCall getAsync(String resourceGroupName, Stri * @param expand expand references resources. * @return the observable to the PublicIPAddressInner object */ - public Observable> getAsync(String resourceGroupName, String publicIpAddressName, String expand) { + public Observable getAsync(String resourceGroupName, String publicIpAddressName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, publicIpAddressName, expand).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get publicIpAddress operation retrieves information about the specified pubicIpAddress. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the subnet. + * @param expand expand references resources. + * @return the observable to the PublicIPAddressInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -360,10 +423,10 @@ private ServiceResponse getDelegate(Response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the PublicIPAddressInner object wrapped in ServiceResponse if successful. + * @return the PublicIPAddressInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last(); + public PublicIPAddressInner createOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().last().getBody(); } /** @@ -376,7 +439,24 @@ public ServiceResponse createOrUpdate(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + } + + /** + * The Put PublicIPAddress operation creates/updates a stable/dynamic PublicIP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the publicIpAddress. + * @param parameters Parameters supplied to the create/update PublicIPAddress operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -387,7 +467,7 @@ public ServiceCall createOrUpdateAsync(String resourceGrou * @param parameters Parameters supplied to the create/update PublicIPAddress operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -417,10 +497,10 @@ public Observable> createOrUpdateAsync(Str * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the PublicIPAddressInner object wrapped in {@link ServiceResponse} if successful. + * @return the PublicIPAddressInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single(); + public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().getBody(); } /** @@ -433,7 +513,7 @@ public ServiceResponse beginCreateOrUpdate(String resource * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters), serviceCallback); } /** @@ -444,7 +524,24 @@ public ServiceCall beginCreateOrUpdateAsync(String resourc * @param parameters Parameters supplied to the create/update PublicIPAddress operation * @return the observable to the PublicIPAddressInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).map(new Func1, PublicIPAddressInner>() { + @Override + public PublicIPAddressInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put PublicIPAddress operation creates/updates a stable/dynamic PublicIP address. + * + * @param resourceGroupName The name of the resource group. + * @param publicIpAddressName The name of the publicIpAddress. + * @param parameters Parameters supplied to the create/update PublicIPAddress operation + * @return the observable to the PublicIPAddressInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -489,17 +586,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -523,15 +619,33 @@ public Observable>> call(String nextP /** * The List publicIpAddress operation retrieves all the publicIpAddresses in a subscription. * - * @return the observable to the List<PublicIPAddressInner> object + * @return the observable to the PagedList<PublicIPAddressInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List publicIpAddress operation retrieves all the publicIpAddresses in a subscription. + * + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -539,7 +653,7 @@ public Observable>> call(ServiceRespo /** * The List publicIpAddress operation retrieves all the publicIpAddresses in a subscription. * - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -576,17 +690,16 @@ private ServiceResponse> listAllDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -612,15 +725,34 @@ public Observable>> call(String nextP * The List publicIpAddress operation retrieves all the publicIpAddresses in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<PublicIPAddressInner> object + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List publicIpAddress operation retrieves all the publicIpAddresses in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<PublicIPAddressInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -629,7 +761,7 @@ public Observable>> call(ServiceRespo * The List publicIpAddress operation retrieves all the publicIpAddresses in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -669,17 +801,16 @@ private ServiceResponse> listDelegate(Response> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -706,15 +837,34 @@ public Observable>> call(String nextP * The List publicIpAddress operation retrieves all the publicIpAddresses in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<PublicIPAddressInner> object + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List publicIpAddress operation retrieves all the publicIpAddresses in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<PublicIPAddressInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -723,7 +873,7 @@ public Observable>> call(ServiceRespo * The List publicIpAddress operation retrieves all the publicIpAddresses in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -757,17 +907,16 @@ private ServiceResponse> listAllNextDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -794,15 +943,34 @@ public Observable>> call(String nextP * The List publicIpAddress operation retrieves all the publicIpAddresses in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<PublicIPAddressInner> object + * @return the observable to the PagedList<PublicIPAddressInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List publicIpAddress operation retrieves all the publicIpAddresses in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<PublicIPAddressInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -811,7 +979,7 @@ public Observable>> call(ServiceRespo * The List publicIpAddress operation retrieves all the publicIpAddresses in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<PublicIPAddressInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressImpl.java index 40d1dc33bf59..12925b631663 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressImpl.java @@ -9,7 +9,6 @@ import com.microsoft.azure.management.network.PublicIPAddressDnsSettings; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupableResourceImpl; -import com.microsoft.rest.ServiceResponse; import rx.Observable; /** @@ -45,10 +44,8 @@ public Observable applyAsync() { @Override public PublicIpAddress refresh() throws Exception { - ServiceResponse response = - this.client.get(this.resourceGroupName(), this.name()); - PublicIPAddressInner inner = response.getBody(); - this.setInner(inner); + PublicIPAddressInner response = this.client.get(this.resourceGroupName(), this.name()); + this.setInner(response); return this; } diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java index e97d2ab559ff..e279eae13039 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/PublicIpAddressesImpl.java @@ -7,9 +7,9 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.network.PublicIPAddressDnsSettings; import com.microsoft.azure.management.network.PublicIpAddress; import com.microsoft.azure.management.network.PublicIpAddresses; -import com.microsoft.azure.management.network.PublicIPAddressDnsSettings; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; @@ -35,17 +35,17 @@ class PublicIpAddressesImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(this.innerCollection.listAll().getBody()); + return wrapList(this.innerCollection.listAll()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.list(groupName).getBody()); + return wrapList(this.innerCollection.list(groupName)); } @Override public PublicIpAddressImpl getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.get(groupName, name).getBody()); + return wrapModel(this.innerCollection.get(groupName, name)); } @Override diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesInner.java index 3ef1d30415c4..42ea56a7090a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RouteTablesInner.java @@ -109,10 +109,9 @@ interface RouteTablesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, routeTableName).toBlocking().last(); + public void delete(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().last().getBody(); } /** @@ -124,7 +123,7 @@ public ServiceResponse delete(String resourceGroupName, String routeTableN * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, routeTableName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); } /** @@ -134,7 +133,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String routeTable * @param routeTableName The name of the route table. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String routeTableName) { + public Observable deleteAsync(String resourceGroupName, String routeTableName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete RouteTable operation deletes the specified Route Table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -159,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, routeTableName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().getBody(); } /** @@ -174,7 +188,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String routeT * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, routeTableName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); + } + + /** + * The Delete RouteTable operation deletes the specified Route Table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -184,7 +214,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String route * @param routeTableName The name of the route table. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String routeTableName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -227,10 +257,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RouteTableInner object wrapped in {@link ServiceResponse} if successful. + * @return the RouteTableInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, routeTableName).toBlocking().single(); + public RouteTableInner get(String resourceGroupName, String routeTableName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, routeTableName).toBlocking().single().getBody(); } /** @@ -242,7 +272,7 @@ public ServiceResponse get(String resourceGroupName, String rou * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String routeTableName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, routeTableName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, routeTableName), serviceCallback); } /** @@ -252,7 +282,23 @@ public ServiceCall getAsync(String resourceGroupName, String ro * @param routeTableName The name of the route table. * @return the observable to the RouteTableInner object */ - public Observable> getAsync(String resourceGroupName, String routeTableName) { + public Observable getAsync(String resourceGroupName, String routeTableName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get RouteTables operation retrieves information about the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @return the observable to the RouteTableInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -289,10 +335,10 @@ public Observable> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RouteTableInner object wrapped in {@link ServiceResponse} if successful. + * @return the RouteTableInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String routeTableName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, routeTableName, expand).toBlocking().single(); + public RouteTableInner get(String resourceGroupName, String routeTableName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, expand).toBlocking().single().getBody(); } /** @@ -305,7 +351,7 @@ public ServiceResponse get(String resourceGroupName, String rou * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String routeTableName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, routeTableName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, routeTableName, expand), serviceCallback); } /** @@ -316,7 +362,24 @@ public ServiceCall getAsync(String resourceGroupName, String ro * @param expand expand references resources. * @return the observable to the RouteTableInner object */ - public Observable> getAsync(String resourceGroupName, String routeTableName, String expand) { + public Observable getAsync(String resourceGroupName, String routeTableName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, expand).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get RouteTables operation retrieves information about the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param expand expand references resources. + * @return the observable to the RouteTableInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -360,10 +423,10 @@ private ServiceResponse getDelegate(Response resp * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the RouteTableInner object wrapped in ServiceResponse if successful. + * @return the RouteTableInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, routeTableName, parameters).toBlocking().last(); + public RouteTableInner createOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().last().getBody(); } /** @@ -376,7 +439,24 @@ public ServiceResponse createOrUpdate(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + } + + /** + * The Put RouteTable operation creates/updates a route table in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create/update Route Table operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -387,7 +467,7 @@ public ServiceCall createOrUpdateAsync(String resourceGroupName * @param parameters Parameters supplied to the create/update Route Table operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -417,10 +497,10 @@ public Observable> createOrUpdateAsync(String r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RouteTableInner object wrapped in {@link ServiceResponse} if successful. + * @return the RouteTableInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters).toBlocking().single(); + public RouteTableInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, RouteTableInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).toBlocking().single().getBody(); } /** @@ -433,7 +513,7 @@ public ServiceResponse beginCreateOrUpdate(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, routeTableName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters), serviceCallback); } /** @@ -444,7 +524,24 @@ public ServiceCall beginCreateOrUpdateAsync(String resourceGrou * @param parameters Parameters supplied to the create/update Route Table operation * @return the observable to the RouteTableInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, parameters).map(new Func1, RouteTableInner>() { + @Override + public RouteTableInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put RouteTable operation creates/updates a route table in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param parameters Parameters supplied to the create/update Route Table operation + * @return the observable to the RouteTableInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, RouteTableInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -490,17 +587,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -526,15 +622,34 @@ public Observable>> call(String nextPageLi * The list RouteTables returns all route tables in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<RouteTableInner> object + * @return the observable to the PagedList<RouteTableInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list RouteTables returns all route tables in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -543,7 +658,7 @@ public Observable>> call(ServiceResponse

> * @param resourceGroupName The name of the resource group. - * @return the List<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -582,17 +697,16 @@ private ServiceResponse> listDelegate(Response> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -616,15 +730,33 @@ public Observable>> call(String nextPageLi /** * The list RouteTables returns all route tables in a subscription. * - * @return the observable to the List<RouteTableInner> object + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list RouteTables returns all route tables in a subscription. + * + * @return the observable to the PagedList<RouteTableInner> object */ - public Observable>> listAllAsync() { + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -632,7 +764,7 @@ public Observable>> call(ServiceResponse

>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -669,17 +801,16 @@ private ServiceResponse> listAllDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -706,15 +837,34 @@ public Observable>> call(String nextPageLi * The list RouteTables returns all route tables in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<RouteTableInner> object + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list RouteTables returns all route tables in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<RouteTableInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -723,7 +873,7 @@ public Observable>> call(ServiceResponse

> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -757,17 +907,16 @@ private ServiceResponse> listNextDelegate(Response> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -794,15 +943,34 @@ public Observable>> call(String nextPageLi * The list RouteTables returns all route tables in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<RouteTableInner> object + * @return the observable to the PagedList<RouteTableInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list RouteTables returns all route tables in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<RouteTableInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -811,7 +979,7 @@ public Observable>> call(ServiceResponse

> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RouteTableInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RoutesInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RoutesInner.java index 6a9a0e4f715d..b01e15aa293d 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RoutesInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/RoutesInner.java @@ -102,10 +102,9 @@ interface RoutesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String routeTableName, String routeName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, routeTableName, routeName).toBlocking().last(); + public void delete(String resourceGroupName, String routeTableName, String routeName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().last().getBody(); } /** @@ -118,7 +117,7 @@ public ServiceResponse delete(String resourceGroupName, String routeTableN * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); } /** @@ -129,7 +128,24 @@ public ServiceCall deleteAsync(String resourceGroupName, String routeTable * @param routeName The name of the route. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + public Observable deleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return deleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete route operation deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String routeTableName, String routeName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, routeTableName, routeName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String routeTableName, String routeName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().getBody(); } /** @@ -174,7 +189,24 @@ public ServiceResponse beginDelete(String resourceGroupName, String routeT * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * The delete route operation deletes the specified route from a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -185,7 +217,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String route * @param routeName The name of the route. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String routeTableName, String routeName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -232,10 +264,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RouteInner object wrapped in {@link ServiceResponse} if successful. + * @return the RouteInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String routeTableName, String routeName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, routeTableName, routeName).toBlocking().single(); + public RouteInner get(String resourceGroupName, String routeTableName, String routeName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).toBlocking().single().getBody(); } /** @@ -248,7 +280,24 @@ public ServiceResponse get(String resourceGroupName, String routeTab * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String routeTableName, String routeName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName), serviceCallback); + } + + /** + * The Get route operation retrieves information about the specified route from the route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @return the observable to the RouteInner object + */ + public Observable getAsync(String resourceGroupName, String routeTableName, String routeName) { + return getWithServiceResponseAsync(resourceGroupName, routeTableName, routeName).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -259,7 +308,7 @@ public ServiceCall getAsync(String resourceGroupName, String routeTa * @param routeName The name of the route. * @return the observable to the RouteInner object */ - public Observable> getAsync(String resourceGroupName, String routeTableName, String routeName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -307,10 +356,10 @@ private ServiceResponse getDelegate(Response response) * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the RouteInner object wrapped in ServiceResponse if successful. + * @return the RouteInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last(); + public RouteInner createOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().last().getBody(); } /** @@ -324,7 +373,25 @@ public ServiceResponse createOrUpdate(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * The Put route operation creates/updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create/update route operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -336,7 +403,7 @@ public ServiceCall createOrUpdateAsync(String resourceGroupName, Str * @param routeParameters Parameters supplied to the create/update route operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -370,10 +437,10 @@ public Observable> createOrUpdateAsync(String resour * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RouteInner object wrapped in {@link ServiceResponse} if successful. + * @return the RouteInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single(); + public RouteInner beginCreateOrUpdate(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).toBlocking().single().getBody(); } /** @@ -387,7 +454,25 @@ public ServiceResponse beginCreateOrUpdate(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters), serviceCallback); + } + + /** + * The Put route operation creates/updates a route in the specified route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @param routeName The name of the route. + * @param routeParameters Parameters supplied to the create/update route operation + * @return the observable to the RouteInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, routeTableName, routeName, routeParameters).map(new Func1, RouteInner>() { + @Override + public RouteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -399,7 +484,7 @@ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName * @param routeParameters Parameters supplied to the create/update route operation * @return the observable to the RouteInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String routeTableName, String routeName, RouteInner routeParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -449,17 +534,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response> list(final String resourceGroupName, final String routeTableName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String routeTableName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, routeTableName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -487,15 +571,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName The name of the resource group. * @param routeTableName The name of the route table. - * @return the observable to the List<RouteInner> object + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String routeTableName) { + return listWithServiceResponseAsync(resourceGroupName, routeTableName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List network security rule operation retrieves all the routes in a route table. + * + * @param resourceGroupName The name of the resource group. + * @param routeTableName The name of the route table. + * @return the observable to the PagedList<RouteInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String routeTableName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String routeTableName) { return listSinglePageAsync(resourceGroupName, routeTableName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -505,7 +609,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param routeTableName The name of the route table. - * @return the List<RouteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String routeTableName) { if (resourceGroupName == null) { @@ -548,17 +652,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -585,15 +688,34 @@ public Observable>> call(String nextPageLink) { * The List network security rule operation retrieves all the routes in a route table. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<RouteInner> object + * @return the observable to the PagedList<RouteInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List network security rule operation retrieves all the routes in a route table. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<RouteInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -602,7 +724,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<RouteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RouteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SecurityRulesInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SecurityRulesInner.java index 09bce352a542..df8a4050396a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SecurityRulesInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SecurityRulesInner.java @@ -102,10 +102,9 @@ interface SecurityRulesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().last(); + public void delete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().last().getBody(); } /** @@ -118,7 +117,7 @@ public ServiceResponse delete(String resourceGroupName, String networkSecu * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); } /** @@ -129,7 +128,24 @@ public ServiceCall deleteAsync(String resourceGroupName, String networkSec * @param securityRuleName The name of the security rule. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + public Observable deleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return deleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete network security rule operation deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().getBody(); } /** @@ -174,7 +189,24 @@ public ServiceResponse beginDelete(String resourceGroupName, String networ * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * The delete network security rule operation deletes the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -185,7 +217,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String netwo * @param securityRuleName The name of the security rule. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -232,10 +264,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SecurityRuleInner object wrapped in {@link ServiceResponse} if successful. + * @return the SecurityRuleInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single(); + public SecurityRuleInner get(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).toBlocking().single().getBody(); } /** @@ -248,7 +280,24 @@ public ServiceResponse get(String resourceGroupName, String n * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName), serviceCallback); + } + + /** + * The Get NetworkSecurityRule operation retrieves information about the specified network security rule. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @return the observable to the SecurityRuleInner object + */ + public Observable getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + return getWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -259,7 +308,7 @@ public ServiceCall getAsync(String resourceGroupName, String * @param securityRuleName The name of the security rule. * @return the observable to the SecurityRuleInner object */ - public Observable> getAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -307,10 +356,10 @@ private ServiceResponse getDelegate(Response re * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SecurityRuleInner object wrapped in ServiceResponse if successful. + * @return the SecurityRuleInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().last(); + public SecurityRuleInner createOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().last().getBody(); } /** @@ -324,7 +373,25 @@ public ServiceResponse createOrUpdate(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * The Put network security rule operation creates/updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create/update network security rule operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -336,7 +403,7 @@ public ServiceCall createOrUpdateAsync(String resourceGroupNa * @param securityRuleParameters Parameters supplied to the create/update network security rule operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -370,10 +437,10 @@ public Observable> createOrUpdateAsync(String * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SecurityRuleInner object wrapped in {@link ServiceResponse} if successful. + * @return the SecurityRuleInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().single(); + public SecurityRuleInner beginCreateOrUpdate(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).toBlocking().single().getBody(); } /** @@ -387,7 +454,25 @@ public ServiceResponse beginCreateOrUpdate(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters), serviceCallback); + } + + /** + * The Put network security rule operation creates/updates a security rule in the specified network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @param securityRuleName The name of the security rule. + * @param securityRuleParameters Parameters supplied to the create/update network security rule operation + * @return the observable to the SecurityRuleInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters).map(new Func1, SecurityRuleInner>() { + @Override + public SecurityRuleInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -399,7 +484,7 @@ public ServiceCall beginCreateOrUpdateAsync(String resourceGr * @param securityRuleParameters Parameters supplied to the create/update network security rule operation * @return the observable to the SecurityRuleInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String networkSecurityGroupName, String securityRuleName, SecurityRuleInner securityRuleParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -449,17 +534,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SecurityRuleInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String networkSecurityGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, networkSecurityGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -487,15 +571,35 @@ public Observable>> call(String nextPage * * @param resourceGroupName The name of the resource group. * @param networkSecurityGroupName The name of the network security group. - * @return the observable to the List<SecurityRuleInner> object + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + return listWithServiceResponseAsync(resourceGroupName, networkSecurityGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List network security rule operation retrieves all the security rules in a network security group. + * + * @param resourceGroupName The name of the resource group. + * @param networkSecurityGroupName The name of the network security group. + * @return the observable to the PagedList<SecurityRuleInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String networkSecurityGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String networkSecurityGroupName) { return listSinglePageAsync(resourceGroupName, networkSecurityGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -505,7 +609,7 @@ public Observable>> call(ServiceResponse * ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param networkSecurityGroupName The name of the network security group. - * @return the List<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String networkSecurityGroupName) { if (resourceGroupName == null) { @@ -548,17 +652,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -585,15 +688,34 @@ public Observable>> call(String nextPage * The List network security rule operation retrieves all the security rules in a network security group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SecurityRuleInner> object + * @return the observable to the PagedList<SecurityRuleInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List network security rule operation retrieves all the security rules in a network security group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SecurityRuleInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -602,7 +724,7 @@ public Observable>> call(ServiceResponse * The List network security rule operation retrieves all the security rules in a network security group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SecurityRuleInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SubnetsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SubnetsInner.java index 2703fe26af73..9201f3b6bb85 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SubnetsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/SubnetsInner.java @@ -102,10 +102,9 @@ interface SubnetsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().last(); + public void delete(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().last().getBody(); } /** @@ -118,7 +117,7 @@ public ServiceResponse delete(String resourceGroupName, String virtualNetw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); } /** @@ -129,7 +128,24 @@ public ServiceCall deleteAsync(String resourceGroupName, String virtualNet * @param subnetName The name of the subnet. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete subnet operation deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().getBody(); } /** @@ -174,7 +189,7 @@ public ServiceResponse beginDelete(String resourceGroupName, String virtua * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); } /** @@ -185,7 +200,24 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtu * @param subnetName The name of the subnet. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete subnet operation deletes the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -232,10 +264,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SubnetInner object wrapped in {@link ServiceResponse} if successful. + * @return the SubnetInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single(); + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).toBlocking().single().getBody(); } /** @@ -248,7 +280,7 @@ public ServiceResponse get(String resourceGroupName, String virtual * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName), serviceCallback); } /** @@ -259,7 +291,24 @@ public ServiceCall getAsync(String resourceGroupName, String virtua * @param subnetName The name of the subnet. * @return the observable to the SubnetInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get subnet operation retrieves information about the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -300,10 +349,10 @@ public Observable> call(Response resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SubnetInner object wrapped in {@link ServiceResponse} if successful. + * @return the SubnetInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkName, subnetName, expand).toBlocking().single(); + public SubnetInner get(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).toBlocking().single().getBody(); } /** @@ -317,7 +366,7 @@ public ServiceResponse get(String resourceGroupName, String virtual * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkName, subnetName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand), serviceCallback); } /** @@ -329,7 +378,25 @@ public ServiceCall getAsync(String resourceGroupName, String virtua * @param expand expand references resources. * @return the observable to the SubnetInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, expand).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get subnet operation retrieves information about the specified subnet. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param expand expand references resources. + * @return the observable to the SubnetInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -377,10 +444,10 @@ private ServiceResponse getDelegate(Response response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SubnetInner object wrapped in ServiceResponse if successful. + * @return the SubnetInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last(); + public SubnetInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().last().getBody(); } /** @@ -394,7 +461,7 @@ public ServiceResponse createOrUpdate(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); } /** @@ -406,7 +473,25 @@ public ServiceCall createOrUpdateAsync(String resourceGroupName, St * @param subnetParameters Parameters supplied to the create/update Subnet operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put Subnet operation creates/updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create/update Subnet operation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -440,10 +525,10 @@ public Observable> createOrUpdateAsync(String resou * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SubnetInner object wrapped in {@link ServiceResponse} if successful. + * @return the SubnetInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().single(); + public SubnetInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).toBlocking().single().getBody(); } /** @@ -457,7 +542,25 @@ public ServiceResponse beginCreateOrUpdate(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters), serviceCallback); + } + + /** + * The Put Subnet operation creates/updates a subnet in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param subnetName The name of the subnet. + * @param subnetParameters Parameters supplied to the create/update Subnet operation + * @return the observable to the SubnetInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, subnetName, subnetParameters).map(new Func1, SubnetInner>() { + @Override + public SubnetInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -469,7 +572,7 @@ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupNam * @param subnetParameters Parameters supplied to the create/update Subnet operation * @return the observable to the SubnetInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String subnetName, SubnetInner subnetParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -519,17 +622,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Response> list(final String resourceGroupName, final String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -557,15 +659,35 @@ public Observable>> call(String nextPageLink) * * @param resourceGroupName The name of the resource group. * @param virtualNetworkName The name of the virtual network. - * @return the observable to the List<SubnetInner> object + * @return the observable to the PagedList<SubnetInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String virtualNetworkName) { + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List subnets operation retrieves all the subnets in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { return listSinglePageAsync(resourceGroupName, virtualNetworkName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -575,7 +697,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param virtualNetworkName The name of the virtual network. - * @return the List<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { if (resourceGroupName == null) { @@ -618,17 +740,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -655,15 +776,34 @@ public Observable>> call(String nextPageLink) * The List subnets operation retrieves all the subnets in a virtual network. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SubnetInner> object + * @return the observable to the PagedList<SubnetInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List subnets operation retrieves all the subnets in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SubnetInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -672,7 +812,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SubnetInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SubnetInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/UsagesInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/UsagesInner.java index f7529e3472e7..47531e7fc6db 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/UsagesInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/UsagesInner.java @@ -74,17 +74,16 @@ interface UsagesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object if successful. */ - public ServiceResponse> list(final String location) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String location) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(location).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -110,15 +109,34 @@ public Observable>> call(String nextPageLink) { * Lists compute usages for a subscription. * * @param location The location upon which resource usage is queried. - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> listAsync(final String location) { + public Observable> listAsync(final String location) { + return listWithServiceResponseAsync(location) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists compute usages for a subscription. + * + * @param location The location upon which resource usage is queried. + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync(final String location) { return listSinglePageAsync(location) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -127,7 +145,7 @@ public Observable>> call(ServiceResponse> * @param location The location upon which resource usage is queried. - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String location) { if (location == null) { @@ -167,17 +185,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -204,15 +221,34 @@ public Observable>> call(String nextPageLink) { * Lists compute usages for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists compute usages for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -221,7 +257,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayConnectionsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayConnectionsInner.java index 791976314d7e..939777b93fc6 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayConnectionsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayConnectionsInner.java @@ -123,10 +123,10 @@ interface VirtualNetworkGatewayConnectionsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualNetworkGatewayConnectionInner object wrapped in ServiceResponse if successful. + * @return the VirtualNetworkGatewayConnectionInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last(); + public VirtualNetworkGatewayConnectionInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().last().getBody(); } /** @@ -139,7 +139,7 @@ public ServiceResponse createOrUpdate(Stri * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); } /** @@ -150,7 +150,24 @@ public ServiceCall createOrUpdateAsync(Str * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway connection operation through Network resource provider. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnection operation creates/updates a virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway connection operation through Network resource provider. + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -180,10 +197,10 @@ public Observable> createO * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkGatewayConnectionInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkGatewayConnectionInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single(); + public VirtualNetworkGatewayConnectionInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).toBlocking().single().getBody(); } /** @@ -196,7 +213,24 @@ public ServiceResponse beginCreateOrUpdate * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnection operation creates/updates a virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway connection operation through Network resource provider. + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, parameters).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -207,7 +241,7 @@ public ServiceCall beginCreateOrUpdateAsyn * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway connection operation through Network resource provider. * @return the observable to the VirtualNetworkGatewayConnectionInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, VirtualNetworkGatewayConnectionInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -254,10 +288,10 @@ private ServiceResponse beginCreateOrUpdat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkGatewayConnectionInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkGatewayConnectionInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single(); + public VirtualNetworkGatewayConnectionInner get(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().getBody(); } /** @@ -269,7 +303,7 @@ public ServiceResponse get(String resource * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -279,7 +313,23 @@ public ServiceCall getAsync(String resourc * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. * @return the observable to the VirtualNetworkGatewayConnectionInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable getAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, VirtualNetworkGatewayConnectionInner>() { + @Override + public VirtualNetworkGatewayConnectionInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnection operation retrieves information about the specified virtual network gateway connection through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @return the observable to the VirtualNetworkGatewayConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -322,10 +372,9 @@ private ServiceResponse getDelegate(Respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last(); + public void delete(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().getBody(); } /** @@ -337,7 +386,7 @@ public ServiceResponse delete(String resourceGroupName, String virtualNetw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -347,7 +396,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String virtualNet * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete VirtualNetworkGatewayConnection operation deletes the specified virtual network Gateway connection through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -372,10 +437,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().getBody(); } /** @@ -387,7 +451,7 @@ public ServiceResponse beginDelete(String resourceGroupName, String virtua * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -397,7 +461,23 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtu * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete VirtualNetworkGatewayConnection operation deletes the specified virtual network Gateway connection through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -440,10 +520,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionSharedKeyResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionSharedKeyResultInner object if successful. */ - public ServiceResponse getSharedKey(String resourceGroupName, String connectionSharedKeyName) throws CloudException, IOException, IllegalArgumentException { - return getSharedKeyAsync(resourceGroupName, connectionSharedKeyName).toBlocking().single(); + public ConnectionSharedKeyResultInner getSharedKey(String resourceGroupName, String connectionSharedKeyName) throws CloudException, IOException, IllegalArgumentException { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, connectionSharedKeyName).toBlocking().single().getBody(); } /** @@ -455,7 +535,7 @@ public ServiceResponse getSharedKey(String resou * @return the {@link ServiceCall} object */ public ServiceCall getSharedKeyAsync(String resourceGroupName, String connectionSharedKeyName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSharedKeyAsync(resourceGroupName, connectionSharedKeyName), serviceCallback); + return ServiceCall.create(getSharedKeyWithServiceResponseAsync(resourceGroupName, connectionSharedKeyName), serviceCallback); } /** @@ -465,7 +545,23 @@ public ServiceCall getSharedKeyAsync(String reso * @param connectionSharedKeyName The virtual network gateway connection shared key name. * @return the observable to the ConnectionSharedKeyResultInner object */ - public Observable> getSharedKeyAsync(String resourceGroupName, String connectionSharedKeyName) { + public Observable getSharedKeyAsync(String resourceGroupName, String connectionSharedKeyName) { + return getSharedKeyWithServiceResponseAsync(resourceGroupName, connectionSharedKeyName).map(new Func1, ConnectionSharedKeyResultInner>() { + @Override + public ConnectionSharedKeyResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified virtual network gateway connection shared key through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param connectionSharedKeyName The virtual network gateway connection shared key name. + * @return the observable to the ConnectionSharedKeyResultInner object + */ + public Observable> getSharedKeyWithServiceResponseAsync(String resourceGroupName, String connectionSharedKeyName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -506,17 +602,16 @@ private ServiceResponse getSharedKeyDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -542,15 +637,34 @@ public Observable>> c * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<VirtualNetworkGatewayConnectionInner> object + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -559,7 +673,7 @@ public Observable>> c * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -601,10 +715,10 @@ private ServiceResponse> listDele * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ConnectionResetSharedKeyInner object wrapped in ServiceResponse if successful. + * @return the ConnectionResetSharedKeyInner object if successful. */ - public ServiceResponse resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last(); + public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().getBody(); } /** @@ -616,7 +730,7 @@ public ServiceResponse resetSharedKey(String reso * @return the {@link ServiceCall} object */ public ServiceCall resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -626,7 +740,23 @@ public ServiceCall resetSharedKeyAsync(String res * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. * @return the observable for the request */ - public Observable> resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @return the observable for the request + */ + public Observable> resetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -655,10 +785,10 @@ public Observable> resetSharedKey * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ConnectionResetSharedKeyInner object wrapped in ServiceResponse if successful. + * @return the ConnectionResetSharedKeyInner object if successful. */ - public ServiceResponse resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last(); + public ConnectionResetSharedKeyInner resetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().last().getBody(); } /** @@ -671,7 +801,7 @@ public ServiceResponse resetSharedKey(String reso * @return the {@link ServiceCall} object */ public ServiceCall resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength, final ServiceCallback serviceCallback) { - return ServiceCall.create(resetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + return ServiceCall.create(resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); } /** @@ -682,7 +812,24 @@ public ServiceCall resetSharedKeyAsync(String res * @param keyLength The virtual network connection reset shared key length * @return the observable for the request */ - public Observable> resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) { + public Observable resetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) { + return resetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length + * @return the observable for the request + */ + public Observable> resetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -709,10 +856,10 @@ public Observable> resetSharedKey * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionResetSharedKeyInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionResetSharedKeyInner object if successful. */ - public ServiceResponse beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { - return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single(); + public ConnectionResetSharedKeyInner beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().getBody(); } /** @@ -724,7 +871,7 @@ public ServiceResponse beginResetSharedKey(String * @return the {@link ServiceCall} object */ public ServiceCall beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -734,7 +881,23 @@ public ServiceCall beginResetSharedKeyAsync(Strin * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. * @return the observable to the ConnectionResetSharedKeyInner object */ - public Observable> beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable> beginResetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -773,10 +936,10 @@ public Observable> call(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionResetSharedKeyInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionResetSharedKeyInner object if successful. */ - public ServiceResponse beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) throws CloudException, IOException, IllegalArgumentException { - return beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().single(); + public ConnectionResetSharedKeyInner beginResetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) throws CloudException, IOException, IllegalArgumentException { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).toBlocking().single().getBody(); } /** @@ -789,7 +952,24 @@ public ServiceResponse beginResetSharedKey(String * @return the {@link ServiceCall} object */ public ServiceCall beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginResetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + return ServiceCall.create(beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength), serviceCallback); + } + + /** + * The VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection reset shared key Name. + * @param keyLength The virtual network connection reset shared key length + * @return the observable to the ConnectionResetSharedKeyInner object + */ + public Observable beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) { + return beginResetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, keyLength).map(new Func1, ConnectionResetSharedKeyInner>() { + @Override + public ConnectionResetSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -800,7 +980,7 @@ public ServiceCall beginResetSharedKeyAsync(Strin * @param keyLength The virtual network connection reset shared key length * @return the observable to the ConnectionResetSharedKeyInner object */ - public Observable> beginResetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) { + public Observable> beginResetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, Long keyLength) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -846,10 +1026,10 @@ private ServiceResponse beginResetSharedKeyDelega * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ConnectionSharedKeyInner object wrapped in ServiceResponse if successful. + * @return the ConnectionSharedKeyInner object if successful. */ - public ServiceResponse setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last(); + public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().last().getBody(); } /** @@ -861,7 +1041,7 @@ public ServiceResponse setSharedKey(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -871,7 +1051,23 @@ public ServiceCall setSharedKeyAsync(String resourceGr * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. * @return the observable for the request */ - public Observable> setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @return the observable for the request + */ + public Observable> setSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -900,10 +1096,10 @@ public Observable> setSharedKeyAsync(S * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ConnectionSharedKeyInner object wrapped in ServiceResponse if successful. + * @return the ConnectionSharedKeyInner object if successful. */ - public ServiceResponse setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).toBlocking().last(); + public ConnectionSharedKeyInner setSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).toBlocking().last().getBody(); } /** @@ -916,7 +1112,24 @@ public ServiceResponse setSharedKey(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value, final ServiceCallback serviceCallback) { - return ServiceCall.create(setSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value), serviceCallback); + return ServiceCall.create(setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param value The virtual network connection shared key value + * @return the observable for the request + */ + public Observable setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) { + return setSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -927,7 +1140,7 @@ public ServiceCall setSharedKeyAsync(String resourceGr * @param value The virtual network connection shared key value * @return the observable for the request */ - public Observable> setSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) { + public Observable> setSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -954,10 +1167,10 @@ public Observable> setSharedKeyAsync(S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionSharedKeyInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionSharedKeyInner object if successful. */ - public ServiceResponse beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { - return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single(); + public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName) throws CloudException, IOException, IllegalArgumentException { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).toBlocking().single().getBody(); } /** @@ -969,7 +1182,7 @@ public ServiceResponse beginSetSharedKey(String resour * @return the {@link ServiceCall} object */ public ServiceCall beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); + return ServiceCall.create(beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName), serviceCallback); } /** @@ -979,7 +1192,23 @@ public ServiceCall beginSetSharedKeyAsync(String resou * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. * @return the observable to the ConnectionSharedKeyInner object */ - public Observable> beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + public Observable beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable> beginSetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1018,10 +1247,10 @@ public Observable> call(Response beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) throws CloudException, IOException, IllegalArgumentException { - return beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).toBlocking().single(); + public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) throws CloudException, IOException, IllegalArgumentException { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).toBlocking().single().getBody(); } /** @@ -1034,7 +1263,24 @@ public ServiceResponse beginSetSharedKey(String resour * @return the {@link ServiceCall} object */ public ServiceCall beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginSetSharedKeyAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value), serviceCallback); + return ServiceCall.create(beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value), serviceCallback); + } + + /** + * The Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection shared key for passed virtual network gateway connection in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayConnectionName The virtual network gateway connection name. + * @param value The virtual network connection shared key value + * @return the observable to the ConnectionSharedKeyInner object + */ + public Observable beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) { + return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).map(new Func1, ConnectionSharedKeyInner>() { + @Override + public ConnectionSharedKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1045,7 +1291,7 @@ public ServiceCall beginSetSharedKeyAsync(String resou * @param value The virtual network connection shared key value * @return the observable to the ConnectionSharedKeyInner object */ - public Observable> beginSetSharedKeyAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) { + public Observable> beginSetSharedKeyWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1089,17 +1335,16 @@ private ServiceResponse beginSetSharedKeyDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1126,15 +1371,34 @@ public Observable>> c * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualNetworkGatewayConnectionInner> object + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualNetworkGatewayConnectionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1143,7 +1407,7 @@ public Observable>> c * The List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections created. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayConnectionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayInner.java index 15a7a3b9b4cf..7238336ba627 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewayInner.java @@ -50,6 +50,12 @@ public class VirtualNetworkGatewayInner extends Resource { @JsonProperty(value = "properties.enableBgp") private Boolean enableBgp; + /** + * ActiveActive flag. + */ + @JsonProperty(value = "properties.activeActive") + private Boolean activeActive; + /** * Gets or sets the reference of the LocalNetworkGateway resource which * represents Local network site having default routes. Assign Null value @@ -178,6 +184,26 @@ public VirtualNetworkGatewayInner withEnableBgp(Boolean enableBgp) { return this; } + /** + * Get the activeActive value. + * + * @return the activeActive value + */ + public Boolean activeActive() { + return this.activeActive; + } + + /** + * Set the activeActive value. + * + * @param activeActive the activeActive value to set + * @return the VirtualNetworkGatewayInner object itself. + */ + public VirtualNetworkGatewayInner withActiveActive(Boolean activeActive) { + this.activeActive = activeActive; + return this; + } + /** * Get the gatewayDefaultSite value. * diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewaysInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewaysInner.java index ff409d949105..eefb70202de6 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewaysInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkGatewaysInner.java @@ -117,10 +117,10 @@ interface VirtualNetworkGatewaysService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualNetworkGatewayInner object wrapped in ServiceResponse if successful. + * @return the VirtualNetworkGatewayInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last(); + public VirtualNetworkGatewayInner createOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().getBody(); } /** @@ -133,7 +133,7 @@ public ServiceResponse createOrUpdate(String resourc * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); } /** @@ -144,7 +144,24 @@ public ServiceCall createOrUpdateAsync(String resour * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway operation through Network resource provider. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put VirtualNetworkGateway operation creates/updates a virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway operation through Network resource provider. + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -174,10 +191,10 @@ public Observable> createOrUpdateAsy * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkGatewayInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single(); + public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().getBody(); } /** @@ -190,7 +207,7 @@ public ServiceResponse beginCreateOrUpdate(String re * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); } /** @@ -201,7 +218,24 @@ public ServiceCall beginCreateOrUpdateAsync(String r * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway operation through Network resource provider. * @return the observable to the VirtualNetworkGatewayInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put VirtualNetworkGateway operation creates/updates a virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the Begin Create or update Virtual Network Gateway operation through Network resource provider. + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -248,10 +282,10 @@ private ServiceResponse beginCreateOrUpdateDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkGatewayInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + public VirtualNetworkGatewayInner get(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().getBody(); } /** @@ -263,7 +297,7 @@ public ServiceResponse get(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); } /** @@ -273,7 +307,23 @@ public ServiceCall getAsync(String resourceGroupName * @param virtualNetworkGatewayName The name of the virtual network gateway. * @return the observable to the VirtualNetworkGatewayInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable getAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get VirtualNetworkGateway operation retrieves information about the specified virtual network gateway through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -316,10 +366,9 @@ private ServiceResponse getDelegate(Response delete(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last(); + public void delete(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().last().getBody(); } /** @@ -331,7 +380,23 @@ public ServiceResponse delete(String resourceGroupName, String virtualNetw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Delete VirtualNetworkGateway operation deletes the specified virtual network Gateway through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -341,7 +406,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String virtualNet * @param virtualNetworkGatewayName The name of the virtual network gateway. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -366,10 +431,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().getBody(); } /** @@ -381,7 +445,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String virtua * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Delete VirtualNetworkGateway operation deletes the specified virtual network Gateway through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -391,7 +471,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtu * @param virtualNetworkGatewayName The name of the virtual network gateway. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -433,17 +513,16 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -469,15 +548,34 @@ public Observable>> call(String * The List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<VirtualNetworkGatewayInner> object + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -486,7 +584,7 @@ public Observable>> call(Servic * The List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -529,10 +627,10 @@ private ServiceResponse> listDelegate(Respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualNetworkGatewayInner object wrapped in ServiceResponse if successful. + * @return the VirtualNetworkGatewayInner object if successful. */ - public ServiceResponse reset(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return resetAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last(); + public VirtualNetworkGatewayInner reset(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().last().getBody(); } /** @@ -545,7 +643,24 @@ public ServiceResponse reset(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall resetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(resetAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + return ServiceCall.create(resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * The Reset VirtualNetworkGateway operation resets the primary of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the Begin Reset Virtual Network Gateway operation through Network resource provider. + * @return the observable for the request + */ + public Observable resetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return resetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -556,7 +671,7 @@ public ServiceCall resetAsync(String resourceGroupNa * @param parameters Parameters supplied to the Begin Reset Virtual Network Gateway operation through Network resource provider. * @return the observable for the request */ - public Observable> resetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + public Observable> resetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -586,10 +701,10 @@ public Observable> resetAsync(String * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkGatewayInner object if successful. */ - public ServiceResponse beginReset(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginResetAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single(); + public VirtualNetworkGatewayInner beginReset(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().getBody(); } /** @@ -602,7 +717,24 @@ public ServiceResponse beginReset(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginResetAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + return ServiceCall.create(beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters), serviceCallback); + } + + /** + * The Reset VirtualNetworkGateway operation resets the primary of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param parameters Parameters supplied to the Begin Reset Virtual Network Gateway operation through Network resource provider. + * @return the observable to the VirtualNetworkGatewayInner object + */ + public Observable beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + return beginResetWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).map(new Func1, VirtualNetworkGatewayInner>() { + @Override + public VirtualNetworkGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -613,7 +745,7 @@ public ServiceCall beginResetAsync(String resourceGr * @param parameters Parameters supplied to the Begin Reset Virtual Network Gateway operation through Network resource provider. * @return the observable to the VirtualNetworkGatewayInner object */ - public Observable> beginResetAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { + public Observable> beginResetWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -660,10 +792,10 @@ private ServiceResponse beginResetDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the String object wrapped in {@link ServiceResponse} if successful. + * @return the String object if successful. */ - public ServiceResponse generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { - return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single(); + public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName) throws CloudException, IOException, IllegalArgumentException { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).toBlocking().single().getBody(); } /** @@ -675,7 +807,23 @@ public ServiceResponse generatevpnclientpackage(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + return ServiceCall.create(generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName), serviceCallback); + } + + /** + * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @return the observable to the String object + */ + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -685,7 +833,7 @@ public ServiceCall generatevpnclientpackageAsync(String resourceGroupNam * @param virtualNetworkGatewayName The name of the virtual network gateway. * @return the observable to the String object */ - public Observable> generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName) { + public Observable> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -724,10 +872,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the String object wrapped in {@link ServiceResponse} if successful. + * @return the String object if successful. */ - public ServiceResponse generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture) throws CloudException, IOException, IllegalArgumentException { - return generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, processorArchitecture).toBlocking().single(); + public String generatevpnclientpackage(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture) throws CloudException, IOException, IllegalArgumentException { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, processorArchitecture).toBlocking().single().getBody(); } /** @@ -740,7 +888,24 @@ public ServiceResponse generatevpnclientpackage(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture, final ServiceCallback serviceCallback) { - return ServiceCall.create(generatevpnclientpackageAsync(resourceGroupName, virtualNetworkGatewayName, processorArchitecture), serviceCallback); + return ServiceCall.create(generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, processorArchitecture), serviceCallback); + } + + /** + * The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkGatewayName The name of the virtual network gateway. + * @param processorArchitecture VPN client Processor Architecture -Amd64/X86. Possible values include: 'Amd64', 'X86' + * @return the observable to the String object + */ + public Observable generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture) { + return generatevpnclientpackageWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, processorArchitecture).map(new Func1, String>() { + @Override + public String call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -751,7 +916,7 @@ public ServiceCall generatevpnclientpackageAsync(String resourceGroupNam * @param processorArchitecture VPN client Processor Architecture -Amd64/X86. Possible values include: 'Amd64', 'X86' * @return the observable to the String object */ - public Observable> generatevpnclientpackageAsync(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture) { + public Observable> generatevpnclientpackageWithServiceResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, ProcessorArchitecture processorArchitecture) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -794,17 +959,16 @@ private ServiceResponse generatevpnclientpackageDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -831,15 +995,34 @@ public Observable>> call(String * The List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualNetworkGatewayInner> object + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualNetworkGatewayInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -848,7 +1031,7 @@ public Observable>> call(Servic * The List VirtualNetworkGateways operation retrieves all the virtual network gateways stored. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkGatewayInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkPeeringsInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkPeeringsInner.java index 7e4eb41455d1..fc5f01c86e0a 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkPeeringsInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworkPeeringsInner.java @@ -102,10 +102,9 @@ interface VirtualNetworkPeeringsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().last(); + public void delete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().last().getBody(); } /** @@ -118,7 +117,7 @@ public ServiceResponse delete(String resourceGroupName, String virtualNetw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); } /** @@ -129,7 +128,24 @@ public ServiceCall deleteAsync(String resourceGroupName, String virtualNet * @param virtualNetworkPeeringName The name of the virtual network peering. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The delete virtual network peering operation deletes the specified peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -158,10 +174,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().getBody(); } /** @@ -174,7 +189,24 @@ public ServiceResponse beginDelete(String resourceGroupName, String virtua * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * The delete virtual network peering operation deletes the specified peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -185,7 +217,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtu * @param virtualNetworkPeeringName The name of the virtual network peering. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -232,10 +264,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkPeeringInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkPeeringInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single(); + public VirtualNetworkPeeringInner get(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).toBlocking().single().getBody(); } /** @@ -248,7 +280,24 @@ public ServiceResponse get(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName), serviceCallback); + } + + /** + * The Get virtual network peering operation retrieves information about the specified virtual network peering. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the virtual network peering. + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -259,7 +308,7 @@ public ServiceCall getAsync(String resourceGroupName * @param virtualNetworkPeeringName The name of the virtual network peering. * @return the observable to the VirtualNetworkPeeringInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -307,10 +356,10 @@ private ServiceResponse getDelegate(Response createOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().last(); + public VirtualNetworkPeeringInner createOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().last().getBody(); } /** @@ -324,7 +373,25 @@ public ServiceResponse createOrUpdate(String resourc * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * The Put virtual network peering operation creates/updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create/update virtual network peering operation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -336,7 +403,7 @@ public ServiceCall createOrUpdateAsync(String resour * @param virtualNetworkPeeringParameters Parameters supplied to the create/update virtual network peering operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -370,10 +437,10 @@ public Observable> createOrUpdateAsy * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkPeeringInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkPeeringInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().single(); + public VirtualNetworkPeeringInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).toBlocking().single().getBody(); } /** @@ -387,7 +454,25 @@ public ServiceResponse beginCreateOrUpdate(String re * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters), serviceCallback); + } + + /** + * The Put virtual network peering operation creates/updates a peering in the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param virtualNetworkPeeringName The name of the peering. + * @param virtualNetworkPeeringParameters Parameters supplied to the create/update virtual network peering operation + * @return the observable to the VirtualNetworkPeeringInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters).map(new Func1, VirtualNetworkPeeringInner>() { + @Override + public VirtualNetworkPeeringInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -399,7 +484,7 @@ public ServiceCall beginCreateOrUpdateAsync(String r * @param virtualNetworkPeeringParameters Parameters supplied to the create/update virtual network peering operation * @return the observable to the VirtualNetworkPeeringInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String virtualNetworkPeeringName, VirtualNetworkPeeringInner virtualNetworkPeeringParameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -449,17 +534,16 @@ private ServiceResponse beginCreateOrUpdateDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -487,15 +571,35 @@ public Observable>> call(String * * @param resourceGroupName The name of the resource group. * @param virtualNetworkName The name of the virtual network. - * @return the observable to the List<VirtualNetworkPeeringInner> object + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String virtualNetworkName) { + return listWithServiceResponseAsync(resourceGroupName, virtualNetworkName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List virtual network peerings operation retrieves all the peerings in a virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String virtualNetworkName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String virtualNetworkName) { return listSinglePageAsync(resourceGroupName, virtualNetworkName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -505,7 +609,7 @@ public Observable>> call(Servic * ServiceResponse> * @param resourceGroupName The name of the resource group. ServiceResponse> * @param virtualNetworkName The name of the virtual network. - * @return the List<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String virtualNetworkName) { if (resourceGroupName == null) { @@ -548,17 +652,16 @@ private ServiceResponse> listDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkPeeringInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -585,15 +688,34 @@ public Observable>> call(String * The List virtual network peerings operation retrieves all the peerings in a virtual network. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualNetworkPeeringInner> object + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The List virtual network peerings operation retrieves all the peerings in a virtual network. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualNetworkPeeringInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -602,7 +724,7 @@ public Observable>> call(Servic * The List virtual network peerings operation retrieves all the peerings in a virtual network. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkPeeringInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworksInner.java b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworksInner.java index 7792666011c2..3c61a7a70813 100644 --- a/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworksInner.java +++ b/azure-mgmt-network/src/main/java/com/microsoft/azure/management/network/implementation/VirtualNetworksInner.java @@ -113,10 +113,9 @@ interface VirtualNetworksService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, virtualNetworkName).toBlocking().last(); + public void delete(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().last().getBody(); } /** @@ -128,7 +127,7 @@ public ServiceResponse delete(String resourceGroupName, String virtualNetw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, virtualNetworkName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); } /** @@ -138,7 +137,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String virtualNet * @param virtualNetworkName The name of the virtual network. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String virtualNetworkName) { + public Observable deleteAsync(String resourceGroupName, String virtualNetworkName) { + return deleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete VirtualNetwork operation deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -163,10 +178,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().getBody(); } /** @@ -178,7 +192,7 @@ public ServiceResponse beginDelete(String resourceGroupName, String virtua * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, virtualNetworkName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); } /** @@ -188,7 +202,23 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String virtu * @param virtualNetworkName The name of the virtual network. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + public Observable beginDeleteAsync(String resourceGroupName, String virtualNetworkName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Delete VirtualNetwork operation deletes the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -231,10 +261,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + public VirtualNetworkInner get(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().getBody(); } /** @@ -246,7 +276,7 @@ public ServiceResponse get(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); } /** @@ -256,7 +286,23 @@ public ServiceCall getAsync(String resourceGroupName, Strin * @param virtualNetworkName The name of the virtual network. * @return the observable to the VirtualNetworkInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkName) { + public Observable getAsync(String resourceGroupName, String virtualNetworkName) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Get VirtualNetwork operation retrieves information about the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the observable to the VirtualNetworkInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -293,10 +339,10 @@ public Observable> call(Response get(String resourceGroupName, String virtualNetworkName, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, virtualNetworkName, expand).toBlocking().single(); + public VirtualNetworkInner get(String resourceGroupName, String virtualNetworkName, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).toBlocking().single().getBody(); } /** @@ -309,7 +355,24 @@ public ServiceResponse get(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String virtualNetworkName, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, virtualNetworkName, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand), serviceCallback); + } + + /** + * The Get VirtualNetwork operation retrieves information about the specified virtual network. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param expand expand references resources. + * @return the observable to the VirtualNetworkInner object + */ + public Observable getAsync(String resourceGroupName, String virtualNetworkName, String expand) { + return getWithServiceResponseAsync(resourceGroupName, virtualNetworkName, expand).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -320,7 +383,7 @@ public ServiceCall getAsync(String resourceGroupName, Strin * @param expand expand references resources. * @return the observable to the VirtualNetworkInner object */ - public Observable> getAsync(String resourceGroupName, String virtualNetworkName, String expand) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String expand) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -364,10 +427,10 @@ private ServiceResponse getDelegate(Response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the VirtualNetworkInner object wrapped in ServiceResponse if successful. + * @return the VirtualNetworkInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().last(); + public VirtualNetworkInner createOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().last().getBody(); } /** @@ -380,7 +443,7 @@ public ServiceResponse createOrUpdate(String resourceGroupN * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); } /** @@ -391,7 +454,24 @@ public ServiceCall createOrUpdateAsync(String resourceGroup * @param parameters Parameters supplied to the create/update Virtual Network operation * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * The Put VirtualNetwork operation creates/updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create/update Virtual Network operation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -421,10 +501,10 @@ public Observable> createOrUpdateAsync(Stri * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VirtualNetworkInner object wrapped in {@link ServiceResponse} if successful. + * @return the VirtualNetworkInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single(); + public VirtualNetworkInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).toBlocking().single().getBody(); } /** @@ -437,7 +517,24 @@ public ServiceResponse beginCreateOrUpdate(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters), serviceCallback); + } + + /** + * The Put VirtualNetwork operation creates/updates a virtual network in the specified resource group. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param parameters Parameters supplied to the create/update Virtual Network operation + * @return the observable to the VirtualNetworkInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkName, parameters).map(new Func1, VirtualNetworkInner>() { + @Override + public VirtualNetworkInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -448,7 +545,7 @@ public ServiceCall beginCreateOrUpdateAsync(String resource * @param parameters Parameters supplied to the create/update Virtual Network operation * @return the observable to the VirtualNetworkInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, VirtualNetworkInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -493,17 +590,16 @@ private ServiceResponse beginCreateOrUpdateDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -527,15 +623,33 @@ public Observable>> call(String nextPa /** * The list VirtualNetwork returns all Virtual Networks in a subscription. * - * @return the observable to the List<VirtualNetworkInner> object + * @return the observable to the PagedList<VirtualNetworkInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list VirtualNetwork returns all Virtual Networks in a subscription. + * + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -543,7 +657,7 @@ public Observable>> call(ServiceRespon /** * The list VirtualNetwork returns all Virtual Networks in a subscription. * - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -580,17 +694,16 @@ private ServiceResponse> listAllDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -616,15 +729,34 @@ public Observable>> call(String nextPa * The list VirtualNetwork returns all Virtual Networks in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<VirtualNetworkInner> object + * @return the observable to the PagedList<VirtualNetworkInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list VirtualNetwork returns all Virtual Networks in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -633,7 +765,7 @@ public Observable>> call(ServiceRespon * The list VirtualNetwork returns all Virtual Networks in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -674,10 +806,10 @@ private ServiceResponse> listDelegate(Response checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { - return checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName).toBlocking().single(); + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName) throws CloudException, IOException, IllegalArgumentException { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).toBlocking().single().getBody(); } /** @@ -689,7 +821,7 @@ public ServiceResponse checkIPAddressAvailabil * @return the {@link ServiceCall} object */ public ServiceCall checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName), serviceCallback); + return ServiceCall.create(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName), serviceCallback); } /** @@ -699,7 +831,23 @@ public ServiceCall checkIPAddressAvailabilityA * @param virtualNetworkName The name of the virtual network. * @return the observable to the IPAddressAvailabilityResultInner object */ - public Observable> checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) { + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Checks whether a private Ip address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -736,10 +884,10 @@ public Observable> call(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the IPAddressAvailabilityResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the IPAddressAvailabilityResultInner object if successful. */ - public ServiceResponse checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName, String ipAddress) throws CloudException, IOException, IllegalArgumentException { - return checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress).toBlocking().single(); + public IPAddressAvailabilityResultInner checkIPAddressAvailability(String resourceGroupName, String virtualNetworkName, String ipAddress) throws CloudException, IOException, IllegalArgumentException { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).toBlocking().single().getBody(); } /** @@ -752,7 +900,24 @@ public ServiceResponse checkIPAddressAvailabil * @return the {@link ServiceCall} object */ public ServiceCall checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkIPAddressAvailabilityAsync(resourceGroupName, virtualNetworkName, ipAddress), serviceCallback); + return ServiceCall.create(checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress), serviceCallback); + } + + /** + * Checks whether a private Ip address is available for use. + * + * @param resourceGroupName The name of the resource group. + * @param virtualNetworkName The name of the virtual network. + * @param ipAddress The private IP address to be verified. + * @return the observable to the IPAddressAvailabilityResultInner object + */ + public Observable checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + return checkIPAddressAvailabilityWithServiceResponseAsync(resourceGroupName, virtualNetworkName, ipAddress).map(new Func1, IPAddressAvailabilityResultInner>() { + @Override + public IPAddressAvailabilityResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -763,7 +928,7 @@ public ServiceCall checkIPAddressAvailabilityA * @param ipAddress The private IP address to be verified. * @return the observable to the IPAddressAvailabilityResultInner object */ - public Observable> checkIPAddressAvailabilityAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { + public Observable> checkIPAddressAvailabilityWithServiceResponseAsync(String resourceGroupName, String virtualNetworkName, String ipAddress) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -804,17 +969,16 @@ private ServiceResponse checkIPAddressAvailabi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object if successful. */ - public ServiceResponse> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -841,15 +1005,34 @@ public Observable>> call(String nextPa * The list VirtualNetwork returns all Virtual Networks in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualNetworkInner> object + * @return the observable to the PagedList<VirtualNetworkInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list VirtualNetwork returns all Virtual Networks in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -858,7 +1041,7 @@ public Observable>> call(ServiceRespon * The list VirtualNetwork returns all Virtual Networks in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -892,17 +1075,16 @@ private ServiceResponse> listAllNextDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -929,15 +1111,34 @@ public Observable>> call(String nextPa * The list VirtualNetwork returns all Virtual Networks in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<VirtualNetworkInner> object + * @return the observable to the PagedList<VirtualNetworkInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * The list VirtualNetwork returns all Virtual Networks in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<VirtualNetworkInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -946,7 +1147,7 @@ public Observable>> call(ServiceRespon * The list VirtualNetwork returns all Virtual Networks in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<VirtualNetworkInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java index 7d0aa7a9700e..8f30dc7df61b 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/PatchSchedulesInner.java @@ -81,10 +81,10 @@ interface PatchSchedulesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RedisPatchSchedulesResponseInner object wrapped in {@link ServiceResponse} if successful. + * @return the RedisPatchSchedulesResponseInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String name, List scheduleEntries) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(resourceGroupName, name, scheduleEntries).toBlocking().single(); + public RedisPatchSchedulesResponseInner createOrUpdate(String resourceGroupName, String name, List scheduleEntries) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, scheduleEntries).toBlocking().single().getBody(); } /** @@ -97,7 +97,7 @@ public ServiceResponse createOrUpdate(String r * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String name, List scheduleEntries, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, name, scheduleEntries), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, scheduleEntries), serviceCallback); } /** @@ -108,7 +108,24 @@ public ServiceCall createOrUpdateAsync(String * @param scheduleEntries List of patch schedules for redis cache. * @return the observable to the RedisPatchSchedulesResponseInner object */ - public Observable> createOrUpdateAsync(String resourceGroupName, String name, List scheduleEntries) { + public Observable createOrUpdateAsync(String resourceGroupName, String name, List scheduleEntries) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, scheduleEntries).map(new Func1, RedisPatchSchedulesResponseInner>() { + @Override + public RedisPatchSchedulesResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create or replace the patching schedule for redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param scheduleEntries List of patch schedules for redis cache. + * @return the observable to the RedisPatchSchedulesResponseInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, List scheduleEntries) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -156,10 +173,9 @@ private ServiceResponse createOrUpdateDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse delete(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(resourceGroupName, name).toBlocking().single(); + public void delete(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -171,7 +187,7 @@ public ServiceResponse delete(String resourceGroupName, String name) throw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -181,7 +197,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String name, fina * @param name The name of the redis cache. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String resourceGroupName, String name) { + public Observable deleteAsync(String resourceGroupName, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Deletes the patching schedule for redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -222,10 +254,10 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RedisPatchSchedulesResponseInner object wrapped in {@link ServiceResponse} if successful. + * @return the RedisPatchSchedulesResponseInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, name).toBlocking().single(); + public RedisPatchSchedulesResponseInner get(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -237,7 +269,23 @@ public ServiceResponse get(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the patching schedule for redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @return the observable to the RedisPatchSchedulesResponseInner object + */ + public Observable getAsync(String resourceGroupName, String name) { + return getWithServiceResponseAsync(resourceGroupName, name).map(new Func1, RedisPatchSchedulesResponseInner>() { + @Override + public RedisPatchSchedulesResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -247,7 +295,7 @@ public ServiceCall getAsync(String resourceGro * @param name The name of the redis cache. * @return the observable to the RedisPatchSchedulesResponseInner object */ - public Observable> getAsync(String resourceGroupName, String name) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java index ba1c04a35761..2582e709acfc 100644 --- a/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java +++ b/azure-mgmt-redis/src/main/java/com/microsoft/azure/management/redis/implementation/RedisInner.java @@ -132,10 +132,10 @@ interface RedisService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RedisResourceWithAccessKeyInner object wrapped in {@link ServiceResponse} if successful. + * @return the RedisResourceWithAccessKeyInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String name, RedisCreateOrUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(resourceGroupName, name, parameters).toBlocking().single(); + public RedisResourceWithAccessKeyInner createOrUpdate(String resourceGroupName, String name, RedisCreateOrUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().getBody(); } /** @@ -148,7 +148,7 @@ public ServiceResponse createOrUpdate(String re * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String name, RedisCreateOrUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); } /** @@ -159,7 +159,24 @@ public ServiceCall createOrUpdateAsync(String r * @param parameters Parameters supplied to the CreateOrUpdate redis operation. * @return the observable to the RedisResourceWithAccessKeyInner object */ - public Observable> createOrUpdateAsync(String resourceGroupName, String name, RedisCreateOrUpdateParametersInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String name, RedisCreateOrUpdateParametersInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, RedisResourceWithAccessKeyInner>() { + @Override + public RedisResourceWithAccessKeyInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create a redis cache, or replace (overwrite/recreate, with potential downtime) an existing cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param parameters Parameters supplied to the CreateOrUpdate redis operation. + * @return the observable to the RedisResourceWithAccessKeyInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String name, RedisCreateOrUpdateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -206,10 +223,9 @@ private ServiceResponse createOrUpdateDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse delete(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(resourceGroupName, name).toBlocking().single(); + public void delete(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -221,7 +237,23 @@ public ServiceResponse delete(String resourceGroupName, String name) throw * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Deletes a redis cache. This operation takes a while to complete. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String name) { + return deleteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -231,7 +263,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String name, fina * @param name The name of the redis cache. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String resourceGroupName, String name) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -273,10 +305,10 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RedisResourceInner object wrapped in {@link ServiceResponse} if successful. + * @return the RedisResourceInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, name).toBlocking().single(); + public RedisResourceInner get(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -288,7 +320,7 @@ public ServiceResponse get(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -298,7 +330,23 @@ public ServiceCall getAsync(String resourceGroupName, String * @param name The name of the redis cache. * @return the observable to the RedisResourceInner object */ - public Observable> getAsync(String resourceGroupName, String name) { + public Observable getAsync(String resourceGroupName, String name) { + return getWithServiceResponseAsync(resourceGroupName, name).map(new Func1, RedisResourceInner>() { + @Override + public RedisResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets a redis cache (resource description). + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @return the observable to the RedisResourceInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -339,17 +387,16 @@ private ServiceResponse getDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object if successful. */ - public ServiceResponse> listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList listByResourceGroup(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -375,15 +422,34 @@ public Observable>> call(String nextPag * Gets all redis caches in a resource group. * * @param resourceGroupName The name of the resource group. - * @return the observable to the List<RedisResourceInner> object + * @return the observable to the PagedList<RedisResourceInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all redis caches in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the PagedList<RedisResourceInner> object */ - public Observable>> listByResourceGroupAsync(final String resourceGroupName) { + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { return listByResourceGroupSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listByResourceGroupNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -392,7 +458,7 @@ public Observable>> call(ServiceRespons * Gets all redis caches in a resource group. * ServiceResponse> * @param resourceGroupName The name of the resource group. - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -431,17 +497,16 @@ private ServiceResponse> listByResourceGroupDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -465,15 +530,33 @@ public Observable>> call(String nextPag /** * Gets all redis caches in the specified subscription. * - * @return the observable to the List<RedisResourceInner> object + * @return the observable to the PagedList<RedisResourceInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all redis caches in the specified subscription. + * + * @return the observable to the PagedList<RedisResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -481,7 +564,7 @@ public Observable>> call(ServiceRespons /** * Gets all redis caches in the specified subscription. * - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -519,10 +602,10 @@ private ServiceResponse> listDelegate(Response listKeys(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listKeysAsync(resourceGroupName, name).toBlocking().single(); + public RedisListKeysResultInner listKeys(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listKeysWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -534,7 +617,23 @@ public ServiceResponse listKeys(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall listKeysAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listKeysAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listKeysWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrieve a redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @return the observable to the RedisListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String name) { + return listKeysWithServiceResponseAsync(resourceGroupName, name).map(new Func1, RedisListKeysResultInner>() { + @Override + public RedisListKeysResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -544,7 +643,7 @@ public ServiceCall listKeysAsync(String resourceGroupN * @param name The name of the redis cache. * @return the observable to the RedisListKeysResultInner object */ - public Observable> listKeysAsync(String resourceGroupName, String name) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -587,10 +686,10 @@ private ServiceResponse listKeysDelegate(Response regenerateKey(String resourceGroupName, String name, RedisKeyType keyType) throws CloudException, IOException, IllegalArgumentException { - return regenerateKeyAsync(resourceGroupName, name, keyType).toBlocking().single(); + public RedisListKeysResultInner regenerateKey(String resourceGroupName, String name, RedisKeyType keyType) throws CloudException, IOException, IllegalArgumentException { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, name, keyType).toBlocking().single().getBody(); } /** @@ -603,7 +702,7 @@ public ServiceResponse regenerateKey(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall regenerateKeyAsync(String resourceGroupName, String name, RedisKeyType keyType, final ServiceCallback serviceCallback) { - return ServiceCall.create(regenerateKeyAsync(resourceGroupName, name, keyType), serviceCallback); + return ServiceCall.create(regenerateKeyWithServiceResponseAsync(resourceGroupName, name, keyType), serviceCallback); } /** @@ -614,7 +713,24 @@ public ServiceCall regenerateKeyAsync(String resourceG * @param keyType Which redis access key to reset. Possible values include: 'Primary', 'Secondary' * @return the observable to the RedisListKeysResultInner object */ - public Observable> regenerateKeyAsync(String resourceGroupName, String name, RedisKeyType keyType) { + public Observable regenerateKeyAsync(String resourceGroupName, String name, RedisKeyType keyType) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, name, keyType).map(new Func1, RedisListKeysResultInner>() { + @Override + public RedisListKeysResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Regenerate redis cache's access keys. This operation requires write permission to the cache resource. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param keyType Which redis access key to reset. Possible values include: 'Primary', 'Secondary' + * @return the observable to the RedisListKeysResultInner object + */ + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String name, RedisKeyType keyType) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -662,10 +778,9 @@ private ServiceResponse regenerateKeyDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse forceReboot(String resourceGroupName, String name, RedisRebootParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return forceRebootAsync(resourceGroupName, name, parameters).toBlocking().single(); + public void forceReboot(String resourceGroupName, String name, RedisRebootParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + forceRebootWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().getBody(); } /** @@ -678,7 +793,24 @@ public ServiceResponse forceReboot(String resourceGroupName, String name, * @return the {@link ServiceCall} object */ public ServiceCall forceRebootAsync(String resourceGroupName, String name, RedisRebootParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(forceRebootAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(forceRebootWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Reboot specified redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param parameters Specifies which redis node(s) to reboot. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable forceRebootAsync(String resourceGroupName, String name, RedisRebootParametersInner parameters) { + return forceRebootWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -689,7 +821,7 @@ public ServiceCall forceRebootAsync(String resourceGroupName, String name, * @param parameters Specifies which redis node(s) to reboot. * @return the {@link ServiceResponse} object if successful. */ - public Observable> forceRebootAsync(String resourceGroupName, String name, RedisRebootParametersInner parameters) { + public Observable> forceRebootWithServiceResponseAsync(String resourceGroupName, String name, RedisRebootParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -737,10 +869,9 @@ private ServiceResponse forceRebootDelegate(Response respons * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse importMethod(String resourceGroupName, String name, ImportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return importMethodAsync(resourceGroupName, name, parameters).toBlocking().last(); + public void importMethod(String resourceGroupName, String name, ImportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + importMethodWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().getBody(); } /** @@ -753,7 +884,24 @@ public ServiceResponse importMethod(String resourceGroupName, String name, * @return the {@link ServiceCall} object */ public ServiceCall importMethodAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(importMethodAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(importMethodWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Import data into redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param parameters Parameters for redis import operation. + * @return the observable for the request + */ + public Observable importMethodAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters) { + return importMethodWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -764,7 +912,7 @@ public ServiceCall importMethodAsync(String resourceGroupName, String name * @param parameters Parameters for redis import operation. * @return the observable for the request */ - public Observable> importMethodAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters) { + public Observable> importMethodWithServiceResponseAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -794,10 +942,9 @@ public Observable> importMethodAsync(String resourceGroupN * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginImport(String resourceGroupName, String name, ImportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginImportAsync(resourceGroupName, name, parameters).toBlocking().single(); + public void beginImport(String resourceGroupName, String name, ImportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + beginImportWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().getBody(); } /** @@ -810,7 +957,7 @@ public ServiceResponse beginImport(String resourceGroupName, String name, * @return the {@link ServiceCall} object */ public ServiceCall beginImportAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginImportAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(beginImportWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); } /** @@ -821,7 +968,24 @@ public ServiceCall beginImportAsync(String resourceGroupName, String name, * @param parameters Parameters for redis import operation. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginImportAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters) { + public Observable beginImportAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters) { + return beginImportWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Import data into redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param parameters Parameters for redis import operation. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginImportWithServiceResponseAsync(String resourceGroupName, String name, ImportRDBParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -868,10 +1032,9 @@ private ServiceResponse beginImportDelegate(Response respons * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse export(String resourceGroupName, String name, ExportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return exportAsync(resourceGroupName, name, parameters).toBlocking().last(); + public void export(String resourceGroupName, String name, ExportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + exportWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().getBody(); } /** @@ -884,7 +1047,24 @@ public ServiceResponse export(String resourceGroupName, String name, Expor * @return the {@link ServiceCall} object */ public ServiceCall exportAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(exportAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(exportWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); + } + + /** + * Import data into redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param parameters Parameters for redis export operation. + * @return the observable for the request + */ + public Observable exportAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters) { + return exportWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -895,7 +1075,7 @@ public ServiceCall exportAsync(String resourceGroupName, String name, Expo * @param parameters Parameters for redis export operation. * @return the observable for the request */ - public Observable> exportAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters) { + public Observable> exportWithServiceResponseAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -925,10 +1105,9 @@ public Observable> exportAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginExport(String resourceGroupName, String name, ExportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginExportAsync(resourceGroupName, name, parameters).toBlocking().single(); + public void beginExport(String resourceGroupName, String name, ExportRDBParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + beginExportWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().single().getBody(); } /** @@ -941,7 +1120,7 @@ public ServiceResponse beginExport(String resourceGroupName, String name, * @return the {@link ServiceCall} object */ public ServiceCall beginExportAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginExportAsync(resourceGroupName, name, parameters), serviceCallback); + return ServiceCall.create(beginExportWithServiceResponseAsync(resourceGroupName, name, parameters), serviceCallback); } /** @@ -952,7 +1131,24 @@ public ServiceCall beginExportAsync(String resourceGroupName, String name, * @param parameters Parameters for redis export operation. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginExportAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters) { + public Observable beginExportAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters) { + return beginExportWithServiceResponseAsync(resourceGroupName, name, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Import data into redis cache. + * + * @param resourceGroupName The name of the resource group. + * @param name The name of the redis cache. + * @param parameters Parameters for redis export operation. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginExportWithServiceResponseAsync(String resourceGroupName, String name, ExportRDBParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -996,17 +1192,16 @@ private ServiceResponse beginExportDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object if successful. */ - public ServiceResponse> listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listByResourceGroupNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1033,15 +1228,34 @@ public Observable>> call(String nextPag * Gets all redis caches in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<RedisResourceInner> object + * @return the observable to the PagedList<RedisResourceInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all redis caches in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<RedisResourceInner> object */ - public Observable>> listByResourceGroupNextAsync(final String nextPageLink) { + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { return listByResourceGroupNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listByResourceGroupNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1050,7 +1264,7 @@ public Observable>> call(ServiceRespons * Gets all redis caches in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1084,17 +1298,16 @@ private ServiceResponse> listByResourceGroupNextDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1121,15 +1334,34 @@ public Observable>> call(String nextPag * Gets all redis caches in the specified subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<RedisResourceInner> object + * @return the observable to the PagedList<RedisResourceInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all redis caches in the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<RedisResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1138,7 +1370,7 @@ public Observable>> call(ServiceRespons * Gets all redis caches in the specified subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<RedisResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/implementation/CreatableImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/implementation/CreatableImpl.java index d265afe86676..f216e36b5c57 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/implementation/CreatableImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/model/implementation/CreatableImpl.java @@ -112,11 +112,11 @@ public FluentModelT createResource() throws Exception { return this.createResourceAsync().toBlocking().last(); } - protected Func1, FluentModelT> innerToFluentMap(final FluentModelImplT fluentModelImplT) { - return new Func1, FluentModelT>() { + protected Func1 innerToFluentMap(final FluentModelImplT fluentModelImplT) { + return new Func1() { @Override - public FluentModelT call(ServiceResponse innerModelT) { - fluentModelImplT.setInner(innerModelT.getBody()); + public FluentModelT call(InnerModelT innerModelT) { + fluentModelImplT.setInner(innerModelT); return (FluentModelT) fluentModelImplT; } }; diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/Utils.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/Utils.java index 2717ee32fddd..474f89834c5e 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/Utils.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/fluentcore/utils/Utils.java @@ -6,10 +6,6 @@ package com.microsoft.azure.management.resources.fluentcore.utils; -import com.microsoft.azure.management.resources.fluentcore.model.implementation.CreatableImpl; -import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceResponse; - /** * Defines a few utilities. */ @@ -27,59 +23,6 @@ public static boolean toPrimitiveBoolean(Boolean value) { return value; } - /** - * Creates a void callback from a callback that returns another type of - * instance. This is useful for internal async handoffs where returned - * resource is stored elsewhere. - * - * @param model the fluent model - * @param callback the callback to return the fluent model - * @param the fluent model type - * @return the void callback - */ - public static ServiceCallback toVoidCallback(final T model, final ServiceCallback callback) { - return new ServiceCallback() { - @Override - public void failure(Throwable t) { - callback.failure(t); - } - - @Override - public void success(ServiceResponse result) { - callback.success(new ServiceResponse<>(model, result.getResponse())); - } - }; - } - - /** - * Creates a callback returning the inner resource from a fluent model - * and a void callback, and set the inner on the fluent model. - * - * @param modelImpl the implementation instance of the fluent resource - * @param callback the void callback - * @param the inner resource type - * @param the fluent resource type - * @param the fluent model base type that all fluent models in the same task group derive from - * @param the implementation for the fluent resource type - * - * @return new callback from the void callback - */ - public static > ServiceCallback - fromVoidCallback(final FluentImplT modelImpl, final ServiceCallback callback) { - return new ServiceCallback() { - @Override - public void failure(Throwable t) { - callback.failure(t); - } - - @Override - public void success(ServiceResponse result) { - modelImpl.setInner(result.getBody()); - callback.success(new ServiceResponse(result.getHeadResponse())); - } - }; - } - private Utils() { } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentImpl.java index 95d5abd26929..bff13a8a9485 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentImpl.java @@ -174,7 +174,7 @@ public void cancel() throws CloudException, IOException { @Override public DeploymentExportResult exportTemplate() throws CloudException, IOException { - DeploymentExportResultInner inner = client.exportTemplate(resourceGroupName(), name()).getBody(); + DeploymentExportResultInner inner = client.exportTemplate(resourceGroupName(), name()); return new DeploymentExportResultImpl(inner); } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationImpl.java index cae695b63615..4ae2346c25d6 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationImpl.java @@ -78,7 +78,7 @@ public TargetResource targetResource() { @Override public DeploymentOperation refresh() throws Exception { - this.setInner(client.get(resourceGroupName, deploymentName, operationId()).getBody()); + this.setInner(client.get(resourceGroupName, deploymentName, operationId())); return this; } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java index de76b5e66554..73f3185ceaec 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsImpl.java @@ -31,12 +31,12 @@ final class DeploymentOperationsImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(client.list(deployment.resourceGroupName(), deployment.name()).getBody()); + return wrapList(client.list(deployment.resourceGroupName(), deployment.name())); } @Override public DeploymentOperation getById(String operationId) throws CloudException, IllegalArgumentException, IOException { - return wrapModel(client.get(deployment.resourceGroupName(), deployment.name(), operationId).getBody()); + return wrapModel(client.get(deployment.resourceGroupName(), deployment.name(), operationId)); } @Override diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsInner.java index e182c9ba8eca..e19d40052394 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentOperationsInner.java @@ -81,10 +81,10 @@ interface DeploymentOperationsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentOperationInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentOperationInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String deploymentName, String operationId) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, deploymentName, operationId).toBlocking().single(); + public DeploymentOperationInner get(String resourceGroupName, String deploymentName, String operationId) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, deploymentName, operationId).toBlocking().single().getBody(); } /** @@ -97,7 +97,7 @@ public ServiceResponse get(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String deploymentName, String operationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, deploymentName, operationId), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, deploymentName, operationId), serviceCallback); } /** @@ -108,7 +108,24 @@ public ServiceCall getAsync(String resourceGroupName, * @param operationId Operation Id. * @return the observable to the DeploymentOperationInner object */ - public Observable> getAsync(String resourceGroupName, String deploymentName, String operationId) { + public Observable getAsync(String resourceGroupName, String deploymentName, String operationId) { + return getWithServiceResponseAsync(resourceGroupName, deploymentName, operationId).map(new Func1, DeploymentOperationInner>() { + @Override + public DeploymentOperationInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param operationId Operation Id. + * @return the observable to the DeploymentOperationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String deploymentName, String operationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -153,17 +170,16 @@ private ServiceResponse getDelegate(Response> list(final String resourceGroupName, final String deploymentName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String deploymentName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, deploymentName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -191,15 +207,35 @@ public Observable>> call(String n * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @return the observable to the List<DeploymentOperationInner> object + * @return the observable to the PagedList<DeploymentOperationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String deploymentName) { + return listWithServiceResponseAsync(resourceGroupName, deploymentName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @return the observable to the PagedList<DeploymentOperationInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String deploymentName) { + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String deploymentName) { return listSinglePageAsync(resourceGroupName, deploymentName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -209,7 +245,7 @@ public Observable>> call(ServiceR * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. - * @return the List<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String deploymentName) { if (resourceGroupName == null) { @@ -248,17 +284,16 @@ public Observable>> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentOperationInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String deploymentName, final Integer top) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String deploymentName, final Integer top) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, deploymentName, top).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -288,15 +323,36 @@ public Observable>> call(String n * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param deploymentName The name of the deployment. * @param top Query parameters. - * @return the observable to the List<DeploymentOperationInner> object + * @return the observable to the PagedList<DeploymentOperationInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String deploymentName, final Integer top) { + public Observable> listAsync(final String resourceGroupName, final String deploymentName, final Integer top) { + return listWithServiceResponseAsync(resourceGroupName, deploymentName, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of deployments operations. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param top Query parameters. + * @return the observable to the PagedList<DeploymentOperationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String deploymentName, final Integer top) { return listSinglePageAsync(resourceGroupName, deploymentName, top) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -307,7 +363,7 @@ public Observable>> call(ServiceR ServiceResponse> * @param resourceGroupName The name of the resource group. The name is case insensitive. ServiceResponse> * @param deploymentName The name of the deployment. ServiceResponse> * @param top Query parameters. - * @return the List<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String deploymentName, final Integer top) { if (resourceGroupName == null) { @@ -350,17 +406,16 @@ private ServiceResponse> listDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentOperationInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -387,15 +442,34 @@ public Observable>> call(String n * Gets a list of deployments operations. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeploymentOperationInner> object + * @return the observable to the PagedList<DeploymentOperationInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of deployments operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeploymentOperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -404,7 +478,7 @@ public Observable>> call(ServiceR * Gets a list of deployments operations. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentOperationInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java index de4f8c9ee3d0..4214b34988e8 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsImpl.java @@ -8,12 +8,12 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.resources.Deployment; import com.microsoft.azure.management.resources.Deployments; +import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.models.implementation.GroupPagedList; import com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter; -import com.microsoft.azure.management.resources.Deployment; -import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.rest.RestException; import java.io.IOException; @@ -49,21 +49,21 @@ public PagedList list() throws CloudException, IOException { return new GroupPagedList(this.resourceManager.resourceGroups().list()) { @Override public List listNextGroup(String resourceGroupName) throws RestException, IOException { - return converter.convert(client.list(resourceGroupName).getBody()); + return converter.convert(client.list(resourceGroupName)); } }; } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return converter.convert(client.list(groupName).getBody()); + return converter.convert(client.list(groupName)); } @Override public Deployment getByName(String name) throws IOException, CloudException { for (ResourceGroup group : this.resourceManager.resourceGroups().list()) { try { - DeploymentExtendedInner inner = client.get(group.name(), name).getBody(); + DeploymentExtendedInner inner = client.get(group.name(), name); if (inner != null) { return createFluentModel(inner); } @@ -76,7 +76,7 @@ public Deployment getByName(String name) throws IOException, CloudException { @Override public Deployment getByGroup(String groupName, String name) throws IOException, CloudException { - return createFluentModel(client.get(groupName, name).getBody()); + return createFluentModel(client.get(groupName, name)); } @Override @@ -96,7 +96,7 @@ public DeploymentImpl define(String name) { @Override public boolean checkExistence(String resourceGroupName, String deploymentName) throws IOException, CloudException { - return client.checkExistence(resourceGroupName, deploymentName).getBody(); + return client.checkExistence(resourceGroupName, deploymentName); } protected DeploymentImpl createFluentModel(String name) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsInner.java index 53da83577ece..e2e5578be901 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/DeploymentsInner.java @@ -119,10 +119,9 @@ interface DeploymentsService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse delete(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName, deploymentName).toBlocking().last(); + public void delete(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().last().getBody(); } /** @@ -134,7 +133,7 @@ public ServiceResponse delete(String resourceGroupName, String deploymentN * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String deploymentName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, deploymentName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, deploymentName), serviceCallback); } /** @@ -144,7 +143,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String deployment * @param deploymentName The name of the deployment to be deleted. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName, String deploymentName) { + public Observable deleteAsync(String resourceGroupName, String deploymentName) { + return deleteWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to be deleted. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String deploymentName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -169,10 +184,9 @@ public Observable> deleteAsync(String resourceGroupName, S * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName, deploymentName).toBlocking().single(); + public void beginDelete(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().getBody(); } /** @@ -184,7 +198,23 @@ public ServiceResponse beginDelete(String resourceGroupName, String deploy * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, String deploymentName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName, deploymentName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName, deploymentName), serviceCallback); + } + + /** + * Delete deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment to be deleted. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String deploymentName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -194,7 +224,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, String deplo * @param deploymentName The name of the deployment to be deleted. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName, String deploymentName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String deploymentName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -236,10 +266,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the boolean object wrapped in {@link ServiceResponse} if successful. + * @return the boolean object if successful. */ - public ServiceResponse checkExistence(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { - return checkExistenceAsync(resourceGroupName, deploymentName).toBlocking().single(); + public boolean checkExistence(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { + return checkExistenceWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().getBody(); } /** @@ -251,7 +281,23 @@ public ServiceResponse checkExistence(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall checkExistenceAsync(String resourceGroupName, String deploymentName, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkExistenceAsync(resourceGroupName, deploymentName), serviceCallback); + return ServiceCall.create(checkExistenceWithServiceResponseAsync(resourceGroupName, deploymentName), serviceCallback); + } + + /** + * Checks whether deployment exists. + * + * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @return the observable to the boolean object + */ + public Observable checkExistenceAsync(String resourceGroupName, String deploymentName) { + return checkExistenceWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -261,7 +307,7 @@ public ServiceCall checkExistenceAsync(String resourceGroupName, String * @param deploymentName The name of the deployment. * @return the observable to the boolean object */ - public Observable> checkExistenceAsync(String resourceGroupName, String deploymentName) { + public Observable> checkExistenceWithServiceResponseAsync(String resourceGroupName, String deploymentName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -306,10 +352,10 @@ private ServiceResponse checkExistenceDelegate(Response response) * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the DeploymentExtendedInner object wrapped in ServiceResponse if successful. + * @return the DeploymentExtendedInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateAsync(resourceGroupName, deploymentName, parameters).toBlocking().last(); + public DeploymentExtendedInner createOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters).toBlocking().last().getBody(); } /** @@ -322,7 +368,7 @@ public ServiceResponse createOrUpdate(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, deploymentName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters), serviceCallback); } /** @@ -333,7 +379,24 @@ public ServiceCall createOrUpdateAsync(String resourceG * @param parameters Additional parameters supplied to the operation. * @return the observable for the request */ - public Observable> createOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters).map(new Func1, DeploymentExtendedInner>() { + @Override + public DeploymentExtendedInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create a named template deployment using a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -363,10 +426,10 @@ public Observable> createOrUpdateAsync( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentExtendedInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentExtendedInner object if successful. */ - public ServiceResponse beginCreateOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters).toBlocking().single(); + public DeploymentExtendedInner beginCreateOrUpdate(String resourceGroupName, String deploymentName, DeploymentInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters).toBlocking().single().getBody(); } /** @@ -379,7 +442,7 @@ public ServiceResponse beginCreateOrUpdate(String resou * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateAsync(resourceGroupName, deploymentName, parameters), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters), serviceCallback); } /** @@ -390,7 +453,24 @@ public ServiceCall beginCreateOrUpdateAsync(String reso * @param parameters Additional parameters supplied to the operation. * @return the observable to the DeploymentExtendedInner object */ - public Observable> beginCreateOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters).map(new Func1, DeploymentExtendedInner>() { + @Override + public DeploymentExtendedInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create a named template deployment using a template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Additional parameters supplied to the operation. + * @return the observable to the DeploymentExtendedInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -437,10 +517,10 @@ private ServiceResponse beginCreateOrUpdateDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentExtendedInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentExtendedInner object if successful. */ - public ServiceResponse get(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, deploymentName).toBlocking().single(); + public DeploymentExtendedInner get(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().getBody(); } /** @@ -452,7 +532,7 @@ public ServiceResponse get(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String deploymentName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, deploymentName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, deploymentName), serviceCallback); } /** @@ -462,7 +542,23 @@ public ServiceCall getAsync(String resourceGroupName, S * @param deploymentName The name of the deployment. * @return the observable to the DeploymentExtendedInner object */ - public Observable> getAsync(String resourceGroupName, String deploymentName) { + public Observable getAsync(String resourceGroupName, String deploymentName) { + return getWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1, DeploymentExtendedInner>() { + @Override + public DeploymentExtendedInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get a deployment. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @return the observable to the DeploymentExtendedInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String deploymentName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -504,10 +600,9 @@ private ServiceResponse getDelegate(Response cancel(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { - return cancelAsync(resourceGroupName, deploymentName).toBlocking().single(); + public void cancel(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { + cancelWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().getBody(); } /** @@ -519,7 +614,23 @@ public ServiceResponse cancel(String resourceGroupName, String deploymentN * @return the {@link ServiceCall} object */ public ServiceCall cancelAsync(String resourceGroupName, String deploymentName, final ServiceCallback serviceCallback) { - return ServiceCall.create(cancelAsync(resourceGroupName, deploymentName), serviceCallback); + return ServiceCall.create(cancelWithServiceResponseAsync(resourceGroupName, deploymentName), serviceCallback); + } + + /** + * Cancel a currently running template deployment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable cancelAsync(String resourceGroupName, String deploymentName) { + return cancelWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -529,7 +640,7 @@ public ServiceCall cancelAsync(String resourceGroupName, String deployment * @param deploymentName The name of the deployment. * @return the {@link ServiceResponse} object if successful. */ - public Observable> cancelAsync(String resourceGroupName, String deploymentName) { + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String deploymentName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -571,10 +682,10 @@ private ServiceResponse cancelDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentValidateResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentValidateResultInner object if successful. */ - public ServiceResponse validate(String resourceGroupName, String deploymentName, DeploymentInner parameters) throws CloudException, IOException, IllegalArgumentException { - return validateAsync(resourceGroupName, deploymentName, parameters).toBlocking().single(); + public DeploymentValidateResultInner validate(String resourceGroupName, String deploymentName, DeploymentInner parameters) throws CloudException, IOException, IllegalArgumentException { + return validateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters).toBlocking().single().getBody(); } /** @@ -587,7 +698,24 @@ public ServiceResponse validate(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall validateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(validateAsync(resourceGroupName, deploymentName, parameters), serviceCallback); + return ServiceCall.create(validateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters), serviceCallback); + } + + /** + * Validate a deployment template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @param parameters Deployment to validate. + * @return the observable to the DeploymentValidateResultInner object + */ + public Observable validateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + return validateWithServiceResponseAsync(resourceGroupName, deploymentName, parameters).map(new Func1, DeploymentValidateResultInner>() { + @Override + public DeploymentValidateResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -598,7 +726,7 @@ public ServiceCall validateAsync(String resourceG * @param parameters Deployment to validate. * @return the observable to the DeploymentValidateResultInner object */ - public Observable> validateAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { + public Observable> validateWithServiceResponseAsync(String resourceGroupName, String deploymentName, DeploymentInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -645,10 +773,10 @@ private ServiceResponse validateDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentExportResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentExportResultInner object if successful. */ - public ServiceResponse exportTemplate(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { - return exportTemplateAsync(resourceGroupName, deploymentName).toBlocking().single(); + public DeploymentExportResultInner exportTemplate(String resourceGroupName, String deploymentName) throws CloudException, IOException, IllegalArgumentException { + return exportTemplateWithServiceResponseAsync(resourceGroupName, deploymentName).toBlocking().single().getBody(); } /** @@ -660,7 +788,23 @@ public ServiceResponse exportTemplate(String resour * @return the {@link ServiceCall} object */ public ServiceCall exportTemplateAsync(String resourceGroupName, String deploymentName, final ServiceCallback serviceCallback) { - return ServiceCall.create(exportTemplateAsync(resourceGroupName, deploymentName), serviceCallback); + return ServiceCall.create(exportTemplateWithServiceResponseAsync(resourceGroupName, deploymentName), serviceCallback); + } + + /** + * Exports a deployment template. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param deploymentName The name of the deployment. + * @return the observable to the DeploymentExportResultInner object + */ + public Observable exportTemplateAsync(String resourceGroupName, String deploymentName) { + return exportTemplateWithServiceResponseAsync(resourceGroupName, deploymentName).map(new Func1, DeploymentExportResultInner>() { + @Override + public DeploymentExportResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -670,7 +814,7 @@ public ServiceCall exportTemplateAsync(String resou * @param deploymentName The name of the deployment. * @return the observable to the DeploymentExportResultInner object */ - public Observable> exportTemplateAsync(String resourceGroupName, String deploymentName) { + public Observable> exportTemplateWithServiceResponseAsync(String resourceGroupName, String deploymentName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -711,17 +855,16 @@ private ServiceResponse exportTemplateDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentExtendedInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -747,15 +890,34 @@ public Observable>> call(String ne * Get a list of deployments. * * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. - * @return the observable to the List<DeploymentExtendedInner> object + * @return the observable to the PagedList<DeploymentExtendedInner> object */ - public Observable>> listAsync(final String resourceGroupName) { + public Observable> listAsync(final String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get a list of deployments. + * + * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. + * @return the observable to the PagedList<DeploymentExtendedInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName) { return listSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -764,7 +926,7 @@ public Observable>> call(ServiceRe * Get a list of deployments. * * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. - * @return the List<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -801,17 +963,16 @@ public Observable>> call(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentExtendedInner> object if successful. */ - public ServiceResponse> list(final String resourceGroupName, final String filter, final Integer top) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceGroupName, final String filter, final Integer top) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceGroupName, filter, top).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -841,15 +1002,36 @@ public Observable>> call(String ne * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. * @param filter The filter to apply on the operation. * @param top Query parameters. If null is passed returns all deployments. - * @return the observable to the List<DeploymentExtendedInner> object + * @return the observable to the PagedList<DeploymentExtendedInner> object */ - public Observable>> listAsync(final String resourceGroupName, final String filter, final Integer top) { + public Observable> listAsync(final String resourceGroupName, final String filter, final Integer top) { + return listWithServiceResponseAsync(resourceGroupName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get a list of deployments. + * + * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. + * @param filter The filter to apply on the operation. + * @param top Query parameters. If null is passed returns all deployments. + * @return the observable to the PagedList<DeploymentExtendedInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String filter, final Integer top) { return listSinglePageAsync(resourceGroupName, filter, top) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -860,7 +1042,7 @@ public Observable>> call(ServiceRe ServiceResponse> * @param resourceGroupName The name of the resource group to filter by. The name is case insensitive. ServiceResponse> * @param filter The filter to apply on the operation. ServiceResponse> * @param top Query parameters. If null is passed returns all deployments. - * @return the List<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceGroupName, final String filter, final Integer top) { if (resourceGroupName == null) { @@ -900,17 +1082,16 @@ private ServiceResponse> listDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentExtendedInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -937,15 +1118,34 @@ public Observable>> call(String ne * Get a list of deployments. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeploymentExtendedInner> object + * @return the observable to the PagedList<DeploymentExtendedInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get a list of deployments. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeploymentExtendedInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -954,7 +1154,7 @@ public Observable>> call(ServiceRe * Get a list of deployments. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentExtendedInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java index de966ce3eed0..40be00ce6c41 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesImpl.java @@ -27,7 +27,7 @@ final class FeaturesImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(client.listAll().getBody()); + return wrapList(client.listAll()); } @Override diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInResourceProviderImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInResourceProviderImpl.java index 16d6d8191826..325cd951c4ab 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInResourceProviderImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInResourceProviderImpl.java @@ -35,16 +35,16 @@ public Feature typeConvert(FeatureResultInner tenantInner) { return new FeatureImpl(tenantInner); } }; - return converter.convert(client.list(resourceProviderNamespace).getBody()); + return converter.convert(client.list(resourceProviderNamespace)); } @Override public Feature register(String featureName) throws IOException, CloudException { - return new FeatureImpl(client.register(resourceProviderNamespace, featureName).getBody()); + return new FeatureImpl(client.register(resourceProviderNamespace, featureName)); } @Override public Feature getByName(String name) throws CloudException, IOException { - return new FeatureImpl(client.get(resourceProviderNamespace, name).getBody()); + return new FeatureImpl(client.get(resourceProviderNamespace, name)); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java index 33d9d4de022a..275cc84dad32 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java @@ -91,17 +91,16 @@ interface FeaturesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<FeatureResultInner> object if successful. */ - public ServiceResponse> listAll() throws CloudException, IOException, IllegalArgumentException { + public PagedList listAll() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -125,15 +124,33 @@ public Observable>> call(String nextPag /** * Gets a list of previewed features for all the providers in the current subscription. * - * @return the observable to the List<FeatureResultInner> object + * @return the observable to the PagedList<FeatureResultInner> object */ - public Observable>> listAllAsync() { + public Observable> listAllAsync() { + return listAllWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of previewed features for all the providers in the current subscription. + * + * @return the observable to the PagedList<FeatureResultInner> object + */ + public Observable>> listAllWithServiceResponseAsync() { return listAllSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -141,7 +158,7 @@ public Observable>> call(ServiceRespons /** * Gets a list of previewed features for all the providers in the current subscription. * - * @return the List<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -178,17 +195,16 @@ private ServiceResponse> listAllDelegate(Response> list(final String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(resourceProviderNamespace).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -214,15 +230,34 @@ public Observable>> call(String nextPag * Gets a list of previewed features of a resource provider. * * @param resourceProviderNamespace The namespace of the resource provider. - * @return the observable to the List<FeatureResultInner> object + * @return the observable to the PagedList<FeatureResultInner> object */ - public Observable>> listAsync(final String resourceProviderNamespace) { + public Observable> listAsync(final String resourceProviderNamespace) { + return listWithServiceResponseAsync(resourceProviderNamespace) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of previewed features of a resource provider. + * + * @param resourceProviderNamespace The namespace of the resource provider. + * @return the observable to the PagedList<FeatureResultInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceProviderNamespace) { return listSinglePageAsync(resourceProviderNamespace) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -231,7 +266,7 @@ public Observable>> call(ServiceRespons * Gets a list of previewed features of a resource provider. * ServiceResponse> * @param resourceProviderNamespace The namespace of the resource provider. - * @return the List<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String resourceProviderNamespace) { if (resourceProviderNamespace == null) { @@ -272,10 +307,10 @@ private ServiceResponse> listDelegate(Response get(String resourceProviderNamespace, String featureName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceProviderNamespace, featureName).toBlocking().single(); + public FeatureResultInner get(String resourceProviderNamespace, String featureName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceProviderNamespace, featureName).toBlocking().single().getBody(); } /** @@ -287,7 +322,7 @@ public ServiceResponse get(String resourceProviderNamespace, * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceProviderNamespace, String featureName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceProviderNamespace, featureName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceProviderNamespace, featureName), serviceCallback); } /** @@ -297,7 +332,23 @@ public ServiceCall getAsync(String resourceProviderNamespace * @param featureName Previewed feature name in the resource provider. * @return the observable to the FeatureResultInner object */ - public Observable> getAsync(String resourceProviderNamespace, String featureName) { + public Observable getAsync(String resourceProviderNamespace, String featureName) { + return getWithServiceResponseAsync(resourceProviderNamespace, featureName).map(new Func1, FeatureResultInner>() { + @Override + public FeatureResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get all features under the subscription. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param featureName Previewed feature name in the resource provider. + * @return the observable to the FeatureResultInner object + */ + public Observable> getWithServiceResponseAsync(String resourceProviderNamespace, String featureName) { if (resourceProviderNamespace == null) { throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); } @@ -339,10 +390,10 @@ private ServiceResponse getDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the FeatureResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the FeatureResultInner object if successful. */ - public ServiceResponse register(String resourceProviderNamespace, String featureName) throws CloudException, IOException, IllegalArgumentException { - return registerAsync(resourceProviderNamespace, featureName).toBlocking().single(); + public FeatureResultInner register(String resourceProviderNamespace, String featureName) throws CloudException, IOException, IllegalArgumentException { + return registerWithServiceResponseAsync(resourceProviderNamespace, featureName).toBlocking().single().getBody(); } /** @@ -354,7 +405,7 @@ public ServiceResponse register(String resourceProviderNames * @return the {@link ServiceCall} object */ public ServiceCall registerAsync(String resourceProviderNamespace, String featureName, final ServiceCallback serviceCallback) { - return ServiceCall.create(registerAsync(resourceProviderNamespace, featureName), serviceCallback); + return ServiceCall.create(registerWithServiceResponseAsync(resourceProviderNamespace, featureName), serviceCallback); } /** @@ -364,7 +415,23 @@ public ServiceCall registerAsync(String resourceProviderName * @param featureName Previewed feature name in the resource provider. * @return the observable to the FeatureResultInner object */ - public Observable> registerAsync(String resourceProviderNamespace, String featureName) { + public Observable registerAsync(String resourceProviderNamespace, String featureName) { + return registerWithServiceResponseAsync(resourceProviderNamespace, featureName).map(new Func1, FeatureResultInner>() { + @Override + public FeatureResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Registers for a previewed feature of a resource provider. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param featureName Previewed feature name in the resource provider. + * @return the observable to the FeatureResultInner object + */ + public Observable> registerWithServiceResponseAsync(String resourceProviderNamespace, String featureName) { if (resourceProviderNamespace == null) { throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); } @@ -405,17 +472,16 @@ private ServiceResponse registerDelegate(Response> listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listAllNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listAllNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listAllNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -442,15 +508,34 @@ public Observable>> call(String nextPag * Gets a list of previewed features for all the providers in the current subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<FeatureResultInner> object + * @return the observable to the PagedList<FeatureResultInner> object + */ + public Observable> listAllNextAsync(final String nextPageLink) { + return listAllNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of previewed features for all the providers in the current subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<FeatureResultInner> object */ - public Observable>> listAllNextAsync(final String nextPageLink) { + public Observable>> listAllNextWithServiceResponseAsync(final String nextPageLink) { return listAllNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listAllNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listAllNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -459,7 +544,7 @@ public Observable>> call(ServiceRespons * Gets a list of previewed features for all the providers in the current subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listAllNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -493,17 +578,16 @@ private ServiceResponse> listAllNextDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<FeatureResultInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -530,15 +614,34 @@ public Observable>> call(String nextPag * Gets a list of previewed features of a resource provider. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<FeatureResultInner> object + * @return the observable to the PagedList<FeatureResultInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of previewed features of a resource provider. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<FeatureResultInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -547,7 +650,7 @@ public Observable>> call(ServiceRespons * Gets a list of previewed features of a resource provider. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<FeatureResultInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java index cc9f409d1efe..d683cb6c4443 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/GenericResourcesImpl.java @@ -8,11 +8,11 @@ import com.microsoft.azure.CloudException; import com.microsoft.azure.PagedList; +import com.microsoft.azure.management.resources.GenericResource; import com.microsoft.azure.management.resources.GenericResources; import com.microsoft.azure.management.resources.ResourceGroup; import com.microsoft.azure.management.resources.fluentcore.arm.ResourceUtils; import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.GroupableResourcesImpl; -import com.microsoft.azure.management.resources.GenericResource; import java.io.IOException; import java.util.List; @@ -38,7 +38,7 @@ final class GenericResourcesImpl @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.serviceClient.resourceGroups().listResources(groupName).getBody()); + return wrapList(this.serviceClient.resourceGroups().listResources(groupName)); } @Override @@ -59,7 +59,7 @@ public boolean checkExistence(String resourceGroupName, String resourceProviderN parentResourcePath, resourceType, resourceName, - apiVersion).getBody(); + apiVersion); } @Override @@ -109,7 +109,7 @@ public GenericResource get( parentResourcePath, resourceType, resourceName, - apiVersion).getBody(); + apiVersion); GenericResourceImpl resource = new GenericResourceImpl( resourceName, inner, diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java index 4ddde78d7294..480e4cca4d79 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersImpl.java @@ -28,22 +28,22 @@ final class ProvidersImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(client.list().getBody()); + return wrapList(client.list()); } @Override public Provider unregister(String resourceProviderNamespace) throws CloudException, IOException { - return wrapModel(client.unregister(resourceProviderNamespace).getBody()); + return wrapModel(client.unregister(resourceProviderNamespace)); } @Override public Provider register(String resourceProviderNamespace) throws CloudException, IOException { - return wrapModel(client.register(resourceProviderNamespace).getBody()); + return wrapModel(client.register(resourceProviderNamespace)); } @Override public Provider getByName(String resourceProviderNamespace) throws CloudException, IOException { - return wrapModel(client.get(resourceProviderNamespace).getBody()); + return wrapModel(client.get(resourceProviderNamespace)); } @Override diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersInner.java index 164841cb2207..3d20ded7ca85 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ProvidersInner.java @@ -88,10 +88,10 @@ interface ProvidersService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ProviderInner object wrapped in {@link ServiceResponse} if successful. + * @return the ProviderInner object if successful. */ - public ServiceResponse unregister(String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { - return unregisterAsync(resourceProviderNamespace).toBlocking().single(); + public ProviderInner unregister(String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { + return unregisterWithServiceResponseAsync(resourceProviderNamespace).toBlocking().single().getBody(); } /** @@ -102,7 +102,7 @@ public ServiceResponse unregister(String resourceProviderNamespac * @return the {@link ServiceCall} object */ public ServiceCall unregisterAsync(String resourceProviderNamespace, final ServiceCallback serviceCallback) { - return ServiceCall.create(unregisterAsync(resourceProviderNamespace), serviceCallback); + return ServiceCall.create(unregisterWithServiceResponseAsync(resourceProviderNamespace), serviceCallback); } /** @@ -111,7 +111,22 @@ public ServiceCall unregisterAsync(String resourceProviderNamespa * @param resourceProviderNamespace Namespace of the resource provider. * @return the observable to the ProviderInner object */ - public Observable> unregisterAsync(String resourceProviderNamespace) { + public Observable unregisterAsync(String resourceProviderNamespace) { + return unregisterWithServiceResponseAsync(resourceProviderNamespace).map(new Func1, ProviderInner>() { + @Override + public ProviderInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Unregisters provider from a subscription. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @return the observable to the ProviderInner object + */ + public Observable> unregisterWithServiceResponseAsync(String resourceProviderNamespace) { if (resourceProviderNamespace == null) { throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); } @@ -149,10 +164,10 @@ private ServiceResponse unregisterDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ProviderInner object wrapped in {@link ServiceResponse} if successful. + * @return the ProviderInner object if successful. */ - public ServiceResponse register(String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { - return registerAsync(resourceProviderNamespace).toBlocking().single(); + public ProviderInner register(String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { + return registerWithServiceResponseAsync(resourceProviderNamespace).toBlocking().single().getBody(); } /** @@ -163,7 +178,22 @@ public ServiceResponse register(String resourceProviderNamespace) * @return the {@link ServiceCall} object */ public ServiceCall registerAsync(String resourceProviderNamespace, final ServiceCallback serviceCallback) { - return ServiceCall.create(registerAsync(resourceProviderNamespace), serviceCallback); + return ServiceCall.create(registerWithServiceResponseAsync(resourceProviderNamespace), serviceCallback); + } + + /** + * Registers provider to be used with a subscription. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @return the observable to the ProviderInner object + */ + public Observable registerAsync(String resourceProviderNamespace) { + return registerWithServiceResponseAsync(resourceProviderNamespace).map(new Func1, ProviderInner>() { + @Override + public ProviderInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -172,7 +202,7 @@ public ServiceCall registerAsync(String resourceProviderNamespace * @param resourceProviderNamespace Namespace of the resource provider. * @return the observable to the ProviderInner object */ - public Observable> registerAsync(String resourceProviderNamespace) { + public Observable> registerWithServiceResponseAsync(String resourceProviderNamespace) { if (resourceProviderNamespace == null) { throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); } @@ -209,17 +239,16 @@ private ServiceResponse registerDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ProviderInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -243,15 +272,33 @@ public Observable>> call(String nextPageLink /** * Gets a list of resource providers. * - * @return the observable to the List<ProviderInner> object + * @return the observable to the PagedList<ProviderInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of resource providers. + * + * @return the observable to the PagedList<ProviderInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -259,7 +306,7 @@ public Observable>> call(ServiceResponse>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -292,17 +339,16 @@ public Observable>> call(Response> list(final Integer top, final String expand) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final Integer top, final String expand) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(top, expand).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -330,15 +376,35 @@ public Observable>> call(String nextPageLink * * @param top Query parameters. If null is passed returns all deployments. * @param expand The $expand query parameter. e.g. To include property aliases in response, use $expand=resourceTypes/aliases. - * @return the observable to the List<ProviderInner> object + * @return the observable to the PagedList<ProviderInner> object */ - public Observable>> listAsync(final Integer top, final String expand) { + public Observable> listAsync(final Integer top, final String expand) { + return listWithServiceResponseAsync(top, expand) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of resource providers. + * + * @param top Query parameters. If null is passed returns all deployments. + * @param expand The $expand query parameter. e.g. To include property aliases in response, use $expand=resourceTypes/aliases. + * @return the observable to the PagedList<ProviderInner> object + */ + public Observable>> listWithServiceResponseAsync(final Integer top, final String expand) { return listSinglePageAsync(top, expand) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -348,7 +414,7 @@ public Observable>> call(ServiceResponse> * @param top Query parameters. If null is passed returns all deployments. ServiceResponse> * @param expand The $expand query parameter. e.g. To include property aliases in response, use $expand=resourceTypes/aliases. - * @return the List<ProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ProviderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final Integer top, final String expand) { if (this.client.subscriptionId() == null) { @@ -385,10 +451,10 @@ private ServiceResponse> listDelegate(Response get(String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceProviderNamespace).toBlocking().single(); + public ProviderInner get(String resourceProviderNamespace) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceProviderNamespace).toBlocking().single().getBody(); } /** @@ -399,7 +465,7 @@ public ServiceResponse get(String resourceProviderNamespace) thro * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceProviderNamespace, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceProviderNamespace), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceProviderNamespace), serviceCallback); } /** @@ -408,7 +474,22 @@ public ServiceCall getAsync(String resourceProviderNamespace, fin * @param resourceProviderNamespace Namespace of the resource provider. * @return the observable to the ProviderInner object */ - public Observable> getAsync(String resourceProviderNamespace) { + public Observable getAsync(String resourceProviderNamespace) { + return getWithServiceResponseAsync(resourceProviderNamespace).map(new Func1, ProviderInner>() { + @Override + public ProviderInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets a resource provider. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @return the observable to the ProviderInner object + */ + public Observable> getWithServiceResponseAsync(String resourceProviderNamespace) { if (resourceProviderNamespace == null) { throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); } @@ -441,10 +522,10 @@ public Observable> call(Response re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ProviderInner object wrapped in {@link ServiceResponse} if successful. + * @return the ProviderInner object if successful. */ - public ServiceResponse get(String resourceProviderNamespace, String expand) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceProviderNamespace, expand).toBlocking().single(); + public ProviderInner get(String resourceProviderNamespace, String expand) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceProviderNamespace, expand).toBlocking().single().getBody(); } /** @@ -456,7 +537,23 @@ public ServiceResponse get(String resourceProviderNamespace, Stri * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceProviderNamespace, String expand, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceProviderNamespace, expand), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceProviderNamespace, expand), serviceCallback); + } + + /** + * Gets a resource provider. + * + * @param resourceProviderNamespace Namespace of the resource provider. + * @param expand The $expand query parameter. e.g. To include property aliases in response, use $expand=resourceTypes/aliases. + * @return the observable to the ProviderInner object + */ + public Observable getAsync(String resourceProviderNamespace, String expand) { + return getWithServiceResponseAsync(resourceProviderNamespace, expand).map(new Func1, ProviderInner>() { + @Override + public ProviderInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -466,7 +563,7 @@ public ServiceCall getAsync(String resourceProviderNamespace, Str * @param expand The $expand query parameter. e.g. To include property aliases in response, use $expand=resourceTypes/aliases. * @return the observable to the ProviderInner object */ - public Observable> getAsync(String resourceProviderNamespace, String expand) { + public Observable> getWithServiceResponseAsync(String resourceProviderNamespace, String expand) { if (resourceProviderNamespace == null) { throw new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."); } @@ -504,17 +601,16 @@ private ServiceResponse getDelegate(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ProviderInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -541,15 +637,34 @@ public Observable>> call(String nextPageLink * Gets a list of resource providers. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ProviderInner> object + * @return the observable to the PagedList<ProviderInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of resource providers. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ProviderInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -558,7 +673,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ProviderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ProviderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupImpl.java index c7fd13d1a543..4cd3d09c1d1e 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupImpl.java @@ -78,7 +78,7 @@ public ResourceGroupExportResult exportTemplate(ResourceGroupExportTemplateOptio .withResources(Arrays.asList("*")) .withOptions(options.toString()); ResourceGroupExportResultInner resultInner = - client.exportTemplate(name(), inner).getBody(); + client.exportTemplate(name(), inner); return new ResourceGroupExportResultImpl(resultInner); } @@ -121,7 +121,7 @@ public Observable applyAsync() { @Override public ResourceGroupImpl refresh() throws Exception { - this.setInner(client.get(this.key).getBody()); + this.setInner(client.get(this.key)); return this; } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java index bb3202f8177e..c2d3edb1564c 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsImpl.java @@ -35,12 +35,12 @@ final class ResourceGroupsImpl @Override public PagedList list() throws CloudException, IOException { - return wrapList(client.list().getBody()); + return wrapList(client.list()); } @Override public ResourceGroupImpl getByName(String name) throws CloudException, IOException { - return wrapModel(client.get(name).getBody()); + return wrapModel(client.get(name)); } @Override @@ -55,7 +55,7 @@ public ResourceGroupImpl define(String name) { @Override public boolean checkExistence(String name) throws CloudException, IOException { - return client.checkExistence(name).getBody(); + return client.checkExistence(name); } @Override diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java index 7a8e9e5d3402..62b80c03dbd4 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourceGroupsInner.java @@ -118,17 +118,16 @@ interface ResourceGroupsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object if successful. */ - public ServiceResponse> listResources(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList listResources(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listResourcesSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listResourcesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -154,15 +153,34 @@ public Observable>> call(String nextP * Get all of the resources under a subscription. * * @param resourceGroupName Query parameters. If null is passed returns all resource groups. - * @return the observable to the List<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceInner> object */ - public Observable>> listResourcesAsync(final String resourceGroupName) { + public Observable> listResourcesAsync(final String resourceGroupName) { + return listResourcesWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all of the resources under a subscription. + * + * @param resourceGroupName Query parameters. If null is passed returns all resource groups. + * @return the observable to the PagedList<GenericResourceInner> object + */ + public Observable>> listResourcesWithServiceResponseAsync(final String resourceGroupName) { return listResourcesSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listResourcesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourcesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -171,7 +189,7 @@ public Observable>> call(ServiceRespo * Get all of the resources under a subscription. * * @param resourceGroupName Query parameters. If null is passed returns all resource groups. - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listResourcesSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -210,17 +228,16 @@ public Observable>> call(Response> listResources(final String resourceGroupName, final String filter, final String expand, final Integer top) throws CloudException, IOException, IllegalArgumentException { + public PagedList listResources(final String resourceGroupName, final String filter, final String expand, final Integer top) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listResourcesSinglePageAsync(resourceGroupName, filter, expand, top).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listResourcesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -252,15 +269,37 @@ public Observable>> call(String nextP * @param filter The filter to apply on the operation. * @param expand The $expand query parameter * @param top Query parameters. If null is passed returns all resource groups. - * @return the observable to the List<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceInner> object + */ + public Observable> listResourcesAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { + return listResourcesWithServiceResponseAsync(resourceGroupName, filter, expand, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all of the resources under a subscription. + * + * @param resourceGroupName Query parameters. If null is passed returns all resource groups. + * @param filter The filter to apply on the operation. + * @param expand The $expand query parameter + * @param top Query parameters. If null is passed returns all resource groups. + * @return the observable to the PagedList<GenericResourceInner> object */ - public Observable>> listResourcesAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { + public Observable>> listResourcesWithServiceResponseAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { return listResourcesSinglePageAsync(resourceGroupName, filter, expand, top) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listResourcesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourcesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -272,7 +311,7 @@ public Observable>> call(ServiceRespo ServiceResponse> * @param filter The filter to apply on the operation. ServiceResponse> * @param expand The $expand query parameter ServiceResponse> * @param top Query parameters. If null is passed returns all resource groups. - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listResourcesSinglePageAsync(final String resourceGroupName, final String filter, final String expand, final Integer top) { if (resourceGroupName == null) { @@ -312,10 +351,10 @@ private ServiceResponse> listResourcesDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the boolean object wrapped in {@link ServiceResponse} if successful. + * @return the boolean object if successful. */ - public ServiceResponse checkExistence(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return checkExistenceAsync(resourceGroupName).toBlocking().single(); + public boolean checkExistence(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + return checkExistenceWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -326,7 +365,7 @@ public ServiceResponse checkExistence(String resourceGroupName) throws * @return the {@link ServiceCall} object */ public ServiceCall checkExistenceAsync(String resourceGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkExistenceAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(checkExistenceWithServiceResponseAsync(resourceGroupName), serviceCallback); } /** @@ -335,7 +374,22 @@ public ServiceCall checkExistenceAsync(String resourceGroupName, final * @param resourceGroupName The name of the resource group to check. The name is case insensitive. * @return the observable to the boolean object */ - public Observable> checkExistenceAsync(String resourceGroupName) { + public Observable checkExistenceAsync(String resourceGroupName) { + return checkExistenceWithServiceResponseAsync(resourceGroupName).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Checks whether resource group exists. + * + * @param resourceGroupName The name of the resource group to check. The name is case insensitive. + * @return the observable to the boolean object + */ + public Observable> checkExistenceWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -375,10 +429,10 @@ private ServiceResponse checkExistenceDelegate(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceGroupInner object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceGroupInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, ResourceGroupInner parameters) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(resourceGroupName, parameters).toBlocking().single(); + public ResourceGroupInner createOrUpdate(String resourceGroupName, ResourceGroupInner parameters) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().getBody(); } /** @@ -390,7 +444,7 @@ public ServiceResponse createOrUpdate(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback); } /** @@ -400,7 +454,23 @@ public ServiceCall createOrUpdateAsync(String resourceGroupN * @param parameters Parameters supplied to the create or update resource group service operation. * @return the observable to the ResourceGroupInner object */ - public Observable> createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1, ResourceGroupInner>() { + @Override + public ResourceGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create a resource group. + * + * @param resourceGroupName The name of the resource group to be created or updated. + * @param parameters Parameters supplied to the create or update resource group service operation. + * @return the observable to the ResourceGroupInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, ResourceGroupInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -444,10 +514,9 @@ private ServiceResponse createOrUpdateDelegate(Response delete(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteAsync(resourceGroupName).toBlocking().last(); + public void delete(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + deleteWithServiceResponseAsync(resourceGroupName).toBlocking().last().getBody(); } /** @@ -458,7 +527,7 @@ public ServiceResponse delete(String resourceGroupName) throws CloudExcept * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName), serviceCallback); } /** @@ -467,7 +536,22 @@ public ServiceCall deleteAsync(String resourceGroupName, final ServiceCall * @param resourceGroupName The name of the resource group to be deleted. The name is case insensitive. * @return the observable for the request */ - public Observable> deleteAsync(String resourceGroupName) { + public Observable deleteAsync(String resourceGroupName) { + return deleteWithServiceResponseAsync(resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete resource group. + * + * @param resourceGroupName The name of the resource group to be deleted. The name is case insensitive. + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -488,10 +572,9 @@ public Observable> deleteAsync(String resourceGroupName) { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginDelete(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteAsync(resourceGroupName).toBlocking().single(); + public void beginDelete(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + beginDeleteWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -502,7 +585,22 @@ public ServiceResponse beginDelete(String resourceGroupName) throws CloudE * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteAsync(String resourceGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(beginDeleteWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Delete resource group. + * + * @param resourceGroupName The name of the resource group to be deleted. The name is case insensitive. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -511,7 +609,7 @@ public ServiceCall beginDeleteAsync(String resourceGroupName, final Servic * @param resourceGroupName The name of the resource group to be deleted. The name is case insensitive. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginDeleteAsync(String resourceGroupName) { + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -549,10 +647,10 @@ private ServiceResponse beginDeleteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceGroupInner object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceGroupInner object if successful. */ - public ServiceResponse get(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName).toBlocking().single(); + public ResourceGroupInner get(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -563,7 +661,7 @@ public ServiceResponse get(String resourceGroupName) throws * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName), serviceCallback); } /** @@ -572,7 +670,22 @@ public ServiceCall getAsync(String resourceGroupName, final * @param resourceGroupName The name of the resource group to get. The name is case insensitive. * @return the observable to the ResourceGroupInner object */ - public Observable> getAsync(String resourceGroupName) { + public Observable getAsync(String resourceGroupName) { + return getWithServiceResponseAsync(resourceGroupName).map(new Func1, ResourceGroupInner>() { + @Override + public ResourceGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get a resource group. + * + * @param resourceGroupName The name of the resource group to get. The name is case insensitive. + * @return the observable to the ResourceGroupInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -611,10 +724,10 @@ private ServiceResponse getDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceGroupInner object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceGroupInner object if successful. */ - public ServiceResponse patch(String resourceGroupName, ResourceGroupInner parameters) throws CloudException, IOException, IllegalArgumentException { - return patchAsync(resourceGroupName, parameters).toBlocking().single(); + public ResourceGroupInner patch(String resourceGroupName, ResourceGroupInner parameters) throws CloudException, IOException, IllegalArgumentException { + return patchWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().getBody(); } /** @@ -626,7 +739,7 @@ public ServiceResponse patch(String resourceGroupName, Resou * @return the {@link ServiceCall} object */ public ServiceCall patchAsync(String resourceGroupName, ResourceGroupInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(patchAsync(resourceGroupName, parameters), serviceCallback); + return ServiceCall.create(patchWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback); } /** @@ -636,7 +749,23 @@ public ServiceCall patchAsync(String resourceGroupName, Reso * @param parameters Parameters supplied to the update state resource group service operation. * @return the observable to the ResourceGroupInner object */ - public Observable> patchAsync(String resourceGroupName, ResourceGroupInner parameters) { + public Observable patchAsync(String resourceGroupName, ResourceGroupInner parameters) { + return patchWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1, ResourceGroupInner>() { + @Override + public ResourceGroupInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Resource groups can be updated through a simple PATCH operation to a group address. The format of the request is the same as that for creating a resource groups, though if a field is unspecified current value will be carried over. + * + * @param resourceGroupName The name of the resource group to be created or updated. The name is case insensitive. + * @param parameters Parameters supplied to the update state resource group service operation. + * @return the observable to the ResourceGroupInner object + */ + public Observable> patchWithServiceResponseAsync(String resourceGroupName, ResourceGroupInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -679,10 +808,10 @@ private ServiceResponse patchDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceGroupExportResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceGroupExportResultInner object if successful. */ - public ServiceResponse exportTemplate(String resourceGroupName, ExportTemplateRequestInner parameters) throws CloudException, IOException, IllegalArgumentException { - return exportTemplateAsync(resourceGroupName, parameters).toBlocking().single(); + public ResourceGroupExportResultInner exportTemplate(String resourceGroupName, ExportTemplateRequestInner parameters) throws CloudException, IOException, IllegalArgumentException { + return exportTemplateWithServiceResponseAsync(resourceGroupName, parameters).toBlocking().single().getBody(); } /** @@ -694,7 +823,7 @@ public ServiceResponse exportTemplate(String res * @return the {@link ServiceCall} object */ public ServiceCall exportTemplateAsync(String resourceGroupName, ExportTemplateRequestInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(exportTemplateAsync(resourceGroupName, parameters), serviceCallback); + return ServiceCall.create(exportTemplateWithServiceResponseAsync(resourceGroupName, parameters), serviceCallback); } /** @@ -704,7 +833,23 @@ public ServiceCall exportTemplateAsync(String re * @param parameters Parameters supplied to the export template resource group operation. * @return the observable to the ResourceGroupExportResultInner object */ - public Observable> exportTemplateAsync(String resourceGroupName, ExportTemplateRequestInner parameters) { + public Observable exportTemplateAsync(String resourceGroupName, ExportTemplateRequestInner parameters) { + return exportTemplateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1, ResourceGroupExportResultInner>() { + @Override + public ResourceGroupExportResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Captures the specified resource group as a template. + * + * @param resourceGroupName The name of the resource group to be created or updated. + * @param parameters Parameters supplied to the export template resource group operation. + * @return the observable to the ResourceGroupExportResultInner object + */ + public Observable> exportTemplateWithServiceResponseAsync(String resourceGroupName, ExportTemplateRequestInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -745,17 +890,16 @@ private ServiceResponse exportTemplateDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceGroupInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -779,15 +923,33 @@ public Observable>> call(String nextPag /** * Gets a collection of resource groups. * - * @return the observable to the List<ResourceGroupInner> object + * @return the observable to the PagedList<ResourceGroupInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a collection of resource groups. + * + * @return the observable to the PagedList<ResourceGroupInner> object */ - public Observable>> listAsync() { + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -795,7 +957,7 @@ public Observable>> call(ServiceRespons /** * Gets a collection of resource groups. * - * @return the List<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -828,17 +990,16 @@ public Observable>> call(Response> list(final String filter, final Integer top) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String filter, final Integer top) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(filter, top).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -866,15 +1027,35 @@ public Observable>> call(String nextPag * * @param filter The filter to apply on the operation. * @param top Query parameters. If null is passed returns all resource groups. - * @return the observable to the List<ResourceGroupInner> object + * @return the observable to the PagedList<ResourceGroupInner> object */ - public Observable>> listAsync(final String filter, final Integer top) { + public Observable> listAsync(final String filter, final Integer top) { + return listWithServiceResponseAsync(filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a collection of resource groups. + * + * @param filter The filter to apply on the operation. + * @param top Query parameters. If null is passed returns all resource groups. + * @return the observable to the PagedList<ResourceGroupInner> object + */ + public Observable>> listWithServiceResponseAsync(final String filter, final Integer top) { return listSinglePageAsync(filter, top) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -884,7 +1065,7 @@ public Observable>> call(ServiceRespons * ServiceResponse> * @param filter The filter to apply on the operation. ServiceResponse> * @param top Query parameters. If null is passed returns all resource groups. - * @return the List<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String filter, final Integer top) { if (this.client.subscriptionId() == null) { @@ -921,17 +1102,16 @@ private ServiceResponse> listDelegate(Response> listResourcesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listResourcesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listResourcesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listResourcesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -958,15 +1138,34 @@ public Observable>> call(String nextP * Get all of the resources under a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceInner> object */ - public Observable>> listResourcesNextAsync(final String nextPageLink) { + public Observable> listResourcesNextAsync(final String nextPageLink) { + return listResourcesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all of the resources under a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<GenericResourceInner> object + */ + public Observable>> listResourcesNextWithServiceResponseAsync(final String nextPageLink) { return listResourcesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listResourcesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listResourcesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -975,7 +1174,7 @@ public Observable>> call(ServiceRespo * Get all of the resources under a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listResourcesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1009,17 +1208,16 @@ private ServiceResponse> listResourcesNextDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceGroupInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1046,15 +1244,34 @@ public Observable>> call(String nextPag * Gets a collection of resource groups. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceGroupInner> object + * @return the observable to the PagedList<ResourceGroupInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a collection of resource groups. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceGroupInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1063,7 +1280,7 @@ public Observable>> call(ServiceRespons * Gets a collection of resource groups. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceGroupInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java index 01041c088bc1..0934350db883 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/ResourcesInner.java @@ -107,10 +107,9 @@ interface ResourcesService { * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServiceResponse object if successful. */ - public ServiceResponse moveResources(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return moveResourcesAsync(sourceResourceGroupName, parameters).toBlocking().last(); + public void moveResources(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().getBody(); } /** @@ -122,7 +121,7 @@ public ServiceResponse moveResources(String sourceResourceGroupName, Resou * @return the {@link ServiceCall} object */ public ServiceCall moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(moveResourcesAsync(sourceResourceGroupName, parameters), serviceCallback); + return ServiceCall.create(moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback); } /** @@ -132,7 +131,23 @@ public ServiceCall moveResourcesAsync(String sourceResourceGroupName, Reso * @param parameters move resources' parameters. * @return the observable for the request */ - public Observable> moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public Observable moveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + return moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Move resources from one resource group to another. The resources being moved should all be in the same resource group. + * + * @param sourceResourceGroupName Source resource group name. + * @param parameters move resources' parameters. + * @return the observable for the request + */ + public Observable> moveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { if (sourceResourceGroupName == null) { throw new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null."); } @@ -158,10 +173,9 @@ public Observable> moveResourcesAsync(String sourceResourc * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginMoveResourcesAsync(sourceResourceGroupName, parameters).toBlocking().single(); + public void beginMoveResources(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) throws CloudException, IOException, IllegalArgumentException { + beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().single().getBody(); } /** @@ -173,7 +187,7 @@ public ServiceResponse beginMoveResources(String sourceResourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginMoveResourcesAsync(sourceResourceGroupName, parameters), serviceCallback); + return ServiceCall.create(beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters), serviceCallback); } /** @@ -183,7 +197,23 @@ public ServiceCall beginMoveResourcesAsync(String sourceResourceGroupName, * @param parameters move resources' parameters. * @return the {@link ServiceResponse} object if successful. */ - public Observable> beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + public Observable beginMoveResourcesAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { + return beginMoveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Move resources from one resource group to another. The resources being moved should all be in the same resource group. + * + * @param sourceResourceGroupName Source resource group name. + * @param parameters move resources' parameters. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginMoveResourcesWithServiceResponseAsync(String sourceResourceGroupName, ResourcesMoveInfoInner parameters) { if (sourceResourceGroupName == null) { throw new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null."); } @@ -224,17 +254,16 @@ private ServiceResponse beginMoveResourcesDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -258,15 +287,33 @@ public Observable>> call(String nextP /** * Get all of the resources under a subscription. * - * @return the observable to the List<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all of the resources under a subscription. + * + * @return the observable to the PagedList<GenericResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -274,7 +321,7 @@ public Observable>> call(ServiceRespo /** * Get all of the resources under a subscription. * - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -309,17 +356,16 @@ public Observable>> call(Response> list(final String filter, final String expand, final Integer top) throws CloudException, IOException, IllegalArgumentException { + public PagedList list(final String filter, final String expand, final Integer top) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync(filter, expand, top).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -349,15 +395,36 @@ public Observable>> call(String nextP * @param filter The filter to apply on the operation. * @param expand The $expand query parameter. * @param top Query parameters. If null is passed returns all resource groups. - * @return the observable to the List<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceInner> object + */ + public Observable> listAsync(final String filter, final String expand, final Integer top) { + return listWithServiceResponseAsync(filter, expand, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all of the resources under a subscription. + * + * @param filter The filter to apply on the operation. + * @param expand The $expand query parameter. + * @param top Query parameters. If null is passed returns all resource groups. + * @return the observable to the PagedList<GenericResourceInner> object */ - public Observable>> listAsync(final String filter, final String expand, final Integer top) { + public Observable>> listWithServiceResponseAsync(final String filter, final String expand, final Integer top) { return listSinglePageAsync(filter, expand, top) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -368,7 +435,7 @@ public Observable>> call(ServiceRespo ServiceResponse> * @param filter The filter to apply on the operation. ServiceResponse> * @param expand The $expand query parameter. ServiceResponse> * @param top Query parameters. If null is passed returns all resource groups. - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync(final String filter, final String expand, final Integer top) { if (this.client.subscriptionId() == null) { @@ -410,10 +477,10 @@ private ServiceResponse> listDelegate(Response checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) throws CloudException, IOException, IllegalArgumentException { - return checkExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single(); + public boolean checkExistence(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) throws CloudException, IOException, IllegalArgumentException { + return checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single().getBody(); } /** @@ -429,7 +496,27 @@ public ServiceResponse checkExistence(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback); + return ServiceCall.create(checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback); + } + + /** + * Checks whether resource exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @param apiVersion the String value + * @return the observable to the boolean object + */ + public Observable checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + return checkExistenceWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1, Boolean>() { + @Override + public Boolean call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -443,7 +530,7 @@ public ServiceCall checkExistenceAsync(String resourceGroupName, String * @param apiVersion the String value * @return the observable to the boolean object */ - public Observable> checkExistenceAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + public Observable> checkExistenceWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -499,10 +586,9 @@ private ServiceResponse checkExistenceDelegate(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single(); + public void delete(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single().getBody(); } /** @@ -518,7 +604,7 @@ public ServiceResponse delete(String resourceGroupName, String resourcePro * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback); } /** @@ -532,7 +618,27 @@ public ServiceCall deleteAsync(String resourceGroupName, String resourcePr * @param apiVersion the String value * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + public Observable deleteAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + return deleteWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete resource and all of its resources. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @param apiVersion the String value + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -589,10 +695,10 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the GenericResourceInner object wrapped in {@link ServiceResponse} if successful. + * @return the GenericResourceInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).toBlocking().single(); + public GenericResourceInner createOrUpdate(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).toBlocking().single().getBody(); } /** @@ -609,7 +715,7 @@ public ServiceResponse createOrUpdate(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters), serviceCallback); } /** @@ -624,7 +730,28 @@ public ServiceCall createOrUpdateAsync(String resourceGrou * @param parameters Create or update resource parameters. * @return the observable to the GenericResourceInner object */ - public Observable> createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).map(new Func1, GenericResourceInner>() { + @Override + public GenericResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create a resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @param apiVersion the String value + * @param parameters Create or update resource parameters. + * @return the observable to the GenericResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, GenericResourceInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -684,10 +811,10 @@ private ServiceResponse createOrUpdateDelegate(Response get(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) throws CloudException, IOException, IllegalArgumentException { - return getAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single(); + public GenericResourceInner get(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).toBlocking().single().getBody(); } /** @@ -703,7 +830,27 @@ public ServiceResponse get(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), serviceCallback); + } + + /** + * Returns a resource belonging to a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param resourceProviderNamespace Resource identity. + * @param parentResourcePath Resource identity. + * @param resourceType Resource identity. + * @param resourceName Resource identity. + * @param apiVersion the String value + * @return the observable to the GenericResourceInner object + */ + public Observable getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + return getWithServiceResponseAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).map(new Func1, GenericResourceInner>() { + @Override + public GenericResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -717,7 +864,7 @@ public ServiceCall getAsync(String resourceGroupName, Stri * @param apiVersion the String value * @return the observable to the GenericResourceInner object */ - public Observable> getAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { + public Observable> getWithServiceResponseAsync(String resourceGroupName, String resourceProviderNamespace, String parentResourcePath, String resourceType, String resourceName, String apiVersion) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -767,17 +914,16 @@ private ServiceResponse getDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -804,15 +950,34 @@ public Observable>> call(String nextP * Get all of the resources under a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<GenericResourceInner> object + * @return the observable to the PagedList<GenericResourceInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all of the resources under a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<GenericResourceInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -821,7 +986,7 @@ public Observable>> call(ServiceRespo * Get all of the resources under a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GenericResourceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java index 7d071c1ecea5..9226c2ed18ee 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionImpl.java @@ -62,7 +62,7 @@ public Location typeConvert(LocationInner locationInner) { return new LocationImpl(locationInner); } }; - return converter.convert(toPagedList(client.listLocations(this.subscriptionId()).getBody())); + return converter.convert(toPagedList(client.listLocations(this.subscriptionId()))); } private PagedList toPagedList(List list) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java index 2ede3387802f..9e06529b67a0 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/SubscriptionsImpl.java @@ -33,13 +33,13 @@ public Subscription typeConvert(SubscriptionInner subscriptionInner) { return new SubscriptionImpl(subscriptionInner, client); } }; - return converter.convert(client.list().getBody()); + return converter.convert(client.list()); } @Override // Gets a specific resource group public SubscriptionImpl getByName(String name) throws CloudException, IOException { - SubscriptionInner subscription = client.get(name).getBody(); + SubscriptionInner subscription = client.get(name); return new SubscriptionImpl(subscription, client); } } 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 c88a92bef2d2..f345f8365800 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 @@ -83,10 +83,10 @@ interface SubscriptionsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<LocationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<LocationInner> object if successful. */ - public ServiceResponse> listLocations(String subscriptionId) throws CloudException, IOException, IllegalArgumentException { - return listLocationsAsync(subscriptionId).toBlocking().single(); + public List listLocations(String subscriptionId) throws CloudException, IOException, IllegalArgumentException { + return listLocationsWithServiceResponseAsync(subscriptionId).toBlocking().single().getBody(); } /** @@ -97,7 +97,7 @@ public ServiceResponse> listLocations(String subscriptionId) * @return the {@link ServiceCall} object */ public ServiceCall> listLocationsAsync(String subscriptionId, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listLocationsAsync(subscriptionId), serviceCallback); + return ServiceCall.create(listLocationsWithServiceResponseAsync(subscriptionId), serviceCallback); } /** @@ -106,7 +106,22 @@ public ServiceCall> listLocationsAsync(String subscriptionId * @param subscriptionId Id of the subscription * @return the observable to the List<LocationInner> object */ - public Observable>> listLocationsAsync(String subscriptionId) { + public Observable> listLocationsAsync(String subscriptionId) { + return listLocationsWithServiceResponseAsync(subscriptionId).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of the subscription locations. + * + * @param subscriptionId Id of the subscription + * @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."); } @@ -142,10 +157,10 @@ private ServiceResponse> listLocationsDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SubscriptionInner object wrapped in {@link ServiceResponse} if successful. + * @return the SubscriptionInner object if successful. */ - public ServiceResponse get(String subscriptionId) throws CloudException, IOException, IllegalArgumentException { - return getAsync(subscriptionId).toBlocking().single(); + public SubscriptionInner get(String subscriptionId) throws CloudException, IOException, IllegalArgumentException { + return getWithServiceResponseAsync(subscriptionId).toBlocking().single().getBody(); } /** @@ -156,7 +171,22 @@ public ServiceResponse get(String subscriptionId) throws Clou * @return the {@link ServiceCall} object */ public ServiceCall getAsync(String subscriptionId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getAsync(subscriptionId), serviceCallback); + return ServiceCall.create(getWithServiceResponseAsync(subscriptionId), serviceCallback); + } + + /** + * Gets details about particular subscription. + * + * @param subscriptionId Id of the subscription. + * @return the observable to the SubscriptionInner object + */ + public Observable getAsync(String subscriptionId) { + return getWithServiceResponseAsync(subscriptionId).map(new Func1, SubscriptionInner>() { + @Override + public SubscriptionInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -165,7 +195,7 @@ public ServiceCall getAsync(String subscriptionId, final Serv * @param subscriptionId Id of the subscription. * @return the observable to the SubscriptionInner object */ - public Observable> getAsync(String subscriptionId) { + public Observable> getWithServiceResponseAsync(String subscriptionId) { if (subscriptionId == null) { throw new IllegalArgumentException("Parameter subscriptionId is required and cannot be null."); } @@ -199,17 +229,16 @@ private ServiceResponse getDelegate(Response re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SubscriptionInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -233,15 +262,33 @@ public Observable>> call(String nextPage /** * Gets a list of the subscriptionIds. * - * @return the observable to the List<SubscriptionInner> object + * @return the observable to the PagedList<SubscriptionInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of the subscriptionIds. + * + * @return the observable to the PagedList<SubscriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -249,7 +296,7 @@ public Observable>> call(ServiceResponse /** * Gets a list of the subscriptionIds. * - * @return the List<SubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SubscriptionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.apiVersion() == null) { @@ -283,17 +330,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -320,15 +366,34 @@ public Observable>> call(String nextPage * Gets a list of the subscriptionIds. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SubscriptionInner> object + * @return the observable to the PagedList<SubscriptionInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of the subscriptionIds. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SubscriptionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -337,7 +402,7 @@ public Observable>> call(ServiceResponse * Gets a list of the subscriptionIds. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SubscriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SubscriptionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TagsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TagsInner.java index a8a46c9b3c89..4aac409cf588 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TagsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TagsInner.java @@ -94,10 +94,9 @@ interface TagsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse deleteValue(String tagName, String tagValue) throws CloudException, IOException, IllegalArgumentException { - return deleteValueAsync(tagName, tagValue).toBlocking().single(); + public void deleteValue(String tagName, String tagValue) throws CloudException, IOException, IllegalArgumentException { + deleteValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().getBody(); } /** @@ -109,7 +108,7 @@ public ServiceResponse deleteValue(String tagName, String tagValue) throws * @return the {@link ServiceCall} object */ public ServiceCall deleteValueAsync(String tagName, String tagValue, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteValueAsync(tagName, tagValue), serviceCallback); + return ServiceCall.create(deleteValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); } /** @@ -119,7 +118,23 @@ public ServiceCall deleteValueAsync(String tagName, String tagValue, final * @param tagValue The value of the tag. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteValueAsync(String tagName, String tagValue) { + public Observable deleteValueAsync(String tagName, String tagValue) { + return deleteValueWithServiceResponseAsync(tagName, tagValue).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a subscription resource tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteValueWithServiceResponseAsync(String tagName, String tagValue) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } @@ -161,10 +176,10 @@ private ServiceResponse deleteValueDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the TagValueInner object wrapped in {@link ServiceResponse} if successful. + * @return the TagValueInner object if successful. */ - public ServiceResponse createOrUpdateValue(String tagName, String tagValue) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateValueAsync(tagName, tagValue).toBlocking().single(); + public TagValueInner createOrUpdateValue(String tagName, String tagValue) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().getBody(); } /** @@ -176,7 +191,23 @@ public ServiceResponse createOrUpdateValue(String tagName, String * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateValueAsync(String tagName, String tagValue, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateValueAsync(tagName, tagValue), serviceCallback); + return ServiceCall.create(createOrUpdateValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); + } + + /** + * Create a subscription resource tag value. + * + * @param tagName The name of the tag. + * @param tagValue The value of the tag. + * @return the observable to the TagValueInner object + */ + public Observable createOrUpdateValueAsync(String tagName, String tagValue) { + return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).map(new Func1, TagValueInner>() { + @Override + public TagValueInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -186,7 +217,7 @@ public ServiceCall createOrUpdateValueAsync(String tagName, Strin * @param tagValue The value of the tag. * @return the observable to the TagValueInner object */ - public Observable> createOrUpdateValueAsync(String tagName, String tagValue) { + public Observable> createOrUpdateValueWithServiceResponseAsync(String tagName, String tagValue) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } @@ -228,10 +259,10 @@ private ServiceResponse createOrUpdateValueDelegate(Response createOrUpdate(String tagName) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(tagName).toBlocking().single(); + public TagDetailsInner createOrUpdate(String tagName) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(tagName).toBlocking().single().getBody(); } /** @@ -242,7 +273,7 @@ public ServiceResponse createOrUpdate(String tagName) throws Cl * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String tagName, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(tagName), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(tagName), serviceCallback); } /** @@ -251,7 +282,22 @@ public ServiceCall createOrUpdateAsync(String tagName, final Se * @param tagName The name of the tag. * @return the observable to the TagDetailsInner object */ - public Observable> createOrUpdateAsync(String tagName) { + public Observable createOrUpdateAsync(String tagName) { + return createOrUpdateWithServiceResponseAsync(tagName).map(new Func1, TagDetailsInner>() { + @Override + public TagDetailsInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create a subscription resource tag. + * + * @param tagName The name of the tag. + * @return the observable to the TagDetailsInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String tagName) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } @@ -290,10 +336,9 @@ private ServiceResponse createOrUpdateDelegate(Response delete(String tagName) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(tagName).toBlocking().single(); + public void delete(String tagName) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(tagName).toBlocking().single().getBody(); } /** @@ -304,7 +349,7 @@ public ServiceResponse delete(String tagName) throws CloudException, IOExc * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String tagName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(tagName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(tagName), serviceCallback); } /** @@ -313,7 +358,22 @@ public ServiceCall deleteAsync(String tagName, final ServiceCallback * @param tagName The name of the tag. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String tagName) { + public Observable deleteAsync(String tagName) { + return deleteWithServiceResponseAsync(tagName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a subscription resource tag. + * + * @param tagName The name of the tag. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String tagName) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } @@ -350,17 +410,16 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TagDetailsInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TagDetailsInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -384,15 +443,33 @@ public Observable>> call(String nextPageLi /** * Get a list of subscription resource tags. * - * @return the observable to the List<TagDetailsInner> object + * @return the observable to the PagedList<TagDetailsInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get a list of subscription resource tags. + * + * @return the observable to the PagedList<TagDetailsInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -400,7 +477,7 @@ public Observable>> call(ServiceResponse

>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -437,17 +514,16 @@ private ServiceResponse> listDelegate(Response> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -474,15 +550,34 @@ public Observable>> call(String nextPageLi * Get a list of subscription resource tags. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<TagDetailsInner> object + * @return the observable to the PagedList<TagDetailsInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get a list of subscription resource tags. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<TagDetailsInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -491,7 +586,7 @@ public Observable>> call(ServiceResponse

> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<TagDetailsInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TagDetailsInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsImpl.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsImpl.java index 9abe95399045..92fc559b1f7a 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsImpl.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsImpl.java @@ -33,6 +33,6 @@ public Tenant typeConvert(TenantIdDescriptionInner tenantInner) { return new TenantImpl(tenantInner); } }; - return converter.convert(client.list().getBody()); + return converter.convert(client.list()); } } diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsInner.java index 2e86f7f0bfa5..53bdf83d2939 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/TenantsInner.java @@ -73,17 +73,16 @@ interface TenantsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TenantIdDescriptionInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { + public PagedList list() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -107,15 +106,33 @@ public Observable>> call(String n /** * Gets a list of the tenantIds. * - * @return the observable to the List<TenantIdDescriptionInner> object + * @return the observable to the PagedList<TenantIdDescriptionInner> object */ - public Observable>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of the tenantIds. + * + * @return the observable to the PagedList<TenantIdDescriptionInner> object + */ + public Observable>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -123,7 +140,7 @@ public Observable>> call(ServiceR /** * Gets a list of the tenantIds. * - * @return the List<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { if (this.client.apiVersion() == null) { @@ -157,17 +174,16 @@ private ServiceResponse> listDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TenantIdDescriptionInner> object if successful. */ - public ServiceResponse> listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -194,15 +210,34 @@ public Observable>> call(String n * Gets a list of the tenantIds. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<TenantIdDescriptionInner> object + * @return the observable to the PagedList<TenantIdDescriptionInner> object */ - public Observable>> listNextAsync(final String nextPageLink) { + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of the tenantIds. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<TenantIdDescriptionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -211,7 +246,7 @@ public Observable>> call(ServiceR * Gets a list of the tenantIds. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/AdminKeysInner.java b/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/AdminKeysInner.java index 52c57b1e9644..85da65d20eec 100644 --- a/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/AdminKeysInner.java +++ b/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/AdminKeysInner.java @@ -66,10 +66,10 @@ interface AdminKeysService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AdminKeyResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the AdminKeyResultInner object if successful. */ - public ServiceResponse list(String resourceGroupName, String serviceName) throws CloudException, IOException, IllegalArgumentException { - return listAsync(resourceGroupName, serviceName).toBlocking().single(); + public AdminKeyResultInner list(String resourceGroupName, String serviceName) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().getBody(); } /** @@ -81,7 +81,7 @@ public ServiceResponse list(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall listAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listAsync(resourceGroupName, serviceName), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); } /** @@ -91,7 +91,23 @@ public ServiceCall listAsync(String resourceGroupName, Stri * @param serviceName The name of the Search service for which to list admin keys. * @return the observable to the AdminKeyResultInner object */ - public Observable> listAsync(String resourceGroupName, String serviceName) { + public Observable listAsync(String resourceGroupName, String serviceName) { + return listWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, AdminKeyResultInner>() { + @Override + public AdminKeyResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Returns the primary and secondary API keys for the given Azure Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. + * @param serviceName The name of the Search service for which to list admin keys. + * @return the observable to the AdminKeyResultInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String serviceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/QueryKeysInner.java b/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/QueryKeysInner.java index 398d56057766..d26f37d6fd85 100644 --- a/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/QueryKeysInner.java +++ b/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/QueryKeysInner.java @@ -66,10 +66,10 @@ interface QueryKeysService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ListQueryKeysResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the ListQueryKeysResultInner object if successful. */ - public ServiceResponse list(String resourceGroupName, String serviceName) throws CloudException, IOException, IllegalArgumentException { - return listAsync(resourceGroupName, serviceName).toBlocking().single(); + public ListQueryKeysResultInner list(String resourceGroupName, String serviceName) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().getBody(); } /** @@ -81,7 +81,7 @@ public ServiceResponse list(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall listAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listAsync(resourceGroupName, serviceName), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); } /** @@ -91,7 +91,23 @@ public ServiceCall listAsync(String resourceGroupName, * @param serviceName The name of the Search service for which to list query keys. * @return the observable to the ListQueryKeysResultInner object */ - public Observable> listAsync(String resourceGroupName, String serviceName) { + public Observable listAsync(String resourceGroupName, String serviceName) { + return listWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, ListQueryKeysResultInner>() { + @Override + public ListQueryKeysResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Returns the list of query API keys for the given Azure Search service. + * + * @param resourceGroupName The name of the resource group within the current subscription. + * @param serviceName The name of the Search service for which to list query keys. + * @return the observable to the ListQueryKeysResultInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String serviceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/ServicesInner.java b/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/ServicesInner.java index 4f5341286914..a53415ec9817 100644 --- a/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/ServicesInner.java +++ b/azure-mgmt-search/src/main/java/com/microsoft/azure/management/search/implementation/ServicesInner.java @@ -79,10 +79,10 @@ interface ServicesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SearchServiceResourceInner object wrapped in {@link ServiceResponse} if successful. + * @return the SearchServiceResourceInner object if successful. */ - public ServiceResponse createOrUpdate(String resourceGroupName, String serviceName, SearchServiceCreateOrUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateAsync(resourceGroupName, serviceName, parameters).toBlocking().single(); + public SearchServiceResourceInner createOrUpdate(String resourceGroupName, String serviceName, SearchServiceCreateOrUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters).toBlocking().single().getBody(); } /** @@ -95,7 +95,7 @@ public ServiceResponse createOrUpdate(String resourc * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateAsync(String resourceGroupName, String serviceName, SearchServiceCreateOrUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateAsync(resourceGroupName, serviceName, parameters), serviceCallback); + return ServiceCall.create(createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters), serviceCallback); } /** @@ -106,7 +106,24 @@ public ServiceCall createOrUpdateAsync(String resour * @param parameters The properties to set or update on the Search service. * @return the observable to the SearchServiceResourceInner object */ - public Observable> createOrUpdateAsync(String resourceGroupName, String serviceName, SearchServiceCreateOrUpdateParametersInner parameters) { + public Observable createOrUpdateAsync(String resourceGroupName, String serviceName, SearchServiceCreateOrUpdateParametersInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, serviceName, parameters).map(new Func1, SearchServiceResourceInner>() { + @Override + public SearchServiceResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or updates a Search service in the given resource group. If the Search service already exists, all properties will be updated with the given values. + * + * @param resourceGroupName The name of the resource group within the current subscription. + * @param serviceName The name of the Search service to create or update. + * @param parameters The properties to set or update on the Search service. + * @return the observable to the SearchServiceResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String serviceName, SearchServiceCreateOrUpdateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -153,10 +170,9 @@ private ServiceResponse createOrUpdateDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse delete(String resourceGroupName, String serviceName) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(resourceGroupName, serviceName).toBlocking().single(); + public void delete(String resourceGroupName, String serviceName) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(resourceGroupName, serviceName).toBlocking().single().getBody(); } /** @@ -168,7 +184,23 @@ public ServiceResponse delete(String resourceGroupName, String serviceName * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String serviceName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, serviceName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, serviceName), serviceCallback); + } + + /** + * Deletes a Search service in the given resource group, along with its associated resources. + * + * @param resourceGroupName The name of the resource group within the current subscription. + * @param serviceName The name of the Search service to delete. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String serviceName) { + return deleteWithServiceResponseAsync(resourceGroupName, serviceName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -178,7 +210,7 @@ public ServiceCall deleteAsync(String resourceGroupName, String serviceNam * @param serviceName The name of the Search service to delete. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String resourceGroupName, String serviceName) { + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String serviceName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -220,10 +252,10 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SearchServiceListResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the SearchServiceListResultInner object if successful. */ - public ServiceResponse list(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return listAsync(resourceGroupName).toBlocking().single(); + public SearchServiceListResultInner list(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -234,7 +266,22 @@ public ServiceResponse list(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall listAsync(String resourceGroupName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Returns a list of all Search services in the given resource group. + * + * @param resourceGroupName The name of the resource group within the current subscription. + * @return the observable to the SearchServiceListResultInner object + */ + public Observable listAsync(String resourceGroupName) { + return listWithServiceResponseAsync(resourceGroupName).map(new Func1, SearchServiceListResultInner>() { + @Override + public SearchServiceListResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -243,7 +290,7 @@ public ServiceCall listAsync(String resourceGroupN * @param resourceGroupName The name of the resource group within the current subscription. * @return the observable to the SearchServiceListResultInner object */ - public Observable> listAsync(String resourceGroupName) { + public Observable> listWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountImpl.java index 1718739b3fb2..6c6c8ff49b2c 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountImpl.java @@ -18,7 +18,6 @@ import com.microsoft.azure.management.storage.SkuName; import com.microsoft.azure.management.storage.StorageAccount; import com.microsoft.azure.management.storage.StorageAccountKey; -import com.microsoft.rest.ServiceResponse; import org.joda.time.DateTime; import rx.Observable; import rx.functions.Action1; @@ -124,28 +123,25 @@ public List keys() throws CloudException, IOException { @Override public List refreshKeys() throws CloudException, IOException { - ServiceResponse response = + StorageAccountListKeysResultInner response = this.client.listKeys(this.resourceGroupName(), this.name()); - StorageAccountListKeysResultInner resultInner = response.getBody(); - cachedAccountKeys = resultInner.keys(); + cachedAccountKeys = response.keys(); return cachedAccountKeys; } @Override public List regenerateKey(String keyName) throws CloudException, IOException { - ServiceResponse response = + StorageAccountListKeysResultInner response = this.client.regenerateKey(this.resourceGroupName(), this.name(), keyName); - StorageAccountListKeysResultInner resultInner = response.getBody(); - cachedAccountKeys = resultInner.keys(); + cachedAccountKeys = response.keys(); return cachedAccountKeys; } @Override public StorageAccountImpl refresh() throws Exception { - ServiceResponse response = + StorageAccountInner response = this.client.getProperties(this.resourceGroupName(), this.name()); - StorageAccountInner storageAccountInner = response.getBody(); - this.setInner(storageAccountInner); + this.setInner(response); clearWrapperProperties(); return this; } @@ -243,9 +239,9 @@ public Observable createResourceAsync() { createParameters.withLocation(this.regionName()); createParameters.withTags(this.inner().getTags()); return this.client.createAsync(this.resourceGroupName(), this.name(), createParameters) - .flatMap(new Func1, Observable>>() { + .flatMap(new Func1>() { @Override - public Observable> call(ServiceResponse storageAccountInner) { + public Observable call(StorageAccountInner storageAccountInner) { return client.getPropertiesAsync(resourceGroupName(), name()); } }) diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java index 804d98ddf6a0..dcaa33b5a81d 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsImpl.java @@ -37,22 +37,22 @@ class StorageAccountsImpl @Override public CheckNameAvailabilityResult checkNameAvailability(String name) throws CloudException, IOException { - return new CheckNameAvailabilityResult(this.innerCollection.checkNameAvailability(name).getBody()); + return new CheckNameAvailabilityResult(this.innerCollection.checkNameAvailability(name)); } @Override public PagedList list() throws CloudException, IOException { - return wrapList(this.innerCollection.list().getBody()); + return wrapList(this.innerCollection.list()); } @Override public PagedList listByGroup(String groupName) throws CloudException, IOException { - return wrapList(this.innerCollection.listByResourceGroup(groupName).getBody()); + return wrapList(this.innerCollection.listByResourceGroup(groupName)); } @Override public StorageAccount getByGroup(String groupName, String name) throws CloudException, IOException { - return wrapModel(this.innerCollection.getProperties(groupName, name).getBody()); + return wrapModel(this.innerCollection.getProperties(groupName, name)); } @Override diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java index 929a5423fa8a..acb1ccbdae17 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/StorageAccountsInner.java @@ -110,10 +110,10 @@ interface StorageAccountsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CheckNameAvailabilityResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the CheckNameAvailabilityResultInner object if successful. */ - public ServiceResponse checkNameAvailability(String name) throws CloudException, IOException, IllegalArgumentException { - return checkNameAvailabilityAsync(name).toBlocking().single(); + public CheckNameAvailabilityResultInner checkNameAvailability(String name) throws CloudException, IOException, IllegalArgumentException { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().getBody(); } /** @@ -124,7 +124,7 @@ public ServiceResponse checkNameAvailability(S * @return the {@link ServiceCall} object */ public ServiceCall checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkNameAvailabilityAsync(name), serviceCallback); + return ServiceCall.create(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); } /** @@ -133,7 +133,22 @@ public ServiceCall checkNameAvailabilityAsync( * @param name the String value * @return the observable to the CheckNameAvailabilityResultInner object */ - public Observable> checkNameAvailabilityAsync(String name) { + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, CheckNameAvailabilityResultInner>() { + @Override + public CheckNameAvailabilityResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Checks that account name is valid and is not in use. + * + * @param name the String value + * @return the observable to the CheckNameAvailabilityResultInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -176,10 +191,10 @@ private ServiceResponse checkNameAvailabilityD * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the StorageAccountInner object wrapped in ServiceResponse if successful. + * @return the StorageAccountInner object if successful. */ - public ServiceResponse create(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createAsync(resourceGroupName, accountName, parameters).toBlocking().last(); + public StorageAccountInner create(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().last().getBody(); } /** @@ -192,7 +207,7 @@ public ServiceResponse create(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall createAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(createAsync(resourceGroupName, accountName, parameters), serviceCallback); + return ServiceCall.create(createWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); } /** @@ -203,7 +218,24 @@ public ServiceCall createAsync(String resourceGroupName, St * @param parameters The parameters to provide for the created account. * @return the observable for the request */ - public Observable> createAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + public Observable createAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + return createWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and subsequent create or update request is issued with exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -233,10 +265,10 @@ public Observable> createAsync(String resou * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StorageAccountInner object wrapped in {@link ServiceResponse} if successful. + * @return the StorageAccountInner object if successful. */ - public ServiceResponse beginCreate(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return beginCreateAsync(resourceGroupName, accountName, parameters).toBlocking().single(); + public StorageAccountInner beginCreate(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().getBody(); } /** @@ -249,7 +281,24 @@ public ServiceResponse beginCreate(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateAsync(resourceGroupName, accountName, parameters), serviceCallback); + return ServiceCall.create(beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * Asynchronously creates a new storage account with the specified parameters. If an account is already created and subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and subsequent create or update request is issued with exact same set of properties, the request will succeed. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the created account. + * @return the observable to the StorageAccountInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -260,7 +309,7 @@ public ServiceCall beginCreateAsync(String resourceGroupNam * @param parameters The parameters to provide for the created account. * @return the observable to the StorageAccountInner object */ - public Observable> beginCreateAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountCreateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -307,10 +356,9 @@ private ServiceResponse beginCreateDelegate(Response delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return deleteAsync(resourceGroupName, accountName).toBlocking().single(); + public void delete(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + deleteWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -322,7 +370,7 @@ public ServiceResponse delete(String resourceGroupName, String accountName * @return the {@link ServiceCall} object */ public ServiceCall deleteAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(deleteWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** @@ -332,7 +380,23 @@ public ServiceCall deleteAsync(String resourceGroupName, String accountNam * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @return the {@link ServiceResponse} object if successful. */ - public Observable> deleteAsync(String resourceGroupName, String accountName) { + public Observable deleteAsync(String resourceGroupName, String accountName) { + return deleteWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Deletes a storage account in Microsoft Azure. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -374,10 +438,10 @@ private ServiceResponse deleteDelegate(Response response) th * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StorageAccountInner object wrapped in {@link ServiceResponse} if successful. + * @return the StorageAccountInner object if successful. */ - public ServiceResponse getProperties(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return getPropertiesAsync(resourceGroupName, accountName).toBlocking().single(); + public StorageAccountInner getProperties(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + return getPropertiesWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -389,7 +453,7 @@ public ServiceResponse getProperties(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall getPropertiesAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getPropertiesAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(getPropertiesWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); } /** @@ -399,7 +463,23 @@ public ServiceCall getPropertiesAsync(String resourceGroupN * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @return the observable to the StorageAccountInner object */ - public Observable> getPropertiesAsync(String resourceGroupName, String accountName) { + public Observable getPropertiesAsync(String resourceGroupName, String accountName) { + return getPropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Returns the properties for the specified storage account including but not limited to name, account type, location, and account status. The ListKeys operation should be used to retrieve storage keys. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @return the observable to the StorageAccountInner object + */ + public Observable> getPropertiesWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -442,10 +522,10 @@ private ServiceResponse getPropertiesDelegate(Response update(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { - return updateAsync(resourceGroupName, accountName, parameters).toBlocking().single(); + public StorageAccountInner update(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).toBlocking().single().getBody(); } /** @@ -458,7 +538,24 @@ public ServiceResponse update(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateAsync(resourceGroupName, accountName, parameters), serviceCallback); + return ServiceCall.create(updateWithServiceResponseAsync(resourceGroupName, accountName, parameters), serviceCallback); + } + + /** + * The update operation can be used to update the account type, encryption, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account and. replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value may be set. Update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param parameters The parameters to provide for the updated account. + * @return the observable to the StorageAccountInner object + */ + public Observable updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, accountName, parameters).map(new Func1, StorageAccountInner>() { + @Override + public StorageAccountInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -469,7 +566,7 @@ public ServiceCall updateAsync(String resourceGroupName, St * @param parameters The parameters to provide for the updated account. * @return the observable to the StorageAccountInner object */ - public Observable> updateAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) { + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String accountName, StorageAccountUpdateParametersInner parameters) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -513,10 +610,10 @@ private ServiceResponse updateDelegate(Response> list() throws CloudException, IOException, IllegalArgumentException { - return listAsync().toBlocking().single(); + public List list() throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -526,7 +623,7 @@ public ServiceResponse> list() throws CloudException, * @return the {@link ServiceCall} object */ public ServiceCall> listAsync(final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAsync(), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(), serviceCallback); } /** @@ -534,7 +631,21 @@ public ServiceCall> listAsync(final ServiceCallback

  • >> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @return the observable to the List<StorageAccountInner> object + */ + public Observable>> listWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -570,10 +681,10 @@ private ServiceResponse> listDelegate(Response> listByResourceGroup(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return listByResourceGroupAsync(resourceGroupName).toBlocking().single(); + public List listByResourceGroup(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -584,7 +695,7 @@ public ServiceResponse> listByResourceGroup(String res * @return the {@link ServiceCall} object */ public ServiceCall> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(listByResourceGroupAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); } /** @@ -593,7 +704,22 @@ public ServiceCall> listByResourceGroupAsync(String re * @param resourceGroupName The name of the resource group within the user's subscription. * @return the observable to the List<StorageAccountInner> object */ - public Observable>> listByResourceGroupAsync(String resourceGroupName) { + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @return the observable to the List<StorageAccountInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -633,10 +759,10 @@ private ServiceResponse> listByResourceGroupDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StorageAccountListKeysResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the StorageAccountListKeysResultInner object if successful. */ - public ServiceResponse listKeys(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { - return listKeysAsync(resourceGroupName, accountName).toBlocking().single(); + public StorageAccountListKeysResultInner listKeys(String resourceGroupName, String accountName) throws CloudException, IOException, IllegalArgumentException { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).toBlocking().single().getBody(); } /** @@ -648,7 +774,23 @@ public ServiceResponse listKeys(String resour * @return the {@link ServiceCall} object */ public ServiceCall listKeysAsync(String resourceGroupName, String accountName, final ServiceCallback serviceCallback) { - return ServiceCall.create(listKeysAsync(resourceGroupName, accountName), serviceCallback); + return ServiceCall.create(listKeysWithServiceResponseAsync(resourceGroupName, accountName), serviceCallback); + } + + /** + * Lists the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group. + * @param accountName The name of the storage account. + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable listKeysAsync(String resourceGroupName, String accountName) { + return listKeysWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -658,7 +800,7 @@ public ServiceCall listKeysAsync(String resou * @param accountName The name of the storage account. * @return the observable to the StorageAccountListKeysResultInner object */ - public Observable> listKeysAsync(String resourceGroupName, String accountName) { + public Observable> listKeysWithServiceResponseAsync(String resourceGroupName, String accountName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -701,10 +843,10 @@ private ServiceResponse listKeysDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StorageAccountListKeysResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the StorageAccountListKeysResultInner object if successful. */ - public ServiceResponse regenerateKey(String resourceGroupName, String accountName, String keyName) throws CloudException, IOException, IllegalArgumentException { - return regenerateKeyAsync(resourceGroupName, accountName, keyName).toBlocking().single(); + public StorageAccountListKeysResultInner regenerateKey(String resourceGroupName, String accountName, String keyName) throws CloudException, IOException, IllegalArgumentException { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).toBlocking().single().getBody(); } /** @@ -717,7 +859,24 @@ public ServiceResponse regenerateKey(String r * @return the {@link ServiceCall} object */ public ServiceCall regenerateKeyAsync(String resourceGroupName, String accountName, String keyName, final ServiceCallback serviceCallback) { - return ServiceCall.create(regenerateKeyAsync(resourceGroupName, accountName, keyName), serviceCallback); + return ServiceCall.create(regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName), serviceCallback); + } + + /** + * Regenerates the access keys for the specified storage account. + * + * @param resourceGroupName The name of the resource group within the user's subscription. + * @param accountName The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + * @param keyName the String value + * @return the observable to the StorageAccountListKeysResultInner object + */ + public Observable regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + return regenerateKeyWithServiceResponseAsync(resourceGroupName, accountName, keyName).map(new Func1, StorageAccountListKeysResultInner>() { + @Override + public StorageAccountListKeysResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -728,7 +887,7 @@ public ServiceCall regenerateKeyAsync(String * @param keyName the String value * @return the observable to the StorageAccountListKeysResultInner object */ - public Observable> regenerateKeyAsync(String resourceGroupName, String accountName, String keyName) { + public Observable> regenerateKeyWithServiceResponseAsync(String resourceGroupName, String accountName, String keyName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java index 9e67da278f8b..7497a4ea5ed4 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesImpl.java @@ -20,7 +20,7 @@ class UsagesImpl extends ReadableWrappersImpl list() throws CloudException, IOException { - return wrapList(client.usages().list().getBody()); + return wrapList(client.usages().list()); } @Override diff --git a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java index 9be1a504bc7a..3b72461bbabc 100644 --- a/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java +++ b/azure-mgmt-storage/src/main/java/com/microsoft/azure/management/storage/implementation/UsagesInner.java @@ -65,10 +65,10 @@ interface UsagesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<UsageInner> object if successful. */ - public ServiceResponse> list() throws CloudException, IOException, IllegalArgumentException { - return listAsync().toBlocking().single(); + public List list() throws CloudException, IOException, IllegalArgumentException { + return listWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -78,7 +78,7 @@ public ServiceResponse> list() throws CloudException, IOExcepti * @return the {@link ServiceCall} object */ public ServiceCall> listAsync(final ServiceCallback> serviceCallback) { - return ServiceCall.create(listAsync(), serviceCallback); + return ServiceCall.create(listWithServiceResponseAsync(), serviceCallback); } /** @@ -86,7 +86,21 @@ public ServiceCall> listAsync(final ServiceCallback>> listAsync() { + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the current usage count and the limit for the resources under the subscription. + * + * @return the observable to the List<UsageInner> object + */ + public Observable>> listWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersInner.java index 3e749ae96fa5..00544c2f9e8c 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificateOrdersInner.java @@ -147,10 +147,10 @@ interface CertificateOrdersService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateOrderCertificateInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateOrderCertificateInner object if successful. */ - public ServiceResponse getCertificate(String resourceGroupName, String certificateOrderName, String name) throws CloudException, IOException, IllegalArgumentException { - return getCertificateAsync(resourceGroupName, certificateOrderName, name).toBlocking().single(); + public CertificateOrderCertificateInner getCertificate(String resourceGroupName, String certificateOrderName, String name) throws CloudException, IOException, IllegalArgumentException { + return getCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name).toBlocking().single().getBody(); } /** @@ -163,7 +163,7 @@ public ServiceResponse getCertificate(String r * @return the {@link ServiceCall} object */ public ServiceCall getCertificateAsync(String resourceGroupName, String certificateOrderName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getCertificateAsync(resourceGroupName, certificateOrderName, name), serviceCallback); + return ServiceCall.create(getCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name), serviceCallback); } /** @@ -174,7 +174,24 @@ public ServiceCall getCertificateAsync(String * @param name Certificate name * @return the observable to the CertificateOrderCertificateInner object */ - public Observable> getCertificateAsync(String resourceGroupName, String certificateOrderName, String name) { + public Observable getCertificateAsync(String resourceGroupName, String certificateOrderName, String name) { + return getCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name).map(new Func1, CertificateOrderCertificateInner>() { + @Override + public CertificateOrderCertificateInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get certificate associated with the certificate order. + * + * @param resourceGroupName Azure resource group name + * @param certificateOrderName Certificate name + * @param name Certificate name + * @return the observable to the CertificateOrderCertificateInner object + */ + public Observable> getCertificateWithServiceResponseAsync(String resourceGroupName, String certificateOrderName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -221,10 +238,10 @@ private ServiceResponse getCertificateDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateOrderCertificateInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateOrderCertificateInner object if successful. */ - public ServiceResponse createOrUpdateCertificate(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).toBlocking().single(); + public CertificateOrderCertificateInner createOrUpdateCertificate(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).toBlocking().single().getBody(); } /** @@ -238,7 +255,7 @@ public ServiceResponse createOrUpdateCertifica * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate), serviceCallback); + return ServiceCall.create(createOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate), serviceCallback); } /** @@ -250,7 +267,25 @@ public ServiceCall createOrUpdateCertificateAs * @param keyVaultCertificate Key Vault secret csm Id * @return the observable to the CertificateOrderCertificateInner object */ - public Observable> createOrUpdateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) { + public Observable createOrUpdateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) { + return createOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).map(new Func1, CertificateOrderCertificateInner>() { + @Override + public CertificateOrderCertificateInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Associates a Key Vault secret to a certificate store that will be used for storing the certificate once it's ready. + * + * @param resourceGroupName Azure resource group name + * @param certificateOrderName Certificate name + * @param name Certificate name + * @param keyVaultCertificate Key Vault secret csm Id + * @return the observable to the CertificateOrderCertificateInner object + */ + public Observable> createOrUpdateCertificateWithServiceResponseAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -300,10 +335,10 @@ private ServiceResponse createOrUpdateCertific * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteCertificate(String resourceGroupName, String certificateOrderName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteCertificateAsync(resourceGroupName, certificateOrderName, name).toBlocking().single(); + public Object deleteCertificate(String resourceGroupName, String certificateOrderName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name).toBlocking().single().getBody(); } /** @@ -316,7 +351,24 @@ public ServiceResponse deleteCertificate(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall deleteCertificateAsync(String resourceGroupName, String certificateOrderName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteCertificateAsync(resourceGroupName, certificateOrderName, name), serviceCallback); + return ServiceCall.create(deleteCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name), serviceCallback); + } + + /** + * Deletes the certificate associated with the certificate order. + * + * @param resourceGroupName Azure resource group name + * @param certificateOrderName Certificate name + * @param name Certificate name + * @return the observable to the Object object + */ + public Observable deleteCertificateAsync(String resourceGroupName, String certificateOrderName, String name) { + return deleteCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -327,7 +379,7 @@ public ServiceCall deleteCertificateAsync(String resourceGroupName, Stri * @param name Certificate name * @return the observable to the Object object */ - public Observable> deleteCertificateAsync(String resourceGroupName, String certificateOrderName, String name) { + public Observable> deleteCertificateWithServiceResponseAsync(String resourceGroupName, String certificateOrderName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -374,10 +426,10 @@ private ServiceResponse deleteCertificateDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateOrderCertificateInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateOrderCertificateInner object if successful. */ - public ServiceResponse updateCertificate(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) throws CloudException, IOException, IllegalArgumentException { - return updateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).toBlocking().single(); + public CertificateOrderCertificateInner updateCertificate(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) throws CloudException, IOException, IllegalArgumentException { + return updateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).toBlocking().single().getBody(); } /** @@ -391,7 +443,7 @@ public ServiceResponse updateCertificate(Strin * @return the {@link ServiceCall} object */ public ServiceCall updateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateCertificateAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate), serviceCallback); + return ServiceCall.create(updateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate), serviceCallback); } /** @@ -403,7 +455,25 @@ public ServiceCall updateCertificateAsync(Stri * @param keyVaultCertificate Key Vault secret csm Id * @return the observable to the CertificateOrderCertificateInner object */ - public Observable> updateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) { + public Observable updateCertificateAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) { + return updateCertificateWithServiceResponseAsync(resourceGroupName, certificateOrderName, name, keyVaultCertificate).map(new Func1, CertificateOrderCertificateInner>() { + @Override + public CertificateOrderCertificateInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Associates a Key Vault secret to a certificate store that will be used for storing the certificate once it's ready. + * + * @param resourceGroupName Azure resource group name + * @param certificateOrderName Certificate name + * @param name Certificate name + * @param keyVaultCertificate Key Vault secret csm Id + * @return the observable to the CertificateOrderCertificateInner object + */ + public Observable> updateCertificateWithServiceResponseAsync(String resourceGroupName, String certificateOrderName, String name, CertificateOrderCertificateInner keyVaultCertificate) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -452,10 +522,10 @@ private ServiceResponse updateCertificateDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateOrderInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateOrderInner object if successful. */ - public ServiceResponse getCertificateOrder(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getCertificateOrderAsync(resourceGroupName, name).toBlocking().single(); + public CertificateOrderInner getCertificateOrder(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getCertificateOrderWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -467,7 +537,7 @@ public ServiceResponse getCertificateOrder(String resourc * @return the {@link ServiceCall} object */ public ServiceCall getCertificateOrderAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getCertificateOrderAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getCertificateOrderWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -477,7 +547,23 @@ public ServiceCall getCertificateOrderAsync(String resour * @param name Certificate name * @return the observable to the CertificateOrderInner object */ - public Observable> getCertificateOrderAsync(String resourceGroupName, String name) { + public Observable getCertificateOrderAsync(String resourceGroupName, String name) { + return getCertificateOrderWithServiceResponseAsync(resourceGroupName, name).map(new Func1, CertificateOrderInner>() { + @Override + public CertificateOrderInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get a certificate order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate name + * @return the observable to the CertificateOrderInner object + */ + public Observable> getCertificateOrderWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -520,10 +606,10 @@ private ServiceResponse getCertificateOrderDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateOrderInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateOrderInner object if successful. */ - public ServiceResponse createOrUpdateCertificateOrder(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateCertificateOrderAsync(resourceGroupName, name, certificateDistinguishedName).toBlocking().single(); + public CertificateOrderInner createOrUpdateCertificateOrder(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateCertificateOrderWithServiceResponseAsync(resourceGroupName, name, certificateDistinguishedName).toBlocking().single().getBody(); } /** @@ -536,7 +622,7 @@ public ServiceResponse createOrUpdateCertificateOrder(Str * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateCertificateOrderAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateCertificateOrderAsync(resourceGroupName, name, certificateDistinguishedName), serviceCallback); + return ServiceCall.create(createOrUpdateCertificateOrderWithServiceResponseAsync(resourceGroupName, name, certificateDistinguishedName), serviceCallback); } /** @@ -547,7 +633,24 @@ public ServiceCall createOrUpdateCertificateOrderAsync(St * @param certificateDistinguishedName Distinguished name to be used for purchasing certificate * @return the observable to the CertificateOrderInner object */ - public Observable> createOrUpdateCertificateOrderAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) { + public Observable createOrUpdateCertificateOrderAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) { + return createOrUpdateCertificateOrderWithServiceResponseAsync(resourceGroupName, name, certificateDistinguishedName).map(new Func1, CertificateOrderInner>() { + @Override + public CertificateOrderInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create or update a certificate purchase order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate name + * @param certificateDistinguishedName Distinguished name to be used for purchasing certificate + * @return the observable to the CertificateOrderInner object + */ + public Observable> createOrUpdateCertificateOrderWithServiceResponseAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -593,10 +696,10 @@ private ServiceResponse createOrUpdateCertificateOrderDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteCertificateOrder(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteCertificateOrderAsync(resourceGroupName, name).toBlocking().single(); + public Object deleteCertificateOrder(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteCertificateOrderWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -608,7 +711,7 @@ public ServiceResponse deleteCertificateOrder(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall deleteCertificateOrderAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteCertificateOrderAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteCertificateOrderWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -618,7 +721,23 @@ public ServiceCall deleteCertificateOrderAsync(String resourceGroupName, * @param name Certificate name * @return the observable to the Object object */ - public Observable> deleteCertificateOrderAsync(String resourceGroupName, String name) { + public Observable deleteCertificateOrderAsync(String resourceGroupName, String name) { + return deleteCertificateOrderWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete an existing certificate order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate name + * @return the observable to the Object object + */ + public Observable> deleteCertificateOrderWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -661,10 +780,10 @@ private ServiceResponse deleteCertificateOrderDelegate(Response updateCertificateOrder(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) throws CloudException, IOException, IllegalArgumentException { - return updateCertificateOrderAsync(resourceGroupName, name, certificateDistinguishedName).toBlocking().single(); + public CertificateOrderInner updateCertificateOrder(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) throws CloudException, IOException, IllegalArgumentException { + return updateCertificateOrderWithServiceResponseAsync(resourceGroupName, name, certificateDistinguishedName).toBlocking().single().getBody(); } /** @@ -677,7 +796,24 @@ public ServiceResponse updateCertificateOrder(String reso * @return the {@link ServiceCall} object */ public ServiceCall updateCertificateOrderAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateCertificateOrderAsync(resourceGroupName, name, certificateDistinguishedName), serviceCallback); + return ServiceCall.create(updateCertificateOrderWithServiceResponseAsync(resourceGroupName, name, certificateDistinguishedName), serviceCallback); + } + + /** + * Create or update a certificate purchase order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate name + * @param certificateDistinguishedName Distinguished name to be used for purchasing certificate + * @return the observable to the CertificateOrderInner object + */ + public Observable updateCertificateOrderAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) { + return updateCertificateOrderWithServiceResponseAsync(resourceGroupName, name, certificateDistinguishedName).map(new Func1, CertificateOrderInner>() { + @Override + public CertificateOrderInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -688,7 +824,7 @@ public ServiceCall updateCertificateOrderAsync(String res * @param certificateDistinguishedName Distinguished name to be used for purchasing certificate * @return the observable to the CertificateOrderInner object */ - public Observable> updateCertificateOrderAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) { + public Observable> updateCertificateOrderWithServiceResponseAsync(String resourceGroupName, String name, CertificateOrderInner certificateDistinguishedName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -733,17 +869,16 @@ private ServiceResponse updateCertificateOrderDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object if successful. */ - public ServiceResponse> getCertificateOrders(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getCertificateOrders(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getCertificateOrdersSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getCertificateOrdersNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -769,15 +904,34 @@ public Observable>> call(String next * Get certificate orders in a resource group. * * @param resourceGroupName Azure resource group name - * @return the observable to the List<CertificateOrderInner> object + * @return the observable to the PagedList<CertificateOrderInner> object */ - public Observable>> getCertificateOrdersAsync(final String resourceGroupName) { + public Observable> getCertificateOrdersAsync(final String resourceGroupName) { + return getCertificateOrdersWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get certificate orders in a resource group. + * + * @param resourceGroupName Azure resource group name + * @return the observable to the PagedList<CertificateOrderInner> object + */ + public Observable>> getCertificateOrdersWithServiceResponseAsync(final String resourceGroupName) { return getCertificateOrdersSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getCertificateOrdersNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateOrdersNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -786,7 +940,7 @@ public Observable>> call(ServiceResp * Get certificate orders in a resource group. * ServiceResponse> * @param resourceGroupName Azure resource group name - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getCertificateOrdersSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -827,17 +981,16 @@ private ServiceResponse> getCertificateOrdersDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateOrderCertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderCertificateInner> object if successful. */ - public ServiceResponse> getCertificates(final String resourceGroupName, final String certificateOrderName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getCertificates(final String resourceGroupName, final String certificateOrderName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getCertificatesSinglePageAsync(resourceGroupName, certificateOrderName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -865,15 +1018,35 @@ public Observable>> call( * * @param resourceGroupName Azure resource group name * @param certificateOrderName Certificate name - * @return the observable to the List<CertificateOrderCertificateInner> object + * @return the observable to the PagedList<CertificateOrderCertificateInner> object + */ + public Observable> getCertificatesAsync(final String resourceGroupName, final String certificateOrderName) { + return getCertificatesWithServiceResponseAsync(resourceGroupName, certificateOrderName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List all certificates associated with a certificate order (only one certificate can be associated with an order at a time). + * + * @param resourceGroupName Azure resource group name + * @param certificateOrderName Certificate name + * @return the observable to the PagedList<CertificateOrderCertificateInner> object */ - public Observable>> getCertificatesAsync(final String resourceGroupName, final String certificateOrderName) { + public Observable>> getCertificatesWithServiceResponseAsync(final String resourceGroupName, final String certificateOrderName) { return getCertificatesSinglePageAsync(resourceGroupName, certificateOrderName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getCertificatesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -883,7 +1056,7 @@ public Observable>> call( * ServiceResponse> * @param resourceGroupName Azure resource group name ServiceResponse> * @param certificateOrderName Certificate name - * @return the List<CertificateOrderCertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderCertificateInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getCertificatesSinglePageAsync(final String resourceGroupName, final String certificateOrderName) { if (resourceGroupName == null) { @@ -928,10 +1101,10 @@ private ServiceResponse> getCertifica * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse reissueCertificateOrder(String resourceGroupName, String name, ReissueCertificateOrderRequestInner reissueCertificateOrderRequest) throws CloudException, IOException, IllegalArgumentException { - return reissueCertificateOrderAsync(resourceGroupName, name, reissueCertificateOrderRequest).toBlocking().single(); + public Object reissueCertificateOrder(String resourceGroupName, String name, ReissueCertificateOrderRequestInner reissueCertificateOrderRequest) throws CloudException, IOException, IllegalArgumentException { + return reissueCertificateOrderWithServiceResponseAsync(resourceGroupName, name, reissueCertificateOrderRequest).toBlocking().single().getBody(); } /** @@ -944,7 +1117,7 @@ public ServiceResponse reissueCertificateOrder(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall reissueCertificateOrderAsync(String resourceGroupName, String name, ReissueCertificateOrderRequestInner reissueCertificateOrderRequest, final ServiceCallback serviceCallback) { - return ServiceCall.create(reissueCertificateOrderAsync(resourceGroupName, name, reissueCertificateOrderRequest), serviceCallback); + return ServiceCall.create(reissueCertificateOrderWithServiceResponseAsync(resourceGroupName, name, reissueCertificateOrderRequest), serviceCallback); } /** @@ -955,7 +1128,24 @@ public ServiceCall reissueCertificateOrderAsync(String resourceGroupName * @param reissueCertificateOrderRequest Reissue parameters * @return the observable to the Object object */ - public Observable> reissueCertificateOrderAsync(String resourceGroupName, String name, ReissueCertificateOrderRequestInner reissueCertificateOrderRequest) { + public Observable reissueCertificateOrderAsync(String resourceGroupName, String name, ReissueCertificateOrderRequestInner reissueCertificateOrderRequest) { + return reissueCertificateOrderWithServiceResponseAsync(resourceGroupName, name, reissueCertificateOrderRequest).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Reissue an existing certificate order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate name + * @param reissueCertificateOrderRequest Reissue parameters + * @return the observable to the Object object + */ + public Observable> reissueCertificateOrderWithServiceResponseAsync(String resourceGroupName, String name, ReissueCertificateOrderRequestInner reissueCertificateOrderRequest) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1002,10 +1192,10 @@ private ServiceResponse reissueCertificateOrderDelegate(Response renewCertificateOrder(String resourceGroupName, String name, RenewCertificateOrderRequestInner renewCertificateOrderRequest) throws CloudException, IOException, IllegalArgumentException { - return renewCertificateOrderAsync(resourceGroupName, name, renewCertificateOrderRequest).toBlocking().single(); + public Object renewCertificateOrder(String resourceGroupName, String name, RenewCertificateOrderRequestInner renewCertificateOrderRequest) throws CloudException, IOException, IllegalArgumentException { + return renewCertificateOrderWithServiceResponseAsync(resourceGroupName, name, renewCertificateOrderRequest).toBlocking().single().getBody(); } /** @@ -1018,7 +1208,7 @@ public ServiceResponse renewCertificateOrder(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall renewCertificateOrderAsync(String resourceGroupName, String name, RenewCertificateOrderRequestInner renewCertificateOrderRequest, final ServiceCallback serviceCallback) { - return ServiceCall.create(renewCertificateOrderAsync(resourceGroupName, name, renewCertificateOrderRequest), serviceCallback); + return ServiceCall.create(renewCertificateOrderWithServiceResponseAsync(resourceGroupName, name, renewCertificateOrderRequest), serviceCallback); } /** @@ -1029,7 +1219,24 @@ public ServiceCall renewCertificateOrderAsync(String resourceGroupName, * @param renewCertificateOrderRequest Renew parameters * @return the observable to the Object object */ - public Observable> renewCertificateOrderAsync(String resourceGroupName, String name, RenewCertificateOrderRequestInner renewCertificateOrderRequest) { + public Observable renewCertificateOrderAsync(String resourceGroupName, String name, RenewCertificateOrderRequestInner renewCertificateOrderRequest) { + return renewCertificateOrderWithServiceResponseAsync(resourceGroupName, name, renewCertificateOrderRequest).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Renew an existing certificate order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate name + * @param renewCertificateOrderRequest Renew parameters + * @return the observable to the Object object + */ + public Observable> renewCertificateOrderWithServiceResponseAsync(String resourceGroupName, String name, RenewCertificateOrderRequestInner renewCertificateOrderRequest) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1075,10 +1282,10 @@ private ServiceResponse renewCertificateOrderDelegate(Response> retrieveCertificateActions(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return retrieveCertificateActionsAsync(resourceGroupName, name).toBlocking().single(); + public List retrieveCertificateActions(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return retrieveCertificateActionsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1090,7 +1297,23 @@ public ServiceResponse> retrieveCertificateAct * @return the {@link ServiceCall} object */ public ServiceCall> retrieveCertificateActionsAsync(String resourceGroupName, String name, final ServiceCallback> serviceCallback) { - return ServiceCall.create(retrieveCertificateActionsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(retrieveCertificateActionsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrieve the list of certificate actions. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate order name + * @return the observable to the List<CertificateOrderActionInner> object + */ + public Observable> retrieveCertificateActionsAsync(String resourceGroupName, String name) { + return retrieveCertificateActionsWithServiceResponseAsync(resourceGroupName, name).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -1100,7 +1323,7 @@ public ServiceCall> retrieveCertificateActions * @param name Certificate order name * @return the observable to the List<CertificateOrderActionInner> object */ - public Observable>> retrieveCertificateActionsAsync(String resourceGroupName, String name) { + public Observable>> retrieveCertificateActionsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1142,10 +1365,10 @@ private ServiceResponse> retrieveCertificateAc * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateEmailInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<CertificateEmailInner> object if successful. */ - public ServiceResponse> retrieveCertificateEmailHistory(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return retrieveCertificateEmailHistoryAsync(resourceGroupName, name).toBlocking().single(); + public List retrieveCertificateEmailHistory(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1157,7 +1380,23 @@ public ServiceResponse> retrieveCertificateEmailHist * @return the {@link ServiceCall} object */ public ServiceCall> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name, final ServiceCallback> serviceCallback) { - return ServiceCall.create(retrieveCertificateEmailHistoryAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrive email history. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate order name + * @return the observable to the List<CertificateEmailInner> object + */ + public Observable> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name) { + return retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -1167,7 +1406,7 @@ public ServiceCall> retrieveCertificateEmailHistoryA * @param name Certificate order name * @return the observable to the List<CertificateEmailInner> object */ - public Observable>> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name) { + public Observable>> retrieveCertificateEmailHistoryWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1209,10 +1448,10 @@ private ServiceResponse> retrieveCertificateEmailHis * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse resendCertificateEmail(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return resendCertificateEmailAsync(resourceGroupName, name).toBlocking().single(); + public Object resendCertificateEmail(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return resendCertificateEmailWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1224,7 +1463,7 @@ public ServiceResponse resendCertificateEmail(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall resendCertificateEmailAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(resendCertificateEmailAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(resendCertificateEmailWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1234,7 +1473,23 @@ public ServiceCall resendCertificateEmailAsync(String resourceGroupName, * @param name Certificate order name * @return the observable to the Object object */ - public Observable> resendCertificateEmailAsync(String resourceGroupName, String name) { + public Observable resendCertificateEmailAsync(String resourceGroupName, String name) { + return resendCertificateEmailWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Resend certificate email. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate order name + * @return the observable to the Object object + */ + public Observable> resendCertificateEmailWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1276,10 +1531,10 @@ private ServiceResponse resendCertificateEmailDelegate(Response verifyDomainOwnership(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return verifyDomainOwnershipAsync(resourceGroupName, name).toBlocking().single(); + public Object verifyDomainOwnership(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1291,7 +1546,7 @@ public ServiceResponse verifyDomainOwnership(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall verifyDomainOwnershipAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(verifyDomainOwnershipAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1301,7 +1556,23 @@ public ServiceCall verifyDomainOwnershipAsync(String resourceGroupName, * @param name Certificate order name * @return the observable to the Object object */ - public Observable> verifyDomainOwnershipAsync(String resourceGroupName, String name) { + public Observable verifyDomainOwnershipAsync(String resourceGroupName, String name) { + return verifyDomainOwnershipWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Verify domain ownership for this certificate order. + * + * @param resourceGroupName Azure resource group name + * @param name Certificate order name + * @return the observable to the Object object + */ + public Observable> verifyDomainOwnershipWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1342,17 +1613,16 @@ private ServiceResponse verifyDomainOwnershipDelegate(Response> getCertificateOrdersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getCertificateOrdersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getCertificateOrdersNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getCertificateOrdersNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1379,15 +1649,34 @@ public Observable>> call(String next * Get certificate orders in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CertificateOrderInner> object + * @return the observable to the PagedList<CertificateOrderInner> object */ - public Observable>> getCertificateOrdersNextAsync(final String nextPageLink) { + public Observable> getCertificateOrdersNextAsync(final String nextPageLink) { + return getCertificateOrdersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get certificate orders in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateOrderInner> object + */ + public Observable>> getCertificateOrdersNextWithServiceResponseAsync(final String nextPageLink) { return getCertificateOrdersNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getCertificateOrdersNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificateOrdersNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1396,7 +1685,7 @@ public Observable>> call(ServiceResp * Get certificate orders in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getCertificateOrdersNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1430,17 +1719,16 @@ private ServiceResponse> getCertificateOrdersNex * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateOrderCertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderCertificateInner> object if successful. */ - public ServiceResponse> getCertificatesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getCertificatesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1467,15 +1755,34 @@ public Observable>> call( * List all certificates associated with a certificate order (only one certificate can be associated with an order at a time). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CertificateOrderCertificateInner> object + * @return the observable to the PagedList<CertificateOrderCertificateInner> object */ - public Observable>> getCertificatesNextAsync(final String nextPageLink) { + public Observable> getCertificatesNextAsync(final String nextPageLink) { + return getCertificatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List all certificates associated with a certificate order (only one certificate can be associated with an order at a time). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateOrderCertificateInner> object + */ + public Observable>> getCertificatesNextWithServiceResponseAsync(final String nextPageLink) { return getCertificatesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getCertificatesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1484,7 +1791,7 @@ public Observable>> call( * List all certificates associated with a certificate order (only one certificate can be associated with an order at a time). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CertificateOrderCertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderCertificateInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getCertificatesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesInner.java index 46f85b12ec0f..621783bc44e5 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/CertificatesInner.java @@ -116,17 +116,16 @@ interface CertificatesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object if successful. */ - public ServiceResponse> getCertificates(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getCertificates(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getCertificatesSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -152,15 +151,34 @@ public Observable>> call(String nextPageL * Get certificates for a subscription in the specified resource group. * * @param resourceGroupName Name of the resource group - * @return the observable to the List<CertificateInner> object + * @return the observable to the PagedList<CertificateInner> object */ - public Observable>> getCertificatesAsync(final String resourceGroupName) { + public Observable> getCertificatesAsync(final String resourceGroupName) { + return getCertificatesWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get certificates for a subscription in the specified resource group. + * + * @param resourceGroupName Name of the resource group + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable>> getCertificatesWithServiceResponseAsync(final String resourceGroupName) { return getCertificatesSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getCertificatesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -169,7 +187,7 @@ public Observable>> call(ServiceResponse< * Get certificates for a subscription in the specified resource group. * ServiceResponse> * @param resourceGroupName Name of the resource group - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getCertificatesSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -210,10 +228,10 @@ private ServiceResponse> getCertificatesDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateInner object if successful. */ - public ServiceResponse getCertificate(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getCertificateAsync(resourceGroupName, name).toBlocking().single(); + public CertificateInner getCertificate(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getCertificateWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -225,7 +243,23 @@ public ServiceResponse getCertificate(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall getCertificateAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getCertificateAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getCertificateWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Get a certificate by certificate name for a subscription in the specified resource group. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate. + * @return the observable to the CertificateInner object + */ + public Observable getCertificateAsync(String resourceGroupName, String name) { + return getCertificateWithServiceResponseAsync(resourceGroupName, name).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -235,7 +269,7 @@ public ServiceCall getCertificateAsync(String resourceGroupNam * @param name Name of the certificate. * @return the observable to the CertificateInner object */ - public Observable> getCertificateAsync(String resourceGroupName, String name) { + public Observable> getCertificateWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -278,10 +312,10 @@ private ServiceResponse getCertificateDelegate(Response createOrUpdateCertificate(String resourceGroupName, String name, CertificateInner certificateEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateCertificateAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single(); + public CertificateInner createOrUpdateCertificate(String resourceGroupName, String name, CertificateInner certificateEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single().getBody(); } /** @@ -294,7 +328,7 @@ public ServiceResponse createOrUpdateCertificate(String resour * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateCertificateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateCertificateAsync(resourceGroupName, name, certificateEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope), serviceCallback); } /** @@ -305,7 +339,24 @@ public ServiceCall createOrUpdateCertificateAsync(String resou * @param certificateEnvelope Details of certificate if it exists already. * @return the observable to the CertificateInner object */ - public Observable> createOrUpdateCertificateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { + public Observable createOrUpdateCertificateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { + return createOrUpdateCertificateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or modifies an existing certificate. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate if it exists already. + * @return the observable to the CertificateInner object + */ + public Observable> createOrUpdateCertificateWithServiceResponseAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -351,10 +402,10 @@ private ServiceResponse createOrUpdateCertificateDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteCertificate(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteCertificateAsync(resourceGroupName, name).toBlocking().single(); + public Object deleteCertificate(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteCertificateWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -366,7 +417,23 @@ public ServiceResponse deleteCertificate(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall deleteCertificateAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteCertificateAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteCertificateWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Delete a certificate by name in a specificed subscription and resourcegroup. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate to be deleted. + * @return the observable to the Object object + */ + public Observable deleteCertificateAsync(String resourceGroupName, String name) { + return deleteCertificateWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -376,7 +443,7 @@ public ServiceCall deleteCertificateAsync(String resourceGroupName, Stri * @param name Name of the certificate to be deleted. * @return the observable to the Object object */ - public Observable> deleteCertificateAsync(String resourceGroupName, String name) { + public Observable> deleteCertificateWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -419,10 +486,10 @@ private ServiceResponse deleteCertificateDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CertificateInner object wrapped in {@link ServiceResponse} if successful. + * @return the CertificateInner object if successful. */ - public ServiceResponse updateCertificate(String resourceGroupName, String name, CertificateInner certificateEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateCertificateAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single(); + public CertificateInner updateCertificate(String resourceGroupName, String name, CertificateInner certificateEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateCertificateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).toBlocking().single().getBody(); } /** @@ -435,7 +502,7 @@ public ServiceResponse updateCertificate(String resourceGroupN * @return the {@link ServiceCall} object */ public ServiceCall updateCertificateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateCertificateAsync(resourceGroupName, name, certificateEnvelope), serviceCallback); + return ServiceCall.create(updateCertificateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope), serviceCallback); } /** @@ -446,7 +513,24 @@ public ServiceCall updateCertificateAsync(String resourceGroup * @param certificateEnvelope Details of certificate if it exists already. * @return the observable to the CertificateInner object */ - public Observable> updateCertificateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { + public Observable updateCertificateAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { + return updateCertificateWithServiceResponseAsync(resourceGroupName, name, certificateEnvelope).map(new Func1, CertificateInner>() { + @Override + public CertificateInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or modifies an existing certificate. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate. + * @param certificateEnvelope Details of certificate if it exists already. + * @return the observable to the CertificateInner object + */ + public Observable> updateCertificateWithServiceResponseAsync(String resourceGroupName, String name, CertificateInner certificateEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -491,10 +575,10 @@ private ServiceResponse updateCertificateDelegate(Response> getCsrs(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { - return getCsrsAsync(resourceGroupName).toBlocking().single(); + public List getCsrs(String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + return getCsrsWithServiceResponseAsync(resourceGroupName).toBlocking().single().getBody(); } /** @@ -505,7 +589,22 @@ public ServiceResponse> getCsrs(String resourceGroupName) throws * @return the {@link ServiceCall} object */ public ServiceCall> getCsrsAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getCsrsAsync(resourceGroupName), serviceCallback); + return ServiceCall.create(getCsrsWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Gets the certificate signing requests for a subscription in the specified resource group. + * + * @param resourceGroupName Name of the resource group + * @return the observable to the List<CsrInner> object + */ + public Observable> getCsrsAsync(String resourceGroupName) { + return getCsrsWithServiceResponseAsync(resourceGroupName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -514,7 +613,7 @@ public ServiceCall> getCsrsAsync(String resourceGroupName, final * @param resourceGroupName Name of the resource group * @return the observable to the List<CsrInner> object */ - public Observable>> getCsrsAsync(String resourceGroupName) { + public Observable>> getCsrsWithServiceResponseAsync(String resourceGroupName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -553,10 +652,10 @@ private ServiceResponse> getCsrsDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CsrInner object wrapped in {@link ServiceResponse} if successful. + * @return the CsrInner object if successful. */ - public ServiceResponse getCsr(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getCsrAsync(resourceGroupName, name).toBlocking().single(); + public CsrInner getCsr(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getCsrWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -568,7 +667,23 @@ public ServiceResponse getCsr(String resourceGroupName, String name) t * @return the {@link ServiceCall} object */ public ServiceCall getCsrAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getCsrAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getCsrWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets a certificate signing request by certificate name for a subscription in the specified resource group. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate. + * @return the observable to the CsrInner object + */ + public Observable getCsrAsync(String resourceGroupName, String name) { + return getCsrWithServiceResponseAsync(resourceGroupName, name).map(new Func1, CsrInner>() { + @Override + public CsrInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -578,7 +693,7 @@ public ServiceCall getCsrAsync(String resourceGroupName, String name, * @param name Name of the certificate. * @return the observable to the CsrInner object */ - public Observable> getCsrAsync(String resourceGroupName, String name) { + public Observable> getCsrWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -621,10 +736,10 @@ private ServiceResponse getCsrDelegate(Response response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CsrInner object wrapped in {@link ServiceResponse} if successful. + * @return the CsrInner object if successful. */ - public ServiceResponse createOrUpdateCsr(String resourceGroupName, String name, CsrInner csrEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateCsrAsync(resourceGroupName, name, csrEnvelope).toBlocking().single(); + public CsrInner createOrUpdateCsr(String resourceGroupName, String name, CsrInner csrEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateCsrWithServiceResponseAsync(resourceGroupName, name, csrEnvelope).toBlocking().single().getBody(); } /** @@ -637,7 +752,7 @@ public ServiceResponse createOrUpdateCsr(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateCsrAsync(String resourceGroupName, String name, CsrInner csrEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateCsrAsync(resourceGroupName, name, csrEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateCsrWithServiceResponseAsync(resourceGroupName, name, csrEnvelope), serviceCallback); } /** @@ -648,7 +763,24 @@ public ServiceCall createOrUpdateCsrAsync(String resourceGroupName, St * @param csrEnvelope Details of certificate signing request if it exists already. * @return the observable to the CsrInner object */ - public Observable> createOrUpdateCsrAsync(String resourceGroupName, String name, CsrInner csrEnvelope) { + public Observable createOrUpdateCsrAsync(String resourceGroupName, String name, CsrInner csrEnvelope) { + return createOrUpdateCsrWithServiceResponseAsync(resourceGroupName, name, csrEnvelope).map(new Func1, CsrInner>() { + @Override + public CsrInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or modifies an existing certificate signing request. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate. + * @param csrEnvelope Details of certificate signing request if it exists already. + * @return the observable to the CsrInner object + */ + public Observable> createOrUpdateCsrWithServiceResponseAsync(String resourceGroupName, String name, CsrInner csrEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -694,10 +826,10 @@ private ServiceResponse createOrUpdateCsrDelegate(Response deleteCsr(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteCsrAsync(resourceGroupName, name).toBlocking().single(); + public Object deleteCsr(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteCsrWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -709,7 +841,7 @@ public ServiceResponse deleteCsr(String resourceGroupName, String name) * @return the {@link ServiceCall} object */ public ServiceCall deleteCsrAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteCsrAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteCsrWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -719,7 +851,23 @@ public ServiceCall deleteCsrAsync(String resourceGroupName, String name, * @param name Name of the certificate signing request. * @return the observable to the Object object */ - public Observable> deleteCsrAsync(String resourceGroupName, String name) { + public Observable deleteCsrAsync(String resourceGroupName, String name) { + return deleteCsrWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete the certificate signing request. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate signing request. + * @return the observable to the Object object + */ + public Observable> deleteCsrWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -762,10 +910,10 @@ private ServiceResponse deleteCsrDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the CsrInner object wrapped in {@link ServiceResponse} if successful. + * @return the CsrInner object if successful. */ - public ServiceResponse updateCsr(String resourceGroupName, String name, CsrInner csrEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateCsrAsync(resourceGroupName, name, csrEnvelope).toBlocking().single(); + public CsrInner updateCsr(String resourceGroupName, String name, CsrInner csrEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateCsrWithServiceResponseAsync(resourceGroupName, name, csrEnvelope).toBlocking().single().getBody(); } /** @@ -778,7 +926,7 @@ public ServiceResponse updateCsr(String resourceGroupName, String name * @return the {@link ServiceCall} object */ public ServiceCall updateCsrAsync(String resourceGroupName, String name, CsrInner csrEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateCsrAsync(resourceGroupName, name, csrEnvelope), serviceCallback); + return ServiceCall.create(updateCsrWithServiceResponseAsync(resourceGroupName, name, csrEnvelope), serviceCallback); } /** @@ -789,7 +937,24 @@ public ServiceCall updateCsrAsync(String resourceGroupName, String nam * @param csrEnvelope Details of certificate signing request if it exists already. * @return the observable to the CsrInner object */ - public Observable> updateCsrAsync(String resourceGroupName, String name, CsrInner csrEnvelope) { + public Observable updateCsrAsync(String resourceGroupName, String name, CsrInner csrEnvelope) { + return updateCsrWithServiceResponseAsync(resourceGroupName, name, csrEnvelope).map(new Func1, CsrInner>() { + @Override + public CsrInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or modifies an existing certificate signing request. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the certificate. + * @param csrEnvelope Details of certificate signing request if it exists already. + * @return the observable to the CsrInner object + */ + public Observable> updateCsrWithServiceResponseAsync(String resourceGroupName, String name, CsrInner csrEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -834,17 +999,16 @@ private ServiceResponse updateCsrDelegate(Response respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object if successful. */ - public ServiceResponse> getCertificatesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getCertificatesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -871,15 +1035,34 @@ public Observable>> call(String nextPageL * Get certificates for a subscription in the specified resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CertificateInner> object + * @return the observable to the PagedList<CertificateInner> object */ - public Observable>> getCertificatesNextAsync(final String nextPageLink) { + public Observable> getCertificatesNextAsync(final String nextPageLink) { + return getCertificatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get certificates for a subscription in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable>> getCertificatesNextWithServiceResponseAsync(final String nextPageLink) { return getCertificatesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getCertificatesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -888,7 +1071,7 @@ public Observable>> call(ServiceResponse< * Get certificates for a subscription in the specified resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getCertificatesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ClassicMobileServicesInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ClassicMobileServicesInner.java index c27282de51d1..c89646225005 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ClassicMobileServicesInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ClassicMobileServicesInner.java @@ -84,17 +84,16 @@ interface ClassicMobileServicesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object if successful. */ - public ServiceResponse> getClassicMobileServices(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getClassicMobileServices(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getClassicMobileServicesSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getClassicMobileServicesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -120,15 +119,34 @@ public Observable>> call(String * Get all mobile services in a resource group. * * @param resourceGroupName Name of resource group - * @return the observable to the List<ClassicMobileServiceInner> object + * @return the observable to the PagedList<ClassicMobileServiceInner> object */ - public Observable>> getClassicMobileServicesAsync(final String resourceGroupName) { + public Observable> getClassicMobileServicesAsync(final String resourceGroupName) { + return getClassicMobileServicesWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all mobile services in a resource group. + * + * @param resourceGroupName Name of resource group + * @return the observable to the PagedList<ClassicMobileServiceInner> object + */ + public Observable>> getClassicMobileServicesWithServiceResponseAsync(final String resourceGroupName) { return getClassicMobileServicesSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getClassicMobileServicesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getClassicMobileServicesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -137,7 +155,7 @@ public Observable>> call(Service * Get all mobile services in a resource group. * ServiceResponse> * @param resourceGroupName Name of resource group - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getClassicMobileServicesSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -178,10 +196,10 @@ private ServiceResponse> getClassicMobileSer * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ClassicMobileServiceInner object wrapped in {@link ServiceResponse} if successful. + * @return the ClassicMobileServiceInner object if successful. */ - public ServiceResponse getClassicMobileService(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getClassicMobileServiceAsync(resourceGroupName, name).toBlocking().single(); + public ClassicMobileServiceInner getClassicMobileService(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getClassicMobileServiceWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -193,7 +211,23 @@ public ServiceResponse getClassicMobileService(String * @return the {@link ServiceCall} object */ public ServiceCall getClassicMobileServiceAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getClassicMobileServiceAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getClassicMobileServiceWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Get a mobile service. + * + * @param resourceGroupName Name of resource group + * @param name Name of mobile service + * @return the observable to the ClassicMobileServiceInner object + */ + public Observable getClassicMobileServiceAsync(String resourceGroupName, String name) { + return getClassicMobileServiceWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ClassicMobileServiceInner>() { + @Override + public ClassicMobileServiceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -203,7 +237,7 @@ public ServiceCall getClassicMobileServiceAsync(Strin * @param name Name of mobile service * @return the observable to the ClassicMobileServiceInner object */ - public Observable> getClassicMobileServiceAsync(String resourceGroupName, String name) { + public Observable> getClassicMobileServiceWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -245,10 +279,10 @@ private ServiceResponse getClassicMobileServiceDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteClassicMobileService(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteClassicMobileServiceAsync(resourceGroupName, name).toBlocking().single(); + public Object deleteClassicMobileService(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteClassicMobileServiceWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -260,7 +294,7 @@ public ServiceResponse deleteClassicMobileService(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall deleteClassicMobileServiceAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteClassicMobileServiceAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteClassicMobileServiceWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -270,7 +304,23 @@ public ServiceCall deleteClassicMobileServiceAsync(String resourceGroupN * @param name Name of mobile service * @return the observable to the Object object */ - public Observable> deleteClassicMobileServiceAsync(String resourceGroupName, String name) { + public Observable deleteClassicMobileServiceAsync(String resourceGroupName, String name) { + return deleteClassicMobileServiceWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a mobile service. + * + * @param resourceGroupName Name of resource group + * @param name Name of mobile service + * @return the observable to the Object object + */ + public Observable> deleteClassicMobileServiceWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -311,17 +361,16 @@ private ServiceResponse deleteClassicMobileServiceDelegate(Response> getClassicMobileServicesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getClassicMobileServicesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getClassicMobileServicesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getClassicMobileServicesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -348,15 +397,34 @@ public Observable>> call(String * Get all mobile services in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ClassicMobileServiceInner> object + * @return the observable to the PagedList<ClassicMobileServiceInner> object */ - public Observable>> getClassicMobileServicesNextAsync(final String nextPageLink) { + public Observable> getClassicMobileServicesNextAsync(final String nextPageLink) { + return getClassicMobileServicesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all mobile services in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ClassicMobileServiceInner> object + */ + public Observable>> getClassicMobileServicesNextWithServiceResponseAsync(final String nextPageLink) { return getClassicMobileServicesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getClassicMobileServicesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getClassicMobileServicesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -365,7 +433,7 @@ public Observable>> call(Service * Get all mobile services in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getClassicMobileServicesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/DomainsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/DomainsInner.java index a34ef643c0aa..e80333101335 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/DomainsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/DomainsInner.java @@ -100,17 +100,16 @@ interface DomainsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DomainInner> object if successful. */ - public ServiceResponse> getDomains(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDomains(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDomainsSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDomainsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -136,15 +135,34 @@ public Observable>> call(String nextPageLink) * Lists domains under a resource group. * * @param resourceGroupName Name of the resource group - * @return the observable to the List<DomainInner> object + * @return the observable to the PagedList<DomainInner> object */ - public Observable>> getDomainsAsync(final String resourceGroupName) { + public Observable> getDomainsAsync(final String resourceGroupName) { + return getDomainsWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists domains under a resource group. + * + * @param resourceGroupName Name of the resource group + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> getDomainsWithServiceResponseAsync(final String resourceGroupName) { return getDomainsSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDomainsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDomainsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -153,7 +171,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of the resource group - * @return the List<DomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDomainsSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -194,10 +212,10 @@ private ServiceResponse> getDomainsDelegate(Response getDomain(String resourceGroupName, String domainName) throws CloudException, IOException, IllegalArgumentException { - return getDomainAsync(resourceGroupName, domainName).toBlocking().single(); + public DomainInner getDomain(String resourceGroupName, String domainName) throws CloudException, IOException, IllegalArgumentException { + return getDomainWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().getBody(); } /** @@ -209,7 +227,7 @@ public ServiceResponse getDomain(String resourceGroupName, String d * @return the {@link ServiceCall} object */ public ServiceCall getDomainAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getDomainAsync(resourceGroupName, domainName), serviceCallback); + return ServiceCall.create(getDomainWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); } /** @@ -219,7 +237,23 @@ public ServiceCall getDomainAsync(String resourceGroupName, String * @param domainName Name of the domain * @return the observable to the DomainInner object */ - public Observable> getDomainAsync(String resourceGroupName, String domainName) { + public Observable getDomainAsync(String resourceGroupName, String domainName) { + return getDomainWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets details of a domain. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @return the observable to the DomainInner object + */ + public Observable> getDomainWithServiceResponseAsync(String resourceGroupName, String domainName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -262,10 +296,10 @@ private ServiceResponse getDomainDelegate(Response re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DomainInner object wrapped in {@link ServiceResponse} if successful. + * @return the DomainInner object if successful. */ - public ServiceResponse createOrUpdateDomain(String resourceGroupName, String domainName, DomainInner domain) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateDomainAsync(resourceGroupName, domainName, domain).toBlocking().single(); + public DomainInner createOrUpdateDomain(String resourceGroupName, String domainName, DomainInner domain) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateDomainWithServiceResponseAsync(resourceGroupName, domainName, domain).toBlocking().single().getBody(); } /** @@ -278,7 +312,7 @@ public ServiceResponse createOrUpdateDomain(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateDomainAsync(String resourceGroupName, String domainName, DomainInner domain, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateDomainAsync(resourceGroupName, domainName, domain), serviceCallback); + return ServiceCall.create(createOrUpdateDomainWithServiceResponseAsync(resourceGroupName, domainName, domain), serviceCallback); } /** @@ -289,7 +323,24 @@ public ServiceCall createOrUpdateDomainAsync(String resourceGroupNa * @param domain Domain registration information * @return the observable to the DomainInner object */ - public Observable> createOrUpdateDomainAsync(String resourceGroupName, String domainName, DomainInner domain) { + public Observable createOrUpdateDomainAsync(String resourceGroupName, String domainName, DomainInner domain) { + return createOrUpdateDomainWithServiceResponseAsync(resourceGroupName, domainName, domain).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates a domain. + * + * @param resourceGroupName &gt;Name of the resource group + * @param domainName Name of the domain + * @param domain Domain registration information + * @return the observable to the DomainInner object + */ + public Observable> createOrUpdateDomainWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -336,10 +387,10 @@ private ServiceResponse createOrUpdateDomainDelegate(Response deleteDomain(String resourceGroupName, String domainName) throws CloudException, IOException, IllegalArgumentException { - return deleteDomainAsync(resourceGroupName, domainName).toBlocking().single(); + public Object deleteDomain(String resourceGroupName, String domainName) throws CloudException, IOException, IllegalArgumentException { + return deleteDomainWithServiceResponseAsync(resourceGroupName, domainName).toBlocking().single().getBody(); } /** @@ -351,7 +402,7 @@ public ServiceResponse deleteDomain(String resourceGroupName, String dom * @return the {@link ServiceCall} object */ public ServiceCall deleteDomainAsync(String resourceGroupName, String domainName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteDomainAsync(resourceGroupName, domainName), serviceCallback); + return ServiceCall.create(deleteDomainWithServiceResponseAsync(resourceGroupName, domainName), serviceCallback); } /** @@ -361,7 +412,23 @@ public ServiceCall deleteDomainAsync(String resourceGroupName, String do * @param domainName Name of the domain * @return the observable to the Object object */ - public Observable> deleteDomainAsync(String resourceGroupName, String domainName) { + public Observable deleteDomainAsync(String resourceGroupName, String domainName) { + return deleteDomainWithServiceResponseAsync(resourceGroupName, domainName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Deletes a domain. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @return the observable to the Object object + */ + public Observable> deleteDomainWithServiceResponseAsync(String resourceGroupName, String domainName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -398,10 +465,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteDomain(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) throws CloudException, IOException, IllegalArgumentException { - return deleteDomainAsync(resourceGroupName, domainName, forceHardDeleteDomain).toBlocking().single(); + public Object deleteDomain(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) throws CloudException, IOException, IllegalArgumentException { + return deleteDomainWithServiceResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain).toBlocking().single().getBody(); } /** @@ -414,7 +481,24 @@ public ServiceResponse deleteDomain(String resourceGroupName, String dom * @return the {@link ServiceCall} object */ public ServiceCall deleteDomainAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteDomainAsync(resourceGroupName, domainName, forceHardDeleteDomain), serviceCallback); + return ServiceCall.create(deleteDomainWithServiceResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain), serviceCallback); + } + + /** + * Deletes a domain. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @param forceHardDeleteDomain If true then the domain will be deleted immediately instead of after 24 hours + * @return the observable to the Object object + */ + public Observable deleteDomainAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { + return deleteDomainWithServiceResponseAsync(resourceGroupName, domainName, forceHardDeleteDomain).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -425,7 +509,7 @@ public ServiceCall deleteDomainAsync(String resourceGroupName, String do * @param forceHardDeleteDomain If true then the domain will be deleted immediately instead of after 24 hours * @return the observable to the Object object */ - public Observable> deleteDomainAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { + public Observable> deleteDomainWithServiceResponseAsync(String resourceGroupName, String domainName, Boolean forceHardDeleteDomain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -468,10 +552,10 @@ private ServiceResponse deleteDomainDelegate(Response resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DomainInner object wrapped in {@link ServiceResponse} if successful. + * @return the DomainInner object if successful. */ - public ServiceResponse updateDomain(String resourceGroupName, String domainName, DomainInner domain) throws CloudException, IOException, IllegalArgumentException { - return updateDomainAsync(resourceGroupName, domainName, domain).toBlocking().single(); + public DomainInner updateDomain(String resourceGroupName, String domainName, DomainInner domain) throws CloudException, IOException, IllegalArgumentException { + return updateDomainWithServiceResponseAsync(resourceGroupName, domainName, domain).toBlocking().single().getBody(); } /** @@ -484,7 +568,24 @@ public ServiceResponse updateDomain(String resourceGroupName, Strin * @return the {@link ServiceCall} object */ public ServiceCall updateDomainAsync(String resourceGroupName, String domainName, DomainInner domain, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateDomainAsync(resourceGroupName, domainName, domain), serviceCallback); + return ServiceCall.create(updateDomainWithServiceResponseAsync(resourceGroupName, domainName, domain), serviceCallback); + } + + /** + * Creates a domain. + * + * @param resourceGroupName &gt;Name of the resource group + * @param domainName Name of the domain + * @param domain Domain registration information + * @return the observable to the DomainInner object + */ + public Observable updateDomainAsync(String resourceGroupName, String domainName, DomainInner domain) { + return updateDomainWithServiceResponseAsync(resourceGroupName, domainName, domain).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -495,7 +596,7 @@ public ServiceCall updateDomainAsync(String resourceGroupName, Stri * @param domain Domain registration information * @return the observable to the DomainInner object */ - public Observable> updateDomainAsync(String resourceGroupName, String domainName, DomainInner domain) { + public Observable> updateDomainWithServiceResponseAsync(String resourceGroupName, String domainName, DomainInner domain) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -543,10 +644,10 @@ private ServiceResponse updateDomainDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DomainInner object wrapped in {@link ServiceResponse} if successful. + * @return the DomainInner object if successful. */ - public ServiceResponse getDomainOperation(String resourceGroupName, String domainName, String operationId) throws CloudException, IOException, IllegalArgumentException { - return getDomainOperationAsync(resourceGroupName, domainName, operationId).toBlocking().single(); + public DomainInner getDomainOperation(String resourceGroupName, String domainName, String operationId) throws CloudException, IOException, IllegalArgumentException { + return getDomainOperationWithServiceResponseAsync(resourceGroupName, domainName, operationId).toBlocking().single().getBody(); } /** @@ -559,7 +660,7 @@ public ServiceResponse getDomainOperation(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getDomainOperationAsync(String resourceGroupName, String domainName, String operationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getDomainOperationAsync(resourceGroupName, domainName, operationId), serviceCallback); + return ServiceCall.create(getDomainOperationWithServiceResponseAsync(resourceGroupName, domainName, operationId), serviceCallback); } /** @@ -570,7 +671,24 @@ public ServiceCall getDomainOperationAsync(String resourceGroupName * @param operationId Domain purchase operation Id * @return the observable to the DomainInner object */ - public Observable> getDomainOperationAsync(String resourceGroupName, String domainName, String operationId) { + public Observable getDomainOperationAsync(String resourceGroupName, String domainName, String operationId) { + return getDomainOperationWithServiceResponseAsync(resourceGroupName, domainName, operationId).map(new Func1, DomainInner>() { + @Override + public DomainInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Retrieves the latest status of a domain purchase operation. + * + * @param resourceGroupName Name of the resource group + * @param domainName Name of the domain + * @param operationId Domain purchase operation Id + * @return the observable to the DomainInner object + */ + public Observable> getDomainOperationWithServiceResponseAsync(String resourceGroupName, String domainName, String operationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -616,17 +734,16 @@ private ServiceResponse getDomainOperationDelegate(Response> getDomainsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDomainsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDomainsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDomainsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -653,15 +770,34 @@ public Observable>> call(String nextPageLink) * Lists domains under a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DomainInner> object + * @return the observable to the PagedList<DomainInner> object */ - public Observable>> getDomainsNextAsync(final String nextPageLink) { + public Observable> getDomainsNextAsync(final String nextPageLink) { + return getDomainsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists domains under a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> getDomainsNextWithServiceResponseAsync(final String nextPageLink) { return getDomainsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDomainsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDomainsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -670,7 +806,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDomainsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalCertificateOrdersInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalCertificateOrdersInner.java index 29a37274ad11..b3fb022c9eb5 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalCertificateOrdersInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalCertificateOrdersInner.java @@ -81,17 +81,16 @@ interface GlobalCertificateOrdersService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object if successful. */ - public ServiceResponse> getAllCertificateOrders() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllCertificateOrders() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllCertificateOrdersSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllCertificateOrdersNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -115,15 +114,33 @@ public Observable>> call(String next /** * Lists all domains in a subscription. * - * @return the observable to the List<CertificateOrderInner> object + * @return the observable to the PagedList<CertificateOrderInner> object */ - public Observable>> getAllCertificateOrdersAsync() { + public Observable> getAllCertificateOrdersAsync() { + return getAllCertificateOrdersWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all domains in a subscription. + * + * @return the observable to the PagedList<CertificateOrderInner> object + */ + public Observable>> getAllCertificateOrdersWithServiceResponseAsync() { return getAllCertificateOrdersSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllCertificateOrdersNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllCertificateOrdersNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -131,7 +148,7 @@ public Observable>> call(ServiceResp /** * Lists all domains in a subscription. * - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllCertificateOrdersSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -168,10 +185,10 @@ private ServiceResponse> getAllCertificateOrders * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse validateCertificatePurchaseInformation(CertificateOrderInner certificateOrder) throws CloudException, IOException, IllegalArgumentException { - return validateCertificatePurchaseInformationAsync(certificateOrder).toBlocking().single(); + public Object validateCertificatePurchaseInformation(CertificateOrderInner certificateOrder) throws CloudException, IOException, IllegalArgumentException { + return validateCertificatePurchaseInformationWithServiceResponseAsync(certificateOrder).toBlocking().single().getBody(); } /** @@ -182,7 +199,7 @@ public ServiceResponse validateCertificatePurchaseInformation(Certificat * @return the {@link ServiceCall} object */ public ServiceCall validateCertificatePurchaseInformationAsync(CertificateOrderInner certificateOrder, final ServiceCallback serviceCallback) { - return ServiceCall.create(validateCertificatePurchaseInformationAsync(certificateOrder), serviceCallback); + return ServiceCall.create(validateCertificatePurchaseInformationWithServiceResponseAsync(certificateOrder), serviceCallback); } /** @@ -191,7 +208,22 @@ public ServiceCall validateCertificatePurchaseInformationAsync(Certifica * @param certificateOrder Certificate order * @return the observable to the Object object */ - public Observable> validateCertificatePurchaseInformationAsync(CertificateOrderInner certificateOrder) { + public Observable validateCertificatePurchaseInformationAsync(CertificateOrderInner certificateOrder) { + return validateCertificatePurchaseInformationWithServiceResponseAsync(certificateOrder).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Validate certificate purchase information. + * + * @param certificateOrder Certificate order + * @return the observable to the Object object + */ + public Observable> validateCertificatePurchaseInformationWithServiceResponseAsync(CertificateOrderInner certificateOrder) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -230,17 +262,16 @@ private ServiceResponse validateCertificatePurchaseInformationDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object if successful. */ - public ServiceResponse> getAllCertificateOrdersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllCertificateOrdersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllCertificateOrdersNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllCertificateOrdersNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -267,15 +298,34 @@ public Observable>> call(String next * Lists all domains in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CertificateOrderInner> object + * @return the observable to the PagedList<CertificateOrderInner> object + */ + public Observable> getAllCertificateOrdersNextAsync(final String nextPageLink) { + return getAllCertificateOrdersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all domains in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateOrderInner> object */ - public Observable>> getAllCertificateOrdersNextAsync(final String nextPageLink) { + public Observable>> getAllCertificateOrdersNextWithServiceResponseAsync(final String nextPageLink) { return getAllCertificateOrdersNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllCertificateOrdersNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllCertificateOrdersNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -284,7 +334,7 @@ public Observable>> call(ServiceResp * Lists all domains in a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateOrderInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllCertificateOrdersNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalDomainRegistrationsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalDomainRegistrationsInner.java index ce325e180a2e..9289a98ccf23 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalDomainRegistrationsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalDomainRegistrationsInner.java @@ -97,17 +97,16 @@ interface GlobalDomainRegistrationsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DomainInner> object if successful. */ - public ServiceResponse> getAllDomains() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllDomains() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllDomainsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllDomainsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -131,15 +130,33 @@ public Observable>> call(String nextPageLink) /** * Lists all domains in a subscription. * - * @return the observable to the List<DomainInner> object + * @return the observable to the PagedList<DomainInner> object */ - public Observable>> getAllDomainsAsync() { + public Observable> getAllDomainsAsync() { + return getAllDomainsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all domains in a subscription. + * + * @return the observable to the PagedList<DomainInner> object + */ + public Observable>> getAllDomainsWithServiceResponseAsync() { return getAllDomainsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllDomainsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllDomainsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -147,7 +164,7 @@ public Observable>> call(ServiceResponse>> getAllDomainsSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -183,10 +200,10 @@ private ServiceResponse> getAllDomainsDelegate(Response getDomainControlCenterSsoRequest() throws CloudException, IOException, IllegalArgumentException { - return getDomainControlCenterSsoRequestAsync().toBlocking().single(); + public DomainControlCenterSsoRequestInner getDomainControlCenterSsoRequest() throws CloudException, IOException, IllegalArgumentException { + return getDomainControlCenterSsoRequestWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -196,7 +213,7 @@ public ServiceResponse getDomainControlCente * @return the {@link ServiceCall} object */ public ServiceCall getDomainControlCenterSsoRequestAsync(final ServiceCallback serviceCallback) { - return ServiceCall.create(getDomainControlCenterSsoRequestAsync(), serviceCallback); + return ServiceCall.create(getDomainControlCenterSsoRequestWithServiceResponseAsync(), serviceCallback); } /** @@ -204,7 +221,21 @@ public ServiceCall getDomainControlCenterSso * * @return the observable to the DomainControlCenterSsoRequestInner object */ - public Observable> getDomainControlCenterSsoRequestAsync() { + public Observable getDomainControlCenterSsoRequestAsync() { + return getDomainControlCenterSsoRequestWithServiceResponseAsync().map(new Func1, DomainControlCenterSsoRequestInner>() { + @Override + public DomainControlCenterSsoRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Generates a single sign on request for domain management portal. + * + * @return the observable to the DomainControlCenterSsoRequestInner object + */ + public Observable> getDomainControlCenterSsoRequestWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -239,10 +270,10 @@ private ServiceResponse getDomainControlCent * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse validateDomainPurchaseInformation(DomainRegistrationInputInner domainRegistrationInput) throws CloudException, IOException, IllegalArgumentException { - return validateDomainPurchaseInformationAsync(domainRegistrationInput).toBlocking().single(); + public Object validateDomainPurchaseInformation(DomainRegistrationInputInner domainRegistrationInput) throws CloudException, IOException, IllegalArgumentException { + return validateDomainPurchaseInformationWithServiceResponseAsync(domainRegistrationInput).toBlocking().single().getBody(); } /** @@ -253,7 +284,7 @@ public ServiceResponse validateDomainPurchaseInformation(DomainRegistrat * @return the {@link ServiceCall} object */ public ServiceCall validateDomainPurchaseInformationAsync(DomainRegistrationInputInner domainRegistrationInput, final ServiceCallback serviceCallback) { - return ServiceCall.create(validateDomainPurchaseInformationAsync(domainRegistrationInput), serviceCallback); + return ServiceCall.create(validateDomainPurchaseInformationWithServiceResponseAsync(domainRegistrationInput), serviceCallback); } /** @@ -262,7 +293,22 @@ public ServiceCall validateDomainPurchaseInformationAsync(DomainRegistra * @param domainRegistrationInput Domain registration information * @return the observable to the Object object */ - public Observable> validateDomainPurchaseInformationAsync(DomainRegistrationInputInner domainRegistrationInput) { + public Observable validateDomainPurchaseInformationAsync(DomainRegistrationInputInner domainRegistrationInput) { + return validateDomainPurchaseInformationWithServiceResponseAsync(domainRegistrationInput).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Validates domain registration information. + * + * @param domainRegistrationInput Domain registration information + * @return the observable to the Object object + */ + public Observable> validateDomainPurchaseInformationWithServiceResponseAsync(DomainRegistrationInputInner domainRegistrationInput) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -300,10 +346,10 @@ private ServiceResponse validateDomainPurchaseInformationDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DomainAvailablilityCheckResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the DomainAvailablilityCheckResultInner object if successful. */ - public ServiceResponse checkDomainAvailability() throws CloudException, IOException, IllegalArgumentException { - return checkDomainAvailabilityAsync().toBlocking().single(); + public DomainAvailablilityCheckResultInner checkDomainAvailability() throws CloudException, IOException, IllegalArgumentException { + return checkDomainAvailabilityWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -313,7 +359,7 @@ public ServiceResponse checkDomainAvailabil * @return the {@link ServiceCall} object */ public ServiceCall checkDomainAvailabilityAsync(final ServiceCallback serviceCallback) { - return ServiceCall.create(checkDomainAvailabilityAsync(), serviceCallback); + return ServiceCall.create(checkDomainAvailabilityWithServiceResponseAsync(), serviceCallback); } /** @@ -321,7 +367,21 @@ public ServiceCall checkDomainAvailabilityA * * @return the observable to the DomainAvailablilityCheckResultInner object */ - public Observable> checkDomainAvailabilityAsync() { + public Observable checkDomainAvailabilityAsync() { + return checkDomainAvailabilityWithServiceResponseAsync().map(new Func1, DomainAvailablilityCheckResultInner>() { + @Override + public DomainAvailablilityCheckResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Checks if a domain is available for registration. + * + * @return the observable to the DomainAvailablilityCheckResultInner object + */ + public Observable> checkDomainAvailabilityWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -352,10 +412,10 @@ public Observable> call(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DomainAvailablilityCheckResultInner object wrapped in {@link ServiceResponse} if successful. + * @return the DomainAvailablilityCheckResultInner object if successful. */ - public ServiceResponse checkDomainAvailability(String name) throws CloudException, IOException, IllegalArgumentException { - return checkDomainAvailabilityAsync(name).toBlocking().single(); + public DomainAvailablilityCheckResultInner checkDomainAvailability(String name) throws CloudException, IOException, IllegalArgumentException { + return checkDomainAvailabilityWithServiceResponseAsync(name).toBlocking().single().getBody(); } /** @@ -366,7 +426,7 @@ public ServiceResponse checkDomainAvailabil * @return the {@link ServiceCall} object */ public ServiceCall checkDomainAvailabilityAsync(String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkDomainAvailabilityAsync(name), serviceCallback); + return ServiceCall.create(checkDomainAvailabilityWithServiceResponseAsync(name), serviceCallback); } /** @@ -375,7 +435,22 @@ public ServiceCall checkDomainAvailabilityA * @param name Name of the object * @return the observable to the DomainAvailablilityCheckResultInner object */ - public Observable> checkDomainAvailabilityAsync(String name) { + public Observable checkDomainAvailabilityAsync(String name) { + return checkDomainAvailabilityWithServiceResponseAsync(name).map(new Func1, DomainAvailablilityCheckResultInner>() { + @Override + public DomainAvailablilityCheckResultInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Checks if a domain is available for registration. + * + * @param name Name of the object + * @return the observable to the DomainAvailablilityCheckResultInner object + */ + public Observable> checkDomainAvailabilityWithServiceResponseAsync(String name) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -412,17 +487,16 @@ private ServiceResponse checkDomainAvailabi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NameIdentifierInner> object if successful. */ - public ServiceResponse> listDomainRecommendations(final DomainRecommendationSearchParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { + public PagedList listDomainRecommendations(final DomainRecommendationSearchParametersInner parameters) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listDomainRecommendationsSinglePageAsync(parameters).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listDomainRecommendationsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -448,15 +522,34 @@ public Observable>> call(String nextPa * Lists domain recommendations based on keywords. * * @param parameters Domain recommendation search parameters - * @return the observable to the List<NameIdentifierInner> object + * @return the observable to the PagedList<NameIdentifierInner> object */ - public Observable>> listDomainRecommendationsAsync(final DomainRecommendationSearchParametersInner parameters) { + public Observable> listDomainRecommendationsAsync(final DomainRecommendationSearchParametersInner parameters) { + return listDomainRecommendationsWithServiceResponseAsync(parameters) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists domain recommendations based on keywords. + * + * @param parameters Domain recommendation search parameters + * @return the observable to the PagedList<NameIdentifierInner> object + */ + public Observable>> listDomainRecommendationsWithServiceResponseAsync(final DomainRecommendationSearchParametersInner parameters) { return listDomainRecommendationsSinglePageAsync(parameters) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listDomainRecommendationsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDomainRecommendationsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -465,7 +558,7 @@ public Observable>> call(ServiceRespon * Lists domain recommendations based on keywords. * ServiceResponse> * @param parameters Domain recommendation search parameters - * @return the List<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listDomainRecommendationsSinglePageAsync(final DomainRecommendationSearchParametersInner parameters) { if (this.client.subscriptionId() == null) { @@ -506,17 +599,16 @@ private ServiceResponse> listDomainRecommendations * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DomainInner> object if successful. */ - public ServiceResponse> getAllDomainsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllDomainsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllDomainsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllDomainsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -543,15 +635,34 @@ public Observable>> call(String nextPageLink) * Lists all domains in a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DomainInner> object + * @return the observable to the PagedList<DomainInner> object + */ + public Observable> getAllDomainsNextAsync(final String nextPageLink) { + return getAllDomainsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all domains in a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DomainInner> object */ - public Observable>> getAllDomainsNextAsync(final String nextPageLink) { + public Observable>> getAllDomainsNextWithServiceResponseAsync(final String nextPageLink) { return getAllDomainsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllDomainsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllDomainsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -560,7 +671,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllDomainsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -594,17 +705,16 @@ private ServiceResponse> getAllDomainsNextDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NameIdentifierInner> object if successful. */ - public ServiceResponse> listDomainRecommendationsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listDomainRecommendationsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listDomainRecommendationsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listDomainRecommendationsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -631,15 +741,34 @@ public Observable>> call(String nextPa * Lists domain recommendations based on keywords. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<NameIdentifierInner> object + * @return the observable to the PagedList<NameIdentifierInner> object */ - public Observable>> listDomainRecommendationsNextAsync(final String nextPageLink) { + public Observable> listDomainRecommendationsNextAsync(final String nextPageLink) { + return listDomainRecommendationsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists domain recommendations based on keywords. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<NameIdentifierInner> object + */ + public Observable>> listDomainRecommendationsNextWithServiceResponseAsync(final String nextPageLink) { return listDomainRecommendationsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listDomainRecommendationsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listDomainRecommendationsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -648,7 +777,7 @@ public Observable>> call(ServiceRespon * Lists domain recommendations based on keywords. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<NameIdentifierInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listDomainRecommendationsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalResourceGroupsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalResourceGroupsInner.java index 1dd4a6dac75f..06042400c71d 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalResourceGroupsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalResourceGroupsInner.java @@ -67,10 +67,9 @@ interface GlobalResourceGroupsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the {@link ServiceResponse} object if successful. */ - public ServiceResponse moveResources(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope) throws CloudException, IOException, IllegalArgumentException { - return moveResourcesAsync(resourceGroupName, moveResourceEnvelope).toBlocking().single(); + public void moveResources(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope) throws CloudException, IOException, IllegalArgumentException { + moveResourcesWithServiceResponseAsync(resourceGroupName, moveResourceEnvelope).toBlocking().single().getBody(); } /** @@ -81,7 +80,22 @@ public ServiceResponse moveResources(String resourceGroupName, CsmMoveReso * @return the {@link ServiceCall} object */ public ServiceCall moveResourcesAsync(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(moveResourcesAsync(resourceGroupName, moveResourceEnvelope), serviceCallback); + return ServiceCall.create(moveResourcesWithServiceResponseAsync(resourceGroupName, moveResourceEnvelope), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param moveResourceEnvelope the CsmMoveResourceEnvelopeInner value + * @return the {@link ServiceResponse} object if successful. + */ + public Observable moveResourcesAsync(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope) { + return moveResourcesWithServiceResponseAsync(resourceGroupName, moveResourceEnvelope).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -90,7 +104,7 @@ public ServiceCall moveResourcesAsync(String resourceGroupName, CsmMoveRes * @param moveResourceEnvelope the CsmMoveResourceEnvelopeInner value * @return the {@link ServiceResponse} object if successful. */ - public Observable> moveResourcesAsync(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope) { + public Observable> moveResourcesWithServiceResponseAsync(String resourceGroupName, CsmMoveResourceEnvelopeInner moveResourceEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalsInner.java index 5b9475d5ef44..fdbb078ce1d9 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/GlobalsInner.java @@ -150,10 +150,10 @@ interface GlobalsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the UserInner object wrapped in {@link ServiceResponse} if successful. + * @return the UserInner object if successful. */ - public ServiceResponse getSubscriptionPublishingCredentials() throws CloudException, IOException, IllegalArgumentException { - return getSubscriptionPublishingCredentialsAsync().toBlocking().single(); + public UserInner getSubscriptionPublishingCredentials() throws CloudException, IOException, IllegalArgumentException { + return getSubscriptionPublishingCredentialsWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -163,7 +163,7 @@ public ServiceResponse getSubscriptionPublishingCredentials() throws * @return the {@link ServiceCall} object */ public ServiceCall getSubscriptionPublishingCredentialsAsync(final ServiceCallback serviceCallback) { - return ServiceCall.create(getSubscriptionPublishingCredentialsAsync(), serviceCallback); + return ServiceCall.create(getSubscriptionPublishingCredentialsWithServiceResponseAsync(), serviceCallback); } /** @@ -171,7 +171,21 @@ public ServiceCall getSubscriptionPublishingCredentialsAsync(final Se * * @return the observable to the UserInner object */ - public Observable> getSubscriptionPublishingCredentialsAsync() { + public Observable getSubscriptionPublishingCredentialsAsync() { + return getSubscriptionPublishingCredentialsWithServiceResponseAsync().map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets publishing credentials for the subscription owner. + * + * @return the observable to the UserInner object + */ + public Observable> getSubscriptionPublishingCredentialsWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -206,10 +220,10 @@ private ServiceResponse getSubscriptionPublishingCredentialsDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the UserInner object wrapped in {@link ServiceResponse} if successful. + * @return the UserInner object if successful. */ - public ServiceResponse updateSubscriptionPublishingCredentials(UserInner requestMessage) throws CloudException, IOException, IllegalArgumentException { - return updateSubscriptionPublishingCredentialsAsync(requestMessage).toBlocking().single(); + public UserInner updateSubscriptionPublishingCredentials(UserInner requestMessage) throws CloudException, IOException, IllegalArgumentException { + return updateSubscriptionPublishingCredentialsWithServiceResponseAsync(requestMessage).toBlocking().single().getBody(); } /** @@ -220,7 +234,7 @@ public ServiceResponse updateSubscriptionPublishingCredentials(UserIn * @return the {@link ServiceCall} object */ public ServiceCall updateSubscriptionPublishingCredentialsAsync(UserInner requestMessage, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSubscriptionPublishingCredentialsAsync(requestMessage), serviceCallback); + return ServiceCall.create(updateSubscriptionPublishingCredentialsWithServiceResponseAsync(requestMessage), serviceCallback); } /** @@ -229,7 +243,22 @@ public ServiceCall updateSubscriptionPublishingCredentialsAsync(UserI * @param requestMessage requestMessage with new publishing credentials * @return the observable to the UserInner object */ - public Observable> updateSubscriptionPublishingCredentialsAsync(UserInner requestMessage) { + public Observable updateSubscriptionPublishingCredentialsAsync(UserInner requestMessage) { + return updateSubscriptionPublishingCredentialsWithServiceResponseAsync(requestMessage).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Updates publishing credentials for the subscription owner. + * + * @param requestMessage requestMessage with new publishing credentials + * @return the observable to the UserInner object + */ + public Observable> updateSubscriptionPublishingCredentialsWithServiceResponseAsync(UserInner requestMessage) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -267,17 +296,16 @@ private ServiceResponse updateSubscriptionPublishingCredentialsDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GeoRegionInner> object if successful. */ - public ServiceResponse> getSubscriptionGeoRegions() throws CloudException, IOException, IllegalArgumentException { + public PagedList getSubscriptionGeoRegions() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSubscriptionGeoRegionsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -301,15 +329,33 @@ public Observable>> call(String nextPageLin /** * Gets list of available geo regions. * - * @return the observable to the List<GeoRegionInner> object + * @return the observable to the PagedList<GeoRegionInner> object */ - public Observable>> getSubscriptionGeoRegionsAsync() { + public Observable> getSubscriptionGeoRegionsAsync() { + return getSubscriptionGeoRegionsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of available geo regions. + * + * @return the observable to the PagedList<GeoRegionInner> object + */ + public Observable>> getSubscriptionGeoRegionsWithServiceResponseAsync() { return getSubscriptionGeoRegionsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSubscriptionGeoRegionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -317,7 +363,7 @@ public Observable>> call(ServiceResponse>> getSubscriptionGeoRegionsSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -348,17 +394,16 @@ public Observable>> call(Response> getSubscriptionGeoRegions(final String sku) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSubscriptionGeoRegions(final String sku) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSubscriptionGeoRegionsSinglePageAsync(sku).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -384,15 +429,34 @@ public Observable>> call(String nextPageLin * Gets list of available geo regions. * * @param sku Filter only to regions that support this sku - * @return the observable to the List<GeoRegionInner> object + * @return the observable to the PagedList<GeoRegionInner> object */ - public Observable>> getSubscriptionGeoRegionsAsync(final String sku) { + public Observable> getSubscriptionGeoRegionsAsync(final String sku) { + return getSubscriptionGeoRegionsWithServiceResponseAsync(sku) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of available geo regions. + * + * @param sku Filter only to regions that support this sku + * @return the observable to the PagedList<GeoRegionInner> object + */ + public Observable>> getSubscriptionGeoRegionsWithServiceResponseAsync(final String sku) { return getSubscriptionGeoRegionsSinglePageAsync(sku) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSubscriptionGeoRegionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -401,7 +465,7 @@ public Observable>> call(ServiceResponse> * @param sku Filter only to regions that support this sku - * @return the List<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSubscriptionGeoRegionsSinglePageAsync(final String sku) { if (this.client.subscriptionId() == null) { @@ -437,17 +501,16 @@ private ServiceResponse> getSubscriptionGeoRegionsDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object if successful. */ - public ServiceResponse> getAllCertificates() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllCertificates() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllCertificatesSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -471,15 +534,33 @@ public Observable>> call(String nextPageL /** * Get all certificates for a subscription. * - * @return the observable to the List<CertificateInner> object + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable> getAllCertificatesAsync() { + return getAllCertificatesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all certificates for a subscription. + * + * @return the observable to the PagedList<CertificateInner> object */ - public Observable>> getAllCertificatesAsync() { + public Observable>> getAllCertificatesWithServiceResponseAsync() { return getAllCertificatesSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllCertificatesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllCertificatesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -487,7 +568,7 @@ public Observable>> call(ServiceResponse< /** * Get all certificates for a subscription. * - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllCertificatesSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -523,17 +604,16 @@ private ServiceResponse> getAllCertificatesDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getAllServerFarms() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllServerFarms() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllServerFarmsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -557,15 +637,33 @@ public Observable>> call(String /** * Gets all App Service Plans for a subcription. * - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getAllServerFarmsAsync() { + return getAllServerFarmsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all App Service Plans for a subcription. + * + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getAllServerFarmsAsync() { + public Observable>> getAllServerFarmsWithServiceResponseAsync() { return getAllServerFarmsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -573,7 +671,7 @@ public Observable>> call(Servic /** * Gets all App Service Plans for a subcription. * - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllServerFarmsSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -605,17 +703,16 @@ public Observable>> call(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getAllServerFarms(final Boolean detailed) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllServerFarms(final Boolean detailed) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllServerFarmsSinglePageAsync(detailed).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -643,15 +740,35 @@ public Observable>> call(String * * @param detailed False to return a subset of App Service Plan properties, true to return all of the properties. Retrieval of all properties may increase the API latency. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getAllServerFarmsAsync(final Boolean detailed) { + return getAllServerFarmsWithServiceResponseAsync(detailed) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all App Service Plans for a subcription. + * + * @param detailed False to return a subset of App Service Plan properties, true to return all of the properties. + Retrieval of all properties may increase the API latency. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getAllServerFarmsAsync(final Boolean detailed) { + public Observable>> getAllServerFarmsWithServiceResponseAsync(final Boolean detailed) { return getAllServerFarmsSinglePageAsync(detailed) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -661,7 +778,7 @@ public Observable>> call(Servic * ServiceResponse> * @param detailed False to return a subset of App Service Plan properties, true to return all of the properties. Retrieval of all properties may increase the API latency. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllServerFarmsSinglePageAsync(final Boolean detailed) { if (this.client.subscriptionId() == null) { @@ -697,17 +814,16 @@ private ServiceResponse> getAllServerFarmsD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getAllSites() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllSites() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllSitesSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -731,15 +847,33 @@ public Observable>> call(String nextPageLink) { /** * Gets all Web Apps for a subscription. * - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getAllSitesAsync() { + public Observable> getAllSitesAsync() { + return getAllSitesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all Web Apps for a subscription. + * + * @return the observable to the PagedList<SiteInner> object + */ + public Observable>> getAllSitesWithServiceResponseAsync() { return getAllSitesSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -747,7 +881,7 @@ public Observable>> call(ServiceResponse>> getAllSitesSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -783,17 +917,16 @@ private ServiceResponse> getAllSitesDelegate(Response> getAllHostingEnvironments() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllHostingEnvironments() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllHostingEnvironmentsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -817,15 +950,33 @@ public Observable>> call(String ne /** * Gets all hostingEnvironments (App Service Environment) for a subscription. * - * @return the observable to the List<HostingEnvironmentInner> object + * @return the observable to the PagedList<HostingEnvironmentInner> object */ - public Observable>> getAllHostingEnvironmentsAsync() { + public Observable> getAllHostingEnvironmentsAsync() { + return getAllHostingEnvironmentsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all hostingEnvironments (App Service Environment) for a subscription. + * + * @return the observable to the PagedList<HostingEnvironmentInner> object + */ + public Observable>> getAllHostingEnvironmentsWithServiceResponseAsync() { return getAllHostingEnvironmentsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -833,7 +984,7 @@ public Observable>> call(ServiceRe /** * Gets all hostingEnvironments (App Service Environment) for a subscription. * - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllHostingEnvironmentsSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -869,17 +1020,16 @@ private ServiceResponse> getAllHostingEnvironm * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ManagedHostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ManagedHostingEnvironmentInner> object if successful. */ - public ServiceResponse> getAllManagedHostingEnvironments() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllManagedHostingEnvironments() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllManagedHostingEnvironmentsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -903,15 +1053,33 @@ public Observable>> call(St /** * Gets all managed hosting environments for a subscription. * - * @return the observable to the List<ManagedHostingEnvironmentInner> object + * @return the observable to the PagedList<ManagedHostingEnvironmentInner> object + */ + public Observable> getAllManagedHostingEnvironmentsAsync() { + return getAllManagedHostingEnvironmentsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all managed hosting environments for a subscription. + * + * @return the observable to the PagedList<ManagedHostingEnvironmentInner> object */ - public Observable>> getAllManagedHostingEnvironmentsAsync() { + public Observable>> getAllManagedHostingEnvironmentsWithServiceResponseAsync() { return getAllManagedHostingEnvironmentsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllManagedHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -919,7 +1087,7 @@ public Observable>> call(Se /** * Gets all managed hosting environments for a subscription. * - * @return the List<ManagedHostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ManagedHostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllManagedHostingEnvironmentsSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -955,17 +1123,16 @@ private ServiceResponse> getAllManagedH * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object if successful. */ - public ServiceResponse> getAllClassicMobileServices() throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllClassicMobileServices() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllClassicMobileServicesSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllClassicMobileServicesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -989,15 +1156,33 @@ public Observable>> call(String /** * Gets all mobile services for a subscription. * - * @return the observable to the List<ClassicMobileServiceInner> object + * @return the observable to the PagedList<ClassicMobileServiceInner> object */ - public Observable>> getAllClassicMobileServicesAsync() { + public Observable> getAllClassicMobileServicesAsync() { + return getAllClassicMobileServicesWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all mobile services for a subscription. + * + * @return the observable to the PagedList<ClassicMobileServiceInner> object + */ + public Observable>> getAllClassicMobileServicesWithServiceResponseAsync() { return getAllClassicMobileServicesSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllClassicMobileServicesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllClassicMobileServicesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1005,7 +1190,7 @@ public Observable>> call(Service /** * Gets all mobile services for a subscription. * - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllClassicMobileServicesSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -1041,10 +1226,10 @@ private ServiceResponse> getAllClassicMobile * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse listPremierAddOnOffers() throws CloudException, IOException, IllegalArgumentException { - return listPremierAddOnOffersAsync().toBlocking().single(); + public Object listPremierAddOnOffers() throws CloudException, IOException, IllegalArgumentException { + return listPremierAddOnOffersWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -1054,7 +1239,21 @@ public ServiceResponse listPremierAddOnOffers() throws CloudException, I * @return the {@link ServiceCall} object */ public ServiceCall listPremierAddOnOffersAsync(final ServiceCallback serviceCallback) { - return ServiceCall.create(listPremierAddOnOffersAsync(), serviceCallback); + return ServiceCall.create(listPremierAddOnOffersWithServiceResponseAsync(), serviceCallback); + } + + /** + * List premier add on offers. + * + * @return the observable to the Object object + */ + public Observable listPremierAddOnOffersAsync() { + return listPremierAddOnOffersWithServiceResponseAsync().map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1062,7 +1261,7 @@ public ServiceCall listPremierAddOnOffersAsync(final ServiceCallback> listPremierAddOnOffersAsync() { + public Observable> listPremierAddOnOffersWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1097,10 +1296,10 @@ private ServiceResponse listPremierAddOnOffersDelegate(Response isHostingEnvironmentNameAvailable(String name) throws CloudException, IOException, IllegalArgumentException { - return isHostingEnvironmentNameAvailableAsync(name).toBlocking().single(); + public Object isHostingEnvironmentNameAvailable(String name) throws CloudException, IOException, IllegalArgumentException { + return isHostingEnvironmentNameAvailableWithServiceResponseAsync(name).toBlocking().single().getBody(); } /** @@ -1111,7 +1310,7 @@ public ServiceResponse isHostingEnvironmentNameAvailable(String name) th * @return the {@link ServiceCall} object */ public ServiceCall isHostingEnvironmentNameAvailableAsync(String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(isHostingEnvironmentNameAvailableAsync(name), serviceCallback); + return ServiceCall.create(isHostingEnvironmentNameAvailableWithServiceResponseAsync(name), serviceCallback); } /** @@ -1120,7 +1319,22 @@ public ServiceCall isHostingEnvironmentNameAvailableAsync(String name, f * @param name Hosting environment name * @return the observable to the Object object */ - public Observable> isHostingEnvironmentNameAvailableAsync(String name) { + public Observable isHostingEnvironmentNameAvailableAsync(String name) { + return isHostingEnvironmentNameAvailableWithServiceResponseAsync(name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Whether hosting environment name is available. + * + * @param name Hosting environment name + * @return the observable to the Object object + */ + public Observable> isHostingEnvironmentNameAvailableWithServiceResponseAsync(String name) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1158,10 +1372,10 @@ private ServiceResponse isHostingEnvironmentNameAvailableDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse isHostingEnvironmentWithLegacyNameAvailable(String name) throws CloudException, IOException, IllegalArgumentException { - return isHostingEnvironmentWithLegacyNameAvailableAsync(name).toBlocking().single(); + public Object isHostingEnvironmentWithLegacyNameAvailable(String name) throws CloudException, IOException, IllegalArgumentException { + return isHostingEnvironmentWithLegacyNameAvailableWithServiceResponseAsync(name).toBlocking().single().getBody(); } /** @@ -1172,7 +1386,7 @@ public ServiceResponse isHostingEnvironmentWithLegacyNameAvailable(Strin * @return the {@link ServiceCall} object */ public ServiceCall isHostingEnvironmentWithLegacyNameAvailableAsync(String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(isHostingEnvironmentWithLegacyNameAvailableAsync(name), serviceCallback); + return ServiceCall.create(isHostingEnvironmentWithLegacyNameAvailableWithServiceResponseAsync(name), serviceCallback); } /** @@ -1181,7 +1395,22 @@ public ServiceCall isHostingEnvironmentWithLegacyNameAvailableAsync(Stri * @param name Hosting environment name * @return the observable to the Object object */ - public Observable> isHostingEnvironmentWithLegacyNameAvailableAsync(String name) { + public Observable isHostingEnvironmentWithLegacyNameAvailableAsync(String name) { + return isHostingEnvironmentWithLegacyNameAvailableWithServiceResponseAsync(name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Whether hosting environment name is available. + * + * @param name Hosting environment name + * @return the observable to the Object object + */ + public Observable> isHostingEnvironmentWithLegacyNameAvailableWithServiceResponseAsync(String name) { if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } @@ -1219,10 +1448,10 @@ private ServiceResponse isHostingEnvironmentWithLegacyNameAvailableDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ResourceNameAvailabilityInner object wrapped in {@link ServiceResponse} if successful. + * @return the ResourceNameAvailabilityInner object if successful. */ - public ServiceResponse checkNameAvailability(ResourceNameAvailabilityRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return checkNameAvailabilityAsync(request).toBlocking().single(); + public ResourceNameAvailabilityInner checkNameAvailability(ResourceNameAvailabilityRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return checkNameAvailabilityWithServiceResponseAsync(request).toBlocking().single().getBody(); } /** @@ -1233,7 +1462,7 @@ public ServiceResponse checkNameAvailability(Reso * @return the {@link ServiceCall} object */ public ServiceCall checkNameAvailabilityAsync(ResourceNameAvailabilityRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(checkNameAvailabilityAsync(request), serviceCallback); + return ServiceCall.create(checkNameAvailabilityWithServiceResponseAsync(request), serviceCallback); } /** @@ -1242,7 +1471,22 @@ public ServiceCall checkNameAvailabilityAsync(Res * @param request Name availability request * @return the observable to the ResourceNameAvailabilityInner object */ - public Observable> checkNameAvailabilityAsync(ResourceNameAvailabilityRequestInner request) { + public Observable checkNameAvailabilityAsync(ResourceNameAvailabilityRequestInner request) { + return checkNameAvailabilityWithServiceResponseAsync(request).map(new Func1, ResourceNameAvailabilityInner>() { + @Override + public ResourceNameAvailabilityInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Check if resource name is available. + * + * @param request Name availability request + * @return the observable to the ResourceNameAvailabilityInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(ResourceNameAvailabilityRequestInner request) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -1281,17 +1525,16 @@ private ServiceResponse checkNameAvailabilityDele * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GeoRegionInner> object if successful. */ - public ServiceResponse> getSubscriptionGeoRegionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSubscriptionGeoRegionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1318,15 +1561,34 @@ public Observable>> call(String nextPageLin * Gets list of available geo regions. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<GeoRegionInner> object + * @return the observable to the PagedList<GeoRegionInner> object + */ + public Observable> getSubscriptionGeoRegionsNextAsync(final String nextPageLink) { + return getSubscriptionGeoRegionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of available geo regions. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<GeoRegionInner> object */ - public Observable>> getSubscriptionGeoRegionsNextAsync(final String nextPageLink) { + public Observable>> getSubscriptionGeoRegionsNextWithServiceResponseAsync(final String nextPageLink) { return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSubscriptionGeoRegionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSubscriptionGeoRegionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1335,7 +1597,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<GeoRegionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSubscriptionGeoRegionsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1369,17 +1631,16 @@ private ServiceResponse> getSubscriptionGeoRegionsNextD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object if successful. */ - public ServiceResponse> getAllCertificatesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllCertificatesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllCertificatesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1406,15 +1667,34 @@ public Observable>> call(String nextPageL * Get all certificates for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CertificateInner> object + * @return the observable to the PagedList<CertificateInner> object */ - public Observable>> getAllCertificatesNextAsync(final String nextPageLink) { + public Observable> getAllCertificatesNextAsync(final String nextPageLink) { + return getAllCertificatesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all certificates for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CertificateInner> object + */ + public Observable>> getAllCertificatesNextWithServiceResponseAsync(final String nextPageLink) { return getAllCertificatesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllCertificatesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllCertificatesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1423,7 +1703,7 @@ public Observable>> call(ServiceResponse< * Get all certificates for a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CertificateInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CertificateInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllCertificatesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1457,17 +1737,16 @@ private ServiceResponse> getAllCertificatesNextDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getAllServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1494,15 +1773,34 @@ public Observable>> call(String * Gets all App Service Plans for a subcription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getAllServerFarmsNextAsync(final String nextPageLink) { + return getAllServerFarmsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all App Service Plans for a subcription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getAllServerFarmsNextAsync(final String nextPageLink) { + public Observable>> getAllServerFarmsNextWithServiceResponseAsync(final String nextPageLink) { return getAllServerFarmsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1511,7 +1809,7 @@ public Observable>> call(Servic * Gets all App Service Plans for a subcription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllServerFarmsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1545,17 +1843,16 @@ private ServiceResponse> getAllServerFarmsN * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getAllSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllSitesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1582,15 +1879,34 @@ public Observable>> call(String nextPageLink) { * Gets all Web Apps for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getAllSitesNextAsync(final String nextPageLink) { + public Observable> getAllSitesNextAsync(final String nextPageLink) { + return getAllSitesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all Web Apps for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object + */ + public Observable>> getAllSitesNextWithServiceResponseAsync(final String nextPageLink) { return getAllSitesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1599,7 +1915,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllSitesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1633,17 +1949,16 @@ private ServiceResponse> getAllSitesNextDelegate(Response> getAllHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1670,15 +1985,34 @@ public Observable>> call(String ne * Gets all hostingEnvironments (App Service Environment) for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<HostingEnvironmentInner> object + * @return the observable to the PagedList<HostingEnvironmentInner> object */ - public Observable>> getAllHostingEnvironmentsNextAsync(final String nextPageLink) { + public Observable> getAllHostingEnvironmentsNextAsync(final String nextPageLink) { + return getAllHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all hostingEnvironments (App Service Environment) for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<HostingEnvironmentInner> object + */ + public Observable>> getAllHostingEnvironmentsNextWithServiceResponseAsync(final String nextPageLink) { return getAllHostingEnvironmentsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1687,7 +2021,7 @@ public Observable>> call(ServiceRe * Gets all hostingEnvironments (App Service Environment) for a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllHostingEnvironmentsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1721,17 +2055,16 @@ private ServiceResponse> getAllHostingEnvironm * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ManagedHostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ManagedHostingEnvironmentInner> object if successful. */ - public ServiceResponse> getAllManagedHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllManagedHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1758,15 +2091,34 @@ public Observable>> call(St * Gets all managed hosting environments for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ManagedHostingEnvironmentInner> object + * @return the observable to the PagedList<ManagedHostingEnvironmentInner> object + */ + public Observable> getAllManagedHostingEnvironmentsNextAsync(final String nextPageLink) { + return getAllManagedHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all managed hosting environments for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ManagedHostingEnvironmentInner> object */ - public Observable>> getAllManagedHostingEnvironmentsNextAsync(final String nextPageLink) { + public Observable>> getAllManagedHostingEnvironmentsNextWithServiceResponseAsync(final String nextPageLink) { return getAllManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllManagedHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1775,7 +2127,7 @@ public Observable>> call(Se * Gets all managed hosting environments for a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ManagedHostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ManagedHostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllManagedHostingEnvironmentsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1809,17 +2161,16 @@ private ServiceResponse> getAllManagedH * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object if successful. */ - public ServiceResponse> getAllClassicMobileServicesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getAllClassicMobileServicesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getAllClassicMobileServicesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getAllClassicMobileServicesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1846,15 +2197,34 @@ public Observable>> call(String * Gets all mobile services for a subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ClassicMobileServiceInner> object + * @return the observable to the PagedList<ClassicMobileServiceInner> object */ - public Observable>> getAllClassicMobileServicesNextAsync(final String nextPageLink) { + public Observable> getAllClassicMobileServicesNextAsync(final String nextPageLink) { + return getAllClassicMobileServicesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all mobile services for a subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ClassicMobileServiceInner> object + */ + public Observable>> getAllClassicMobileServicesNextWithServiceResponseAsync(final String nextPageLink) { return getAllClassicMobileServicesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getAllClassicMobileServicesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getAllClassicMobileServicesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1863,7 +2233,7 @@ public Observable>> call(Service * Gets all mobile services for a subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ClassicMobileServiceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getAllClassicMobileServicesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostingEnvironmentsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostingEnvironmentsInner.java index 68df5124f556..1a59eb2dcdfb 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostingEnvironmentsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/HostingEnvironmentsInner.java @@ -22,6 +22,7 @@ import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; @@ -329,10 +330,10 @@ interface HostingEnvironmentsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostingEnvironmentInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostingEnvironmentInner object if successful. */ - public ServiceResponse getHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentAsync(resourceGroupName, name).toBlocking().single(); + public HostingEnvironmentInner getHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -344,7 +345,7 @@ public ServiceResponse getHostingEnvironment(String res * @return the {@link ServiceCall} object */ public ServiceCall getHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -354,7 +355,23 @@ public ServiceCall getHostingEnvironmentAsync(String re * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the HostingEnvironmentInner object */ - public Observable> getHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable getHostingEnvironmentAsync(String resourceGroupName, String name) { + return getHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, HostingEnvironmentInner>() { + @Override + public HostingEnvironmentInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get properties of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the HostingEnvironmentInner object + */ + public Observable> getHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -398,10 +415,10 @@ private ServiceResponse getHostingEnvironmentDelegate(R * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the HostingEnvironmentInner object wrapped in ServiceResponse if successful. + * @return the HostingEnvironmentInner object if successful. */ - public ServiceResponse createOrUpdateHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateHostingEnvironmentAsync(resourceGroupName, name, hostingEnvironmentEnvelope).toBlocking().last(); + public HostingEnvironmentInner createOrUpdateHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope).toBlocking().last().getBody(); } /** @@ -414,7 +431,24 @@ public ServiceResponse createOrUpdateHostingEnvironment * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateHostingEnvironmentAsync(resourceGroupName, name, hostingEnvironmentEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope), serviceCallback); + } + + /** + * Create or update a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param hostingEnvironmentEnvelope Properties of hostingEnvironment (App Service Environment) + * @return the observable for the request + */ + public Observable createOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) { + return createOrUpdateHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope).map(new Func1, HostingEnvironmentInner>() { + @Override + public HostingEnvironmentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -425,7 +459,7 @@ public ServiceCall createOrUpdateHostingEnvironmentAsyn * @param hostingEnvironmentEnvelope Properties of hostingEnvironment (App Service Environment) * @return the observable for the request */ - public Observable> createOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) { + public Observable> createOrUpdateHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -455,10 +489,10 @@ public Observable> createOrUpdateHostin * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostingEnvironmentInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostingEnvironmentInner object if successful. */ - public ServiceResponse beginCreateOrUpdateHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateHostingEnvironmentAsync(resourceGroupName, name, hostingEnvironmentEnvelope).toBlocking().single(); + public HostingEnvironmentInner beginCreateOrUpdateHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope).toBlocking().single().getBody(); } /** @@ -471,7 +505,7 @@ public ServiceResponse beginCreateOrUpdateHostingEnviro * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateHostingEnvironmentAsync(resourceGroupName, name, hostingEnvironmentEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope), serviceCallback); } /** @@ -482,7 +516,24 @@ public ServiceCall beginCreateOrUpdateHostingEnvironmen * @param hostingEnvironmentEnvelope Properties of hostingEnvironment (App Service Environment) * @return the observable to the HostingEnvironmentInner object */ - public Observable> beginCreateOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) { + public Observable beginCreateOrUpdateHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) { + return beginCreateOrUpdateHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, hostingEnvironmentEnvelope).map(new Func1, HostingEnvironmentInner>() { + @Override + public HostingEnvironmentInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create or update a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param hostingEnvironmentEnvelope Properties of hostingEnvironment (App Service Environment) + * @return the observable to the HostingEnvironmentInner object + */ + public Observable> beginCreateOrUpdateHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, HostingEnvironmentInner hostingEnvironmentEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -533,10 +584,10 @@ private ServiceResponse beginCreateOrUpdateHostingEnvir * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the Object object wrapped in ServiceResponse if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteHostingEnvironmentAsync(resourceGroupName, name).toBlocking().last(); + public Object deleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return deleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().last().getBody(); } /** @@ -548,7 +599,7 @@ public ServiceResponse deleteHostingEnvironment(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall deleteHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -558,7 +609,23 @@ public ServiceCall deleteHostingEnvironmentAsync(String resourceGroupNam * @param name Name of hostingEnvironment (App Service Environment) * @return the observable for the request */ - public Observable> deleteHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable deleteHostingEnvironmentAsync(String resourceGroupName, String name) { + return deleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable for the request + */ + public Observable> deleteHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -585,10 +652,10 @@ public Observable> deleteHostingEnvironmentAsync(String * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the Object object wrapped in ServiceResponse if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteHostingEnvironmentAsync(resourceGroupName, name, forceDelete).toBlocking().last(); + public Object deleteHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return deleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).toBlocking().last().getBody(); } /** @@ -601,7 +668,7 @@ public ServiceResponse deleteHostingEnvironment(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall deleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteHostingEnvironmentAsync(resourceGroupName, name, forceDelete), serviceCallback); + return ServiceCall.create(deleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete), serviceCallback); } /** @@ -612,7 +679,24 @@ public ServiceCall deleteHostingEnvironmentAsync(String resourceGroupNam * @param forceDelete Delete even if the hostingEnvironment (App Service Environment) contains resources * @return the observable for the request */ - public Observable> deleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + public Observable deleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + return deleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param forceDelete Delete even if the hostingEnvironment (App Service Environment) contains resources + * @return the observable for the request + */ + public Observable> deleteHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, Boolean forceDelete) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -637,10 +721,10 @@ public Observable> deleteHostingEnvironmentAsync(String * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse beginDeleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteHostingEnvironmentAsync(resourceGroupName, name).toBlocking().single(); + public Object beginDeleteHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return beginDeleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -652,7 +736,7 @@ public ServiceResponse beginDeleteHostingEnvironment(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(beginDeleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -662,7 +746,23 @@ public ServiceCall beginDeleteHostingEnvironmentAsync(String resourceGro * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the Object object */ - public Observable> beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name) { + return beginDeleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the Object object + */ + public Observable> beginDeleteHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -699,10 +799,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse beginDeleteHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteHostingEnvironmentAsync(resourceGroupName, name, forceDelete).toBlocking().single(); + public Object beginDeleteHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException { + return beginDeleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).toBlocking().single().getBody(); } /** @@ -715,7 +815,24 @@ public ServiceResponse beginDeleteHostingEnvironment(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteHostingEnvironmentAsync(resourceGroupName, name, forceDelete), serviceCallback); + return ServiceCall.create(beginDeleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete), serviceCallback); + } + + /** + * Delete a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param forceDelete Delete even if the hostingEnvironment (App Service Environment) contains resources + * @return the observable to the Object object + */ + public Observable beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + return beginDeleteHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -726,7 +843,7 @@ public ServiceCall beginDeleteHostingEnvironmentAsync(String resourceGro * @param forceDelete Delete even if the hostingEnvironment (App Service Environment) contains resources * @return the observable to the Object object */ - public Observable> beginDeleteHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + public Observable> beginDeleteHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, Boolean forceDelete) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -772,10 +889,10 @@ private ServiceResponse beginDeleteHostingEnvironmentDelegate(Response> getHostingEnvironmentDiagnostics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentDiagnosticsAsync(resourceGroupName, name).toBlocking().single(); + public List getHostingEnvironmentDiagnostics(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentDiagnosticsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -787,7 +904,7 @@ public ServiceResponse> getHostingEnvir * @return the {@link ServiceCall} object */ public ServiceCall> getHostingEnvironmentDiagnosticsAsync(String resourceGroupName, String name, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getHostingEnvironmentDiagnosticsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getHostingEnvironmentDiagnosticsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -797,7 +914,23 @@ public ServiceCall> getHostingEnvironme * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the List<HostingEnvironmentDiagnosticsInner> object */ - public Observable>> getHostingEnvironmentDiagnosticsAsync(String resourceGroupName, String name) { + public Observable> getHostingEnvironmentDiagnosticsAsync(String resourceGroupName, String name) { + return getHostingEnvironmentDiagnosticsWithServiceResponseAsync(resourceGroupName, name).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get diagnostic information for hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the List<HostingEnvironmentDiagnosticsInner> object + */ + public Observable>> getHostingEnvironmentDiagnosticsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -840,10 +973,10 @@ private ServiceResponse> getHostingEnvi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostingEnvironmentDiagnosticsInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostingEnvironmentDiagnosticsInner object if successful. */ - public ServiceResponse getHostingEnvironmentDiagnosticsItem(String resourceGroupName, String name, String diagnosticsName) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentDiagnosticsItemAsync(resourceGroupName, name, diagnosticsName).toBlocking().single(); + public HostingEnvironmentDiagnosticsInner getHostingEnvironmentDiagnosticsItem(String resourceGroupName, String name, String diagnosticsName) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentDiagnosticsItemWithServiceResponseAsync(resourceGroupName, name, diagnosticsName).toBlocking().single().getBody(); } /** @@ -856,7 +989,24 @@ public ServiceResponse getHostingEnvironment * @return the {@link ServiceCall} object */ public ServiceCall getHostingEnvironmentDiagnosticsItemAsync(String resourceGroupName, String name, String diagnosticsName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getHostingEnvironmentDiagnosticsItemAsync(resourceGroupName, name, diagnosticsName), serviceCallback); + return ServiceCall.create(getHostingEnvironmentDiagnosticsItemWithServiceResponseAsync(resourceGroupName, name, diagnosticsName), serviceCallback); + } + + /** + * Get diagnostic information for hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param diagnosticsName Name of the diagnostics + * @return the observable to the HostingEnvironmentDiagnosticsInner object + */ + public Observable getHostingEnvironmentDiagnosticsItemAsync(String resourceGroupName, String name, String diagnosticsName) { + return getHostingEnvironmentDiagnosticsItemWithServiceResponseAsync(resourceGroupName, name, diagnosticsName).map(new Func1, HostingEnvironmentDiagnosticsInner>() { + @Override + public HostingEnvironmentDiagnosticsInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -867,7 +1017,7 @@ public ServiceCall getHostingEnvironmentDiag * @param diagnosticsName Name of the diagnostics * @return the observable to the HostingEnvironmentDiagnosticsInner object */ - public Observable> getHostingEnvironmentDiagnosticsItemAsync(String resourceGroupName, String name, String diagnosticsName) { + public Observable> getHostingEnvironmentDiagnosticsItemWithServiceResponseAsync(String resourceGroupName, String name, String diagnosticsName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -912,17 +1062,16 @@ private ServiceResponse getHostingEnvironmen * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<StampCapacityInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<StampCapacityInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentCapacities(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentCapacities(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentCapacitiesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentCapacitiesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -950,15 +1099,35 @@ public Observable>> call(String nextPag * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<StampCapacityInner> object + * @return the observable to the PagedList<StampCapacityInner> object + */ + public Observable> getHostingEnvironmentCapacitiesAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentCapacitiesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get used, available, and total worker capacity for hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<StampCapacityInner> object */ - public Observable>> getHostingEnvironmentCapacitiesAsync(final String resourceGroupName, final String name) { + public Observable>> getHostingEnvironmentCapacitiesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentCapacitiesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentCapacitiesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentCapacitiesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -968,7 +1137,7 @@ public Observable>> call(ServiceRespons * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<StampCapacityInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<StampCapacityInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentCapacitiesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1012,10 +1181,10 @@ private ServiceResponse> getHostingEnvironmentCapac * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AddressResponseInner object wrapped in {@link ServiceResponse} if successful. + * @return the AddressResponseInner object if successful. */ - public ServiceResponse getHostingEnvironmentVips(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentVipsAsync(resourceGroupName, name).toBlocking().single(); + public AddressResponseInner getHostingEnvironmentVips(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentVipsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1027,7 +1196,7 @@ public ServiceResponse getHostingEnvironmentVips(String re * @return the {@link ServiceCall} object */ public ServiceCall getHostingEnvironmentVipsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getHostingEnvironmentVipsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getHostingEnvironmentVipsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1037,7 +1206,23 @@ public ServiceCall getHostingEnvironmentVipsAsync(String r * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the AddressResponseInner object */ - public Observable> getHostingEnvironmentVipsAsync(String resourceGroupName, String name) { + public Observable getHostingEnvironmentVipsAsync(String resourceGroupName, String name) { + return getHostingEnvironmentVipsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, AddressResponseInner>() { + @Override + public AddressResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get IP addresses assigned to the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the AddressResponseInner object + */ + public Observable> getHostingEnvironmentVipsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1078,17 +1263,16 @@ private ServiceResponse getHostingEnvironmentVipsDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object if successful. */ - public ServiceResponse> getHostingEnvironments(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironments(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentsSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1114,15 +1298,34 @@ public Observable>> call(String ne * Get all hostingEnvironments (App Service Environments) in a resource group. * * @param resourceGroupName Name of resource group - * @return the observable to the List<HostingEnvironmentInner> object + * @return the observable to the PagedList<HostingEnvironmentInner> object */ - public Observable>> getHostingEnvironmentsAsync(final String resourceGroupName) { + public Observable> getHostingEnvironmentsAsync(final String resourceGroupName) { + return getHostingEnvironmentsWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all hostingEnvironments (App Service Environments) in a resource group. + * + * @param resourceGroupName Name of resource group + * @return the observable to the PagedList<HostingEnvironmentInner> object + */ + public Observable>> getHostingEnvironmentsWithServiceResponseAsync(final String resourceGroupName) { return getHostingEnvironmentsSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1131,7 +1334,7 @@ public Observable>> call(ServiceRe * Get all hostingEnvironments (App Service Environments) in a resource group. * ServiceResponse> * @param resourceGroupName Name of resource group - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentsSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -1172,10 +1375,10 @@ private ServiceResponse> getHostingEnvironment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse rebootHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return rebootHostingEnvironmentAsync(resourceGroupName, name).toBlocking().single(); + public Object rebootHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return rebootHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1187,7 +1390,7 @@ public ServiceResponse rebootHostingEnvironment(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall rebootHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(rebootHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(rebootHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1197,7 +1400,23 @@ public ServiceCall rebootHostingEnvironmentAsync(String resourceGroupNam * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the Object object */ - public Observable> rebootHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable rebootHostingEnvironmentAsync(String resourceGroupName, String name) { + return rebootHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Reboots all machines in a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the Object object + */ + public Observable> rebootHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1242,10 +1461,10 @@ private ServiceResponse rebootHostingEnvironmentDelegate(Response getHostingEnvironmentOperations(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentOperationsAsync(resourceGroupName, name).toBlocking().single(); + public Object getHostingEnvironmentOperations(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentOperationsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1257,7 +1476,7 @@ public ServiceResponse getHostingEnvironmentOperations(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall getHostingEnvironmentOperationsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getHostingEnvironmentOperationsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getHostingEnvironmentOperationsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1267,7 +1486,23 @@ public ServiceCall getHostingEnvironmentOperationsAsync(String resourceG * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the Object object */ - public Observable> getHostingEnvironmentOperationsAsync(String resourceGroupName, String name) { + public Observable getHostingEnvironmentOperationsAsync(String resourceGroupName, String name) { + return getHostingEnvironmentOperationsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * List all currently running operations on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the Object object + */ + public Observable> getHostingEnvironmentOperationsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1310,10 +1545,10 @@ private ServiceResponse getHostingEnvironmentOperationsDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getHostingEnvironmentOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentOperationAsync(resourceGroupName, name, operationId).toBlocking().single(); + public Object getHostingEnvironmentOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentOperationWithServiceResponseAsync(resourceGroupName, name, operationId).toBlocking().single().getBody(); } /** @@ -1326,7 +1561,7 @@ public ServiceResponse getHostingEnvironmentOperation(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall getHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getHostingEnvironmentOperationAsync(resourceGroupName, name, operationId), serviceCallback); + return ServiceCall.create(getHostingEnvironmentOperationWithServiceResponseAsync(resourceGroupName, name, operationId), serviceCallback); } /** @@ -1337,7 +1572,24 @@ public ServiceCall getHostingEnvironmentOperationAsync(String resourceGr * @param operationId operation identifier GUID * @return the observable to the Object object */ - public Observable> getHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId) { + public Observable getHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId) { + return getHostingEnvironmentOperationWithServiceResponseAsync(resourceGroupName, name, operationId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get status of an operation on a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param operationId operation identifier GUID + * @return the observable to the Object object + */ + public Observable> getHostingEnvironmentOperationWithServiceResponseAsync(String resourceGroupName, String name, String operationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1385,17 +1637,16 @@ private ServiceResponse getHostingEnvironmentOperationDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMetricsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1423,15 +1674,35 @@ public Observable>> call(String nextPa * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getHostingEnvironmentMetricsAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentMetricsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentMetricsAsync(final String resourceGroupName, final String name) { + public Observable>> getHostingEnvironmentMetricsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentMetricsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1441,7 +1712,7 @@ public Observable>> call(ServiceRespon * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMetricsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1482,17 +1753,16 @@ public Observable>> call(Response> getHostingEnvironmentMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMetricsSinglePageAsync(resourceGroupName, name, details, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1524,15 +1794,37 @@ public Observable>> call(String nextPa * @param name Name of hostingEnvironment (App Service Environment) * @param details Include instance details * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentMetricsAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { + public Observable> getHostingEnvironmentMetricsAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { + return getHostingEnvironmentMetricsWithServiceResponseAsync(resourceGroupName, name, details, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param details Include instance details + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getHostingEnvironmentMetricsWithServiceResponseAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { return getHostingEnvironmentMetricsSinglePageAsync(resourceGroupName, name, details, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1544,7 +1836,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) ServiceResponse> * @param details Include instance details ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMetricsSinglePageAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { if (resourceGroupName == null) { @@ -1588,10 +1880,10 @@ private ServiceResponse> getHostingEnvironmentMetr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the MetricDefinitionInner object wrapped in {@link ServiceResponse} if successful. + * @return the MetricDefinitionInner object if successful. */ - public ServiceResponse getHostingEnvironmentMetricDefinitions(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getHostingEnvironmentMetricDefinitionsAsync(resourceGroupName, name).toBlocking().single(); + public MetricDefinitionInner getHostingEnvironmentMetricDefinitions(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getHostingEnvironmentMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1603,7 +1895,7 @@ public ServiceResponse getHostingEnvironmentMetricDefinit * @return the {@link ServiceCall} object */ public ServiceCall getHostingEnvironmentMetricDefinitionsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getHostingEnvironmentMetricDefinitionsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getHostingEnvironmentMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1613,7 +1905,23 @@ public ServiceCall getHostingEnvironmentMetricDefinitions * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the MetricDefinitionInner object */ - public Observable> getHostingEnvironmentMetricDefinitionsAsync(String resourceGroupName, String name) { + public Observable getHostingEnvironmentMetricDefinitionsAsync(String resourceGroupName, String name) { + return getHostingEnvironmentMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, MetricDefinitionInner>() { + @Override + public MetricDefinitionInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get global metric definitions of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the MetricDefinitionInner object + */ + public Observable> getHostingEnvironmentMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1655,17 +1963,16 @@ private ServiceResponse getHostingEnvironmentMetricDefini * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentUsages(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentUsages(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentUsagesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1693,15 +2000,35 @@ public Observable>> call(String nextPag * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getHostingEnvironmentUsagesAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentUsagesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getHostingEnvironmentUsagesAsync(final String resourceGroupName, final String name) { + public Observable>> getHostingEnvironmentUsagesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentUsagesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1711,7 +2038,7 @@ public Observable>> call(ServiceRespons * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentUsagesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1750,17 +2077,16 @@ public Observable>> call(Response> getHostingEnvironmentUsages(final String resourceGroupName, final String name, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentUsages(final String resourceGroupName, final String name, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentUsagesSinglePageAsync(resourceGroupName, name, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1790,15 +2116,36 @@ public Observable>> call(String nextPag * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getHostingEnvironmentUsagesAsync(final String resourceGroupName, final String name, final String filter) { + public Observable> getHostingEnvironmentUsagesAsync(final String resourceGroupName, final String name, final String filter) { + return getHostingEnvironmentUsagesWithServiceResponseAsync(resourceGroupName, name, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable>> getHostingEnvironmentUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String filter) { return getHostingEnvironmentUsagesSinglePageAsync(resourceGroupName, name, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1809,7 +2156,7 @@ public Observable>> call(ServiceRespons ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentUsagesSinglePageAsync(final String resourceGroupName, final String name, final String filter) { if (resourceGroupName == null) { @@ -1853,17 +2200,16 @@ private ServiceResponse> getHostingEnvironmentUsage * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMultiRoleMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleMetricsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1891,15 +2237,35 @@ public Observable>> call(String nextPa * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentMultiRoleMetricsAsync(final String resourceGroupName, final String name) { + public Observable> getHostingEnvironmentMultiRoleMetricsAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentMultiRoleMetricsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getHostingEnvironmentMultiRoleMetricsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentMultiRoleMetricsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1909,7 +2275,7 @@ public Observable>> call(ServiceRespon * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleMetricsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1956,17 +2322,16 @@ public Observable>> call(Response> getHostingEnvironmentMultiRoleMetrics(final String resourceGroupName, final String name, final String startTime, final String endTime, final String timeGrain, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleMetrics(final String resourceGroupName, final String name, final String startTime, final String endTime, final String timeGrain, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleMetricsSinglePageAsync(resourceGroupName, name, startTime, endTime, timeGrain, details, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2004,15 +2369,40 @@ public Observable>> call(String nextPa * @param timeGrain Time granularity of metrics query * @param details Include instance details * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentMultiRoleMetricsAsync(final String resourceGroupName, final String name, final String startTime, final String endTime, final String timeGrain, final Boolean details, final String filter) { + public Observable> getHostingEnvironmentMultiRoleMetricsAsync(final String resourceGroupName, final String name, final String startTime, final String endTime, final String timeGrain, final Boolean details, final String filter) { + return getHostingEnvironmentMultiRoleMetricsWithServiceResponseAsync(resourceGroupName, name, startTime, endTime, timeGrain, details, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param startTime Beginning time of metrics query + * @param endTime End time of metrics query + * @param timeGrain Time granularity of metrics query + * @param details Include instance details + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getHostingEnvironmentMultiRoleMetricsWithServiceResponseAsync(final String resourceGroupName, final String name, final String startTime, final String endTime, final String timeGrain, final Boolean details, final String filter) { return getHostingEnvironmentMultiRoleMetricsSinglePageAsync(resourceGroupName, name, startTime, endTime, timeGrain, details, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2027,7 +2417,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param timeGrain Time granularity of metrics query ServiceResponse> * @param details Include instance details ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleMetricsSinglePageAsync(final String resourceGroupName, final String name, final String startTime, final String endTime, final String timeGrain, final Boolean details, final String filter) { if (resourceGroupName == null) { @@ -2072,17 +2462,16 @@ private ServiceResponse> getHostingEnvironmentMult * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebWorkerMetrics(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerMetrics(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2112,15 +2501,36 @@ public Observable>> call(String nextPa * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param workerPoolName Name of worker pool - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getHostingEnvironmentWebWorkerMetricsAsync(final String resourceGroupName, final String name, final String workerPoolName) { + return getHostingEnvironmentWebWorkerMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentWebWorkerMetricsAsync(final String resourceGroupName, final String name, final String workerPoolName) { + public Observable>> getHostingEnvironmentWebWorkerMetricsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) { return getHostingEnvironmentWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2131,7 +2541,7 @@ public Observable>> call(ServiceRespon * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param workerPoolName Name of worker pool - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerMetricsSinglePageAsync(final String resourceGroupName, final String name, final String workerPoolName) { if (resourceGroupName == null) { @@ -2176,17 +2586,16 @@ public Observable>> call(Response> getHostingEnvironmentWebWorkerMetrics(final String resourceGroupName, final String name, final String workerPoolName, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerMetrics(final String resourceGroupName, final String name, final String workerPoolName, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName, details, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2220,15 +2629,38 @@ public Observable>> call(String nextPa * @param workerPoolName Name of worker pool * @param details Include instance details * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentWebWorkerMetricsAsync(final String resourceGroupName, final String name, final String workerPoolName, final Boolean details, final String filter) { + public Observable> getHostingEnvironmentWebWorkerMetricsAsync(final String resourceGroupName, final String name, final String workerPoolName, final Boolean details, final String filter) { + return getHostingEnvironmentWebWorkerMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, details, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param details Include instance details + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getHostingEnvironmentWebWorkerMetricsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName, final Boolean details, final String filter) { return getHostingEnvironmentWebWorkerMetricsSinglePageAsync(resourceGroupName, name, workerPoolName, details, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2241,7 +2673,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param workerPoolName Name of worker pool ServiceResponse> * @param details Include instance details ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerMetricsSinglePageAsync(final String resourceGroupName, final String name, final String workerPoolName, final Boolean details, final String filter) { if (resourceGroupName == null) { @@ -2288,17 +2720,16 @@ private ServiceResponse> getHostingEnvironmentWebW * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMultiRoleMetricDefinitions(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleMetricDefinitions(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleMetricDefinitionsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2326,15 +2757,35 @@ public Observable>> call(String next * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getHostingEnvironmentMultiRoleMetricDefinitionsAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentMultiRoleMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metric definitions for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getHostingEnvironmentMultiRoleMetricDefinitionsAsync(final String resourceGroupName, final String name) { + public Observable>> getHostingEnvironmentMultiRoleMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentMultiRoleMetricDefinitionsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleMetricDefinitionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2344,7 +2795,7 @@ public Observable>> call(ServiceResp * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleMetricDefinitionsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -2389,17 +2840,16 @@ private ServiceResponse> getHostingEnvironmentMu * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebWorkerMetricDefinitions(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerMetricDefinitions(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerMetricDefinitionsSinglePageAsync(resourceGroupName, name, workerPoolName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2429,15 +2879,36 @@ public Observable>> call(String next * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param workerPoolName Name of worker pool - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getHostingEnvironmentWebWorkerMetricDefinitionsAsync(final String resourceGroupName, final String name, final String workerPoolName) { + return getHostingEnvironmentWebWorkerMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, workerPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metric definitions for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getHostingEnvironmentWebWorkerMetricDefinitionsAsync(final String resourceGroupName, final String name, final String workerPoolName) { + public Observable>> getHostingEnvironmentWebWorkerMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) { return getHostingEnvironmentWebWorkerMetricDefinitionsSinglePageAsync(resourceGroupName, name, workerPoolName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerMetricDefinitionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2448,7 +2919,7 @@ public Observable>> call(ServiceResp ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) ServiceResponse> * @param workerPoolName Name of worker pool - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerMetricDefinitionsSinglePageAsync(final String resourceGroupName, final String name, final String workerPoolName) { if (resourceGroupName == null) { @@ -2495,17 +2966,16 @@ private ServiceResponse> getHostingEnvironmentWe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMultiRoleUsages(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleUsages(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleUsagesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2533,15 +3003,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> getHostingEnvironmentMultiRoleUsagesAsync(final String resourceGroupName, final String name) { + public Observable> getHostingEnvironmentMultiRoleUsagesAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentMultiRoleUsagesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get usages for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> getHostingEnvironmentMultiRoleUsagesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentMultiRoleUsagesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2551,7 +3041,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleUsagesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -2596,17 +3086,16 @@ private ServiceResponse> getHostingEnvironmentMultiRoleUsag * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebWorkerUsages(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerUsages(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerUsagesSinglePageAsync(resourceGroupName, name, workerPoolName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2636,15 +3125,36 @@ public Observable>> call(String nextPageLink) { * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param workerPoolName Name of worker pool - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> getHostingEnvironmentWebWorkerUsagesAsync(final String resourceGroupName, final String name, final String workerPoolName) { + public Observable> getHostingEnvironmentWebWorkerUsagesAsync(final String resourceGroupName, final String name, final String workerPoolName) { + return getHostingEnvironmentWebWorkerUsagesWithServiceResponseAsync(resourceGroupName, name, workerPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get usages for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> getHostingEnvironmentWebWorkerUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) { return getHostingEnvironmentWebWorkerUsagesSinglePageAsync(resourceGroupName, name, workerPoolName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2655,7 +3165,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) ServiceResponse> * @param workerPoolName Name of worker pool - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerUsagesSinglePageAsync(final String resourceGroupName, final String name, final String workerPoolName) { if (resourceGroupName == null) { @@ -2702,17 +3212,16 @@ private ServiceResponse> getHostingEnvironmentWebWorkerUsag * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2740,15 +3249,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getHostingEnvironmentSitesAsync(final String resourceGroupName, final String name) { + public Observable> getHostingEnvironmentSitesAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentSitesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<SiteInner> object + */ + public Observable>> getHostingEnvironmentSitesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2758,7 +3287,7 @@ public Observable>> call(ServiceResponse>> getHostingEnvironmentSitesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -2797,17 +3326,16 @@ public Observable>> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentSites(final String resourceGroupName, final String name, final String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentSites(final String resourceGroupName, final String name, final String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name, propertiesToInclude).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2837,15 +3365,36 @@ public Observable>> call(String nextPageLink) { * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param propertiesToInclude Comma separated list of site properties to include - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getHostingEnvironmentSitesAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { + return getHostingEnvironmentSitesWithServiceResponseAsync(resourceGroupName, name, propertiesToInclude) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param propertiesToInclude Comma separated list of site properties to include + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getHostingEnvironmentSitesAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { + public Observable>> getHostingEnvironmentSitesWithServiceResponseAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { return getHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name, propertiesToInclude) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2856,7 +3405,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) ServiceResponse> * @param propertiesToInclude Comma separated list of site properties to include - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentSitesSinglePageAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { if (resourceGroupName == null) { @@ -2900,17 +3449,16 @@ private ServiceResponse> getHostingEnvironmentSitesDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebHostingPlans(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebHostingPlans(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebHostingPlansSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2938,15 +3486,35 @@ public Observable>> call(String * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getHostingEnvironmentWebHostingPlansAsync(final String resourceGroupName, final String name) { + public Observable> getHostingEnvironmentWebHostingPlansAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentWebHostingPlansWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable>> getHostingEnvironmentWebHostingPlansWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentWebHostingPlansSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2956,7 +3524,7 @@ public Observable>> call(Servic * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebHostingPlansSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -3000,17 +3568,16 @@ private ServiceResponse> getHostingEnvironm * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentServerFarms(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentServerFarms(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentServerFarmsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -3038,15 +3605,35 @@ public Observable>> call(String * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getHostingEnvironmentServerFarmsAsync(final String resourceGroupName, final String name) { + return getHostingEnvironmentServerFarmsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getHostingEnvironmentServerFarmsAsync(final String resourceGroupName, final String name) { + public Observable>> getHostingEnvironmentServerFarmsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getHostingEnvironmentServerFarmsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -3056,7 +3643,7 @@ public Observable>> call(Servic * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentServerFarmsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -3100,17 +3687,16 @@ private ServiceResponse> getHostingEnvironm * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object if successful. */ - public ServiceResponse> getMultiRolePools(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getMultiRolePools(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getMultiRolePoolsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getMultiRolePoolsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -3138,15 +3724,35 @@ public Observable>> call(String nextPageLi * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<WorkerPoolInner> object + * @return the observable to the PagedList<WorkerPoolInner> object + */ + public Observable> getMultiRolePoolsAsync(final String resourceGroupName, final String name) { + return getMultiRolePoolsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all multi role pools. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<WorkerPoolInner> object */ - public Observable>> getMultiRolePoolsAsync(final String resourceGroupName, final String name) { + public Observable>> getMultiRolePoolsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getMultiRolePoolsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getMultiRolePoolsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiRolePoolsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -3156,7 +3762,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getMultiRolePoolsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -3200,10 +3806,10 @@ private ServiceResponse> getMultiRolePoolsDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the WorkerPoolInner object wrapped in {@link ServiceResponse} if successful. + * @return the WorkerPoolInner object if successful. */ - public ServiceResponse getMultiRolePool(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getMultiRolePoolAsync(resourceGroupName, name).toBlocking().single(); + public WorkerPoolInner getMultiRolePool(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getMultiRolePoolWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -3215,7 +3821,23 @@ public ServiceResponse getMultiRolePool(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall getMultiRolePoolAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getMultiRolePoolAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getMultiRolePoolWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Get properties of a multiRool pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the WorkerPoolInner object + */ + public Observable getMultiRolePoolAsync(String resourceGroupName, String name) { + return getMultiRolePoolWithServiceResponseAsync(resourceGroupName, name).map(new Func1, WorkerPoolInner>() { + @Override + public WorkerPoolInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3225,7 +3847,7 @@ public ServiceCall getMultiRolePoolAsync(String resourceGroupNa * @param name Name of hostingEnvironment (App Service Environment) * @return the observable to the WorkerPoolInner object */ - public Observable> getMultiRolePoolAsync(String resourceGroupName, String name) { + public Observable> getMultiRolePoolWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3269,10 +3891,10 @@ private ServiceResponse getMultiRolePoolDelegate(Response createOrUpdateMultiRolePool(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().last(); + public WorkerPoolInner createOrUpdateMultiRolePool(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().last().getBody(); } /** @@ -3285,7 +3907,24 @@ public ServiceResponse createOrUpdateMultiRolePool(String resou * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope), serviceCallback); + } + + /** + * Create or update a multiRole pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param multiRolePoolEnvelope Properties of multiRole pool + * @return the observable for the request + */ + public Observable createOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) { + return createOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).map(new Func1, WorkerPoolInner>() { + @Override + public WorkerPoolInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3296,7 +3935,7 @@ public ServiceCall createOrUpdateMultiRolePoolAsync(String reso * @param multiRolePoolEnvelope Properties of multiRole pool * @return the observable for the request */ - public Observable> createOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) { + public Observable> createOrUpdateMultiRolePoolWithServiceResponseAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3326,10 +3965,10 @@ public Observable> createOrUpdateMultiRolePoolA * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the WorkerPoolInner object wrapped in {@link ServiceResponse} if successful. + * @return the WorkerPoolInner object if successful. */ - public ServiceResponse beginCreateOrUpdateMultiRolePool(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().single(); + public WorkerPoolInner beginCreateOrUpdateMultiRolePool(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().single().getBody(); } /** @@ -3342,7 +3981,24 @@ public ServiceResponse beginCreateOrUpdateMultiRolePool(String * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateMultiRolePoolAsync(resourceGroupName, name, multiRolePoolEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope), serviceCallback); + } + + /** + * Create or update a multiRole pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param multiRolePoolEnvelope Properties of multiRole pool + * @return the observable to the WorkerPoolInner object + */ + public Observable beginCreateOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) { + return beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).map(new Func1, WorkerPoolInner>() { + @Override + public WorkerPoolInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3353,7 +4009,7 @@ public ServiceCall beginCreateOrUpdateMultiRolePoolAsync(String * @param multiRolePoolEnvelope Properties of multiRole pool * @return the observable to the WorkerPoolInner object */ - public Observable> beginCreateOrUpdateMultiRolePoolAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) { + public Observable> beginCreateOrUpdateMultiRolePoolWithServiceResponseAsync(String resourceGroupName, String name, WorkerPoolInner multiRolePoolEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3403,17 +4059,16 @@ private ServiceResponse beginCreateOrUpdateMultiRolePoolDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object if successful. */ - public ServiceResponse> getMultiRolePoolSkus(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getMultiRolePoolSkus(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getMultiRolePoolSkusSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getMultiRolePoolSkusNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -3441,15 +4096,35 @@ public Observable>> call(String nextPageLink) * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<SkuInfoInner> object + * @return the observable to the PagedList<SkuInfoInner> object + */ + public Observable> getMultiRolePoolSkusAsync(final String resourceGroupName, final String name) { + return getMultiRolePoolSkusWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get available skus for scaling a multiRole pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<SkuInfoInner> object */ - public Observable>> getMultiRolePoolSkusAsync(final String resourceGroupName, final String name) { + public Observable>> getMultiRolePoolSkusWithServiceResponseAsync(final String resourceGroupName, final String name) { return getMultiRolePoolSkusSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getMultiRolePoolSkusNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiRolePoolSkusNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -3459,7 +4134,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getMultiRolePoolSkusSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -3503,17 +4178,16 @@ private ServiceResponse> getMultiRolePoolSkusDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object if successful. */ - public ServiceResponse> getWorkerPools(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getWorkerPools(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getWorkerPoolsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getWorkerPoolsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -3541,15 +4215,35 @@ public Observable>> call(String nextPageLi * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<WorkerPoolInner> object + * @return the observable to the PagedList<WorkerPoolInner> object + */ + public Observable> getWorkerPoolsAsync(final String resourceGroupName, final String name) { + return getWorkerPoolsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all worker pools. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<WorkerPoolInner> object */ - public Observable>> getWorkerPoolsAsync(final String resourceGroupName, final String name) { + public Observable>> getWorkerPoolsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getWorkerPoolsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getWorkerPoolsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getWorkerPoolsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -3559,7 +4253,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getWorkerPoolsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -3604,10 +4298,10 @@ private ServiceResponse> getWorkerPoolsDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the WorkerPoolInner object wrapped in {@link ServiceResponse} if successful. + * @return the WorkerPoolInner object if successful. */ - public ServiceResponse getWorkerPool(String resourceGroupName, String name, String workerPoolName) throws CloudException, IOException, IllegalArgumentException { - return getWorkerPoolAsync(resourceGroupName, name, workerPoolName).toBlocking().single(); + public WorkerPoolInner getWorkerPool(String resourceGroupName, String name, String workerPoolName) throws CloudException, IOException, IllegalArgumentException { + return getWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName).toBlocking().single().getBody(); } /** @@ -3620,7 +4314,24 @@ public ServiceResponse getWorkerPool(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getWorkerPoolAsync(resourceGroupName, name, workerPoolName), serviceCallback); + return ServiceCall.create(getWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName), serviceCallback); + } + + /** + * Get properties of a worker pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @return the observable to the WorkerPoolInner object + */ + public Observable getWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName) { + return getWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName).map(new Func1, WorkerPoolInner>() { + @Override + public WorkerPoolInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3631,7 +4342,7 @@ public ServiceCall getWorkerPoolAsync(String resourceGroupName, * @param workerPoolName Name of worker pool * @return the observable to the WorkerPoolInner object */ - public Observable> getWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName) { + public Observable> getWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3679,10 +4390,10 @@ private ServiceResponse getWorkerPoolDelegate(Response createOrUpdateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).toBlocking().last(); + public WorkerPoolInner createOrUpdateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).toBlocking().last().getBody(); } /** @@ -3696,7 +4407,25 @@ public ServiceResponse createOrUpdateWorkerPool(String resource * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope), serviceCallback); + } + + /** + * Create or update a worker pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param workerPoolEnvelope Properties of worker pool + * @return the observable for the request + */ + public Observable createOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) { + return createOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(new Func1, WorkerPoolInner>() { + @Override + public WorkerPoolInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3708,7 +4437,7 @@ public ServiceCall createOrUpdateWorkerPoolAsync(String resourc * @param workerPoolEnvelope Properties of worker pool * @return the observable for the request */ - public Observable> createOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) { + public Observable> createOrUpdateWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3742,10 +4471,10 @@ public Observable> createOrUpdateWorkerPoolAsyn * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the WorkerPoolInner object wrapped in {@link ServiceResponse} if successful. + * @return the WorkerPoolInner object if successful. */ - public ServiceResponse beginCreateOrUpdateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).toBlocking().single(); + public WorkerPoolInner beginCreateOrUpdateWorkerPool(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).toBlocking().single().getBody(); } /** @@ -3759,7 +4488,25 @@ public ServiceResponse beginCreateOrUpdateWorkerPool(String res * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateWorkerPoolAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope), serviceCallback); + } + + /** + * Create or update a worker pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param workerPoolEnvelope Properties of worker pool + * @return the observable to the WorkerPoolInner object + */ + public Observable beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) { + return beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(resourceGroupName, name, workerPoolName, workerPoolEnvelope).map(new Func1, WorkerPoolInner>() { + @Override + public WorkerPoolInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3771,7 +4518,7 @@ public ServiceCall beginCreateOrUpdateWorkerPoolAsync(String re * @param workerPoolEnvelope Properties of worker pool * @return the observable to the WorkerPoolInner object */ - public Observable> beginCreateOrUpdateWorkerPoolAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) { + public Observable> beginCreateOrUpdateWorkerPoolWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, WorkerPoolInner workerPoolEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3825,17 +4572,16 @@ private ServiceResponse beginCreateOrUpdateWorkerPoolDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object if successful. */ - public ServiceResponse> getWorkerPoolSkus(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getWorkerPoolSkus(final String resourceGroupName, final String name, final String workerPoolName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getWorkerPoolSkusSinglePageAsync(resourceGroupName, name, workerPoolName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getWorkerPoolSkusNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -3865,15 +4611,36 @@ public Observable>> call(String nextPageLink) * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) * @param workerPoolName Name of worker pool - * @return the observable to the List<SkuInfoInner> object + * @return the observable to the PagedList<SkuInfoInner> object + */ + public Observable> getWorkerPoolSkusAsync(final String resourceGroupName, final String name, final String workerPoolName) { + return getWorkerPoolSkusWithServiceResponseAsync(resourceGroupName, name, workerPoolName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get available skus for scaling a worker pool. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @return the observable to the PagedList<SkuInfoInner> object */ - public Observable>> getWorkerPoolSkusAsync(final String resourceGroupName, final String name, final String workerPoolName) { + public Observable>> getWorkerPoolSkusWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) { return getWorkerPoolSkusSinglePageAsync(resourceGroupName, name, workerPoolName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getWorkerPoolSkusNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getWorkerPoolSkusNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -3884,7 +4651,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) ServiceResponse> * @param workerPoolName Name of worker pool - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getWorkerPoolSkusSinglePageAsync(final String resourceGroupName, final String name, final String workerPoolName) { if (resourceGroupName == null) { @@ -3933,10 +4700,10 @@ private ServiceResponse> getWorkerPoolSkusDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getWorkerPoolInstanceMetrics(String resourceGroupName, String name, String workerPoolName, String instance) throws CloudException, IOException, IllegalArgumentException { - return getWorkerPoolInstanceMetricsAsync(resourceGroupName, name, workerPoolName, instance).toBlocking().single(); + public Object getWorkerPoolInstanceMetrics(String resourceGroupName, String name, String workerPoolName, String instance) throws CloudException, IOException, IllegalArgumentException { + return getWorkerPoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance).toBlocking().single().getBody(); } /** @@ -3950,7 +4717,25 @@ public ServiceResponse getWorkerPoolInstanceMetrics(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance, final ServiceCallback serviceCallback) { - return ServiceCall.create(getWorkerPoolInstanceMetricsAsync(resourceGroupName, name, workerPoolName, instance), serviceCallback); + return ServiceCall.create(getWorkerPoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance), serviceCallback); + } + + /** + * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param instance Name of instance in the worker pool + * @return the observable to the Object object + */ + public Observable getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance) { + return getWorkerPoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3962,7 +4747,7 @@ public ServiceCall getWorkerPoolInstanceMetricsAsync(String resourceGrou * @param instance Name of instance in the worker pool * @return the observable to the Object object */ - public Observable> getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance) { + public Observable> getWorkerPoolInstanceMetricsWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, String instance) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4009,10 +4794,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getWorkerPoolInstanceMetrics(String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) throws CloudException, IOException, IllegalArgumentException { - return getWorkerPoolInstanceMetricsAsync(resourceGroupName, name, workerPoolName, instance, details, filter).toBlocking().single(); + public Object getWorkerPoolInstanceMetrics(String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) throws CloudException, IOException, IllegalArgumentException { + return getWorkerPoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance, details, filter).toBlocking().single().getBody(); } /** @@ -4028,7 +4813,27 @@ public ServiceResponse getWorkerPoolInstanceMetrics(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter, final ServiceCallback serviceCallback) { - return ServiceCall.create(getWorkerPoolInstanceMetricsAsync(resourceGroupName, name, workerPoolName, instance, details, filter), serviceCallback); + return ServiceCall.create(getWorkerPoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance, details, filter), serviceCallback); + } + + /** + * Get metrics for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param instance Name of instance in the worker pool + * @param details Include instance details + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the Object object + */ + public Observable getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) { + return getWorkerPoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance, details, filter).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4042,7 +4847,7 @@ public ServiceCall getWorkerPoolInstanceMetricsAsync(String resourceGrou * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. * @return the observable to the Object object */ - public Observable> getWorkerPoolInstanceMetricsAsync(String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) { + public Observable> getWorkerPoolInstanceMetricsWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, String instance, Boolean details, String filter) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4092,10 +4897,10 @@ private ServiceResponse getWorkerPoolInstanceMetricsDelegate(Response getWorkerPoolInstanceMetricDefinitions(String resourceGroupName, String name, String workerPoolName, String instance) throws CloudException, IOException, IllegalArgumentException { - return getWorkerPoolInstanceMetricDefinitionsAsync(resourceGroupName, name, workerPoolName, instance).toBlocking().single(); + public Object getWorkerPoolInstanceMetricDefinitions(String resourceGroupName, String name, String workerPoolName, String instance) throws CloudException, IOException, IllegalArgumentException { + return getWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance).toBlocking().single().getBody(); } /** @@ -4109,7 +4914,25 @@ public ServiceResponse getWorkerPoolInstanceMetricDefinitions(String res * @return the {@link ServiceCall} object */ public ServiceCall getWorkerPoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String workerPoolName, String instance, final ServiceCallback serviceCallback) { - return ServiceCall.create(getWorkerPoolInstanceMetricDefinitionsAsync(resourceGroupName, name, workerPoolName, instance), serviceCallback); + return ServiceCall.create(getWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance), serviceCallback); + } + + /** + * Get metric definitions for a specific instance of a worker pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param workerPoolName Name of worker pool + * @param instance Name of instance in the worker pool + * @return the observable to the Object object + */ + public Observable getWorkerPoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String workerPoolName, String instance) { + return getWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, workerPoolName, instance).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4121,7 +4944,7 @@ public ServiceCall getWorkerPoolInstanceMetricDefinitionsAsync(String re * @param instance Name of instance in the worker pool * @return the observable to the Object object */ - public Observable> getWorkerPoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String workerPoolName, String instance) { + public Observable> getWorkerPoolInstanceMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String name, String workerPoolName, String instance) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4170,10 +4993,10 @@ private ServiceResponse getWorkerPoolInstanceMetricDefinitionsDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getMultiRolePoolInstanceMetrics(String resourceGroupName, String name, String instance) throws CloudException, IOException, IllegalArgumentException { - return getMultiRolePoolInstanceMetricsAsync(resourceGroupName, name, instance).toBlocking().single(); + public Object getMultiRolePoolInstanceMetrics(String resourceGroupName, String name, String instance) throws CloudException, IOException, IllegalArgumentException { + return getMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance).toBlocking().single().getBody(); } /** @@ -4186,7 +5009,24 @@ public ServiceResponse getMultiRolePoolInstanceMetrics(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance, final ServiceCallback serviceCallback) { - return ServiceCall.create(getMultiRolePoolInstanceMetricsAsync(resourceGroupName, name, instance), serviceCallback); + return ServiceCall.create(getMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance), serviceCallback); + } + + /** + * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool + * @return the observable to the Object object + */ + public Observable getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance) { + return getMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4197,7 +5037,7 @@ public ServiceCall getMultiRolePoolInstanceMetricsAsync(String resourceG * @param instance Name of instance in the multiRole pool * @return the observable to the Object object */ - public Observable> getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance) { + public Observable> getMultiRolePoolInstanceMetricsWithServiceResponseAsync(String resourceGroupName, String name, String instance) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4238,10 +5078,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getMultiRolePoolInstanceMetrics(String resourceGroupName, String name, String instance, Boolean details) throws CloudException, IOException, IllegalArgumentException { - return getMultiRolePoolInstanceMetricsAsync(resourceGroupName, name, instance, details).toBlocking().single(); + public Object getMultiRolePoolInstanceMetrics(String resourceGroupName, String name, String instance, Boolean details) throws CloudException, IOException, IllegalArgumentException { + return getMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance, details).toBlocking().single().getBody(); } /** @@ -4255,7 +5095,25 @@ public ServiceResponse getMultiRolePoolInstanceMetrics(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance, Boolean details, final ServiceCallback serviceCallback) { - return ServiceCall.create(getMultiRolePoolInstanceMetricsAsync(resourceGroupName, name, instance, details), serviceCallback); + return ServiceCall.create(getMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance, details), serviceCallback); + } + + /** + * Get metrics for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool + * @param details Include instance details + * @return the observable to the Object object + */ + public Observable getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance, Boolean details) { + return getMultiRolePoolInstanceMetricsWithServiceResponseAsync(resourceGroupName, name, instance, details).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4267,7 +5125,7 @@ public ServiceCall getMultiRolePoolInstanceMetricsAsync(String resourceG * @param details Include instance details * @return the observable to the Object object */ - public Observable> getMultiRolePoolInstanceMetricsAsync(String resourceGroupName, String name, String instance, Boolean details) { + public Observable> getMultiRolePoolInstanceMetricsWithServiceResponseAsync(String resourceGroupName, String name, String instance, Boolean details) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4313,10 +5171,10 @@ private ServiceResponse getMultiRolePoolInstanceMetricsDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getMultiRolePoolInstanceMetricDefinitions(String resourceGroupName, String name, String instance) throws CloudException, IOException, IllegalArgumentException { - return getMultiRolePoolInstanceMetricDefinitionsAsync(resourceGroupName, name, instance).toBlocking().single(); + public Object getMultiRolePoolInstanceMetricDefinitions(String resourceGroupName, String name, String instance) throws CloudException, IOException, IllegalArgumentException { + return getMultiRolePoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, instance).toBlocking().single().getBody(); } /** @@ -4329,7 +5187,24 @@ public ServiceResponse getMultiRolePoolInstanceMetricDefinitions(String * @return the {@link ServiceCall} object */ public ServiceCall getMultiRolePoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String instance, final ServiceCallback serviceCallback) { - return ServiceCall.create(getMultiRolePoolInstanceMetricDefinitionsAsync(resourceGroupName, name, instance), serviceCallback); + return ServiceCall.create(getMultiRolePoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, instance), serviceCallback); + } + + /** + * Get metric definitions for a specific instance of a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @param instance Name of instance in the multiRole pool&gt; + * @return the observable to the Object object + */ + public Observable getMultiRolePoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String instance) { + return getMultiRolePoolInstanceMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name, instance).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4340,7 +5215,7 @@ public ServiceCall getMultiRolePoolInstanceMetricDefinitionsAsync(String * @param instance Name of instance in the multiRole pool&gt; * @return the observable to the Object object */ - public Observable> getMultiRolePoolInstanceMetricDefinitionsAsync(String resourceGroupName, String name, String instance) { + public Observable> getMultiRolePoolInstanceMetricDefinitionsWithServiceResponseAsync(String resourceGroupName, String name, String instance) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4386,17 +5261,16 @@ private ServiceResponse getMultiRolePoolInstanceMetricDefinitionsDelegat * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> suspendHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public PagedList suspendHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { ServiceResponse> response = suspendHostingEnvironmentSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return suspendHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4424,15 +5298,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> suspendHostingEnvironmentAsync(final String resourceGroupName, final String name) { + public Observable> suspendHostingEnvironmentAsync(final String resourceGroupName, final String name) { + return suspendHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Suspends the hostingEnvironment. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<SiteInner> object + */ + public Observable>> suspendHostingEnvironmentWithServiceResponseAsync(final String resourceGroupName, final String name) { return suspendHostingEnvironmentSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return suspendHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(suspendHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4442,7 +5336,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> suspendHostingEnvironmentSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -4487,17 +5381,16 @@ private ServiceResponse> suspendHostingEnvironmentDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> beginSuspendHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList beginSuspendHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = beginSuspendHostingEnvironmentSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return beginSuspendHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4525,15 +5418,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> beginSuspendHostingEnvironmentAsync(final String resourceGroupName, final String name) { + return beginSuspendHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Suspends the hostingEnvironment. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> beginSuspendHostingEnvironmentAsync(final String resourceGroupName, final String name) { + public Observable>> beginSuspendHostingEnvironmentWithServiceResponseAsync(final String resourceGroupName, final String name) { return beginSuspendHostingEnvironmentSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return beginSuspendHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(beginSuspendHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4543,7 +5456,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> beginSuspendHostingEnvironmentSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -4589,17 +5502,16 @@ private ServiceResponse> beginSuspendHostingEnvironmentDeleg * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> resumeHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public PagedList resumeHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { ServiceResponse> response = resumeHostingEnvironmentSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return resumeHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4627,15 +5539,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> resumeHostingEnvironmentAsync(final String resourceGroupName, final String name) { + return resumeHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Resumes the hostingEnvironment. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> resumeHostingEnvironmentAsync(final String resourceGroupName, final String name) { + public Observable>> resumeHostingEnvironmentWithServiceResponseAsync(final String resourceGroupName, final String name) { return resumeHostingEnvironmentSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return resumeHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(resumeHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4645,7 +5577,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> resumeHostingEnvironmentSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -4690,17 +5622,16 @@ private ServiceResponse> resumeHostingEnvironmentDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> beginResumeHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList beginResumeHostingEnvironment(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = beginResumeHostingEnvironmentSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return beginResumeHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4728,15 +5659,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of hostingEnvironment (App Service Environment) - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> beginResumeHostingEnvironmentAsync(final String resourceGroupName, final String name) { + return beginResumeHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Resumes the hostingEnvironment. + * + * @param resourceGroupName Name of resource group + * @param name Name of hostingEnvironment (App Service Environment) + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> beginResumeHostingEnvironmentAsync(final String resourceGroupName, final String name) { + public Observable>> beginResumeHostingEnvironmentWithServiceResponseAsync(final String resourceGroupName, final String name) { return beginResumeHostingEnvironmentSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return beginResumeHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(beginResumeHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4746,7 +5697,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of hostingEnvironment (App Service Environment) - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> beginResumeHostingEnvironmentSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -4790,17 +5741,16 @@ private ServiceResponse> beginResumeHostingEnvironmentDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<StampCapacityInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<StampCapacityInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentCapacitiesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentCapacitiesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentCapacitiesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentCapacitiesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4827,15 +5777,34 @@ public Observable>> call(String nextPag * Get used, available, and total worker capacity for hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<StampCapacityInner> object + * @return the observable to the PagedList<StampCapacityInner> object + */ + public Observable> getHostingEnvironmentCapacitiesNextAsync(final String nextPageLink) { + return getHostingEnvironmentCapacitiesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get used, available, and total worker capacity for hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<StampCapacityInner> object */ - public Observable>> getHostingEnvironmentCapacitiesNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentCapacitiesNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentCapacitiesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentCapacitiesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentCapacitiesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4844,7 +5813,7 @@ public Observable>> call(ServiceRespons * Get used, available, and total worker capacity for hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<StampCapacityInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<StampCapacityInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentCapacitiesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -4878,17 +5847,16 @@ private ServiceResponse> getHostingEnvironmentCapac * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4915,15 +5883,34 @@ public Observable>> call(String ne * Get all hostingEnvironments (App Service Environments) in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<HostingEnvironmentInner> object + * @return the observable to the PagedList<HostingEnvironmentInner> object */ - public Observable>> getHostingEnvironmentsNextAsync(final String nextPageLink) { + public Observable> getHostingEnvironmentsNextAsync(final String nextPageLink) { + return getHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all hostingEnvironments (App Service Environments) in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<HostingEnvironmentInner> object + */ + public Observable>> getHostingEnvironmentsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4932,7 +5919,7 @@ public Observable>> call(ServiceRe * Get all hostingEnvironments (App Service Environments) in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -4966,17 +5953,16 @@ private ServiceResponse> getHostingEnvironment * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5003,15 +5989,34 @@ public Observable>> call(String nextPa * Get global metrics of hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getHostingEnvironmentMetricsNextAsync(final String nextPageLink) { + return getHostingEnvironmentMetricsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get global metrics of hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentMetricsNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentMetricsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5020,7 +6025,7 @@ public Observable>> call(ServiceRespon * Get global metrics of hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMetricsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5054,17 +6059,16 @@ private ServiceResponse> getHostingEnvironmentMetr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5091,15 +6095,34 @@ public Observable>> call(String nextPag * Get global usages of hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getHostingEnvironmentUsagesNextAsync(final String nextPageLink) { + return getHostingEnvironmentUsagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get global usages of hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getHostingEnvironmentUsagesNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentUsagesNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5108,7 +6131,7 @@ public Observable>> call(ServiceRespons * Get global usages of hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentUsagesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5142,17 +6165,16 @@ private ServiceResponse> getHostingEnvironmentUsage * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMultiRoleMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5179,15 +6201,34 @@ public Observable>> call(String nextPa * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getHostingEnvironmentMultiRoleMetricsNextAsync(final String nextPageLink) { + return getHostingEnvironmentMultiRoleMetricsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentMultiRoleMetricsNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentMultiRoleMetricsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5196,7 +6237,7 @@ public Observable>> call(ServiceRespon * Get metrics for a multiRole pool of a hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleMetricsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5230,17 +6271,16 @@ private ServiceResponse> getHostingEnvironmentMult * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebWorkerMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5267,15 +6307,34 @@ public Observable>> call(String nextPa * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getHostingEnvironmentWebWorkerMetricsNextAsync(final String nextPageLink) { + public Observable> getHostingEnvironmentWebWorkerMetricsNextAsync(final String nextPageLink) { + return getHostingEnvironmentWebWorkerMetricsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getHostingEnvironmentWebWorkerMetricsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5284,7 +6343,7 @@ public Observable>> call(ServiceRespon * Get metrics for a worker pool of a hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerMetricsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5318,17 +6377,16 @@ private ServiceResponse> getHostingEnvironmentWebW * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMultiRoleMetricDefinitionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleMetricDefinitionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5355,15 +6413,34 @@ public Observable>> call(String next * Get metric definitions for a multiRole pool of a hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getHostingEnvironmentMultiRoleMetricDefinitionsNextAsync(final String nextPageLink) { + return getHostingEnvironmentMultiRoleMetricDefinitionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metric definitions for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getHostingEnvironmentMultiRoleMetricDefinitionsNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentMultiRoleMetricDefinitionsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleMetricDefinitionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5372,7 +6449,7 @@ public Observable>> call(ServiceResp * Get metric definitions for a multiRole pool of a hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleMetricDefinitionsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5406,17 +6483,16 @@ private ServiceResponse> getHostingEnvironmentMu * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebWorkerMetricDefinitionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerMetricDefinitionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5443,15 +6519,34 @@ public Observable>> call(String next * Get metric definitions for a worker pool of a hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getHostingEnvironmentWebWorkerMetricDefinitionsNextAsync(final String nextPageLink) { + return getHostingEnvironmentWebWorkerMetricDefinitionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get metric definitions for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getHostingEnvironmentWebWorkerMetricDefinitionsNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentWebWorkerMetricDefinitionsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerMetricDefinitionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5460,7 +6555,7 @@ public Observable>> call(ServiceResp * Get metric definitions for a worker pool of a hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerMetricDefinitionsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5494,17 +6589,16 @@ private ServiceResponse> getHostingEnvironmentWe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentMultiRoleUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentMultiRoleUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5531,15 +6625,34 @@ public Observable>> call(String nextPageLink) { * Get usages for a multiRole pool of a hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object + */ + public Observable> getHostingEnvironmentMultiRoleUsagesNextAsync(final String nextPageLink) { + return getHostingEnvironmentMultiRoleUsagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get usages for a multiRole pool of a hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> getHostingEnvironmentMultiRoleUsagesNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentMultiRoleUsagesNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentMultiRoleUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5548,7 +6661,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentMultiRoleUsagesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5582,17 +6695,16 @@ private ServiceResponse> getHostingEnvironmentMultiRoleUsag * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebWorkerUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebWorkerUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5619,15 +6731,34 @@ public Observable>> call(String nextPageLink) { * Get usages for a worker pool of a hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<UsageInner> object + * @return the observable to the PagedList<UsageInner> object */ - public Observable>> getHostingEnvironmentWebWorkerUsagesNextAsync(final String nextPageLink) { + public Observable> getHostingEnvironmentWebWorkerUsagesNextAsync(final String nextPageLink) { + return getHostingEnvironmentWebWorkerUsagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get usages for a worker pool of a hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<UsageInner> object + */ + public Observable>> getHostingEnvironmentWebWorkerUsagesNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebWorkerUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5636,7 +6767,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<UsageInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<UsageInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebWorkerUsagesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5670,17 +6801,16 @@ private ServiceResponse> getHostingEnvironmentWebWorkerUsag * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5707,15 +6837,34 @@ public Observable>> call(String nextPageLink) { * Get all sites on the hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getHostingEnvironmentSitesNextAsync(final String nextPageLink) { + return getHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all sites on the hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getHostingEnvironmentSitesNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentSitesNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5724,7 +6873,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentSitesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5758,17 +6907,16 @@ private ServiceResponse> getHostingEnvironmentSitesNextDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentWebHostingPlansNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentWebHostingPlansNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5795,15 +6943,34 @@ public Observable>> call(String * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getHostingEnvironmentWebHostingPlansNextAsync(final String nextPageLink) { + return getHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getHostingEnvironmentWebHostingPlansNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5812,7 +6979,7 @@ public Observable>> call(Servic * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentWebHostingPlansNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5846,17 +7013,16 @@ private ServiceResponse> getHostingEnvironm * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getHostingEnvironmentServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getHostingEnvironmentServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5883,15 +7049,34 @@ public Observable>> call(String * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getHostingEnvironmentServerFarmsNextAsync(final String nextPageLink) { + return getHostingEnvironmentServerFarmsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getHostingEnvironmentServerFarmsNextAsync(final String nextPageLink) { + public Observable>> getHostingEnvironmentServerFarmsNextWithServiceResponseAsync(final String nextPageLink) { return getHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getHostingEnvironmentServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5900,7 +7085,7 @@ public Observable>> call(Servic * Get all serverfarms (App Service Plans) on the hostingEnvironment (App Service Environment). * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getHostingEnvironmentServerFarmsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -5934,17 +7119,16 @@ private ServiceResponse> getHostingEnvironm * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object if successful. */ - public ServiceResponse> getMultiRolePoolsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getMultiRolePoolsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getMultiRolePoolsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getMultiRolePoolsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5971,15 +7155,34 @@ public Observable>> call(String nextPageLi * Get all multi role pools. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<WorkerPoolInner> object + * @return the observable to the PagedList<WorkerPoolInner> object */ - public Observable>> getMultiRolePoolsNextAsync(final String nextPageLink) { + public Observable> getMultiRolePoolsNextAsync(final String nextPageLink) { + return getMultiRolePoolsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all multi role pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<WorkerPoolInner> object + */ + public Observable>> getMultiRolePoolsNextWithServiceResponseAsync(final String nextPageLink) { return getMultiRolePoolsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getMultiRolePoolsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiRolePoolsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5988,7 +7191,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getMultiRolePoolsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6022,17 +7225,16 @@ private ServiceResponse> getMultiRolePoolsNextDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object if successful. */ - public ServiceResponse> getMultiRolePoolSkusNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getMultiRolePoolSkusNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getMultiRolePoolSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getMultiRolePoolSkusNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6059,15 +7261,34 @@ public Observable>> call(String nextPageLink) * Get available skus for scaling a multiRole pool. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SkuInfoInner> object + * @return the observable to the PagedList<SkuInfoInner> object + */ + public Observable> getMultiRolePoolSkusNextAsync(final String nextPageLink) { + return getMultiRolePoolSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get available skus for scaling a multiRole pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SkuInfoInner> object */ - public Observable>> getMultiRolePoolSkusNextAsync(final String nextPageLink) { + public Observable>> getMultiRolePoolSkusNextWithServiceResponseAsync(final String nextPageLink) { return getMultiRolePoolSkusNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getMultiRolePoolSkusNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getMultiRolePoolSkusNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6076,7 +7297,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getMultiRolePoolSkusNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6110,17 +7331,16 @@ private ServiceResponse> getMultiRolePoolSkusNextDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object if successful. */ - public ServiceResponse> getWorkerPoolsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getWorkerPoolsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getWorkerPoolsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getWorkerPoolsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6147,15 +7367,34 @@ public Observable>> call(String nextPageLi * Get all worker pools. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<WorkerPoolInner> object + * @return the observable to the PagedList<WorkerPoolInner> object + */ + public Observable> getWorkerPoolsNextAsync(final String nextPageLink) { + return getWorkerPoolsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all worker pools. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<WorkerPoolInner> object */ - public Observable>> getWorkerPoolsNextAsync(final String nextPageLink) { + public Observable>> getWorkerPoolsNextWithServiceResponseAsync(final String nextPageLink) { return getWorkerPoolsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getWorkerPoolsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getWorkerPoolsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6164,7 +7403,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<WorkerPoolInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getWorkerPoolsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6198,17 +7437,16 @@ private ServiceResponse> getWorkerPoolsNextDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object if successful. */ - public ServiceResponse> getWorkerPoolSkusNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getWorkerPoolSkusNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getWorkerPoolSkusNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getWorkerPoolSkusNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6235,15 +7473,34 @@ public Observable>> call(String nextPageLink) * Get available skus for scaling a worker pool. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SkuInfoInner> object + * @return the observable to the PagedList<SkuInfoInner> object + */ + public Observable> getWorkerPoolSkusNextAsync(final String nextPageLink) { + return getWorkerPoolSkusNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get available skus for scaling a worker pool. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SkuInfoInner> object */ - public Observable>> getWorkerPoolSkusNextAsync(final String nextPageLink) { + public Observable>> getWorkerPoolSkusNextWithServiceResponseAsync(final String nextPageLink) { return getWorkerPoolSkusNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getWorkerPoolSkusNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getWorkerPoolSkusNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6252,7 +7509,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SkuInfoInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getWorkerPoolSkusNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6287,17 +7544,16 @@ private ServiceResponse> getWorkerPoolSkusNextDelegate(Re * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> suspendHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public PagedList suspendHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException, InterruptedException { ServiceResponse> response = suspendHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return suspendHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6324,15 +7580,34 @@ public Observable>> call(String nextPageLink) { * Suspends the hostingEnvironment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> suspendHostingEnvironmentNextAsync(final String nextPageLink) { + public Observable> suspendHostingEnvironmentNextAsync(final String nextPageLink) { + return suspendHostingEnvironmentNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Suspends the hostingEnvironment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object + */ + public Observable>> suspendHostingEnvironmentNextWithServiceResponseAsync(final String nextPageLink) { return suspendHostingEnvironmentNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return suspendHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(suspendHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6341,7 +7616,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> suspendHostingEnvironmentNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6376,17 +7651,16 @@ private ServiceResponse> suspendHostingEnvironmentNextDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> beginSuspendHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList beginSuspendHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = beginSuspendHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return beginSuspendHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6413,15 +7687,34 @@ public Observable>> call(String nextPageLink) { * Suspends the hostingEnvironment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> beginSuspendHostingEnvironmentNextAsync(final String nextPageLink) { + return beginSuspendHostingEnvironmentNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Suspends the hostingEnvironment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> beginSuspendHostingEnvironmentNextAsync(final String nextPageLink) { + public Observable>> beginSuspendHostingEnvironmentNextWithServiceResponseAsync(final String nextPageLink) { return beginSuspendHostingEnvironmentNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return beginSuspendHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(beginSuspendHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6430,7 +7723,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> beginSuspendHostingEnvironmentNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6466,17 +7759,16 @@ private ServiceResponse> beginSuspendHostingEnvironmentNextD * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> resumeHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + public PagedList resumeHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException, InterruptedException { ServiceResponse> response = resumeHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return resumeHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6503,15 +7795,34 @@ public Observable>> call(String nextPageLink) { * Resumes the hostingEnvironment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> resumeHostingEnvironmentNextAsync(final String nextPageLink) { + return resumeHostingEnvironmentNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Resumes the hostingEnvironment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> resumeHostingEnvironmentNextAsync(final String nextPageLink) { + public Observable>> resumeHostingEnvironmentNextWithServiceResponseAsync(final String nextPageLink) { return resumeHostingEnvironmentNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return resumeHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(resumeHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6520,7 +7831,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> resumeHostingEnvironmentNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -6555,17 +7866,16 @@ private ServiceResponse> resumeHostingEnvironmentNextDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> beginResumeHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList beginResumeHostingEnvironmentNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = beginResumeHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return beginResumeHostingEnvironmentNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6592,15 +7902,34 @@ public Observable>> call(String nextPageLink) { * Resumes the hostingEnvironment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> beginResumeHostingEnvironmentNextAsync(final String nextPageLink) { + return beginResumeHostingEnvironmentNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Resumes the hostingEnvironment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> beginResumeHostingEnvironmentNextAsync(final String nextPageLink) { + public Observable>> beginResumeHostingEnvironmentNextWithServiceResponseAsync(final String nextPageLink) { return beginResumeHostingEnvironmentNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return beginResumeHostingEnvironmentNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(beginResumeHostingEnvironmentNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6609,7 +7938,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> beginResumeHostingEnvironmentNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ManagedHostingEnvironmentsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ManagedHostingEnvironmentsInner.java index a740f048c6d5..f0b5aca5b651 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ManagedHostingEnvironmentsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ManagedHostingEnvironmentsInner.java @@ -132,10 +132,10 @@ interface ManagedHostingEnvironmentsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ManagedHostingEnvironmentInner object wrapped in {@link ServiceResponse} if successful. + * @return the ManagedHostingEnvironmentInner object if successful. */ - public ServiceResponse getManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getManagedHostingEnvironmentAsync(resourceGroupName, name).toBlocking().single(); + public ManagedHostingEnvironmentInner getManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -147,7 +147,7 @@ public ServiceResponse getManagedHostingEnvironm * @return the {@link ServiceCall} object */ public ServiceCall getManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getManagedHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -157,7 +157,23 @@ public ServiceCall getManagedHostingEnvironmentA * @param name Name of managed hosting environment * @return the observable to the ManagedHostingEnvironmentInner object */ - public Observable> getManagedHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable getManagedHostingEnvironmentAsync(String resourceGroupName, String name) { + return getManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ManagedHostingEnvironmentInner>() { + @Override + public ManagedHostingEnvironmentInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get properties of a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable to the ManagedHostingEnvironmentInner object + */ + public Observable> getManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -201,10 +217,10 @@ private ServiceResponse getManagedHostingEnviron * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the HostingEnvironmentInner object wrapped in ServiceResponse if successful. + * @return the HostingEnvironmentInner object if successful. */ - public ServiceResponse createOrUpdateManagedHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateManagedHostingEnvironmentAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope).toBlocking().last(); + public HostingEnvironmentInner createOrUpdateManagedHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope).toBlocking().last().getBody(); } /** @@ -217,7 +233,24 @@ public ServiceResponse createOrUpdateManagedHostingEnvi * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateManagedHostingEnvironmentAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope), serviceCallback); + } + + /** + * Create or update a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param managedHostingEnvironmentEnvelope Properties of managed hosting environment + * @return the observable for the request + */ + public Observable createOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) { + return createOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope).map(new Func1, HostingEnvironmentInner>() { + @Override + public HostingEnvironmentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -228,7 +261,7 @@ public ServiceCall createOrUpdateManagedHostingEnvironm * @param managedHostingEnvironmentEnvelope Properties of managed hosting environment * @return the observable for the request */ - public Observable> createOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) { + public Observable> createOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -258,10 +291,10 @@ public Observable> createOrUpdateManage * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostingEnvironmentInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostingEnvironmentInner object if successful. */ - public ServiceResponse beginCreateOrUpdateManagedHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateManagedHostingEnvironmentAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope).toBlocking().single(); + public HostingEnvironmentInner beginCreateOrUpdateManagedHostingEnvironment(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope).toBlocking().single().getBody(); } /** @@ -274,7 +307,7 @@ public ServiceResponse beginCreateOrUpdateManagedHostin * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateManagedHostingEnvironmentAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope), serviceCallback); } /** @@ -285,7 +318,24 @@ public ServiceCall beginCreateOrUpdateManagedHostingEnv * @param managedHostingEnvironmentEnvelope Properties of managed hosting environment * @return the observable to the HostingEnvironmentInner object */ - public Observable> beginCreateOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) { + public Observable beginCreateOrUpdateManagedHostingEnvironmentAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) { + return beginCreateOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, managedHostingEnvironmentEnvelope).map(new Func1, HostingEnvironmentInner>() { + @Override + public HostingEnvironmentInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Create or update a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param managedHostingEnvironmentEnvelope Properties of managed hosting environment + * @return the observable to the HostingEnvironmentInner object + */ + public Observable> beginCreateOrUpdateManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, HostingEnvironmentInner managedHostingEnvironmentEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -335,10 +385,10 @@ private ServiceResponse beginCreateOrUpdateManagedHosti * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the Object object wrapped in ServiceResponse if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteManagedHostingEnvironmentAsync(resourceGroupName, name).toBlocking().last(); + public Object deleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return deleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().last().getBody(); } /** @@ -350,7 +400,7 @@ public ServiceResponse deleteManagedHostingEnvironment(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteManagedHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -360,7 +410,23 @@ public ServiceCall deleteManagedHostingEnvironmentAsync(String resourceG * @param name Name of managed hosting environment * @return the observable for the request */ - public Observable> deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name) { + return deleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable for the request + */ + public Observable> deleteManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -387,10 +453,10 @@ public Observable> deleteManagedHostingEnvironmentAsync( * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the Object object wrapped in ServiceResponse if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteManagedHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return deleteManagedHostingEnvironmentAsync(resourceGroupName, name, forceDelete).toBlocking().last(); + public Object deleteManagedHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return deleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).toBlocking().last().getBody(); } /** @@ -403,7 +469,7 @@ public ServiceResponse deleteManagedHostingEnvironment(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteManagedHostingEnvironmentAsync(resourceGroupName, name, forceDelete), serviceCallback); + return ServiceCall.create(deleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete), serviceCallback); } /** @@ -414,7 +480,24 @@ public ServiceCall deleteManagedHostingEnvironmentAsync(String resourceG * @param forceDelete Delete even if the managed hosting environment contains resources * @return the observable for the request */ - public Observable> deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + public Observable deleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + return deleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param forceDelete Delete even if the managed hosting environment contains resources + * @return the observable for the request + */ + public Observable> deleteManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, Boolean forceDelete) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -439,10 +522,10 @@ public Observable> deleteManagedHostingEnvironmentAsync( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse beginDeleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteManagedHostingEnvironmentAsync(resourceGroupName, name).toBlocking().single(); + public Object beginDeleteManagedHostingEnvironment(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -454,7 +537,23 @@ public ServiceResponse beginDeleteManagedHostingEnvironment(String resou * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteManagedHostingEnvironmentAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable to the Object object + */ + public Observable beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name) { + return beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -464,7 +563,7 @@ public ServiceCall beginDeleteManagedHostingEnvironmentAsync(String reso * @param name Name of managed hosting environment * @return the observable to the Object object */ - public Observable> beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name) { + public Observable> beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -501,10 +600,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse beginDeleteManagedHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException { - return beginDeleteManagedHostingEnvironmentAsync(resourceGroupName, name, forceDelete).toBlocking().single(); + public Object beginDeleteManagedHostingEnvironment(String resourceGroupName, String name, Boolean forceDelete) throws CloudException, IOException, IllegalArgumentException { + return beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).toBlocking().single().getBody(); } /** @@ -517,7 +616,7 @@ public ServiceResponse beginDeleteManagedHostingEnvironment(String resou * @return the {@link ServiceCall} object */ public ServiceCall beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginDeleteManagedHostingEnvironmentAsync(resourceGroupName, name, forceDelete), serviceCallback); + return ServiceCall.create(beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete), serviceCallback); } /** @@ -528,7 +627,24 @@ public ServiceCall beginDeleteManagedHostingEnvironmentAsync(String reso * @param forceDelete Delete even if the managed hosting environment contains resources * @return the observable to the Object object */ - public Observable> beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + public Observable beginDeleteManagedHostingEnvironmentAsync(String resourceGroupName, String name, Boolean forceDelete) { + return beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(resourceGroupName, name, forceDelete).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Delete a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param forceDelete Delete even if the managed hosting environment contains resources + * @return the observable to the Object object + */ + public Observable> beginDeleteManagedHostingEnvironmentWithServiceResponseAsync(String resourceGroupName, String name, Boolean forceDelete) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -572,17 +688,16 @@ private ServiceResponse beginDeleteManagedHostingEnvironmentDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironments(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironments(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentsSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -608,15 +723,34 @@ public Observable>> call(String ne * Get all managed hosting environments in a resource group. * * @param resourceGroupName Name of resource group - * @return the observable to the List<HostingEnvironmentInner> object + * @return the observable to the PagedList<HostingEnvironmentInner> object + */ + public Observable> getManagedHostingEnvironmentsAsync(final String resourceGroupName) { + return getManagedHostingEnvironmentsWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all managed hosting environments in a resource group. + * + * @param resourceGroupName Name of resource group + * @return the observable to the PagedList<HostingEnvironmentInner> object */ - public Observable>> getManagedHostingEnvironmentsAsync(final String resourceGroupName) { + public Observable>> getManagedHostingEnvironmentsWithServiceResponseAsync(final String resourceGroupName) { return getManagedHostingEnvironmentsSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -625,7 +759,7 @@ public Observable>> call(ServiceRe * Get all managed hosting environments in a resource group. * ServiceResponse> * @param resourceGroupName Name of resource group - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentsSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -666,10 +800,10 @@ private ServiceResponse> getManagedHostingEnvi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the AddressResponseInner object wrapped in {@link ServiceResponse} if successful. + * @return the AddressResponseInner object if successful. */ - public ServiceResponse getManagedHostingEnvironmentVips(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getManagedHostingEnvironmentVipsAsync(resourceGroupName, name).toBlocking().single(); + public AddressResponseInner getManagedHostingEnvironmentVips(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getManagedHostingEnvironmentVipsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -681,7 +815,7 @@ public ServiceResponse getManagedHostingEnvironmentVips(St * @return the {@link ServiceCall} object */ public ServiceCall getManagedHostingEnvironmentVipsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getManagedHostingEnvironmentVipsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getManagedHostingEnvironmentVipsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -691,7 +825,23 @@ public ServiceCall getManagedHostingEnvironmentVipsAsync(S * @param name Name of managed hosting environment * @return the observable to the AddressResponseInner object */ - public Observable> getManagedHostingEnvironmentVipsAsync(String resourceGroupName, String name) { + public Observable getManagedHostingEnvironmentVipsAsync(String resourceGroupName, String name) { + return getManagedHostingEnvironmentVipsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, AddressResponseInner>() { + @Override + public AddressResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get list of ip addresses assigned to a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable to the AddressResponseInner object + */ + public Observable> getManagedHostingEnvironmentVipsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -734,10 +884,10 @@ private ServiceResponse getManagedHostingEnvironmentVipsDe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getManagedHostingEnvironmentOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { - return getManagedHostingEnvironmentOperationAsync(resourceGroupName, name, operationId).toBlocking().single(); + public Object getManagedHostingEnvironmentOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { + return getManagedHostingEnvironmentOperationWithServiceResponseAsync(resourceGroupName, name, operationId).toBlocking().single().getBody(); } /** @@ -750,7 +900,7 @@ public ServiceResponse getManagedHostingEnvironmentOperation(String reso * @return the {@link ServiceCall} object */ public ServiceCall getManagedHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getManagedHostingEnvironmentOperationAsync(resourceGroupName, name, operationId), serviceCallback); + return ServiceCall.create(getManagedHostingEnvironmentOperationWithServiceResponseAsync(resourceGroupName, name, operationId), serviceCallback); } /** @@ -761,7 +911,24 @@ public ServiceCall getManagedHostingEnvironmentOperationAsync(String res * @param operationId operation identifier GUID * @return the observable to the Object object */ - public Observable> getManagedHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId) { + public Observable getManagedHostingEnvironmentOperationAsync(String resourceGroupName, String name, String operationId) { + return getManagedHostingEnvironmentOperationWithServiceResponseAsync(resourceGroupName, name, operationId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get status of an operation on a managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param operationId operation identifier GUID + * @return the observable to the Object object + */ + public Observable> getManagedHostingEnvironmentOperationWithServiceResponseAsync(String resourceGroupName, String name, String operationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -809,17 +976,16 @@ private ServiceResponse getManagedHostingEnvironmentOperationDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -847,15 +1013,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of managed hosting environment - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getManagedHostingEnvironmentSitesAsync(final String resourceGroupName, final String name) { + public Observable> getManagedHostingEnvironmentSitesAsync(final String resourceGroupName, final String name) { + return getManagedHostingEnvironmentSitesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all sites on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable to the PagedList<SiteInner> object + */ + public Observable>> getManagedHostingEnvironmentSitesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getManagedHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -865,7 +1051,7 @@ public Observable>> call(ServiceResponse>> getManagedHostingEnvironmentSitesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -904,17 +1090,16 @@ public Observable>> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentSites(final String resourceGroupName, final String name, final String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentSites(final String resourceGroupName, final String name, final String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name, propertiesToInclude).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -944,15 +1129,36 @@ public Observable>> call(String nextPageLink) { * @param resourceGroupName Name of resource group * @param name Name of managed hosting environment * @param propertiesToInclude Comma separated list of site properties to include - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getManagedHostingEnvironmentSitesAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { + return getManagedHostingEnvironmentSitesWithServiceResponseAsync(resourceGroupName, name, propertiesToInclude) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all sites on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @param propertiesToInclude Comma separated list of site properties to include + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getManagedHostingEnvironmentSitesAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { + public Observable>> getManagedHostingEnvironmentSitesWithServiceResponseAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { return getManagedHostingEnvironmentSitesSinglePageAsync(resourceGroupName, name, propertiesToInclude) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -963,7 +1169,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of managed hosting environment ServiceResponse> * @param propertiesToInclude Comma separated list of site properties to include - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentSitesSinglePageAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { if (resourceGroupName == null) { @@ -1007,17 +1213,16 @@ private ServiceResponse> getManagedHostingEnvironmentSitesDe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentWebHostingPlans(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentWebHostingPlans(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentWebHostingPlansSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1045,15 +1250,35 @@ public Observable>> call(String * * @param resourceGroupName Name of resource group * @param name Name of managed hosting environment - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getManagedHostingEnvironmentWebHostingPlansAsync(final String resourceGroupName, final String name) { + public Observable> getManagedHostingEnvironmentWebHostingPlansAsync(final String resourceGroupName, final String name) { + return getManagedHostingEnvironmentWebHostingPlansWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable>> getManagedHostingEnvironmentWebHostingPlansWithServiceResponseAsync(final String resourceGroupName, final String name) { return getManagedHostingEnvironmentWebHostingPlansSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1063,7 +1288,7 @@ public Observable>> call(Servic * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of managed hosting environment - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentWebHostingPlansSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1107,17 +1332,16 @@ private ServiceResponse> getManagedHostingE * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentServerFarms(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentServerFarms(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentServerFarmsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1145,15 +1369,35 @@ public Observable>> call(String * * @param resourceGroupName Name of resource group * @param name Name of managed hosting environment - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getManagedHostingEnvironmentServerFarmsAsync(final String resourceGroupName, final String name) { + return getManagedHostingEnvironmentServerFarmsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the managed hosting environment. + * + * @param resourceGroupName Name of resource group + * @param name Name of managed hosting environment + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getManagedHostingEnvironmentServerFarmsAsync(final String resourceGroupName, final String name) { + public Observable>> getManagedHostingEnvironmentServerFarmsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getManagedHostingEnvironmentServerFarmsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1163,7 +1407,7 @@ public Observable>> call(Servic * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of managed hosting environment - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentServerFarmsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1206,17 +1450,16 @@ private ServiceResponse> getManagedHostingE * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1243,15 +1486,34 @@ public Observable>> call(String ne * Get all managed hosting environments in a resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<HostingEnvironmentInner> object + * @return the observable to the PagedList<HostingEnvironmentInner> object */ - public Observable>> getManagedHostingEnvironmentsNextAsync(final String nextPageLink) { + public Observable> getManagedHostingEnvironmentsNextAsync(final String nextPageLink) { + return getManagedHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all managed hosting environments in a resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<HostingEnvironmentInner> object + */ + public Observable>> getManagedHostingEnvironmentsNextWithServiceResponseAsync(final String nextPageLink) { return getManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1260,7 +1522,7 @@ public Observable>> call(ServiceRe * Get all managed hosting environments in a resource group. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostingEnvironmentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1294,17 +1556,16 @@ private ServiceResponse> getManagedHostingEnvi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1331,15 +1592,34 @@ public Observable>> call(String nextPageLink) { * Get all sites on the managed hosting environment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getManagedHostingEnvironmentSitesNextAsync(final String nextPageLink) { + return getManagedHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all sites on the managed hosting environment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getManagedHostingEnvironmentSitesNextAsync(final String nextPageLink) { + public Observable>> getManagedHostingEnvironmentSitesNextWithServiceResponseAsync(final String nextPageLink) { return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1348,7 +1628,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentSitesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1382,17 +1662,16 @@ private ServiceResponse> getManagedHostingEnvironmentSitesNe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentWebHostingPlansNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentWebHostingPlansNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1419,15 +1698,34 @@ public Observable>> call(String * Get all serverfarms (App Service Plans) on the managed hosting environment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable> getManagedHostingEnvironmentWebHostingPlansNextAsync(final String nextPageLink) { + return getManagedHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the managed hosting environment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getManagedHostingEnvironmentWebHostingPlansNextAsync(final String nextPageLink) { + public Observable>> getManagedHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(final String nextPageLink) { return getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentWebHostingPlansNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1436,7 +1734,7 @@ public Observable>> call(Servic * Get all serverfarms (App Service Plans) on the managed hosting environment. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentWebHostingPlansNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -1470,17 +1768,16 @@ private ServiceResponse> getManagedHostingE * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getManagedHostingEnvironmentServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getManagedHostingEnvironmentServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1507,15 +1804,34 @@ public Observable>> call(String * Get all serverfarms (App Service Plans) on the managed hosting environment. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getManagedHostingEnvironmentServerFarmsNextAsync(final String nextPageLink) { + public Observable> getManagedHostingEnvironmentServerFarmsNextAsync(final String nextPageLink) { + return getManagedHostingEnvironmentServerFarmsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get all serverfarms (App Service Plans) on the managed hosting environment. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable>> getManagedHostingEnvironmentServerFarmsNextWithServiceResponseAsync(final String nextPageLink) { return getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getManagedHostingEnvironmentServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1524,7 +1840,7 @@ public Observable>> call(Servic * Get all serverfarms (App Service Plans) on the managed hosting environment. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getManagedHostingEnvironmentServerFarmsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ProvidersInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ProvidersInner.java index 2aec49304bfd..4a420b36327c 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ProvidersInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ProvidersInner.java @@ -93,17 +93,16 @@ interface ProvidersService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SourceControlInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SourceControlInner> object if successful. */ - public ServiceResponse> getSourceControls() throws CloudException, IOException, IllegalArgumentException { + public PagedList getSourceControls() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSourceControlsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSourceControlsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -127,15 +126,33 @@ public Observable>> call(String nextPag /** * Gets the source controls available for Azure websites. * - * @return the observable to the List<SourceControlInner> object + * @return the observable to the PagedList<SourceControlInner> object */ - public Observable>> getSourceControlsAsync() { + public Observable> getSourceControlsAsync() { + return getSourceControlsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the source controls available for Azure websites. + * + * @return the observable to the PagedList<SourceControlInner> object + */ + public Observable>> getSourceControlsWithServiceResponseAsync() { return getSourceControlsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSourceControlsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSourceControlsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -143,7 +160,7 @@ public Observable>> call(ServiceRespons /** * Gets the source controls available for Azure websites. * - * @return the List<SourceControlInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SourceControlInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSourceControlsSinglePageAsync() { if (this.client.apiVersion() == null) { @@ -177,10 +194,10 @@ private ServiceResponse> getSourceControlsDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SourceControlInner object wrapped in {@link ServiceResponse} if successful. + * @return the SourceControlInner object if successful. */ - public ServiceResponse getSourceControl(String sourceControlType) throws CloudException, IOException, IllegalArgumentException { - return getSourceControlAsync(sourceControlType).toBlocking().single(); + public SourceControlInner getSourceControl(String sourceControlType) throws CloudException, IOException, IllegalArgumentException { + return getSourceControlWithServiceResponseAsync(sourceControlType).toBlocking().single().getBody(); } /** @@ -191,7 +208,22 @@ public ServiceResponse getSourceControl(String sourceControl * @return the {@link ServiceCall} object */ public ServiceCall getSourceControlAsync(String sourceControlType, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSourceControlAsync(sourceControlType), serviceCallback); + return ServiceCall.create(getSourceControlWithServiceResponseAsync(sourceControlType), serviceCallback); + } + + /** + * Gets source control token. + * + * @param sourceControlType Type of source control + * @return the observable to the SourceControlInner object + */ + public Observable getSourceControlAsync(String sourceControlType) { + return getSourceControlWithServiceResponseAsync(sourceControlType).map(new Func1, SourceControlInner>() { + @Override + public SourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -200,7 +232,7 @@ public ServiceCall getSourceControlAsync(String sourceContro * @param sourceControlType Type of source control * @return the observable to the SourceControlInner object */ - public Observable> getSourceControlAsync(String sourceControlType) { + public Observable> getSourceControlWithServiceResponseAsync(String sourceControlType) { if (sourceControlType == null) { throw new IllegalArgumentException("Parameter sourceControlType is required and cannot be null."); } @@ -236,10 +268,10 @@ private ServiceResponse getSourceControlDelegate(Response updateSourceControl(String sourceControlType, SourceControlInner requestMessage) throws CloudException, IOException, IllegalArgumentException { - return updateSourceControlAsync(sourceControlType, requestMessage).toBlocking().single(); + public SourceControlInner updateSourceControl(String sourceControlType, SourceControlInner requestMessage) throws CloudException, IOException, IllegalArgumentException { + return updateSourceControlWithServiceResponseAsync(sourceControlType, requestMessage).toBlocking().single().getBody(); } /** @@ -251,7 +283,23 @@ public ServiceResponse updateSourceControl(String sourceCont * @return the {@link ServiceCall} object */ public ServiceCall updateSourceControlAsync(String sourceControlType, SourceControlInner requestMessage, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSourceControlAsync(sourceControlType, requestMessage), serviceCallback); + return ServiceCall.create(updateSourceControlWithServiceResponseAsync(sourceControlType, requestMessage), serviceCallback); + } + + /** + * Updates source control token. + * + * @param sourceControlType Type of source control + * @param requestMessage Source control token information + * @return the observable to the SourceControlInner object + */ + public Observable updateSourceControlAsync(String sourceControlType, SourceControlInner requestMessage) { + return updateSourceControlWithServiceResponseAsync(sourceControlType, requestMessage).map(new Func1, SourceControlInner>() { + @Override + public SourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -261,7 +309,7 @@ public ServiceCall updateSourceControlAsync(String sourceCon * @param requestMessage Source control token information * @return the observable to the SourceControlInner object */ - public Observable> updateSourceControlAsync(String sourceControlType, SourceControlInner requestMessage) { + public Observable> updateSourceControlWithServiceResponseAsync(String sourceControlType, SourceControlInner requestMessage) { if (sourceControlType == null) { throw new IllegalArgumentException("Parameter sourceControlType is required and cannot be null."); } @@ -299,10 +347,10 @@ private ServiceResponse updateSourceControlDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the UserInner object wrapped in {@link ServiceResponse} if successful. + * @return the UserInner object if successful. */ - public ServiceResponse getPublishingUser() throws CloudException, IOException, IllegalArgumentException { - return getPublishingUserAsync().toBlocking().single(); + public UserInner getPublishingUser() throws CloudException, IOException, IllegalArgumentException { + return getPublishingUserWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -312,7 +360,7 @@ public ServiceResponse getPublishingUser() throws CloudException, IOE * @return the {@link ServiceCall} object */ public ServiceCall getPublishingUserAsync(final ServiceCallback serviceCallback) { - return ServiceCall.create(getPublishingUserAsync(), serviceCallback); + return ServiceCall.create(getPublishingUserWithServiceResponseAsync(), serviceCallback); } /** @@ -320,7 +368,21 @@ public ServiceCall getPublishingUserAsync(final ServiceCallback> getPublishingUserAsync() { + public Observable getPublishingUserAsync() { + return getPublishingUserWithServiceResponseAsync().map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets publishing user. + * + * @return the observable to the UserInner object + */ + public Observable> getPublishingUserWithServiceResponseAsync() { if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } @@ -352,10 +414,10 @@ private ServiceResponse getPublishingUserDelegate(Response updatePublishingUser(UserInner requestMessage) throws CloudException, IOException, IllegalArgumentException { - return updatePublishingUserAsync(requestMessage).toBlocking().single(); + public UserInner updatePublishingUser(UserInner requestMessage) throws CloudException, IOException, IllegalArgumentException { + return updatePublishingUserWithServiceResponseAsync(requestMessage).toBlocking().single().getBody(); } /** @@ -366,7 +428,7 @@ public ServiceResponse updatePublishingUser(UserInner requestMessage) * @return the {@link ServiceCall} object */ public ServiceCall updatePublishingUserAsync(UserInner requestMessage, final ServiceCallback serviceCallback) { - return ServiceCall.create(updatePublishingUserAsync(requestMessage), serviceCallback); + return ServiceCall.create(updatePublishingUserWithServiceResponseAsync(requestMessage), serviceCallback); } /** @@ -375,7 +437,22 @@ public ServiceCall updatePublishingUserAsync(UserInner requestMessage * @param requestMessage Details of publishing user * @return the observable to the UserInner object */ - public Observable> updatePublishingUserAsync(UserInner requestMessage) { + public Observable updatePublishingUserAsync(UserInner requestMessage) { + return updatePublishingUserWithServiceResponseAsync(requestMessage).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Updates publishing user. + * + * @param requestMessage Details of publishing user + * @return the observable to the UserInner object + */ + public Observable> updatePublishingUserWithServiceResponseAsync(UserInner requestMessage) { if (requestMessage == null) { throw new IllegalArgumentException("Parameter requestMessage is required and cannot be null."); } @@ -411,17 +488,16 @@ private ServiceResponse updatePublishingUserDelegate(Response> getSourceControlsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSourceControlsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSourceControlsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSourceControlsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -448,15 +524,34 @@ public Observable>> call(String nextPag * Gets the source controls available for Azure websites. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SourceControlInner> object + * @return the observable to the PagedList<SourceControlInner> object */ - public Observable>> getSourceControlsNextAsync(final String nextPageLink) { + public Observable> getSourceControlsNextAsync(final String nextPageLink) { + return getSourceControlsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the source controls available for Azure websites. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SourceControlInner> object + */ + public Observable>> getSourceControlsNextWithServiceResponseAsync(final String nextPageLink) { return getSourceControlsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSourceControlsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSourceControlsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -465,7 +560,7 @@ public Observable>> call(ServiceRespons * Gets the source controls available for Azure websites. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SourceControlInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SourceControlInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSourceControlsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/RecommendationsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/RecommendationsInner.java index c906eec7daae..95193158d53d 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/RecommendationsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/RecommendationsInner.java @@ -77,10 +77,10 @@ interface RecommendationsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<RecommendationInner> object if successful. */ - public ServiceResponse> getRecommendationBySubscription() throws CloudException, IOException, IllegalArgumentException { - return getRecommendationBySubscriptionAsync().toBlocking().single(); + public List getRecommendationBySubscription() throws CloudException, IOException, IllegalArgumentException { + return getRecommendationBySubscriptionWithServiceResponseAsync().toBlocking().single().getBody(); } /** @@ -90,7 +90,7 @@ public ServiceResponse> getRecommendationBySubscriptio * @return the {@link ServiceCall} object */ public ServiceCall> getRecommendationBySubscriptionAsync(final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRecommendationBySubscriptionAsync(), serviceCallback); + return ServiceCall.create(getRecommendationBySubscriptionWithServiceResponseAsync(), serviceCallback); } /** @@ -98,7 +98,21 @@ public ServiceCall> getRecommendationBySubscriptionAsy * * @return the observable to the List<RecommendationInner> object */ - public Observable>> getRecommendationBySubscriptionAsync() { + public Observable> getRecommendationBySubscriptionAsync() { + return getRecommendationBySubscriptionWithServiceResponseAsync().map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of recommendations associated with the specified subscription. + * + * @return the observable to the List<RecommendationInner> object + */ + public Observable>> getRecommendationBySubscriptionWithServiceResponseAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -129,10 +143,10 @@ public Observable>> call(Response> getRecommendationBySubscription(Boolean featured, String filter) throws CloudException, IOException, IllegalArgumentException { - return getRecommendationBySubscriptionAsync(featured, filter).toBlocking().single(); + public List getRecommendationBySubscription(Boolean featured, String filter) throws CloudException, IOException, IllegalArgumentException { + return getRecommendationBySubscriptionWithServiceResponseAsync(featured, filter).toBlocking().single().getBody(); } /** @@ -144,7 +158,7 @@ public ServiceResponse> getRecommendationBySubscriptio * @return the {@link ServiceCall} object */ public ServiceCall> getRecommendationBySubscriptionAsync(Boolean featured, String filter, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRecommendationBySubscriptionAsync(featured, filter), serviceCallback); + return ServiceCall.create(getRecommendationBySubscriptionWithServiceResponseAsync(featured, filter), serviceCallback); } /** @@ -154,7 +168,23 @@ public ServiceCall> getRecommendationBySubscriptionAsy * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' * @return the observable to the List<RecommendationInner> object */ - public Observable>> getRecommendationBySubscriptionAsync(Boolean featured, String filter) { + public Observable> getRecommendationBySubscriptionAsync(Boolean featured, String filter) { + return getRecommendationBySubscriptionWithServiceResponseAsync(featured, filter).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of recommendations associated with the specified subscription. + * + * @param featured If set, this API returns only the most critical recommendation among the others. Otherwise this API returns all recommendations available + * @param filter Return only channels specified in the filter. Filter is specified by using OData syntax. Example: $filter=channels eq 'Api' or channel eq 'Notification' + * @return the observable to the List<RecommendationInner> object + */ + public Observable>> getRecommendationBySubscriptionWithServiceResponseAsync(Boolean featured, String filter) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } @@ -191,10 +221,10 @@ private ServiceResponse> getRecommendationBySubscripti * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RecommendationRuleInner object wrapped in {@link ServiceResponse} if successful. + * @return the RecommendationRuleInner object if successful. */ - public ServiceResponse getRuleDetailsBySiteName(String resourceGroupName, String siteName, String name) throws CloudException, IOException, IllegalArgumentException { - return getRuleDetailsBySiteNameAsync(resourceGroupName, siteName, name).toBlocking().single(); + public RecommendationRuleInner getRuleDetailsBySiteName(String resourceGroupName, String siteName, String name) throws CloudException, IOException, IllegalArgumentException { + return getRuleDetailsBySiteNameWithServiceResponseAsync(resourceGroupName, siteName, name).toBlocking().single().getBody(); } /** @@ -207,7 +237,24 @@ public ServiceResponse getRuleDetailsBySiteName(String * @return the {@link ServiceCall} object */ public ServiceCall getRuleDetailsBySiteNameAsync(String resourceGroupName, String siteName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getRuleDetailsBySiteNameAsync(resourceGroupName, siteName, name), serviceCallback); + return ServiceCall.create(getRuleDetailsBySiteNameWithServiceResponseAsync(resourceGroupName, siteName, name), serviceCallback); + } + + /** + * Gets the detailed properties of the recommendation object for the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param name Recommendation rule name + * @return the observable to the RecommendationRuleInner object + */ + public Observable getRuleDetailsBySiteNameAsync(String resourceGroupName, String siteName, String name) { + return getRuleDetailsBySiteNameWithServiceResponseAsync(resourceGroupName, siteName, name).map(new Func1, RecommendationRuleInner>() { + @Override + public RecommendationRuleInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -218,7 +265,7 @@ public ServiceCall getRuleDetailsBySiteNameAsync(String * @param name Recommendation rule name * @return the observable to the RecommendationRuleInner object */ - public Observable> getRuleDetailsBySiteNameAsync(String resourceGroupName, String siteName, String name) { + public Observable> getRuleDetailsBySiteNameWithServiceResponseAsync(String resourceGroupName, String siteName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -263,10 +310,10 @@ private ServiceResponse getRuleDetailsBySiteNameDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<RecommendationInner> object if successful. */ - public ServiceResponse> getRecommendedRulesForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException { - return getRecommendedRulesForSiteAsync(resourceGroupName, siteName).toBlocking().single(); + public List getRecommendedRulesForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException { + return getRecommendedRulesForSiteWithServiceResponseAsync(resourceGroupName, siteName).toBlocking().single().getBody(); } /** @@ -278,7 +325,7 @@ public ServiceResponse> getRecommendedRulesForSite(Str * @return the {@link ServiceCall} object */ public ServiceCall> getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRecommendedRulesForSiteAsync(resourceGroupName, siteName), serviceCallback); + return ServiceCall.create(getRecommendedRulesForSiteWithServiceResponseAsync(resourceGroupName, siteName), serviceCallback); } /** @@ -288,7 +335,23 @@ public ServiceCall> getRecommendedRulesForSiteAsync(St * @param siteName Site name * @return the observable to the List<RecommendationInner> object */ - public Observable>> getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName) { + public Observable> getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName) { + return getRecommendedRulesForSiteWithServiceResponseAsync(resourceGroupName, siteName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of recommendations associated with the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @return the observable to the List<RecommendationInner> object + */ + public Observable>> getRecommendedRulesForSiteWithServiceResponseAsync(String resourceGroupName, String siteName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -329,10 +392,10 @@ public Observable>> call(Response> getRecommendedRulesForSite(String resourceGroupName, String siteName, Boolean featured, String siteSku, Integer numSlots) throws CloudException, IOException, IllegalArgumentException { - return getRecommendedRulesForSiteAsync(resourceGroupName, siteName, featured, siteSku, numSlots).toBlocking().single(); + public List getRecommendedRulesForSite(String resourceGroupName, String siteName, Boolean featured, String siteSku, Integer numSlots) throws CloudException, IOException, IllegalArgumentException { + return getRecommendedRulesForSiteWithServiceResponseAsync(resourceGroupName, siteName, featured, siteSku, numSlots).toBlocking().single().getBody(); } /** @@ -347,7 +410,7 @@ public ServiceResponse> getRecommendedRulesForSite(Str * @return the {@link ServiceCall} object */ public ServiceCall> getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, Boolean featured, String siteSku, Integer numSlots, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRecommendedRulesForSiteAsync(resourceGroupName, siteName, featured, siteSku, numSlots), serviceCallback); + return ServiceCall.create(getRecommendedRulesForSiteWithServiceResponseAsync(resourceGroupName, siteName, featured, siteSku, numSlots), serviceCallback); } /** @@ -360,7 +423,26 @@ public ServiceCall> getRecommendedRulesForSiteAsync(St * @param numSlots The number of site slots associated to the site * @return the observable to the List<RecommendationInner> object */ - public Observable>> getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, Boolean featured, String siteSku, Integer numSlots) { + public Observable> getRecommendedRulesForSiteAsync(String resourceGroupName, String siteName, Boolean featured, String siteSku, Integer numSlots) { + return getRecommendedRulesForSiteWithServiceResponseAsync(resourceGroupName, siteName, featured, siteSku, numSlots).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of recommendations associated with the specified web site. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param featured If set, this API returns only the most critical recommendation among the others. Otherwise this API returns all recommendations available + * @param siteSku The name of site SKU. + * @param numSlots The number of site slots associated to the site + * @return the observable to the List<RecommendationInner> object + */ + public Observable>> getRecommendedRulesForSiteWithServiceResponseAsync(String resourceGroupName, String siteName, Boolean featured, String siteSku, Integer numSlots) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -402,10 +484,10 @@ private ServiceResponse> getRecommendedRulesForSiteDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<RecommendationInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<RecommendationInner> object if successful. */ - public ServiceResponse> getRecommendationHistoryForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException { - return getRecommendationHistoryForSiteAsync(resourceGroupName, siteName).toBlocking().single(); + public List getRecommendationHistoryForSite(String resourceGroupName, String siteName) throws CloudException, IOException, IllegalArgumentException { + return getRecommendationHistoryForSiteWithServiceResponseAsync(resourceGroupName, siteName).toBlocking().single().getBody(); } /** @@ -417,7 +499,7 @@ public ServiceResponse> getRecommendationHistoryForSit * @return the {@link ServiceCall} object */ public ServiceCall> getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRecommendationHistoryForSiteAsync(resourceGroupName, siteName), serviceCallback); + return ServiceCall.create(getRecommendationHistoryForSiteWithServiceResponseAsync(resourceGroupName, siteName), serviceCallback); } /** @@ -427,7 +509,23 @@ public ServiceCall> getRecommendationHistoryForSiteAsy * @param siteName Site name * @return the observable to the List<RecommendationInner> object */ - public Observable>> getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName) { + public Observable> getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName) { + return getRecommendationHistoryForSiteWithServiceResponseAsync(resourceGroupName, siteName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the list of past recommendations optionally specified by the time range. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @return the observable to the List<RecommendationInner> object + */ + public Observable>> getRecommendationHistoryForSiteWithServiceResponseAsync(String resourceGroupName, String siteName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -466,10 +564,10 @@ public Observable>> call(Response> getRecommendationHistoryForSite(String resourceGroupName, String siteName, String startTime, String endTime) throws CloudException, IOException, IllegalArgumentException { - return getRecommendationHistoryForSiteAsync(resourceGroupName, siteName, startTime, endTime).toBlocking().single(); + public List getRecommendationHistoryForSite(String resourceGroupName, String siteName, String startTime, String endTime) throws CloudException, IOException, IllegalArgumentException { + return getRecommendationHistoryForSiteWithServiceResponseAsync(resourceGroupName, siteName, startTime, endTime).toBlocking().single().getBody(); } /** @@ -483,7 +581,25 @@ public ServiceResponse> getRecommendationHistoryForSit * @return the {@link ServiceCall} object */ public ServiceCall> getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName, String startTime, String endTime, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRecommendationHistoryForSiteAsync(resourceGroupName, siteName, startTime, endTime), serviceCallback); + return ServiceCall.create(getRecommendationHistoryForSiteWithServiceResponseAsync(resourceGroupName, siteName, startTime, endTime), serviceCallback); + } + + /** + * Gets the list of past recommendations optionally specified by the time range. + * + * @param resourceGroupName Resource group name + * @param siteName Site name + * @param startTime The start time of a time range to query, e.g. $filter=startTime eq '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' + * @param endTime The end time of a time range to query, e.g. $filter=startTime eq '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' + * @return the observable to the List<RecommendationInner> object + */ + public Observable> getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName, String startTime, String endTime) { + return getRecommendationHistoryForSiteWithServiceResponseAsync(resourceGroupName, siteName, startTime, endTime).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -495,7 +611,7 @@ public ServiceCall> getRecommendationHistoryForSiteAsy * @param endTime The end time of a time range to query, e.g. $filter=startTime eq '2015-01-01T00:00:00Z' and endTime eq '2015-01-02T00:00:00Z' * @return the observable to the List<RecommendationInner> object */ - public Observable>> getRecommendationHistoryForSiteAsync(String resourceGroupName, String siteName, String startTime, String endTime) { + public Observable>> getRecommendationHistoryForSiteWithServiceResponseAsync(String resourceGroupName, String siteName, String startTime, String endTime) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ServerFarmsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ServerFarmsInner.java index 3a545ea4c689..c7e26dffb26d 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ServerFarmsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/ServerFarmsInner.java @@ -169,17 +169,16 @@ interface ServerFarmsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getServerFarms(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarms(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmsSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -205,15 +204,34 @@ public Observable>> call(String * Gets collection of App Service Plans in a resource group for a given subscription. * * @param resourceGroupName Name of resource group - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getServerFarmsAsync(final String resourceGroupName) { + public Observable> getServerFarmsAsync(final String resourceGroupName) { + return getServerFarmsWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets collection of App Service Plans in a resource group for a given subscription. + * + * @param resourceGroupName Name of resource group + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable>> getServerFarmsWithServiceResponseAsync(final String resourceGroupName) { return getServerFarmsSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -222,7 +240,7 @@ public Observable>> call(Servic * Gets collection of App Service Plans in a resource group for a given subscription. * ServiceResponse> * @param resourceGroupName Name of resource group - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmsSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -263,10 +281,10 @@ private ServiceResponse> getServerFarmsDele * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ServerFarmWithRichSkuInner object wrapped in {@link ServiceResponse} if successful. + * @return the ServerFarmWithRichSkuInner object if successful. */ - public ServiceResponse getServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getServerFarmAsync(resourceGroupName, name).toBlocking().single(); + public ServerFarmWithRichSkuInner getServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getServerFarmWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -278,7 +296,23 @@ public ServiceResponse getServerFarm(String resource * @return the {@link ServiceCall} object */ public ServiceCall getServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getServerFarmAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getServerFarmWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets specified App Service Plan in a resource group. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the ServerFarmWithRichSkuInner object + */ + public Observable getServerFarmAsync(String resourceGroupName, String name) { + return getServerFarmWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ServerFarmWithRichSkuInner>() { + @Override + public ServerFarmWithRichSkuInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -288,7 +322,7 @@ public ServiceCall getServerFarmAsync(String resourc * @param name Name of App Service Plan * @return the observable to the ServerFarmWithRichSkuInner object */ - public Observable> getServerFarmAsync(String resourceGroupName, String name) { + public Observable> getServerFarmWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -332,10 +366,10 @@ private ServiceResponse getServerFarmDelegate(Respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServerFarmWithRichSkuInner object wrapped in ServiceResponse if successful. + * @return the ServerFarmWithRichSkuInner object if successful. */ - public ServiceResponse createOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope).toBlocking().last(); + public ServerFarmWithRichSkuInner createOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope).toBlocking().last().getBody(); } /** @@ -348,7 +382,7 @@ public ServiceResponse createOrUpdateServerFarm(Stri * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope), serviceCallback); } /** @@ -359,7 +393,24 @@ public ServiceCall createOrUpdateServerFarmAsync(Str * @param serverFarmEnvelope Details of App Service Plan * @return the observable for the request */ - public Observable> createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) { + public Observable createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) { + return createOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope).map(new Func1, ServerFarmWithRichSkuInner>() { + @Override + public ServerFarmWithRichSkuInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @return the observable for the request + */ + public Observable> createOrUpdateServerFarmWithServiceResponseAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -391,10 +442,10 @@ public Observable> createOrUpdateSer * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the ServerFarmWithRichSkuInner object wrapped in ServiceResponse if successful. + * @return the ServerFarmWithRichSkuInner object if successful. */ - public ServiceResponse createOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState).toBlocking().last(); + public ServerFarmWithRichSkuInner createOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState).toBlocking().last().getBody(); } /** @@ -408,7 +459,25 @@ public ServiceResponse createOrUpdateServerFarm(Stri * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState), serviceCallback); + return ServiceCall.create(createOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState), serviceCallback); + } + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @param allowPendingState OBSOLETE: If true, allow pending state for App Service Plan + * @return the observable for the request + */ + public Observable createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) { + return createOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState).map(new Func1, ServerFarmWithRichSkuInner>() { + @Override + public ServerFarmWithRichSkuInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -420,7 +489,7 @@ public ServiceCall createOrUpdateServerFarmAsync(Str * @param allowPendingState OBSOLETE: If true, allow pending state for App Service Plan * @return the observable for the request */ - public Observable> createOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) { + public Observable> createOrUpdateServerFarmWithServiceResponseAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -450,10 +519,10 @@ public Observable> createOrUpdateSer * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ServerFarmWithRichSkuInner object wrapped in {@link ServiceResponse} if successful. + * @return the ServerFarmWithRichSkuInner object if successful. */ - public ServiceResponse beginCreateOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope).toBlocking().single(); + public ServerFarmWithRichSkuInner beginCreateOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope).toBlocking().single().getBody(); } /** @@ -466,7 +535,7 @@ public ServiceResponse beginCreateOrUpdateServerFarm * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope), serviceCallback); } /** @@ -477,7 +546,24 @@ public ServiceCall beginCreateOrUpdateServerFarmAsyn * @param serverFarmEnvelope Details of App Service Plan * @return the observable to the ServerFarmWithRichSkuInner object */ - public Observable> beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) { + public Observable beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) { + return beginCreateOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope).map(new Func1, ServerFarmWithRichSkuInner>() { + @Override + public ServerFarmWithRichSkuInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @return the observable to the ServerFarmWithRichSkuInner object + */ + public Observable> beginCreateOrUpdateServerFarmWithServiceResponseAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -519,10 +605,10 @@ public Observable> call(Response beginCreateOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState).toBlocking().single(); + public ServerFarmWithRichSkuInner beginCreateOrUpdateServerFarm(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState).toBlocking().single().getBody(); } /** @@ -536,7 +622,25 @@ public ServiceResponse beginCreateOrUpdateServerFarm * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateServerFarmAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState), serviceCallback); + } + + /** + * Creates or updates an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param serverFarmEnvelope Details of App Service Plan + * @param allowPendingState OBSOLETE: If true, allow pending state for App Service Plan + * @return the observable to the ServerFarmWithRichSkuInner object + */ + public Observable beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) { + return beginCreateOrUpdateServerFarmWithServiceResponseAsync(resourceGroupName, name, serverFarmEnvelope, allowPendingState).map(new Func1, ServerFarmWithRichSkuInner>() { + @Override + public ServerFarmWithRichSkuInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -548,7 +652,7 @@ public ServiceCall beginCreateOrUpdateServerFarmAsyn * @param allowPendingState OBSOLETE: If true, allow pending state for App Service Plan * @return the observable to the ServerFarmWithRichSkuInner object */ - public Observable> beginCreateOrUpdateServerFarmAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) { + public Observable> beginCreateOrUpdateServerFarmWithServiceResponseAsync(String resourceGroupName, String name, ServerFarmWithRichSkuInner serverFarmEnvelope, Boolean allowPendingState) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -595,10 +699,10 @@ private ServiceResponse beginCreateOrUpdateServerFar * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteServerFarmAsync(resourceGroupName, name).toBlocking().single(); + public Object deleteServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteServerFarmWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -610,7 +714,7 @@ public ServiceResponse deleteServerFarm(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall deleteServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteServerFarmAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteServerFarmWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -620,7 +724,23 @@ public ServiceCall deleteServerFarmAsync(String resourceGroupName, Strin * @param name Name of App Service Plan * @return the observable to the Object object */ - public Observable> deleteServerFarmAsync(String resourceGroupName, String name) { + public Observable deleteServerFarmAsync(String resourceGroupName, String name) { + return deleteServerFarmWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Deletes a App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the Object object + */ + public Observable> deleteServerFarmWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -662,17 +782,16 @@ private ServiceResponse deleteServerFarmDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getServerFarmMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmMetricsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -700,15 +819,35 @@ public Observable>> call(String nextPa * * @param resourceGroupName Name of resource group * @param name Name of App Service Plan - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getServerFarmMetricsAsync(final String resourceGroupName, final String name) { + public Observable> getServerFarmMetricsAsync(final String resourceGroupName, final String name) { + return getServerFarmMetricsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Queries for App Serice Plan metrics. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getServerFarmMetricsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getServerFarmMetricsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -718,7 +857,7 @@ public Observable>> call(ServiceRespon * * @param resourceGroupName Name of resource group * @param name Name of App Service Plan - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmMetricsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -759,17 +898,16 @@ public Observable>> call(Response> getServerFarmMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmMetricsSinglePageAsync(resourceGroupName, name, details, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -801,15 +939,37 @@ public Observable>> call(String nextPa * @param name Name of App Service Plan * @param details If true, metrics are broken down per App Service Plan instance * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getServerFarmMetricsAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { + public Observable> getServerFarmMetricsAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { + return getServerFarmMetricsWithServiceResponseAsync(resourceGroupName, name, details, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Queries for App Serice Plan metrics. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param details If true, metrics are broken down per App Service Plan instance + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getServerFarmMetricsWithServiceResponseAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { return getServerFarmMetricsSinglePageAsync(resourceGroupName, name, details, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -821,7 +981,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param name Name of App Service Plan ServiceResponse> * @param details If true, metrics are broken down per App Service Plan instance ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmMetricsSinglePageAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { if (resourceGroupName == null) { @@ -865,17 +1025,16 @@ private ServiceResponse> getServerFarmMetricsDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getServerFarmMetricDefintions(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmMetricDefintions(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmMetricDefintionsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmMetricDefintionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -903,15 +1062,35 @@ public Observable>> call(String next * * @param resourceGroupName Name of resource group * @param name Name of App Service Plan - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getServerFarmMetricDefintionsAsync(final String resourceGroupName, final String name) { + return getServerFarmMetricDefintionsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List of metrics that can be queried for an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getServerFarmMetricDefintionsAsync(final String resourceGroupName, final String name) { + public Observable>> getServerFarmMetricDefintionsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getServerFarmMetricDefintionsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmMetricDefintionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmMetricDefintionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -921,7 +1100,7 @@ public Observable>> call(ServiceResp * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of App Service Plan - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmMetricDefintionsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -965,10 +1144,10 @@ private ServiceResponse> getServerFarmMetricDefi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VnetInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VnetInfoInner> object if successful. */ - public ServiceResponse> getVnetsForServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getVnetsForServerFarmAsync(resourceGroupName, name).toBlocking().single(); + public List getVnetsForServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getVnetsForServerFarmWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -980,7 +1159,7 @@ public ServiceResponse> getVnetsForServerFarm(String resourc * @return the {@link ServiceCall} object */ public ServiceCall> getVnetsForServerFarmAsync(String resourceGroupName, String name, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getVnetsForServerFarmAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getVnetsForServerFarmWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -990,7 +1169,23 @@ public ServiceCall> getVnetsForServerFarmAsync(String resour * @param name Name of App Service Plan * @return the observable to the List<VnetInfoInner> object */ - public Observable>> getVnetsForServerFarmAsync(String resourceGroupName, String name) { + public Observable> getVnetsForServerFarmAsync(String resourceGroupName, String name) { + return getVnetsForServerFarmWithServiceResponseAsync(resourceGroupName, name).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of vnets associated with App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the List<VnetInfoInner> object + */ + public Observable>> getVnetsForServerFarmWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1033,10 +1228,10 @@ private ServiceResponse> getVnetsForServerFarmDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetInfoInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetInfoInner object if successful. */ - public ServiceResponse getVnetFromServerFarm(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { - return getVnetFromServerFarmAsync(resourceGroupName, name, vnetName).toBlocking().single(); + public VnetInfoInner getVnetFromServerFarm(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { + return getVnetFromServerFarmWithServiceResponseAsync(resourceGroupName, name, vnetName).toBlocking().single().getBody(); } /** @@ -1049,7 +1244,7 @@ public ServiceResponse getVnetFromServerFarm(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall getVnetFromServerFarmAsync(String resourceGroupName, String name, String vnetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getVnetFromServerFarmAsync(resourceGroupName, name, vnetName), serviceCallback); + return ServiceCall.create(getVnetFromServerFarmWithServiceResponseAsync(resourceGroupName, name, vnetName), serviceCallback); } /** @@ -1060,7 +1255,24 @@ public ServiceCall getVnetFromServerFarmAsync(String resourceGrou * @param vnetName Name of virtual network * @return the observable to the VnetInfoInner object */ - public Observable> getVnetFromServerFarmAsync(String resourceGroupName, String name, String vnetName) { + public Observable getVnetFromServerFarmAsync(String resourceGroupName, String name, String vnetName) { + return getVnetFromServerFarmWithServiceResponseAsync(resourceGroupName, name, vnetName).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets a vnet associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param vnetName Name of virtual network + * @return the observable to the VnetInfoInner object + */ + public Observable> getVnetFromServerFarmWithServiceResponseAsync(String resourceGroupName, String name, String vnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1107,10 +1319,10 @@ private ServiceResponse getVnetFromServerFarmDelegate(Response> getRoutesForVnet(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { - return getRoutesForVnetAsync(resourceGroupName, name, vnetName).toBlocking().single(); + public List getRoutesForVnet(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { + return getRoutesForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName).toBlocking().single().getBody(); } /** @@ -1123,7 +1335,7 @@ public ServiceResponse> getRoutesForVnet(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall> getRoutesForVnetAsync(String resourceGroupName, String name, String vnetName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRoutesForVnetAsync(resourceGroupName, name, vnetName), serviceCallback); + return ServiceCall.create(getRoutesForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName), serviceCallback); } /** @@ -1134,7 +1346,24 @@ public ServiceCall> getRoutesForVnetAsync(String resourceGr * @param vnetName Name of virtual network * @return the observable to the List<VnetRouteInner> object */ - public Observable>> getRoutesForVnetAsync(String resourceGroupName, String name, String vnetName) { + public Observable> getRoutesForVnetAsync(String resourceGroupName, String name, String vnetName) { + return getRoutesForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a list of all routes associated with a vnet, in an app service plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param vnetName Name of virtual network + * @return the observable to the List<VnetRouteInner> object + */ + public Observable>> getRoutesForVnetWithServiceResponseAsync(String resourceGroupName, String name, String vnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1181,10 +1410,10 @@ private ServiceResponse> getRoutesForVnetDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VnetRouteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VnetRouteInner> object if successful. */ - public ServiceResponse> getRouteForVnet(String resourceGroupName, String name, String vnetName, String routeName) throws CloudException, IOException, IllegalArgumentException { - return getRouteForVnetAsync(resourceGroupName, name, vnetName, routeName).toBlocking().single(); + public List getRouteForVnet(String resourceGroupName, String name, String vnetName, String routeName) throws CloudException, IOException, IllegalArgumentException { + return getRouteForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).toBlocking().single().getBody(); } /** @@ -1198,7 +1427,7 @@ public ServiceResponse> getRouteForVnet(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall> getRouteForVnetAsync(String resourceGroupName, String name, String vnetName, String routeName, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getRouteForVnetAsync(resourceGroupName, name, vnetName, routeName), serviceCallback); + return ServiceCall.create(getRouteForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName), serviceCallback); } /** @@ -1210,7 +1439,25 @@ public ServiceCall> getRouteForVnetAsync(String resourceGro * @param routeName Name of the virtual network route * @return the observable to the List<VnetRouteInner> object */ - public Observable>> getRouteForVnetAsync(String resourceGroupName, String name, String vnetName, String routeName) { + public Observable> getRouteForVnetAsync(String resourceGroupName, String name, String vnetName, String routeName) { + return getRouteForVnetWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets a specific route associated with a vnet, in an app service plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param vnetName Name of virtual network + * @param routeName Name of the virtual network route + * @return the observable to the List<VnetRouteInner> object + */ + public Observable>> getRouteForVnetWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1262,10 +1509,10 @@ private ServiceResponse> getRouteForVnetDelegate(Response createOrUpdateVnetRoute(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateVnetRouteAsync(resourceGroupName, name, vnetName, routeName, route).toBlocking().single(); + public VnetRouteInner createOrUpdateVnetRoute(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName, route).toBlocking().single().getBody(); } /** @@ -1280,7 +1527,7 @@ public ServiceResponse createOrUpdateVnetRoute(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateVnetRouteAsync(resourceGroupName, name, vnetName, routeName, route), serviceCallback); + return ServiceCall.create(createOrUpdateVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName, route), serviceCallback); } /** @@ -1293,7 +1540,26 @@ public ServiceCall createOrUpdateVnetRouteAsync(String resourceG * @param route The route object * @return the observable to the VnetRouteInner object */ - public Observable> createOrUpdateVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { + public Observable createOrUpdateVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { + return createOrUpdateVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName, route).map(new Func1, VnetRouteInner>() { + @Override + public VnetRouteInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Creates a new route or updates an existing route for a vnet in an app service plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param vnetName Name of virtual network + * @param routeName Name of the virtual network route + * @param route The route object + * @return the observable to the VnetRouteInner object + */ + public Observable> createOrUpdateVnetRouteWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1349,10 +1615,10 @@ private ServiceResponse createOrUpdateVnetRouteDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteVnetRoute(String resourceGroupName, String name, String vnetName, String routeName) throws CloudException, IOException, IllegalArgumentException { - return deleteVnetRouteAsync(resourceGroupName, name, vnetName, routeName).toBlocking().single(); + public Object deleteVnetRoute(String resourceGroupName, String name, String vnetName, String routeName) throws CloudException, IOException, IllegalArgumentException { + return deleteVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).toBlocking().single().getBody(); } /** @@ -1366,7 +1632,7 @@ public ServiceResponse deleteVnetRoute(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteVnetRouteAsync(resourceGroupName, name, vnetName, routeName), serviceCallback); + return ServiceCall.create(deleteVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName), serviceCallback); } /** @@ -1378,7 +1644,25 @@ public ServiceCall deleteVnetRouteAsync(String resourceGroupName, String * @param routeName Name of the virtual network route * @return the observable to the Object object */ - public Observable> deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName) { + public Observable deleteVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName) { + return deleteVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Deletes an existing route for a vnet in an app service plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param vnetName Name of virtual network + * @param routeName Name of the virtual network route + * @return the observable to the Object object + */ + public Observable> deleteVnetRouteWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String routeName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1430,10 +1714,10 @@ private ServiceResponse deleteVnetRouteDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetRouteInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetRouteInner object if successful. */ - public ServiceResponse updateVnetRoute(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) throws CloudException, IOException, IllegalArgumentException { - return updateVnetRouteAsync(resourceGroupName, name, vnetName, routeName, route).toBlocking().single(); + public VnetRouteInner updateVnetRoute(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) throws CloudException, IOException, IllegalArgumentException { + return updateVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName, route).toBlocking().single().getBody(); } /** @@ -1448,7 +1732,26 @@ public ServiceResponse updateVnetRoute(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall updateVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateVnetRouteAsync(resourceGroupName, name, vnetName, routeName, route), serviceCallback); + return ServiceCall.create(updateVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName, route), serviceCallback); + } + + /** + * Creates a new route or updates an existing route for a vnet in an app service plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param vnetName Name of virtual network + * @param routeName Name of the virtual network route + * @param route The route object + * @return the observable to the VnetRouteInner object + */ + public Observable updateVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { + return updateVnetRouteWithServiceResponseAsync(resourceGroupName, name, vnetName, routeName, route).map(new Func1, VnetRouteInner>() { + @Override + public VnetRouteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1461,7 +1764,7 @@ public ServiceCall updateVnetRouteAsync(String resourceGroupName * @param route The route object * @return the observable to the VnetRouteInner object */ - public Observable> updateVnetRouteAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { + public Observable> updateVnetRouteWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String routeName, VnetRouteInner route) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1517,10 +1820,10 @@ private ServiceResponse updateVnetRouteDelegate(Response getServerFarmVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) throws CloudException, IOException, IllegalArgumentException { - return getServerFarmVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName).toBlocking().single(); + public VnetGatewayInner getServerFarmVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) throws CloudException, IOException, IllegalArgumentException { + return getServerFarmVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName).toBlocking().single().getBody(); } /** @@ -1534,7 +1837,7 @@ public ServiceResponse getServerFarmVnetGateway(String resourc * @return the {@link ServiceCall} object */ public ServiceCall getServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getServerFarmVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName), serviceCallback); + return ServiceCall.create(getServerFarmVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName), serviceCallback); } /** @@ -1546,7 +1849,25 @@ public ServiceCall getServerFarmVnetGatewayAsync(String resour * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. * @return the observable to the VnetGatewayInner object */ - public Observable> getServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { + public Observable getServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { + return getServerFarmVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName).map(new Func1, VnetGatewayInner>() { + @Override + public VnetGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets the vnet gateway. + * + * @param resourceGroupName Name of resource group + * @param name Name of the App Service Plan + * @param vnetName Name of the virtual network + * @param gatewayName Name of the gateway. Only the 'primary' gateway is supported. + * @return the observable to the VnetGatewayInner object + */ + public Observable> getServerFarmVnetGatewayWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1597,10 +1918,10 @@ private ServiceResponse getServerFarmVnetGatewayDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetGatewayInner object if successful. */ - public ServiceResponse updateServerFarmVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateServerFarmVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single(); + public VnetGatewayInner updateServerFarmVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateServerFarmVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -1615,7 +1936,7 @@ public ServiceResponse updateServerFarmVnetGateway(String reso * @return the {@link ServiceCall} object */ public ServiceCall updateServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateServerFarmVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateServerFarmVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope), serviceCallback); } /** @@ -1628,7 +1949,26 @@ public ServiceCall updateServerFarmVnetGatewayAsync(String res * @param connectionEnvelope The gateway entity. * @return the observable to the VnetGatewayInner object */ - public Observable> updateServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { + public Observable updateServerFarmVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { + return updateServerFarmVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).map(new Func1, VnetGatewayInner>() { + @Override + public VnetGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Updates the vnet gateway. + * + * @param resourceGroupName The resource group + * @param name The name of the App Service Plan + * @param vnetName The name of the virtual network + * @param gatewayName The name of the gateway. Only 'primary' is supported. + * @param connectionEnvelope The gateway entity. + * @return the observable to the VnetGatewayInner object + */ + public Observable> updateServerFarmVnetGatewayWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1680,17 +2020,16 @@ private ServiceResponse updateServerFarmVnetGatewayDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getServerFarmSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmSites(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmSitesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1718,15 +2057,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of App Service Plan - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getServerFarmSitesAsync(final String resourceGroupName, final String name) { + return getServerFarmSitesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getServerFarmSitesAsync(final String resourceGroupName, final String name) { + public Observable>> getServerFarmSitesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getServerFarmSitesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1736,7 +2095,7 @@ public Observable>> call(ServiceResponse>> getServerFarmSitesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -1779,17 +2138,16 @@ public Observable>> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getServerFarmSites(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmSites(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmSitesSinglePageAsync(resourceGroupName, name, skipToken, filter, top).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -1823,15 +2181,38 @@ public Observable>> call(String nextPageLink) { * @param skipToken Skip to of web apps in a list. If specified, the resulting list will contain web apps starting from (including) the skipToken. Else, the resulting list contains web apps from the start of the list * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running * @param top List page size. If specified, results are paged. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getServerFarmSitesAsync(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) { + return getServerFarmSitesWithServiceResponseAsync(resourceGroupName, name, skipToken, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param skipToken Skip to of web apps in a list. If specified, the resulting list will contain web apps starting from (including) the skipToken. Else, the resulting list contains web apps from the start of the list + * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running + * @param top List page size. If specified, results are paged. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getServerFarmSitesAsync(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) { + public Observable>> getServerFarmSitesWithServiceResponseAsync(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) { return getServerFarmSitesSinglePageAsync(resourceGroupName, name, skipToken, filter, top) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -1844,7 +2225,7 @@ public Observable>> call(ServiceResponse> * @param skipToken Skip to of web apps in a list. If specified, the resulting list will contain web apps starting from (including) the skipToken. Else, the resulting list contains web apps from the start of the list ServiceResponse> * @param filter Supported filter: $filter=state eq running. Returns only web apps that are currently running ServiceResponse> * @param top List page size. If specified, results are paged. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmSitesSinglePageAsync(final String resourceGroupName, final String name, final String skipToken, final String filter, final String top) { if (resourceGroupName == null) { @@ -1889,10 +2270,10 @@ private ServiceResponse> getServerFarmSitesDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse rebootWorkerForServerFarm(String resourceGroupName, String name, String workerName) throws CloudException, IOException, IllegalArgumentException { - return rebootWorkerForServerFarmAsync(resourceGroupName, name, workerName).toBlocking().single(); + public Object rebootWorkerForServerFarm(String resourceGroupName, String name, String workerName) throws CloudException, IOException, IllegalArgumentException { + return rebootWorkerForServerFarmWithServiceResponseAsync(resourceGroupName, name, workerName).toBlocking().single().getBody(); } /** @@ -1905,7 +2286,24 @@ public ServiceResponse rebootWorkerForServerFarm(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall rebootWorkerForServerFarmAsync(String resourceGroupName, String name, String workerName, final ServiceCallback serviceCallback) { - return ServiceCall.create(rebootWorkerForServerFarmAsync(resourceGroupName, name, workerName), serviceCallback); + return ServiceCall.create(rebootWorkerForServerFarmWithServiceResponseAsync(resourceGroupName, name, workerName), serviceCallback); + } + + /** + * Submit a reboot request for a worker machine in the specified server farm. + * + * @param resourceGroupName Name of resource group + * @param name Name of server farm + * @param workerName Name of worker machine, typically starts with RD + * @return the observable to the Object object + */ + public Observable rebootWorkerForServerFarmAsync(String resourceGroupName, String name, String workerName) { + return rebootWorkerForServerFarmWithServiceResponseAsync(resourceGroupName, name, workerName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1916,7 +2314,7 @@ public ServiceCall rebootWorkerForServerFarmAsync(String resourceGroupNa * @param workerName Name of worker machine, typically starts with RD * @return the observable to the Object object */ - public Observable> rebootWorkerForServerFarmAsync(String resourceGroupName, String name, String workerName) { + public Observable> rebootWorkerForServerFarmWithServiceResponseAsync(String resourceGroupName, String name, String workerName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1961,10 +2359,10 @@ private ServiceResponse rebootWorkerForServerFarmDelegate(Response restartSitesForServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return restartSitesForServerFarmAsync(resourceGroupName, name).toBlocking().single(); + public Object restartSitesForServerFarm(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return restartSitesForServerFarmWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -1976,7 +2374,7 @@ public ServiceResponse restartSitesForServerFarm(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall restartSitesForServerFarmAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartSitesForServerFarmAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(restartSitesForServerFarmWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -1986,7 +2384,23 @@ public ServiceCall restartSitesForServerFarmAsync(String resourceGroupNa * @param name Name of App Service Plan * @return the observable to the Object object */ - public Observable> restartSitesForServerFarmAsync(String resourceGroupName, String name) { + public Observable restartSitesForServerFarmAsync(String resourceGroupName, String name) { + return restartSitesForServerFarmWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Restarts web apps in a specified App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @return the observable to the Object object + */ + public Observable> restartSitesForServerFarmWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2023,10 +2437,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse restartSitesForServerFarm(String resourceGroupName, String name, Boolean softRestart) throws CloudException, IOException, IllegalArgumentException { - return restartSitesForServerFarmAsync(resourceGroupName, name, softRestart).toBlocking().single(); + public Object restartSitesForServerFarm(String resourceGroupName, String name, Boolean softRestart) throws CloudException, IOException, IllegalArgumentException { + return restartSitesForServerFarmWithServiceResponseAsync(resourceGroupName, name, softRestart).toBlocking().single().getBody(); } /** @@ -2039,7 +2453,24 @@ public ServiceResponse restartSitesForServerFarm(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall restartSitesForServerFarmAsync(String resourceGroupName, String name, Boolean softRestart, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartSitesForServerFarmAsync(resourceGroupName, name, softRestart), serviceCallback); + return ServiceCall.create(restartSitesForServerFarmWithServiceResponseAsync(resourceGroupName, name, softRestart), serviceCallback); + } + + /** + * Restarts web apps in a specified App Service Plan. + * + * @param resourceGroupName Name of resource group + * @param name Name of App Service Plan + * @param softRestart Soft restart applies the configuration settings and restarts the apps if necessary. Hard restart always restarts and reprovisions the apps + * @return the observable to the Object object + */ + public Observable restartSitesForServerFarmAsync(String resourceGroupName, String name, Boolean softRestart) { + return restartSitesForServerFarmWithServiceResponseAsync(resourceGroupName, name, softRestart).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2050,7 +2481,7 @@ public ServiceCall restartSitesForServerFarmAsync(String resourceGroupNa * @param softRestart Soft restart applies the configuration settings and restarts the apps if necessary. Hard restart always restarts and reprovisions the apps * @return the observable to the Object object */ - public Observable> restartSitesForServerFarmAsync(String resourceGroupName, String name, Boolean softRestart) { + public Observable> restartSitesForServerFarmWithServiceResponseAsync(String resourceGroupName, String name, Boolean softRestart) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2093,10 +2524,10 @@ private ServiceResponse restartSitesForServerFarmDelegate(Response getServerFarmOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { - return getServerFarmOperationAsync(resourceGroupName, name, operationId).toBlocking().single(); + public ServerFarmWithRichSkuInner getServerFarmOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { + return getServerFarmOperationWithServiceResponseAsync(resourceGroupName, name, operationId).toBlocking().single().getBody(); } /** @@ -2109,7 +2540,7 @@ public ServiceResponse getServerFarmOperation(String * @return the {@link ServiceCall} object */ public ServiceCall getServerFarmOperationAsync(String resourceGroupName, String name, String operationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getServerFarmOperationAsync(resourceGroupName, name, operationId), serviceCallback); + return ServiceCall.create(getServerFarmOperationWithServiceResponseAsync(resourceGroupName, name, operationId), serviceCallback); } /** @@ -2120,7 +2551,24 @@ public ServiceCall getServerFarmOperationAsync(Strin * @param operationId Id of Server farm operation"&gt; * @return the observable to the ServerFarmWithRichSkuInner object */ - public Observable> getServerFarmOperationAsync(String resourceGroupName, String name, String operationId) { + public Observable getServerFarmOperationAsync(String resourceGroupName, String name, String operationId) { + return getServerFarmOperationWithServiceResponseAsync(resourceGroupName, name, operationId).map(new Func1, ServerFarmWithRichSkuInner>() { + @Override + public ServerFarmWithRichSkuInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets a server farm operation. + * + * @param resourceGroupName Name of resource group + * @param name Name of server farm + * @param operationId Id of Server farm operation"&gt; + * @return the observable to the ServerFarmWithRichSkuInner object + */ + public Observable> getServerFarmOperationWithServiceResponseAsync(String resourceGroupName, String name, String operationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2164,17 +2612,16 @@ private ServiceResponse getServerFarmOperationDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object if successful. */ - public ServiceResponse> getServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2201,15 +2648,34 @@ public Observable>> call(String * Gets collection of App Service Plans in a resource group for a given subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ServerFarmWithRichSkuInner> object + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object */ - public Observable>> getServerFarmsNextAsync(final String nextPageLink) { + public Observable> getServerFarmsNextAsync(final String nextPageLink) { + return getServerFarmsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets collection of App Service Plans in a resource group for a given subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ServerFarmWithRichSkuInner> object + */ + public Observable>> getServerFarmsNextWithServiceResponseAsync(final String nextPageLink) { return getServerFarmsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2218,7 +2684,7 @@ public Observable>> call(Servic * Gets collection of App Service Plans in a resource group for a given subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ServerFarmWithRichSkuInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -2252,17 +2718,16 @@ private ServiceResponse> getServerFarmsNext * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getServerFarmMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2289,15 +2754,34 @@ public Observable>> call(String nextPa * Queries for App Serice Plan metrics. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getServerFarmMetricsNextAsync(final String nextPageLink) { + public Observable> getServerFarmMetricsNextAsync(final String nextPageLink) { + return getServerFarmMetricsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Queries for App Serice Plan metrics. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getServerFarmMetricsNextWithServiceResponseAsync(final String nextPageLink) { return getServerFarmMetricsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2306,7 +2790,7 @@ public Observable>> call(ServiceRespon * Queries for App Serice Plan metrics. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmMetricsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -2340,17 +2824,16 @@ private ServiceResponse> getServerFarmMetricsNextD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getServerFarmMetricDefintionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmMetricDefintionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmMetricDefintionsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmMetricDefintionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2377,15 +2860,34 @@ public Observable>> call(String next * List of metrics that can be queried for an App Service Plan. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getServerFarmMetricDefintionsNextAsync(final String nextPageLink) { + public Observable> getServerFarmMetricDefintionsNextAsync(final String nextPageLink) { + return getServerFarmMetricDefintionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List of metrics that can be queried for an App Service Plan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable>> getServerFarmMetricDefintionsNextWithServiceResponseAsync(final String nextPageLink) { return getServerFarmMetricDefintionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmMetricDefintionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmMetricDefintionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2394,7 +2896,7 @@ public Observable>> call(ServiceResp * List of metrics that can be queried for an App Service Plan. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmMetricDefintionsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -2428,17 +2930,16 @@ private ServiceResponse> getServerFarmMetricDefi * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getServerFarmSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getServerFarmSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getServerFarmSitesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getServerFarmSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2465,15 +2966,34 @@ public Observable>> call(String nextPageLink) { * Gets list of Apps associated with an App Service Plan. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getServerFarmSitesNextAsync(final String nextPageLink) { + return getServerFarmSitesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets list of Apps associated with an App Service Plan. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getServerFarmSitesNextAsync(final String nextPageLink) { + public Observable>> getServerFarmSitesNextWithServiceResponseAsync(final String nextPageLink) { return getServerFarmSitesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getServerFarmSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getServerFarmSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2482,7 +3002,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getServerFarmSitesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/SitesInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/SitesInner.java index e124600e6bd9..0adf2f21c17f 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/SitesInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/SitesInner.java @@ -849,10 +849,10 @@ interface SitesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetInfoInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetInfoInner object if successful. */ - public ServiceResponse getSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot).toBlocking().single(); + public VnetInfoInner getSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot).toBlocking().single().getBody(); } /** @@ -866,7 +866,7 @@ public ServiceResponse getSiteVNETConnectionSlot(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall getSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot), serviceCallback); + return ServiceCall.create(getSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot), serviceCallback); } /** @@ -878,7 +878,25 @@ public ServiceCall getSiteVNETConnectionSlotAsync(String resource * @param slot The name of the slot for this web app. * @return the observable to the VnetInfoInner object */ - public Observable> getSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot) { + public Observable getSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot) { + return getSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Retrieves a specific Virtual Network Connection associated with this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param slot The name of the slot for this web app. + * @return the observable to the VnetInfoInner object + */ + public Observable> getSiteVNETConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -929,10 +947,10 @@ private ServiceResponse getSiteVNETConnectionSlotDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetInfoInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetInfoInner object if successful. */ - public ServiceResponse createOrUpdateSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).toBlocking().single(); + public VnetInfoInner createOrUpdateSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -947,7 +965,26 @@ public ServiceResponse createOrUpdateSiteVNETConnectionSlot(Strin * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope), serviceCallback); + } + + /** + * Adds a Virtual Network Connection or updates it's properties. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param slot The name of the slot for this web app. + * @param connectionEnvelope The properties of this Virtual Network Connection + * @return the observable to the VnetInfoInner object + */ + public Observable createOrUpdateSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { + return createOrUpdateSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -960,7 +997,7 @@ public ServiceCall createOrUpdateSiteVNETConnectionSlotAsync(Stri * @param connectionEnvelope The properties of this Virtual Network Connection * @return the observable to the VnetInfoInner object */ - public Observable> createOrUpdateSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { + public Observable> createOrUpdateSiteVNETConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1014,10 +1051,10 @@ private ServiceResponse createOrUpdateSiteVNETConnectionSlotDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot).toBlocking().single(); + public Object deleteSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot).toBlocking().single().getBody(); } /** @@ -1031,7 +1068,25 @@ public ServiceResponse deleteSiteVNETConnectionSlot(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot), serviceCallback); + return ServiceCall.create(deleteSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot), serviceCallback); + } + + /** + * Removes the specified Virtual Network Connection association from this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param slot The name of the slot for this web app. + * @return the observable to the Object object + */ + public Observable deleteSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot) { + return deleteSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1043,7 +1098,7 @@ public ServiceCall deleteSiteVNETConnectionSlotAsync(String resourceGrou * @param slot The name of the slot for this web app. * @return the observable to the Object object */ - public Observable> deleteSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot) { + public Observable> deleteSiteVNETConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1094,10 +1149,10 @@ private ServiceResponse deleteSiteVNETConnectionSlotDelegate(Response updateSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).toBlocking().single(); + public VnetInfoInner updateSiteVNETConnectionSlot(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -1112,7 +1167,26 @@ public ServiceResponse updateSiteVNETConnectionSlot(String resour * @return the {@link ServiceCall} object */ public ServiceCall updateSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteVNETConnectionSlotAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope), serviceCallback); + } + + /** + * Adds a Virtual Network Connection or updates it's properties. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param slot The name of the slot for this web app. + * @param connectionEnvelope The properties of this Virtual Network Connection + * @return the observable to the VnetInfoInner object + */ + public Observable updateSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { + return updateSiteVNETConnectionSlotWithServiceResponseAsync(resourceGroupName, name, vnetName, slot, connectionEnvelope).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1125,7 +1199,7 @@ public ServiceCall updateSiteVNETConnectionSlotAsync(String resou * @param connectionEnvelope The properties of this Virtual Network Connection * @return the observable to the VnetInfoInner object */ - public Observable> updateSiteVNETConnectionSlotAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { + public Observable> updateSiteVNETConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String slot, VnetInfoInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1178,10 +1252,10 @@ private ServiceResponse updateSiteVNETConnectionSlotDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetInfoInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetInfoInner object if successful. */ - public ServiceResponse getSiteVNETConnection(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { - return getSiteVNETConnectionAsync(resourceGroupName, name, vnetName).toBlocking().single(); + public VnetInfoInner getSiteVNETConnection(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { + return getSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName).toBlocking().single().getBody(); } /** @@ -1194,7 +1268,24 @@ public ServiceResponse getSiteVNETConnection(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall getSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteVNETConnectionAsync(resourceGroupName, name, vnetName), serviceCallback); + return ServiceCall.create(getSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName), serviceCallback); + } + + /** + * Retrieves a specific Virtual Network Connection associated with this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @return the observable to the VnetInfoInner object + */ + public Observable getSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName) { + return getSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1205,7 +1296,7 @@ public ServiceCall getSiteVNETConnectionAsync(String resourceGrou * @param vnetName The name of the Virtual Network * @return the observable to the VnetInfoInner object */ - public Observable> getSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName) { + public Observable> getSiteVNETConnectionWithServiceResponseAsync(String resourceGroupName, String name, String vnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1252,10 +1343,10 @@ private ServiceResponse getSiteVNETConnectionDelegate(Response createOrUpdateSiteVNETConnection(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteVNETConnectionAsync(resourceGroupName, name, vnetName, connectionEnvelope).toBlocking().single(); + public VnetInfoInner createOrUpdateSiteVNETConnection(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -1269,7 +1360,25 @@ public ServiceResponse createOrUpdateSiteVNETConnection(String re * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteVNETConnectionAsync(resourceGroupName, name, vnetName, connectionEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope), serviceCallback); + } + + /** + * Adds a Virtual Network Connection or updates it's properties. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param connectionEnvelope The properties of this Virtual Network Connection + * @return the observable to the VnetInfoInner object + */ + public Observable createOrUpdateSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { + return createOrUpdateSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1281,7 +1390,7 @@ public ServiceCall createOrUpdateSiteVNETConnectionAsync(String r * @param connectionEnvelope The properties of this Virtual Network Connection * @return the observable to the VnetInfoInner object */ - public Observable> createOrUpdateSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { + public Observable> createOrUpdateSiteVNETConnectionWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1331,10 +1440,10 @@ private ServiceResponse createOrUpdateSiteVNETConnectionDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteVNETConnection(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteVNETConnectionAsync(resourceGroupName, name, vnetName).toBlocking().single(); + public Object deleteSiteVNETConnection(String resourceGroupName, String name, String vnetName) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName).toBlocking().single().getBody(); } /** @@ -1347,7 +1456,24 @@ public ServiceResponse deleteSiteVNETConnection(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteVNETConnectionAsync(resourceGroupName, name, vnetName), serviceCallback); + return ServiceCall.create(deleteSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName), serviceCallback); + } + + /** + * Removes the specified Virtual Network Connection association from this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @return the observable to the Object object + */ + public Observable deleteSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName) { + return deleteSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1358,7 +1484,7 @@ public ServiceCall deleteSiteVNETConnectionAsync(String resourceGroupNam * @param vnetName The name of the Virtual Network * @return the observable to the Object object */ - public Observable> deleteSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName) { + public Observable> deleteSiteVNETConnectionWithServiceResponseAsync(String resourceGroupName, String name, String vnetName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1405,10 +1531,10 @@ private ServiceResponse deleteSiteVNETConnectionDelegate(Response updateSiteVNETConnection(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateSiteVNETConnectionAsync(resourceGroupName, name, vnetName, connectionEnvelope).toBlocking().single(); + public VnetInfoInner updateSiteVNETConnection(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -1422,7 +1548,25 @@ public ServiceResponse updateSiteVNETConnection(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall updateSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteVNETConnectionAsync(resourceGroupName, name, vnetName, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope), serviceCallback); + } + + /** + * Adds a Virtual Network Connection or updates it's properties. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param connectionEnvelope The properties of this Virtual Network Connection + * @return the observable to the VnetInfoInner object + */ + public Observable updateSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { + return updateSiteVNETConnectionWithServiceResponseAsync(resourceGroupName, name, vnetName, connectionEnvelope).map(new Func1, VnetInfoInner>() { + @Override + public VnetInfoInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1434,7 +1578,7 @@ public ServiceCall updateSiteVNETConnectionAsync(String resourceG * @param connectionEnvelope The properties of this Virtual Network Connection * @return the observable to the VnetInfoInner object */ - public Observable> updateSiteVNETConnectionAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { + public Observable> updateSiteVNETConnectionWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, VnetInfoInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1485,10 +1629,10 @@ private ServiceResponse updateSiteVNETConnectionDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkFeaturesInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkFeaturesInner object if successful. */ - public ServiceResponse getSiteNetworkFeaturesSlot(String resourceGroupName, String name, String view, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteNetworkFeaturesSlotAsync(resourceGroupName, name, view, slot).toBlocking().single(); + public NetworkFeaturesInner getSiteNetworkFeaturesSlot(String resourceGroupName, String name, String view, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteNetworkFeaturesSlotWithServiceResponseAsync(resourceGroupName, name, view, slot).toBlocking().single().getBody(); } /** @@ -1502,7 +1646,25 @@ public ServiceResponse getSiteNetworkFeaturesSlot(String r * @return the {@link ServiceCall} object */ public ServiceCall getSiteNetworkFeaturesSlotAsync(String resourceGroupName, String name, String view, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteNetworkFeaturesSlotAsync(resourceGroupName, name, view, slot), serviceCallback); + return ServiceCall.create(getSiteNetworkFeaturesSlotWithServiceResponseAsync(resourceGroupName, name, view, slot), serviceCallback); + } + + /** + * Retrieves a view of all network features in use on this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param view The type of view. This can either be "summary" or "detailed". + * @param slot The name of the slot for this web app. + * @return the observable to the NetworkFeaturesInner object + */ + public Observable getSiteNetworkFeaturesSlotAsync(String resourceGroupName, String name, String view, String slot) { + return getSiteNetworkFeaturesSlotWithServiceResponseAsync(resourceGroupName, name, view, slot).map(new Func1, NetworkFeaturesInner>() { + @Override + public NetworkFeaturesInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1514,7 +1676,7 @@ public ServiceCall getSiteNetworkFeaturesSlotAsync(String * @param slot The name of the slot for this web app. * @return the observable to the NetworkFeaturesInner object */ - public Observable> getSiteNetworkFeaturesSlotAsync(String resourceGroupName, String name, String view, String slot) { + public Observable> getSiteNetworkFeaturesSlotWithServiceResponseAsync(String resourceGroupName, String name, String view, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1564,10 +1726,10 @@ private ServiceResponse getSiteNetworkFeaturesSlotDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the NetworkFeaturesInner object wrapped in {@link ServiceResponse} if successful. + * @return the NetworkFeaturesInner object if successful. */ - public ServiceResponse getSiteNetworkFeatures(String resourceGroupName, String name, String view) throws CloudException, IOException, IllegalArgumentException { - return getSiteNetworkFeaturesAsync(resourceGroupName, name, view).toBlocking().single(); + public NetworkFeaturesInner getSiteNetworkFeatures(String resourceGroupName, String name, String view) throws CloudException, IOException, IllegalArgumentException { + return getSiteNetworkFeaturesWithServiceResponseAsync(resourceGroupName, name, view).toBlocking().single().getBody(); } /** @@ -1580,7 +1742,24 @@ public ServiceResponse getSiteNetworkFeatures(String resou * @return the {@link ServiceCall} object */ public ServiceCall getSiteNetworkFeaturesAsync(String resourceGroupName, String name, String view, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteNetworkFeaturesAsync(resourceGroupName, name, view), serviceCallback); + return ServiceCall.create(getSiteNetworkFeaturesWithServiceResponseAsync(resourceGroupName, name, view), serviceCallback); + } + + /** + * Retrieves a view of all network features in use on this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param view The type of view. This can either be "summary" or "detailed". + * @return the observable to the NetworkFeaturesInner object + */ + public Observable getSiteNetworkFeaturesAsync(String resourceGroupName, String name, String view) { + return getSiteNetworkFeaturesWithServiceResponseAsync(resourceGroupName, name, view).map(new Func1, NetworkFeaturesInner>() { + @Override + public NetworkFeaturesInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1591,7 +1770,7 @@ public ServiceCall getSiteNetworkFeaturesAsync(String reso * @param view The type of view. This can either be "summary" or "detailed". * @return the observable to the NetworkFeaturesInner object */ - public Observable> getSiteNetworkFeaturesAsync(String resourceGroupName, String name, String view) { + public Observable> getSiteNetworkFeaturesWithServiceResponseAsync(String resourceGroupName, String name, String view) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1639,10 +1818,10 @@ private ServiceResponse getSiteNetworkFeaturesDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getSiteOperationSlot(String resourceGroupName, String name, String operationId, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteOperationSlotAsync(resourceGroupName, name, operationId, slot).toBlocking().single(); + public Object getSiteOperationSlot(String resourceGroupName, String name, String operationId, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteOperationSlotWithServiceResponseAsync(resourceGroupName, name, operationId, slot).toBlocking().single().getBody(); } /** @@ -1656,7 +1835,25 @@ public ServiceResponse getSiteOperationSlot(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall getSiteOperationSlotAsync(String resourceGroupName, String name, String operationId, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteOperationSlotAsync(resourceGroupName, name, operationId, slot), serviceCallback); + return ServiceCall.create(getSiteOperationSlotWithServiceResponseAsync(resourceGroupName, name, operationId, slot), serviceCallback); + } + + /** + * Gets the operation for a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param operationId Id of an operation + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable getSiteOperationSlotAsync(String resourceGroupName, String name, String operationId, String slot) { + return getSiteOperationSlotWithServiceResponseAsync(resourceGroupName, name, operationId, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1668,7 +1865,7 @@ public ServiceCall getSiteOperationSlotAsync(String resourceGroupName, S * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> getSiteOperationSlotAsync(String resourceGroupName, String name, String operationId, String slot) { + public Observable> getSiteOperationSlotWithServiceResponseAsync(String resourceGroupName, String name, String operationId, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1717,10 +1914,10 @@ private ServiceResponse getSiteOperationSlotDelegate(Response getSiteOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { - return getSiteOperationAsync(resourceGroupName, name, operationId).toBlocking().single(); + public Object getSiteOperation(String resourceGroupName, String name, String operationId) throws CloudException, IOException, IllegalArgumentException { + return getSiteOperationWithServiceResponseAsync(resourceGroupName, name, operationId).toBlocking().single().getBody(); } /** @@ -1733,7 +1930,24 @@ public ServiceResponse getSiteOperation(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getSiteOperationAsync(String resourceGroupName, String name, String operationId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteOperationAsync(resourceGroupName, name, operationId), serviceCallback); + return ServiceCall.create(getSiteOperationWithServiceResponseAsync(resourceGroupName, name, operationId), serviceCallback); + } + + /** + * Gets the operation for a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param operationId Id of an operation + * @return the observable to the Object object + */ + public Observable getSiteOperationAsync(String resourceGroupName, String name, String operationId) { + return getSiteOperationWithServiceResponseAsync(resourceGroupName, name, operationId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1744,7 +1958,7 @@ public ServiceCall getSiteOperationAsync(String resourceGroupName, Strin * @param operationId Id of an operation * @return the observable to the Object object */ - public Observable> getSiteOperationAsync(String resourceGroupName, String name, String operationId) { + public Observable> getSiteOperationWithServiceResponseAsync(String resourceGroupName, String name, String operationId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1791,10 +2005,10 @@ private ServiceResponse getSiteOperationDelegate(Response * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the Object object wrapped in ServiceResponse if successful. + * @return the Object object if successful. */ - public ServiceResponse swapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return swapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).toBlocking().last(); + public Object swapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return swapSlotWithProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity).toBlocking().last().getBody(); } /** @@ -1807,7 +2021,24 @@ public ServiceResponse swapSlotWithProduction(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(swapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity), serviceCallback); + return ServiceCall.create(swapSlotWithProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity), serviceCallback); + } + + /** + * Swaps web app slots. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slotSwapEntity Request body that contains the target slot name + * @return the observable for the request + */ + public Observable swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { + return swapSlotWithProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1818,7 +2049,7 @@ public ServiceCall swapSlotWithProductionAsync(String resourceGroupName, * @param slotSwapEntity Request body that contains the target slot name * @return the observable for the request */ - public Observable> swapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { + public Observable> swapSlotWithProductionWithServiceResponseAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1848,10 +2079,10 @@ public Observable> swapSlotWithProductionAsync(String re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse beginSwapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { - return beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity).toBlocking().single(); + public Object beginSwapSlotWithProduction(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { + return beginSwapSlotWithProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity).toBlocking().single().getBody(); } /** @@ -1864,7 +2095,24 @@ public ServiceResponse beginSwapSlotWithProduction(String resourceGroupN * @return the {@link ServiceCall} object */ public ServiceCall beginSwapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginSwapSlotWithProductionAsync(resourceGroupName, name, slotSwapEntity), serviceCallback); + return ServiceCall.create(beginSwapSlotWithProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity), serviceCallback); + } + + /** + * Swaps web app slots. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slotSwapEntity Request body that contains the target slot name + * @return the observable to the Object object + */ + public Observable beginSwapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { + return beginSwapSlotWithProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1875,7 +2123,7 @@ public ServiceCall beginSwapSlotWithProductionAsync(String resourceGroup * @param slotSwapEntity Request body that contains the target slot name * @return the observable to the Object object */ - public Observable> beginSwapSlotWithProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { + public Observable> beginSwapSlotWithProductionWithServiceResponseAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1925,10 +2173,10 @@ private ServiceResponse beginSwapSlotWithProductionDelegate(Response swapSlotsSlot(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return swapSlotsSlotAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().last(); + public Object swapSlotsSlot(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return swapSlotsSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().last().getBody(); } /** @@ -1942,7 +2190,25 @@ public ServiceResponse swapSlotsSlot(String resourceGroupName, String na * @return the {@link ServiceCall} object */ public ServiceCall swapSlotsSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(swapSlotsSlotAsync(resourceGroupName, name, slot, slotSwapEntity), serviceCallback); + return ServiceCall.create(swapSlotsSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity), serviceCallback); + } + + /** + * Swaps web app slots. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of source slot for the swap + * @param slotSwapEntity Request body that contains the target slot name + * @return the observable for the request + */ + public Observable swapSlotsSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { + return swapSlotsSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -1954,7 +2220,7 @@ public ServiceCall swapSlotsSlotAsync(String resourceGroupName, String n * @param slotSwapEntity Request body that contains the target slot name * @return the observable for the request */ - public Observable> swapSlotsSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { + public Observable> swapSlotsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -1988,10 +2254,10 @@ public Observable> swapSlotsSlotAsync(String resourceGro * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse beginSwapSlotsSlot(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { - return beginSwapSlotsSlotAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().single(); + public Object beginSwapSlotsSlot(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { + return beginSwapSlotsSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().single().getBody(); } /** @@ -2005,7 +2271,25 @@ public ServiceResponse beginSwapSlotsSlot(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall beginSwapSlotsSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginSwapSlotsSlotAsync(resourceGroupName, name, slot, slotSwapEntity), serviceCallback); + return ServiceCall.create(beginSwapSlotsSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity), serviceCallback); + } + + /** + * Swaps web app slots. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of source slot for the swap + * @param slotSwapEntity Request body that contains the target slot name + * @return the observable to the Object object + */ + public Observable beginSwapSlotsSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { + return beginSwapSlotsSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2017,7 +2301,7 @@ public ServiceCall beginSwapSlotsSlotAsync(String resourceGroupName, Str * @param slotSwapEntity Request body that contains the target slot name * @return the observable to the Object object */ - public Observable> beginSwapSlotsSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { + public Observable> beginSwapSlotsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2068,17 +2352,16 @@ private ServiceResponse beginSwapSlotsSlotDelegate(Response> getSlotsDifferencesFromProduction(final String resourceGroupName, final String name, final CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSlotsDifferencesFromProduction(final String resourceGroupName, final String name, final CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSlotsDifferencesFromProductionSinglePageAsync(resourceGroupName, name, slotSwapEntity).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSlotsDifferencesFromProductionNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2108,15 +2391,36 @@ public Observable>> call(String nextPa * @param resourceGroupName Name of resource group * @param name Name of web app * @param slotSwapEntity Request body that contains the target slot name - * @return the observable to the List<SlotDifferenceInner> object + * @return the observable to the PagedList<SlotDifferenceInner> object + */ + public Observable> getSlotsDifferencesFromProductionAsync(final String resourceGroupName, final String name, final CsmSlotEntityInner slotSwapEntity) { + return getSlotsDifferencesFromProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get the difference in configuration settings between two web app slots. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slotSwapEntity Request body that contains the target slot name + * @return the observable to the PagedList<SlotDifferenceInner> object */ - public Observable>> getSlotsDifferencesFromProductionAsync(final String resourceGroupName, final String name, final CsmSlotEntityInner slotSwapEntity) { + public Observable>> getSlotsDifferencesFromProductionWithServiceResponseAsync(final String resourceGroupName, final String name, final CsmSlotEntityInner slotSwapEntity) { return getSlotsDifferencesFromProductionSinglePageAsync(resourceGroupName, name, slotSwapEntity) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSlotsDifferencesFromProductionNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSlotsDifferencesFromProductionNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2127,7 +2431,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param slotSwapEntity Request body that contains the target slot name - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSlotsDifferencesFromProductionSinglePageAsync(final String resourceGroupName, final String name, final CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { @@ -2177,17 +2481,16 @@ private ServiceResponse> getSlotsDifferencesFromPr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object if successful. */ - public ServiceResponse> getSlotsDifferencesSlot(final String resourceGroupName, final String name, final String slot, final CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSlotsDifferencesSlot(final String resourceGroupName, final String name, final String slot, final CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSlotsDifferencesSlotSinglePageAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSlotsDifferencesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2219,15 +2522,37 @@ public Observable>> call(String nextPa * @param name Name of web app * @param slot Name of the source slot * @param slotSwapEntity Request body that contains the target slot name - * @return the observable to the List<SlotDifferenceInner> object + * @return the observable to the PagedList<SlotDifferenceInner> object + */ + public Observable> getSlotsDifferencesSlotAsync(final String resourceGroupName, final String name, final String slot, final CsmSlotEntityInner slotSwapEntity) { + return getSlotsDifferencesSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get the difference in configuration settings between two web app slots. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of the source slot + * @param slotSwapEntity Request body that contains the target slot name + * @return the observable to the PagedList<SlotDifferenceInner> object */ - public Observable>> getSlotsDifferencesSlotAsync(final String resourceGroupName, final String name, final String slot, final CsmSlotEntityInner slotSwapEntity) { + public Observable>> getSlotsDifferencesSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot, final CsmSlotEntityInner slotSwapEntity) { return getSlotsDifferencesSlotSinglePageAsync(resourceGroupName, name, slot, slotSwapEntity) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSlotsDifferencesSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSlotsDifferencesSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2239,7 +2564,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of the source slot ServiceResponse> * @param slotSwapEntity Request body that contains the target slot name - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSlotsDifferencesSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot, final CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { @@ -2291,10 +2616,10 @@ private ServiceResponse> getSlotsDifferencesSlotDe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse applySlotConfigToProduction(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { - return applySlotConfigToProductionAsync(resourceGroupName, name, slotSwapEntity).toBlocking().single(); + public Object applySlotConfigToProduction(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { + return applySlotConfigToProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity).toBlocking().single().getBody(); } /** @@ -2307,7 +2632,24 @@ public ServiceResponse applySlotConfigToProduction(String resourceGroupN * @return the {@link ServiceCall} object */ public ServiceCall applySlotConfigToProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(applySlotConfigToProductionAsync(resourceGroupName, name, slotSwapEntity), serviceCallback); + return ServiceCall.create(applySlotConfigToProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity), serviceCallback); + } + + /** + * Applies the configuration settings from the target slot onto the current slot. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slotSwapEntity Request body that contains the target slot name. Settings from that slot will be applied on the source slot + * @return the observable to the Object object + */ + public Observable applySlotConfigToProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { + return applySlotConfigToProductionWithServiceResponseAsync(resourceGroupName, name, slotSwapEntity).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2318,7 +2660,7 @@ public ServiceCall applySlotConfigToProductionAsync(String resourceGroup * @param slotSwapEntity Request body that contains the target slot name. Settings from that slot will be applied on the source slot * @return the observable to the Object object */ - public Observable> applySlotConfigToProductionAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { + public Observable> applySlotConfigToProductionWithServiceResponseAsync(String resourceGroupName, String name, CsmSlotEntityInner slotSwapEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2366,10 +2708,10 @@ private ServiceResponse applySlotConfigToProductionDelegate(Response applySlotConfigSlot(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { - return applySlotConfigSlotAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().single(); + public Object applySlotConfigSlot(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) throws CloudException, IOException, IllegalArgumentException { + return applySlotConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity).toBlocking().single().getBody(); } /** @@ -2383,7 +2725,7 @@ public ServiceResponse applySlotConfigSlot(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall applySlotConfigSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(applySlotConfigSlotAsync(resourceGroupName, name, slot, slotSwapEntity), serviceCallback); + return ServiceCall.create(applySlotConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity), serviceCallback); } /** @@ -2395,18 +2737,36 @@ public ServiceCall applySlotConfigSlotAsync(String resourceGroupName, St * @param slotSwapEntity Request body that contains the target slot name. Settings from that slot will be applied on the source slot * @return the observable to the Object object */ - public Observable> applySlotConfigSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { - if (resourceGroupName == null) { - throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); - } - if (name == null) { - throw new IllegalArgumentException("Parameter name is required and cannot be null."); - } - if (slot == null) { - throw new IllegalArgumentException("Parameter slot is required and cannot be null."); - } - if (this.client.subscriptionId() == null) { - throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + public Observable applySlotConfigSlotAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { + return applySlotConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, slotSwapEntity).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Applies the configuration settings from the target slot onto the current slot. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of the source slot. Settings from the target slot will be applied onto this slot + * @param slotSwapEntity Request body that contains the target slot name. Settings from that slot will be applied on the source slot + * @return the observable to the Object object + */ + public Observable> applySlotConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, CsmSlotEntityInner slotSwapEntity) { + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + if (slot == null) { + throw new IllegalArgumentException("Parameter slot 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 (slotSwapEntity == null) { throw new IllegalArgumentException("Parameter slotSwapEntity is required and cannot be null."); @@ -2444,10 +2804,10 @@ private ServiceResponse applySlotConfigSlotDelegate(Response resetProductionSlotConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return resetProductionSlotConfigAsync(resourceGroupName, name).toBlocking().single(); + public Object resetProductionSlotConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return resetProductionSlotConfigWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -2459,7 +2819,23 @@ public ServiceResponse resetProductionSlotConfig(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall resetProductionSlotConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(resetProductionSlotConfigAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(resetProductionSlotConfigWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Resets the configuration settings of the current slot if they were previously modified by calling ApplySlotConfig API. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the Object object + */ + public Observable resetProductionSlotConfigAsync(String resourceGroupName, String name) { + return resetProductionSlotConfigWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2469,7 +2845,7 @@ public ServiceCall resetProductionSlotConfigAsync(String resourceGroupNa * @param name Name of web app * @return the observable to the Object object */ - public Observable> resetProductionSlotConfigAsync(String resourceGroupName, String name) { + public Observable> resetProductionSlotConfigWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2512,10 +2888,10 @@ private ServiceResponse resetProductionSlotConfigDelegate(Response resetSlotConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return resetSlotConfigSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object resetSlotConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return resetSlotConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -2528,7 +2904,24 @@ public ServiceResponse resetSlotConfigSlot(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall resetSlotConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(resetSlotConfigSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(resetSlotConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Resets the configuration settings of the current slot if they were previously modified by calling ApplySlotConfig API. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable resetSlotConfigSlotAsync(String resourceGroupName, String name, String slot) { + return resetSlotConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2539,7 +2932,7 @@ public ServiceCall resetSlotConfigSlotAsync(String resourceGroupName, St * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> resetSlotConfigSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> resetSlotConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2584,10 +2977,10 @@ private ServiceResponse resetSlotConfigSlotDelegate(Response getSlotConfigNames(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSlotConfigNamesAsync(resourceGroupName, name).toBlocking().single(); + public SlotConfigNamesResourceInner getSlotConfigNames(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSlotConfigNamesWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -2599,7 +2992,23 @@ public ServiceResponse getSlotConfigNames(String r * @return the {@link ServiceCall} object */ public ServiceCall getSlotConfigNamesAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSlotConfigNamesAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSlotConfigNamesWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the names of application settings and connection string that remain with the slot during swap operation. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the SlotConfigNamesResourceInner object + */ + public Observable getSlotConfigNamesAsync(String resourceGroupName, String name) { + return getSlotConfigNamesWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SlotConfigNamesResourceInner>() { + @Override + public SlotConfigNamesResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2609,7 +3018,7 @@ public ServiceCall getSlotConfigNamesAsync(String * @param name Name of web app * @return the observable to the SlotConfigNamesResourceInner object */ - public Observable> getSlotConfigNamesAsync(String resourceGroupName, String name) { + public Observable> getSlotConfigNamesWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2652,10 +3061,10 @@ private ServiceResponse getSlotConfigNamesDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SlotConfigNamesResourceInner object wrapped in {@link ServiceResponse} if successful. + * @return the SlotConfigNamesResourceInner object if successful. */ - public ServiceResponse updateSlotConfigNames(String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) throws CloudException, IOException, IllegalArgumentException { - return updateSlotConfigNamesAsync(resourceGroupName, name, slotConfigNames).toBlocking().single(); + public SlotConfigNamesResourceInner updateSlotConfigNames(String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) throws CloudException, IOException, IllegalArgumentException { + return updateSlotConfigNamesWithServiceResponseAsync(resourceGroupName, name, slotConfigNames).toBlocking().single().getBody(); } /** @@ -2668,7 +3077,24 @@ public ServiceResponse updateSlotConfigNames(Strin * @return the {@link ServiceCall} object */ public ServiceCall updateSlotConfigNamesAsync(String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSlotConfigNamesAsync(resourceGroupName, name, slotConfigNames), serviceCallback); + return ServiceCall.create(updateSlotConfigNamesWithServiceResponseAsync(resourceGroupName, name, slotConfigNames), serviceCallback); + } + + /** + * Updates the names of application settings and connection string that remain with the slot during swap operation. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slotConfigNames Request body containing the names of application settings and connection strings + * @return the observable to the SlotConfigNamesResourceInner object + */ + public Observable updateSlotConfigNamesAsync(String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) { + return updateSlotConfigNamesWithServiceResponseAsync(resourceGroupName, name, slotConfigNames).map(new Func1, SlotConfigNamesResourceInner>() { + @Override + public SlotConfigNamesResourceInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -2679,7 +3105,7 @@ public ServiceCall updateSlotConfigNamesAsync(Stri * @param slotConfigNames Request body containing the names of application settings and connection strings * @return the observable to the SlotConfigNamesResourceInner object */ - public Observable> updateSlotConfigNamesAsync(String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) { + public Observable> updateSlotConfigNamesWithServiceResponseAsync(String resourceGroupName, String name, SlotConfigNamesResourceInner slotConfigNames) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -2725,17 +3151,16 @@ private ServiceResponse updateSlotConfigNamesDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getSiteSlots(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteSlots(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteSlotsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteSlotsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2763,15 +3188,35 @@ public Observable>> call(String nextPageLink) { * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getSiteSlotsAsync(final String resourceGroupName, final String name) { + return getSiteSlotsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all the slots for a web apps. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getSiteSlotsAsync(final String resourceGroupName, final String name) { + public Observable>> getSiteSlotsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getSiteSlotsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteSlotsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteSlotsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2781,7 +3226,7 @@ public Observable>> call(ServiceResponse>> getSiteSlotsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -2820,17 +3265,16 @@ public Observable>> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getSiteSlots(final String resourceGroupName, final String name, final String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteSlots(final String resourceGroupName, final String name, final String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteSlotsSinglePageAsync(resourceGroupName, name, propertiesToInclude).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteSlotsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2860,15 +3304,36 @@ public Observable>> call(String nextPageLink) { * @param resourceGroupName Name of resource group * @param name Name of web app * @param propertiesToInclude List of app properties to include in the response - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getSiteSlotsAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { + return getSiteSlotsWithServiceResponseAsync(resourceGroupName, name, propertiesToInclude) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all the slots for a web apps. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param propertiesToInclude List of app properties to include in the response + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getSiteSlotsAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { + public Observable>> getSiteSlotsWithServiceResponseAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { return getSiteSlotsSinglePageAsync(resourceGroupName, name, propertiesToInclude) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteSlotsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteSlotsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2879,7 +3344,7 @@ public Observable>> call(ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param propertiesToInclude List of app properties to include in the response - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteSlotsSinglePageAsync(final String resourceGroupName, final String name, final String propertiesToInclude) { if (resourceGroupName == null) { @@ -2922,17 +3387,16 @@ private ServiceResponse> getSiteSlotsDelegate(Response> getSites(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSites(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSitesSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -2958,15 +3422,34 @@ public Observable>> call(String nextPageLink) { * Gets the web apps for a subscription in the specified resource group. * * @param resourceGroupName Name of resource group - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getSitesAsync(final String resourceGroupName) { + return getSitesWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the web apps for a subscription in the specified resource group. + * + * @param resourceGroupName Name of resource group + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getSitesAsync(final String resourceGroupName) { + public Observable>> getSitesWithServiceResponseAsync(final String resourceGroupName) { return getSitesSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -2975,7 +3458,7 @@ public Observable>> call(ServiceResponse>> getSitesSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -3014,17 +3497,16 @@ public Observable>> call(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getSites(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes, final Boolean includeSlots) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSites(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes, final Boolean includeSlots) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSitesSinglePageAsync(resourceGroupName, propertiesToInclude, includeSiteTypes, includeSlots).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -3056,15 +3538,37 @@ public Observable>> call(String nextPageLink) { * @param propertiesToInclude Additional web app properties included in the response * @param includeSiteTypes Types of apps included in the response * @param includeSlots Whether or not to include deployments slots in results - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getSitesAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes, final Boolean includeSlots) { + return getSitesWithServiceResponseAsync(resourceGroupName, propertiesToInclude, includeSiteTypes, includeSlots) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the web apps for a subscription in the specified resource group. + * + * @param resourceGroupName Name of resource group + * @param propertiesToInclude Additional web app properties included in the response + * @param includeSiteTypes Types of apps included in the response + * @param includeSlots Whether or not to include deployments slots in results + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getSitesAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes, final Boolean includeSlots) { + public Observable>> getSitesWithServiceResponseAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes, final Boolean includeSlots) { return getSitesSinglePageAsync(resourceGroupName, propertiesToInclude, includeSiteTypes, includeSlots) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -3076,7 +3580,7 @@ public Observable>> call(ServiceResponse> * @param propertiesToInclude Additional web app properties included in the response ServiceResponse> * @param includeSiteTypes Types of apps included in the response ServiceResponse> * @param includeSlots Whether or not to include deployments slots in results - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSitesSinglePageAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes, final Boolean includeSlots) { if (resourceGroupName == null) { @@ -3117,10 +3621,10 @@ private ServiceResponse> getSitesDelegate(Response getSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteAsync(resourceGroupName, name).toBlocking().single(); + public SiteInner getSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -3132,7 +3636,23 @@ public ServiceResponse getSite(String resourceGroupName, String name) * @return the {@link ServiceCall} object */ public ServiceCall getSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the SiteInner object + */ + public Observable getSiteAsync(String resourceGroupName, String name) { + return getSiteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3142,7 +3662,7 @@ public ServiceCall getSiteAsync(String resourceGroupName, String name * @param name Name of web app * @return the observable to the SiteInner object */ - public Observable> getSiteAsync(String resourceGroupName, String name) { + public Observable> getSiteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3179,10 +3699,10 @@ public Observable> call(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse getSite(String resourceGroupName, String name, String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { - return getSiteAsync(resourceGroupName, name, propertiesToInclude).toBlocking().single(); + public SiteInner getSite(String resourceGroupName, String name, String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { + return getSiteWithServiceResponseAsync(resourceGroupName, name, propertiesToInclude).toBlocking().single().getBody(); } /** @@ -3195,7 +3715,24 @@ public ServiceResponse getSite(String resourceGroupName, String name, * @return the {@link ServiceCall} object */ public ServiceCall getSiteAsync(String resourceGroupName, String name, String propertiesToInclude, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteAsync(resourceGroupName, name, propertiesToInclude), serviceCallback); + return ServiceCall.create(getSiteWithServiceResponseAsync(resourceGroupName, name, propertiesToInclude), serviceCallback); + } + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param propertiesToInclude Additional web app properties included in the response + * @return the observable to the SiteInner object + */ + public Observable getSiteAsync(String resourceGroupName, String name, String propertiesToInclude) { + return getSiteWithServiceResponseAsync(resourceGroupName, name, propertiesToInclude).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3206,7 +3743,7 @@ public ServiceCall getSiteAsync(String resourceGroupName, String name * @param propertiesToInclude Additional web app properties included in the response * @return the observable to the SiteInner object */ - public Observable> getSiteAsync(String resourceGroupName, String name, String propertiesToInclude) { + public Observable> getSiteWithServiceResponseAsync(String resourceGroupName, String name, String propertiesToInclude) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3250,10 +3787,10 @@ private ServiceResponse getSiteDelegate(Response respon * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SiteInner object wrapped in ServiceResponse if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse createOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope).toBlocking().last(); + public SiteInner createOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope).toBlocking().last().getBody(); } /** @@ -3266,7 +3803,24 @@ public ServiceResponse createOrUpdateSite(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @return the observable for the request + */ + public Observable createOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { + return createOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3277,7 +3831,7 @@ public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, * @param siteEnvelope Details of web app if it exists already * @return the observable for the request */ - public Observable> createOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { + public Observable> createOrUpdateSiteWithServiceResponseAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3316,10 +3870,10 @@ public Observable> createOrUpdateSiteAsync(String res * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SiteInner object wrapped in ServiceResponse if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse createOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().last(); + public SiteInner createOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().last().getBody(); } /** @@ -3337,7 +3891,29 @@ public ServiceResponse createOrUpdateSite(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + return ServiceCall.create(createOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @return the observable for the request + */ + public Observable createOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + return createOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3353,7 +3929,7 @@ public ServiceCall createOrUpdateSiteAsync(String resourceGroupName, * @param ttlInSeconds Time to live in seconds for web app's default domain name * @return the observable for the request */ - public Observable> createOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + public Observable> createOrUpdateSiteWithServiceResponseAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3383,10 +3959,10 @@ public Observable> createOrUpdateSiteAsync(String res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope).toBlocking().single(); + public SiteInner beginCreateOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope).toBlocking().single().getBody(); } /** @@ -3399,7 +3975,24 @@ public ServiceResponse beginCreateOrUpdateSite(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @return the observable to the SiteInner object + */ + public Observable beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { + return beginCreateOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3410,7 +4003,7 @@ public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupN * @param siteEnvelope Details of web app if it exists already * @return the observable to the SiteInner object */ - public Observable> beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { + public Observable> beginCreateOrUpdateSiteWithServiceResponseAsync(String resourceGroupName, String name, SiteInner siteEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3459,10 +4052,10 @@ public Observable> call(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse beginCreateOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().single(); + public SiteInner beginCreateOrUpdateSite(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().single().getBody(); } /** @@ -3480,7 +4073,29 @@ public ServiceResponse beginCreateOrUpdateSite(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateSiteAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @return the observable to the SiteInner object + */ + public Observable beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + return beginCreateOrUpdateSiteWithServiceResponseAsync(resourceGroupName, name, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3496,7 +4111,7 @@ public ServiceCall beginCreateOrUpdateSiteAsync(String resourceGroupN * @param ttlInSeconds Time to live in seconds for web app's default domain name * @return the observable to the SiteInner object */ - public Observable> beginCreateOrUpdateSiteAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + public Observable> beginCreateOrUpdateSiteWithServiceResponseAsync(String resourceGroupName, String name, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3543,10 +4158,10 @@ private ServiceResponse beginCreateOrUpdateSiteDelegate(Response deleteSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteAsync(resourceGroupName, name).toBlocking().single(); + public Object deleteSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -3558,7 +4173,23 @@ public ServiceResponse deleteSite(String resourceGroupName, String name) * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(deleteSiteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the Object object + */ + public Observable deleteSiteAsync(String resourceGroupName, String name) { + return deleteSiteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3568,7 +4199,7 @@ public ServiceCall deleteSiteAsync(String resourceGroupName, String name * @param name Name of web app * @return the observable to the Object object */ - public Observable> deleteSiteAsync(String resourceGroupName, String name) { + public Observable> deleteSiteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3611,10 +4242,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSite(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots).toBlocking().single(); + public Object deleteSite(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots).toBlocking().single().getBody(); } /** @@ -3630,7 +4261,27 @@ public ServiceResponse deleteSite(String resourceGroupName, String name, * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots), serviceCallback); + return ServiceCall.create(deleteSiteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots), serviceCallback); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param deleteMetrics If true, web app metrics are also deleted + * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted + * @param skipDnsRegistration If true, DNS registration is skipped + * @param deleteAllSlots If true, all slots associated with web app are also deleted + * @return the observable to the Object object + */ + public Observable deleteSiteAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) { + return deleteSiteWithServiceResponseAsync(resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3644,7 +4295,7 @@ public ServiceCall deleteSiteAsync(String resourceGroupName, String name * @param deleteAllSlots If true, all slots associated with web app are also deleted * @return the observable to the Object object */ - public Observable> deleteSiteAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) { + public Observable> deleteSiteWithServiceResponseAsync(String resourceGroupName, String name, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3687,10 +4338,10 @@ private ServiceResponse deleteSiteDelegate(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse getSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public SiteInner getSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -3703,7 +4354,24 @@ public ServiceResponse getSiteSlot(String resourceGroupName, String n * @return the {@link ServiceCall} object */ public ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(getSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the SiteInner object + */ + public Observable getSiteSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3714,7 +4382,7 @@ public ServiceCall getSiteSlotAsync(String resourceGroupName, String * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the SiteInner object */ - public Observable> getSiteSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> getSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3755,10 +4423,10 @@ public Observable> call(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse getSiteSlot(String resourceGroupName, String name, String slot, String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { - return getSiteSlotAsync(resourceGroupName, name, slot, propertiesToInclude).toBlocking().single(); + public SiteInner getSiteSlot(String resourceGroupName, String name, String slot, String propertiesToInclude) throws CloudException, IOException, IllegalArgumentException { + return getSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, propertiesToInclude).toBlocking().single().getBody(); } /** @@ -3772,7 +4440,25 @@ public ServiceResponse getSiteSlot(String resourceGroupName, String n * @return the {@link ServiceCall} object */ public ServiceCall getSiteSlotAsync(String resourceGroupName, String name, String slot, String propertiesToInclude, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteSlotAsync(resourceGroupName, name, slot, propertiesToInclude), serviceCallback); + return ServiceCall.create(getSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, propertiesToInclude), serviceCallback); + } + + /** + * Get details of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param propertiesToInclude Additional web app properties included in the response + * @return the observable to the SiteInner object + */ + public Observable getSiteSlotAsync(String resourceGroupName, String name, String slot, String propertiesToInclude) { + return getSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, propertiesToInclude).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3784,7 +4470,7 @@ public ServiceCall getSiteSlotAsync(String resourceGroupName, String * @param propertiesToInclude Additional web app properties included in the response * @return the observable to the SiteInner object */ - public Observable> getSiteSlotAsync(String resourceGroupName, String name, String slot, String propertiesToInclude) { + public Observable> getSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, String propertiesToInclude) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3832,10 +4518,10 @@ private ServiceResponse getSiteSlotDelegate(Response re * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SiteInner object wrapped in ServiceResponse if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope).toBlocking().last(); + public SiteInner createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope).toBlocking().last().getBody(); } /** @@ -3849,7 +4535,25 @@ public ServiceResponse createOrUpdateSiteSlot(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @return the observable for the request + */ + public Observable createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { + return createOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3861,7 +4565,7 @@ public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupNa * @param siteEnvelope Details of web app if it exists already * @return the observable for the request */ - public Observable> createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { + public Observable> createOrUpdateSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3904,10 +4608,10 @@ public Observable> createOrUpdateSiteSlotAsync(String * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SiteInner object wrapped in ServiceResponse if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return createOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().last(); + public SiteInner createOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return createOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().last().getBody(); } /** @@ -3926,7 +4630,30 @@ public ServiceResponse createOrUpdateSiteSlot(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + return ServiceCall.create(createOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @return the observable for the request + */ + public Observable createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + return createOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -3943,7 +4670,7 @@ public ServiceCall createOrUpdateSiteSlotAsync(String resourceGroupNa * @param ttlInSeconds Time to live in seconds for web app's default domain name * @return the observable for the request */ - public Observable> createOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + public Observable> createOrUpdateSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -3977,10 +4704,10 @@ public Observable> createOrUpdateSiteSlotAsync(String * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope).toBlocking().single(); + public SiteInner beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope).toBlocking().single().getBody(); } /** @@ -3994,7 +4721,25 @@ public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @return the observable to the SiteInner object + */ + public Observable beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { + return beginCreateOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4006,7 +4751,7 @@ public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGr * @param siteEnvelope Details of web app if it exists already * @return the observable to the SiteInner object */ - public Observable> beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { + public Observable> beginCreateOrUpdateSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4059,10 +4804,10 @@ public Observable> call(Response respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { - return beginCreateOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().single(); + public SiteInner beginCreateOrUpdateSiteSlot(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) throws CloudException, IOException, IllegalArgumentException { + return beginCreateOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).toBlocking().single().getBody(); } /** @@ -4081,7 +4826,30 @@ public ServiceResponse beginCreateOrUpdateSiteSlot(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginCreateOrUpdateSiteSlotAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + return ServiceCall.create(beginCreateOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteEnvelope Details of web app if it exists already + * @param skipDnsRegistration If true web app hostname is not registered with DNS on creation. This parameter is + only used for app creation + * @param skipCustomDomainVerification If true, custom (non *.azurewebsites.net) domains associated with web app are not verified. + * @param forceDnsRegistration If true, web app hostname is force registered with DNS + * @param ttlInSeconds Time to live in seconds for web app's default domain name + * @return the observable to the SiteInner object + */ + public Observable beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + return beginCreateOrUpdateSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteEnvelope, skipDnsRegistration, skipCustomDomainVerification, forceDnsRegistration, ttlInSeconds).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4098,7 +4866,7 @@ public ServiceCall beginCreateOrUpdateSiteSlotAsync(String resourceGr * @param ttlInSeconds Time to live in seconds for web app's default domain name * @return the observable to the SiteInner object */ - public Observable> beginCreateOrUpdateSiteSlotAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { + public Observable> beginCreateOrUpdateSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteInner siteEnvelope, String skipDnsRegistration, String skipCustomDomainVerification, String forceDnsRegistration, String ttlInSeconds) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4149,10 +4917,10 @@ private ServiceResponse beginCreateOrUpdateSiteSlotDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object deleteSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -4165,7 +4933,24 @@ public ServiceResponse deleteSiteSlot(String resourceGroupName, String n * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(deleteSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable deleteSiteSlotAsync(String resourceGroupName, String name, String slot) { + return deleteSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4176,7 +4961,7 @@ public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> deleteSiteSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> deleteSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4223,10 +5008,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteSlot(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteSlotAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots).toBlocking().single(); + public Object deleteSiteSlot(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots).toBlocking().single().getBody(); } /** @@ -4243,7 +5028,28 @@ public ServiceResponse deleteSiteSlot(String resourceGroupName, String n * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteSlotAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots), serviceCallback); + return ServiceCall.create(deleteSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots), serviceCallback); + } + + /** + * Deletes a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param deleteMetrics If true, web app metrics are also deleted + * @param deleteEmptyServerFarm If true and App Service Plan is empty after web app deletion, App Service Plan is also deleted + * @param skipDnsRegistration If true, DNS registration is skipped + * @param deleteAllSlots If true, all slots associated with web app are also deleted + * @return the observable to the Object object + */ + public Observable deleteSiteSlotAsync(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) { + return deleteSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm, skipDnsRegistration, deleteAllSlots).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4258,7 +5064,7 @@ public ServiceCall deleteSiteSlotAsync(String resourceGroupName, String * @param deleteAllSlots If true, all slots associated with web app are also deleted * @return the observable to the Object object */ - public Observable> deleteSiteSlotAsync(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) { + public Observable> deleteSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, String deleteMetrics, String deleteEmptyServerFarm, String skipDnsRegistration, String deleteAllSlots) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4303,10 +5109,10 @@ private ServiceResponse deleteSiteSlotDelegate(Response re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteCloneabilityInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteCloneabilityInner object if successful. */ - public ServiceResponse isSiteCloneable(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return isSiteCloneableAsync(resourceGroupName, name).toBlocking().single(); + public SiteCloneabilityInner isSiteCloneable(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return isSiteCloneableWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -4318,7 +5124,23 @@ public ServiceResponse isSiteCloneable(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall isSiteCloneableAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(isSiteCloneableAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(isSiteCloneableWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @return the observable to the SiteCloneabilityInner object + */ + public Observable isSiteCloneableAsync(String resourceGroupName, String name) { + return isSiteCloneableWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SiteCloneabilityInner>() { + @Override + public SiteCloneabilityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4328,7 +5150,7 @@ public ServiceCall isSiteCloneableAsync(String resourceGr * @param name Name of the web app * @return the observable to the SiteCloneabilityInner object */ - public Observable> isSiteCloneableAsync(String resourceGroupName, String name) { + public Observable> isSiteCloneableWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4371,10 +5193,10 @@ private ServiceResponse isSiteCloneableDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteCloneabilityInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteCloneabilityInner object if successful. */ - public ServiceResponse isSiteCloneableSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return isSiteCloneableSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public SiteCloneabilityInner isSiteCloneableSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return isSiteCloneableSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -4387,7 +5209,24 @@ public ServiceResponse isSiteCloneableSlot(String resourc * @return the {@link ServiceCall} object */ public ServiceCall isSiteCloneableSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(isSiteCloneableSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(isSiteCloneableSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Creates a new web app or modifies an existing web app. + * + * @param resourceGroupName Name of the resource group + * @param name Name of the web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the SiteCloneabilityInner object + */ + public Observable isSiteCloneableSlotAsync(String resourceGroupName, String name, String slot) { + return isSiteCloneableSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, SiteCloneabilityInner>() { + @Override + public SiteCloneabilityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4398,7 +5237,7 @@ public ServiceCall isSiteCloneableSlotAsync(String resour * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the SiteCloneabilityInner object */ - public Observable> isSiteCloneableSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> isSiteCloneableSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4445,10 +5284,10 @@ private ServiceResponse isSiteCloneableSlotDelegate(Respo * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the SiteInner object wrapped in ServiceResponse if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse recoverSite(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return recoverSiteAsync(resourceGroupName, name, recoveryEntity).toBlocking().last(); + public SiteInner recoverSite(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return recoverSiteWithServiceResponseAsync(resourceGroupName, name, recoveryEntity).toBlocking().last().getBody(); } /** @@ -4461,7 +5300,24 @@ public ServiceResponse recoverSite(String resourceGroupName, String n * @return the {@link ServiceCall} object */ public ServiceCall recoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(recoverSiteAsync(resourceGroupName, name, recoveryEntity), serviceCallback); + return ServiceCall.create(recoverSiteWithServiceResponseAsync(resourceGroupName, name, recoveryEntity), serviceCallback); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + * @return the observable for the request + */ + public Observable recoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) { + return recoverSiteWithServiceResponseAsync(resourceGroupName, name, recoveryEntity).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4472,7 +5328,7 @@ public ServiceCall recoverSiteAsync(String resourceGroupName, String * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. * @return the observable for the request */ - public Observable> recoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) { + public Observable> recoverSiteWithServiceResponseAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4502,10 +5358,10 @@ public Observable> recoverSiteAsync(String resourceGr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse beginRecoverSite(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException { - return beginRecoverSiteAsync(resourceGroupName, name, recoveryEntity).toBlocking().single(); + public SiteInner beginRecoverSite(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException { + return beginRecoverSiteWithServiceResponseAsync(resourceGroupName, name, recoveryEntity).toBlocking().single().getBody(); } /** @@ -4518,7 +5374,24 @@ public ServiceResponse beginRecoverSite(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall beginRecoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRecoverSiteAsync(resourceGroupName, name, recoveryEntity), serviceCallback); + return ServiceCall.create(beginRecoverSiteWithServiceResponseAsync(resourceGroupName, name, recoveryEntity), serviceCallback); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + * @return the observable to the SiteInner object + */ + public Observable beginRecoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) { + return beginRecoverSiteWithServiceResponseAsync(resourceGroupName, name, recoveryEntity).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4529,7 +5402,7 @@ public ServiceCall beginRecoverSiteAsync(String resourceGroupName, St * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. * @return the observable to the SiteInner object */ - public Observable> beginRecoverSiteAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) { + public Observable> beginRecoverSiteWithServiceResponseAsync(String resourceGroupName, String name, CsmSiteRecoveryEntityInner recoveryEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4579,10 +5452,10 @@ private ServiceResponse beginRecoverSiteDelegate(Response recoverSiteSlot(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return recoverSiteSlotAsync(resourceGroupName, name, slot, recoveryEntity).toBlocking().last(); + public SiteInner recoverSiteSlot(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return recoverSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, recoveryEntity).toBlocking().last().getBody(); } /** @@ -4596,7 +5469,25 @@ public ServiceResponse recoverSiteSlot(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall recoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(recoverSiteSlotAsync(resourceGroupName, name, slot, recoveryEntity), serviceCallback); + return ServiceCall.create(recoverSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, recoveryEntity), serviceCallback); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + * @return the observable for the request + */ + public Observable recoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) { + return recoverSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, recoveryEntity).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4608,7 +5499,7 @@ public ServiceCall recoverSiteSlotAsync(String resourceGroupName, Str * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. * @return the observable for the request */ - public Observable> recoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) { + public Observable> recoverSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4642,10 +5533,10 @@ public Observable> recoverSiteSlotAsync(String resour * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteInner object if successful. */ - public ServiceResponse beginRecoverSiteSlot(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException { - return beginRecoverSiteSlotAsync(resourceGroupName, name, slot, recoveryEntity).toBlocking().single(); + public SiteInner beginRecoverSiteSlot(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) throws CloudException, IOException, IllegalArgumentException { + return beginRecoverSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, recoveryEntity).toBlocking().single().getBody(); } /** @@ -4658,8 +5549,26 @@ public ServiceResponse beginRecoverSiteSlot(String resourceGroupName, * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall beginRecoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRecoverSiteSlotAsync(resourceGroupName, name, slot, recoveryEntity), serviceCallback); + public ServiceCall beginRecoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity, final ServiceCallback serviceCallback) { + return ServiceCall.create(beginRecoverSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, recoveryEntity), serviceCallback); + } + + /** + * Recovers a deleted web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. + * @return the observable to the SiteInner object + */ + public Observable beginRecoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) { + return beginRecoverSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, recoveryEntity).map(new Func1, SiteInner>() { + @Override + public SiteInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4671,7 +5580,7 @@ public ServiceCall beginRecoverSiteSlotAsync(String resourceGroupName * @param recoveryEntity Snapshot data used for web app recovery. Snapshot information can be obtained by calling GetDeletedSites or GetSiteSnapshots API. * @return the observable to the SiteInner object */ - public Observable> beginRecoverSiteSlotAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) { + public Observable> beginRecoverSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, CsmSiteRecoveryEntityInner recoveryEntity) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4721,10 +5630,10 @@ private ServiceResponse beginRecoverSiteSlotDelegate(Response getSiteSnapshots(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteSnapshotsAsync(resourceGroupName, name).toBlocking().single(); + public Object getSiteSnapshots(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteSnapshotsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -4736,7 +5645,23 @@ public ServiceResponse getSiteSnapshots(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall getSiteSnapshotsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteSnapshotsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteSnapshotsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Returns all Snapshots to the user. + * + * @param resourceGroupName Webspace + * @param name Website Name + * @return the observable to the Object object + */ + public Observable getSiteSnapshotsAsync(String resourceGroupName, String name) { + return getSiteSnapshotsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -4746,7 +5671,7 @@ public ServiceCall getSiteSnapshotsAsync(String resourceGroupName, Strin * @param name Website Name * @return the observable to the Object object */ - public Observable> getSiteSnapshotsAsync(String resourceGroupName, String name) { + public Observable> getSiteSnapshotsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4789,10 +5714,10 @@ private ServiceResponse getSiteSnapshotsDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getSiteSnapshotsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteSnapshotsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object getSiteSnapshotsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteSnapshotsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -4805,7 +5730,7 @@ public ServiceResponse getSiteSnapshotsSlot(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall getSiteSnapshotsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteSnapshotsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(getSiteSnapshotsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); } /** @@ -4816,7 +5741,24 @@ public ServiceCall getSiteSnapshotsSlotAsync(String resourceGroupName, S * @param slot Website Slot * @return the observable to the Object object */ - public Observable> getSiteSnapshotsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable getSiteSnapshotsSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteSnapshotsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Returns all Snapshots to the user. + * + * @param resourceGroupName Webspace + * @param name Website Name + * @param slot Website Slot + * @return the observable to the Object object + */ + public Observable> getSiteSnapshotsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -4860,17 +5802,16 @@ private ServiceResponse getSiteSnapshotsSlotDelegate(Response> getDeletedSites(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeletedSites(final String resourceGroupName) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeletedSitesSinglePageAsync(resourceGroupName).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeletedSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4896,15 +5837,34 @@ public Observable>> call(String nextPageL * Gets deleted web apps in subscription. * * @param resourceGroupName Name of resource group - * @return the observable to the List<DeletedSiteInner> object + * @return the observable to the PagedList<DeletedSiteInner> object + */ + public Observable> getDeletedSitesAsync(final String resourceGroupName) { + return getDeletedSitesWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @return the observable to the PagedList<DeletedSiteInner> object */ - public Observable>> getDeletedSitesAsync(final String resourceGroupName) { + public Observable>> getDeletedSitesWithServiceResponseAsync(final String resourceGroupName) { return getDeletedSitesSinglePageAsync(resourceGroupName) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeletedSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -4913,7 +5873,7 @@ public Observable>> call(ServiceResponse< * Gets deleted web apps in subscription. * * @param resourceGroupName Name of resource group - * @return the List<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeletedSitesSinglePageAsync(final String resourceGroupName) { if (resourceGroupName == null) { @@ -4950,17 +5910,16 @@ public Observable>> call(Response> getDeletedSites(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeletedSites(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeletedSitesSinglePageAsync(resourceGroupName, propertiesToInclude, includeSiteTypes).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeletedSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -4990,15 +5949,36 @@ public Observable>> call(String nextPageL * @param resourceGroupName Name of resource group * @param propertiesToInclude Additional web app properties included in the response * @param includeSiteTypes Types of apps included in the response - * @return the observable to the List<DeletedSiteInner> object + * @return the observable to the PagedList<DeletedSiteInner> object + */ + public Observable> getDeletedSitesAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes) { + return getDeletedSitesWithServiceResponseAsync(resourceGroupName, propertiesToInclude, includeSiteTypes) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets deleted web apps in subscription. + * + * @param resourceGroupName Name of resource group + * @param propertiesToInclude Additional web app properties included in the response + * @param includeSiteTypes Types of apps included in the response + * @return the observable to the PagedList<DeletedSiteInner> object */ - public Observable>> getDeletedSitesAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes) { + public Observable>> getDeletedSitesWithServiceResponseAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes) { return getDeletedSitesSinglePageAsync(resourceGroupName, propertiesToInclude, includeSiteTypes) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeletedSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5009,7 +5989,7 @@ public Observable>> call(ServiceResponse< ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param propertiesToInclude Additional web app properties included in the response ServiceResponse> * @param includeSiteTypes Types of apps included in the response - * @return the List<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeletedSitesSinglePageAsync(final String resourceGroupName, final String propertiesToInclude, final String includeSiteTypes) { if (resourceGroupName == null) { @@ -5050,17 +6030,16 @@ private ServiceResponse> getDeletedSitesDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getDeployments(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeployments(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeploymentsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeploymentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5088,15 +6067,35 @@ public Observable>> call(String nextPageLi * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getDeploymentsAsync(final String resourceGroupName, final String name) { + return getDeploymentsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getDeploymentsAsync(final String resourceGroupName, final String name) { + public Observable>> getDeploymentsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getDeploymentsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeploymentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeploymentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5106,7 +6105,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeploymentsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -5151,17 +6150,16 @@ private ServiceResponse> getDeploymentsDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getDeploymentsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeploymentsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeploymentsSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeploymentsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5191,15 +6189,36 @@ public Observable>> call(String nextPageLi * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getDeploymentsSlotAsync(final String resourceGroupName, final String name, final String slot) { + return getDeploymentsSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getDeploymentsSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> getDeploymentsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return getDeploymentsSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeploymentsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeploymentsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5210,7 +6229,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeploymentsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -5258,17 +6277,16 @@ private ServiceResponse> getDeploymentsSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getInstanceDeployments(final String resourceGroupName, final String name, final String instanceId) throws CloudException, IOException, IllegalArgumentException { + public PagedList getInstanceDeployments(final String resourceGroupName, final String name, final String instanceId) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getInstanceDeploymentsSinglePageAsync(resourceGroupName, name, instanceId).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getInstanceDeploymentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5298,15 +6316,36 @@ public Observable>> call(String nextPageLi * @param resourceGroupName Name of resource group * @param name Name of web app * @param instanceId Id of web app instance - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getInstanceDeploymentsAsync(final String resourceGroupName, final String name, final String instanceId) { + return getInstanceDeploymentsWithServiceResponseAsync(resourceGroupName, name, instanceId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param instanceId Id of web app instance + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getInstanceDeploymentsAsync(final String resourceGroupName, final String name, final String instanceId) { + public Observable>> getInstanceDeploymentsWithServiceResponseAsync(final String resourceGroupName, final String name, final String instanceId) { return getInstanceDeploymentsSinglePageAsync(resourceGroupName, name, instanceId) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getInstanceDeploymentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getInstanceDeploymentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5317,7 +6356,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param instanceId Id of web app instance - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getInstanceDeploymentsSinglePageAsync(final String resourceGroupName, final String name, final String instanceId) { if (resourceGroupName == null) { @@ -5366,17 +6405,16 @@ private ServiceResponse> getInstanceDeploymentsDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getInstanceDeploymentsSlot(final String resourceGroupName, final String name, final String slot, final String instanceId) throws CloudException, IOException, IllegalArgumentException { + public PagedList getInstanceDeploymentsSlot(final String resourceGroupName, final String name, final String slot, final String instanceId) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getInstanceDeploymentsSlotSinglePageAsync(resourceGroupName, name, slot, instanceId).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getInstanceDeploymentsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -5408,15 +6446,37 @@ public Observable>> call(String nextPageLi * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. * @param instanceId Id of web app instance - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getInstanceDeploymentsSlotAsync(final String resourceGroupName, final String name, final String slot, final String instanceId) { + return getInstanceDeploymentsSlotWithServiceResponseAsync(resourceGroupName, name, slot, instanceId) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getInstanceDeploymentsSlotAsync(final String resourceGroupName, final String name, final String slot, final String instanceId) { + public Observable>> getInstanceDeploymentsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot, final String instanceId) { return getInstanceDeploymentsSlotSinglePageAsync(resourceGroupName, name, slot, instanceId) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getInstanceDeploymentsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getInstanceDeploymentsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -5428,7 +6488,7 @@ public Observable>> call(ServiceResponse

    > * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. ServiceResponse> * @param instanceId Id of web app instance - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getInstanceDeploymentsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot, final String instanceId) { if (resourceGroupName == null) { @@ -5480,10 +6540,10 @@ private ServiceResponse> getInstanceDeploymentsSlotDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentInner object if successful. */ - public ServiceResponse getInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return getInstanceDeploymentAsync(resourceGroupName, name, id, instanceId).toBlocking().single(); + public DeploymentInner getInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { + return getInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId).toBlocking().single().getBody(); } /** @@ -5497,7 +6557,25 @@ public ServiceResponse getInstanceDeployment(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall getInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getInstanceDeploymentAsync(resourceGroupName, name, id, instanceId), serviceCallback); + return ServiceCall.create(getInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId), serviceCallback); + } + + /** + * Get the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param instanceId Id of web app instance + * @return the observable to the DeploymentInner object + */ + public Observable getInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId) { + return getInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5509,7 +6587,7 @@ public ServiceCall getInstanceDeploymentAsync(String resourceGr * @param instanceId Id of web app instance * @return the observable to the DeploymentInner object */ - public Observable> getInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId) { + public Observable> getInstanceDeploymentWithServiceResponseAsync(String resourceGroupName, String name, String id, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5560,10 +6638,10 @@ private ServiceResponse getInstanceDeploymentDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentInner object if successful. */ - public ServiceResponse createInstanceDeployment(String resourceGroupName, String name, String id, String instanceId, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { - return createInstanceDeploymentAsync(resourceGroupName, name, id, instanceId, deployment).toBlocking().single(); + public DeploymentInner createInstanceDeployment(String resourceGroupName, String name, String id, String instanceId, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { + return createInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId, deployment).toBlocking().single().getBody(); } /** @@ -5578,7 +6656,26 @@ public ServiceResponse createInstanceDeployment(String resource * @return the {@link ServiceCall} object */ public ServiceCall createInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, DeploymentInner deployment, final ServiceCallback serviceCallback) { - return ServiceCall.create(createInstanceDeploymentAsync(resourceGroupName, name, id, instanceId, deployment), serviceCallback); + return ServiceCall.create(createInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId, deployment), serviceCallback); + } + + /** + * Create a deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param instanceId Id of web app instance + * @param deployment Details of deployment + * @return the observable to the DeploymentInner object + */ + public Observable createInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, DeploymentInner deployment) { + return createInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId, deployment).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5591,7 +6688,7 @@ public ServiceCall createInstanceDeploymentAsync(String resourc * @param deployment Details of deployment * @return the observable to the DeploymentInner object */ - public Observable> createInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, DeploymentInner deployment) { + public Observable> createInstanceDeploymentWithServiceResponseAsync(String resourceGroupName, String name, String id, String instanceId, DeploymentInner deployment) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5645,10 +6742,10 @@ private ServiceResponse createInstanceDeploymentDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return deleteInstanceDeploymentAsync(resourceGroupName, name, id, instanceId).toBlocking().single(); + public Object deleteInstanceDeployment(String resourceGroupName, String name, String id, String instanceId) throws CloudException, IOException, IllegalArgumentException { + return deleteInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId).toBlocking().single().getBody(); } /** @@ -5662,7 +6759,25 @@ public ServiceResponse deleteInstanceDeployment(String resourceGroupName * @return the {@link ServiceCall} object */ public ServiceCall deleteInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteInstanceDeploymentAsync(resourceGroupName, name, id, instanceId), serviceCallback); + return ServiceCall.create(deleteInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId), serviceCallback); + } + + /** + * Delete the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param instanceId Id of web app instance + * @return the observable to the Object object + */ + public Observable deleteInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId) { + return deleteInstanceDeploymentWithServiceResponseAsync(resourceGroupName, name, id, instanceId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5674,7 +6789,7 @@ public ServiceCall deleteInstanceDeploymentAsync(String resourceGroupNam * @param instanceId Id of web app instance * @return the observable to the Object object */ - public Observable> deleteInstanceDeploymentAsync(String resourceGroupName, String name, String id, String instanceId) { + public Observable> deleteInstanceDeploymentWithServiceResponseAsync(String resourceGroupName, String name, String id, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5723,10 +6838,10 @@ private ServiceResponse deleteInstanceDeploymentDelegate(Response getDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { - return getDeploymentAsync(resourceGroupName, name, id).toBlocking().single(); + public DeploymentInner getDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { + return getDeploymentWithServiceResponseAsync(resourceGroupName, name, id).toBlocking().single().getBody(); } /** @@ -5739,7 +6854,24 @@ public ServiceResponse getDeployment(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getDeploymentAsync(String resourceGroupName, String name, String id, final ServiceCallback serviceCallback) { - return ServiceCall.create(getDeploymentAsync(resourceGroupName, name, id), serviceCallback); + return ServiceCall.create(getDeploymentWithServiceResponseAsync(resourceGroupName, name, id), serviceCallback); + } + + /** + * Get the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @return the observable to the DeploymentInner object + */ + public Observable getDeploymentAsync(String resourceGroupName, String name, String id) { + return getDeploymentWithServiceResponseAsync(resourceGroupName, name, id).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5750,7 +6882,7 @@ public ServiceCall getDeploymentAsync(String resourceGroupName, * @param id Id of the deployment * @return the observable to the DeploymentInner object */ - public Observable> getDeploymentAsync(String resourceGroupName, String name, String id) { + public Observable> getDeploymentWithServiceResponseAsync(String resourceGroupName, String name, String id) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5797,10 +6929,10 @@ private ServiceResponse getDeploymentDelegate(Response createDeployment(String resourceGroupName, String name, String id, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { - return createDeploymentAsync(resourceGroupName, name, id, deployment).toBlocking().single(); + public DeploymentInner createDeployment(String resourceGroupName, String name, String id, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { + return createDeploymentWithServiceResponseAsync(resourceGroupName, name, id, deployment).toBlocking().single().getBody(); } /** @@ -5814,7 +6946,25 @@ public ServiceResponse createDeployment(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall createDeploymentAsync(String resourceGroupName, String name, String id, DeploymentInner deployment, final ServiceCallback serviceCallback) { - return ServiceCall.create(createDeploymentAsync(resourceGroupName, name, id, deployment), serviceCallback); + return ServiceCall.create(createDeploymentWithServiceResponseAsync(resourceGroupName, name, id, deployment), serviceCallback); + } + + /** + * Create a deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param deployment Details of deployment + * @return the observable to the DeploymentInner object + */ + public Observable createDeploymentAsync(String resourceGroupName, String name, String id, DeploymentInner deployment) { + return createDeploymentWithServiceResponseAsync(resourceGroupName, name, id, deployment).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5826,7 +6976,7 @@ public ServiceCall createDeploymentAsync(String resourceGroupNa * @param deployment Details of deployment * @return the observable to the DeploymentInner object */ - public Observable> createDeploymentAsync(String resourceGroupName, String name, String id, DeploymentInner deployment) { + public Observable> createDeploymentWithServiceResponseAsync(String resourceGroupName, String name, String id, DeploymentInner deployment) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5876,10 +7026,10 @@ private ServiceResponse createDeploymentDelegate(Response deleteDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { - return deleteDeploymentAsync(resourceGroupName, name, id).toBlocking().single(); + public Object deleteDeployment(String resourceGroupName, String name, String id) throws CloudException, IOException, IllegalArgumentException { + return deleteDeploymentWithServiceResponseAsync(resourceGroupName, name, id).toBlocking().single().getBody(); } /** @@ -5892,7 +7042,24 @@ public ServiceResponse deleteDeployment(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall deleteDeploymentAsync(String resourceGroupName, String name, String id, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteDeploymentAsync(resourceGroupName, name, id), serviceCallback); + return ServiceCall.create(deleteDeploymentWithServiceResponseAsync(resourceGroupName, name, id), serviceCallback); + } + + /** + * Delete the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @return the observable to the Object object + */ + public Observable deleteDeploymentAsync(String resourceGroupName, String name, String id) { + return deleteDeploymentWithServiceResponseAsync(resourceGroupName, name, id).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5903,7 +7070,7 @@ public ServiceCall deleteDeploymentAsync(String resourceGroupName, Strin * @param id Id of the deployment * @return the observable to the Object object */ - public Observable> deleteDeploymentAsync(String resourceGroupName, String name, String id) { + public Observable> deleteDeploymentWithServiceResponseAsync(String resourceGroupName, String name, String id) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -5950,10 +7117,10 @@ private ServiceResponse deleteDeploymentDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentInner object if successful. */ - public ServiceResponse getDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { - return getDeploymentSlotAsync(resourceGroupName, name, id, slot).toBlocking().single(); + public DeploymentInner getDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { + return getDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot).toBlocking().single().getBody(); } /** @@ -5967,7 +7134,25 @@ public ServiceResponse getDeploymentSlot(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getDeploymentSlotAsync(resourceGroupName, name, id, slot), serviceCallback); + return ServiceCall.create(getDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot), serviceCallback); + } + + /** + * Get the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the DeploymentInner object + */ + public Observable getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot) { + return getDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -5979,7 +7164,7 @@ public ServiceCall getDeploymentSlotAsync(String resourceGroupN * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the DeploymentInner object */ - public Observable> getDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot) { + public Observable> getDeploymentSlotWithServiceResponseAsync(String resourceGroupName, String name, String id, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6030,10 +7215,10 @@ private ServiceResponse getDeploymentSlotDelegate(Response createDeploymentSlot(String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { - return createDeploymentSlotAsync(resourceGroupName, name, id, slot, deployment).toBlocking().single(); + public DeploymentInner createDeploymentSlot(String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { + return createDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, deployment).toBlocking().single().getBody(); } /** @@ -6048,7 +7233,26 @@ public ServiceResponse createDeploymentSlot(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall createDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, DeploymentInner deployment, final ServiceCallback serviceCallback) { - return ServiceCall.create(createDeploymentSlotAsync(resourceGroupName, name, id, slot, deployment), serviceCallback); + return ServiceCall.create(createDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, deployment), serviceCallback); + } + + /** + * Create a deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param deployment Details of deployment + * @return the observable to the DeploymentInner object + */ + public Observable createDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) { + return createDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, deployment).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6061,7 +7265,7 @@ public ServiceCall createDeploymentSlotAsync(String resourceGro * @param deployment Details of deployment * @return the observable to the DeploymentInner object */ - public Observable> createDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) { + public Observable> createDeploymentSlotWithServiceResponseAsync(String resourceGroupName, String name, String id, String slot, DeploymentInner deployment) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6115,10 +7319,10 @@ private ServiceResponse createDeploymentSlotDelegate(Response deleteDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteDeploymentSlotAsync(resourceGroupName, name, id, slot).toBlocking().single(); + public Object deleteDeploymentSlot(String resourceGroupName, String name, String id, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot).toBlocking().single().getBody(); } /** @@ -6132,7 +7336,25 @@ public ServiceResponse deleteDeploymentSlot(String resourceGroupName, St * @return the {@link ServiceCall} object */ public ServiceCall deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteDeploymentSlotAsync(resourceGroupName, name, id, slot), serviceCallback); + return ServiceCall.create(deleteDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot), serviceCallback); + } + + /** + * Delete the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot) { + return deleteDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6144,7 +7366,7 @@ public ServiceCall deleteDeploymentSlotAsync(String resourceGroupName, S * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> deleteDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot) { + public Observable> deleteDeploymentSlotWithServiceResponseAsync(String resourceGroupName, String name, String id, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6195,10 +7417,10 @@ private ServiceResponse deleteDeploymentSlotDelegate(Response getInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return getInstanceDeploymentSlotAsync(resourceGroupName, name, id, slot, instanceId).toBlocking().single(); + public DeploymentInner getInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { + return getInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId).toBlocking().single().getBody(); } /** @@ -6213,7 +7435,26 @@ public ServiceResponse getInstanceDeploymentSlot(String resourc * @return the {@link ServiceCall} object */ public ServiceCall getInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getInstanceDeploymentSlotAsync(resourceGroupName, name, id, slot, instanceId), serviceCallback); + return ServiceCall.create(getInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId), serviceCallback); + } + + /** + * Get the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @return the observable to the DeploymentInner object + */ + public Observable getInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId) { + return getInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6226,7 +7467,7 @@ public ServiceCall getInstanceDeploymentSlotAsync(String resour * @param instanceId Id of web app instance * @return the observable to the DeploymentInner object */ - public Observable> getInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId) { + public Observable> getInstanceDeploymentSlotWithServiceResponseAsync(String resourceGroupName, String name, String id, String slot, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6281,10 +7522,26 @@ private ServiceResponse getInstanceDeploymentSlotDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the DeploymentInner object wrapped in {@link ServiceResponse} if successful. + * @return the DeploymentInner object if successful. + */ + public DeploymentInner createInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { + return createInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId, deployment).toBlocking().single().getBody(); + } + + /** + * Create a deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @param deployment Details of deployment + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceCall} object */ - public ServiceResponse createInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment) throws CloudException, IOException, IllegalArgumentException { - return createInstanceDeploymentSlotAsync(resourceGroupName, name, id, slot, instanceId, deployment).toBlocking().single(); + public ServiceCall createInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment, final ServiceCallback serviceCallback) { + return ServiceCall.create(createInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId, deployment), serviceCallback); } /** @@ -6296,11 +7553,15 @@ public ServiceResponse createInstanceDeploymentSlot(String reso * @param slot Name of web app slot. If not specified then will default to production slot. * @param instanceId Id of web app instance * @param deployment Details of deployment - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @return the {@link ServiceCall} object + * @return the observable to the DeploymentInner object */ - public ServiceCall createInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment, final ServiceCallback serviceCallback) { - return ServiceCall.create(createInstanceDeploymentSlotAsync(resourceGroupName, name, id, slot, instanceId, deployment), serviceCallback); + public Observable createInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment) { + return createInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId, deployment).map(new Func1, DeploymentInner>() { + @Override + public DeploymentInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6314,7 +7575,7 @@ public ServiceCall createInstanceDeploymentSlotAsync(String res * @param deployment Details of deployment * @return the observable to the DeploymentInner object */ - public Observable> createInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment) { + public Observable> createInstanceDeploymentSlotWithServiceResponseAsync(String resourceGroupName, String name, String id, String slot, String instanceId, DeploymentInner deployment) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6372,10 +7633,10 @@ private ServiceResponse createInstanceDeploymentSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { - return deleteInstanceDeploymentSlotAsync(resourceGroupName, name, id, slot, instanceId).toBlocking().single(); + public Object deleteInstanceDeploymentSlot(String resourceGroupName, String name, String id, String slot, String instanceId) throws CloudException, IOException, IllegalArgumentException { + return deleteInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId).toBlocking().single().getBody(); } /** @@ -6390,7 +7651,26 @@ public ServiceResponse deleteInstanceDeploymentSlot(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall deleteInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteInstanceDeploymentSlotAsync(resourceGroupName, name, id, slot, instanceId), serviceCallback); + return ServiceCall.create(deleteInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId), serviceCallback); + } + + /** + * Delete the deployment. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param id Id of the deployment + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param instanceId Id of web app instance + * @return the observable to the Object object + */ + public Observable deleteInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId) { + return deleteInstanceDeploymentSlotWithServiceResponseAsync(resourceGroupName, name, id, slot, instanceId).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6403,7 +7683,7 @@ public ServiceCall deleteInstanceDeploymentSlotAsync(String resourceGrou * @param instanceId Id of web app instance * @return the observable to the Object object */ - public Observable> deleteInstanceDeploymentSlotAsync(String resourceGroupName, String name, String id, String slot, String instanceId) { + public Observable> deleteInstanceDeploymentSlotWithServiceResponseAsync(String resourceGroupName, String name, String id, String slot, String instanceId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6454,17 +7734,16 @@ private ServiceResponse deleteInstanceDeploymentSlotDelegate(Response> getSiteInstanceIdentifiers(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteInstanceIdentifiers(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteInstanceIdentifiersSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteInstanceIdentifiersNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6492,15 +7771,35 @@ public Observable>> call(String nextPage * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<SiteInstanceInner> object + * @return the observable to the PagedList<SiteInstanceInner> object + */ + public Observable> getSiteInstanceIdentifiersAsync(final String resourceGroupName, final String name) { + return getSiteInstanceIdentifiersWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all instance of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<SiteInstanceInner> object */ - public Observable>> getSiteInstanceIdentifiersAsync(final String resourceGroupName, final String name) { + public Observable>> getSiteInstanceIdentifiersWithServiceResponseAsync(final String resourceGroupName, final String name) { return getSiteInstanceIdentifiersSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteInstanceIdentifiersNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteInstanceIdentifiersNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6510,7 +7809,7 @@ public Observable>> call(ServiceResponse * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteInstanceIdentifiersSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -6555,17 +7854,16 @@ private ServiceResponse> getSiteInstanceIdentifiersD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object if successful. */ - public ServiceResponse> getSiteInstanceIdentifiersSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteInstanceIdentifiersSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteInstanceIdentifiersSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteInstanceIdentifiersSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6595,15 +7893,36 @@ public Observable>> call(String nextPage * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<SiteInstanceInner> object + * @return the observable to the PagedList<SiteInstanceInner> object + */ + public Observable> getSiteInstanceIdentifiersSlotAsync(final String resourceGroupName, final String name, final String slot) { + return getSiteInstanceIdentifiersSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all instance of a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<SiteInstanceInner> object */ - public Observable>> getSiteInstanceIdentifiersSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> getSiteInstanceIdentifiersSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return getSiteInstanceIdentifiersSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteInstanceIdentifiersSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteInstanceIdentifiersSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6614,7 +7933,7 @@ public Observable>> call(ServiceResponse ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteInstanceIdentifiersSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -6661,17 +7980,16 @@ private ServiceResponse> getSiteInstanceIdentifiersS * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object if successful. */ - public ServiceResponse> getSiteHostNameBindings(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteHostNameBindings(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteHostNameBindingsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteHostNameBindingsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6699,15 +8017,35 @@ public Observable>> call(String nextP * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<HostNameBindingInner> object + * @return the observable to the PagedList<HostNameBindingInner> object + */ + public Observable> getSiteHostNameBindingsAsync(final String resourceGroupName, final String name) { + return getSiteHostNameBindingsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get web app hostname bindings. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<HostNameBindingInner> object */ - public Observable>> getSiteHostNameBindingsAsync(final String resourceGroupName, final String name) { + public Observable>> getSiteHostNameBindingsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getSiteHostNameBindingsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteHostNameBindingsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteHostNameBindingsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6717,7 +8055,7 @@ public Observable>> call(ServiceRespo * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteHostNameBindingsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -6762,17 +8100,16 @@ private ServiceResponse> getSiteHostNameBindingsD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object if successful. */ - public ServiceResponse> getSiteHostNameBindingsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteHostNameBindingsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteHostNameBindingsSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteHostNameBindingsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -6802,15 +8139,36 @@ public Observable>> call(String nextP * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<HostNameBindingInner> object + * @return the observable to the PagedList<HostNameBindingInner> object + */ + public Observable> getSiteHostNameBindingsSlotAsync(final String resourceGroupName, final String name, final String slot) { + return getSiteHostNameBindingsSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get web app hostname bindings. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<HostNameBindingInner> object */ - public Observable>> getSiteHostNameBindingsSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> getSiteHostNameBindingsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return getSiteHostNameBindingsSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteHostNameBindingsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteHostNameBindingsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -6821,7 +8179,7 @@ public Observable>> call(ServiceRespo ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteHostNameBindingsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -6869,10 +8227,10 @@ private ServiceResponse> getSiteHostNameBindingsS * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBindingInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBindingInner object if successful. */ - public ServiceResponse getSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { - return getSiteHostNameBindingAsync(resourceGroupName, name, hostName).toBlocking().single(); + public HostNameBindingInner getSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { + return getSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName).toBlocking().single().getBody(); } /** @@ -6885,7 +8243,24 @@ public ServiceResponse getSiteHostNameBinding(String resou * @return the {@link ServiceCall} object */ public ServiceCall getSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteHostNameBindingAsync(resourceGroupName, name, hostName), serviceCallback); + return ServiceCall.create(getSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName), serviceCallback); + } + + /** + * Get web app binding for a hostname. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param hostName Name of host + * @return the observable to the HostNameBindingInner object + */ + public Observable getSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName) { + return getSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName).map(new Func1, HostNameBindingInner>() { + @Override + public HostNameBindingInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6896,7 +8271,7 @@ public ServiceCall getSiteHostNameBindingAsync(String reso * @param hostName Name of host * @return the observable to the HostNameBindingInner object */ - public Observable> getSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName) { + public Observable> getSiteHostNameBindingWithServiceResponseAsync(String resourceGroupName, String name, String hostName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -6943,10 +8318,10 @@ private ServiceResponse getSiteHostNameBindingDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBindingInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBindingInner object if successful. */ - public ServiceResponse createOrUpdateSiteHostNameBinding(String resourceGroupName, String name, String hostName, HostNameBindingInner hostNameBinding) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteHostNameBindingAsync(resourceGroupName, name, hostName, hostNameBinding).toBlocking().single(); + public HostNameBindingInner createOrUpdateSiteHostNameBinding(String resourceGroupName, String name, String hostName, HostNameBindingInner hostNameBinding) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName, hostNameBinding).toBlocking().single().getBody(); } /** @@ -6960,7 +8335,25 @@ public ServiceResponse createOrUpdateSiteHostNameBinding(S * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, HostNameBindingInner hostNameBinding, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteHostNameBindingAsync(resourceGroupName, name, hostName, hostNameBinding), serviceCallback); + return ServiceCall.create(createOrUpdateSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName, hostNameBinding), serviceCallback); + } + + /** + * Creates a web app hostname binding. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param hostName Name of host + * @param hostNameBinding Host name binding information + * @return the observable to the HostNameBindingInner object + */ + public Observable createOrUpdateSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, HostNameBindingInner hostNameBinding) { + return createOrUpdateSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName, hostNameBinding).map(new Func1, HostNameBindingInner>() { + @Override + public HostNameBindingInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -6972,7 +8365,7 @@ public ServiceCall createOrUpdateSiteHostNameBindingAsync( * @param hostNameBinding Host name binding information * @return the observable to the HostNameBindingInner object */ - public Observable> createOrUpdateSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, HostNameBindingInner hostNameBinding) { + public Observable> createOrUpdateSiteHostNameBindingWithServiceResponseAsync(String resourceGroupName, String name, String hostName, HostNameBindingInner hostNameBinding) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7022,10 +8415,10 @@ private ServiceResponse createOrUpdateSiteHostNameBindingD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteHostNameBindingAsync(resourceGroupName, name, hostName).toBlocking().single(); + public Object deleteSiteHostNameBinding(String resourceGroupName, String name, String hostName) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName).toBlocking().single().getBody(); } /** @@ -7038,7 +8431,24 @@ public ServiceResponse deleteSiteHostNameBinding(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteHostNameBindingAsync(resourceGroupName, name, hostName), serviceCallback); + return ServiceCall.create(deleteSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName), serviceCallback); + } + + /** + * Deletes a host name binding. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param hostName Name of host + * @return the observable to the Object object + */ + public Observable deleteSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName) { + return deleteSiteHostNameBindingWithServiceResponseAsync(resourceGroupName, name, hostName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7049,7 +8459,7 @@ public ServiceCall deleteSiteHostNameBindingAsync(String resourceGroupNa * @param hostName Name of host * @return the observable to the Object object */ - public Observable> deleteSiteHostNameBindingAsync(String resourceGroupName, String name, String hostName) { + public Observable> deleteSiteHostNameBindingWithServiceResponseAsync(String resourceGroupName, String name, String hostName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7096,10 +8506,10 @@ private ServiceResponse deleteSiteHostNameBindingDelegate(Response getSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { - return getSiteHostNameBindingSlotAsync(resourceGroupName, name, slot, hostName).toBlocking().single(); + public HostNameBindingInner getSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { + return getSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, slot, hostName).toBlocking().single().getBody(); } /** @@ -7113,7 +8523,25 @@ public ServiceResponse getSiteHostNameBindingSlot(String r * @return the {@link ServiceCall} object */ public ServiceCall getSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteHostNameBindingSlotAsync(resourceGroupName, name, slot, hostName), serviceCallback); + return ServiceCall.create(getSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, slot, hostName), serviceCallback); + } + + /** + * Get web app binding for a hostname. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostName Name of host + * @return the observable to the HostNameBindingInner object + */ + public Observable getSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName) { + return getSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, slot, hostName).map(new Func1, HostNameBindingInner>() { + @Override + public HostNameBindingInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7125,7 +8553,7 @@ public ServiceCall getSiteHostNameBindingSlotAsync(String * @param hostName Name of host * @return the observable to the HostNameBindingInner object */ - public Observable> getSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName) { + public Observable> getSiteHostNameBindingSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, String hostName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7176,10 +8604,10 @@ private ServiceResponse getSiteHostNameBindingSlotDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the HostNameBindingInner object wrapped in {@link ServiceResponse} if successful. + * @return the HostNameBindingInner object if successful. */ - public ServiceResponse createOrUpdateSiteHostNameBindingSlot(String resourceGroupName, String name, String hostName, String slot, HostNameBindingInner hostNameBinding) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteHostNameBindingSlotAsync(resourceGroupName, name, hostName, slot, hostNameBinding).toBlocking().single(); + public HostNameBindingInner createOrUpdateSiteHostNameBindingSlot(String resourceGroupName, String name, String hostName, String slot, HostNameBindingInner hostNameBinding) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, hostName, slot, hostNameBinding).toBlocking().single().getBody(); } /** @@ -7194,7 +8622,26 @@ public ServiceResponse createOrUpdateSiteHostNameBindingSl * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String hostName, String slot, HostNameBindingInner hostNameBinding, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteHostNameBindingSlotAsync(resourceGroupName, name, hostName, slot, hostNameBinding), serviceCallback); + return ServiceCall.create(createOrUpdateSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, hostName, slot, hostNameBinding), serviceCallback); + } + + /** + * Creates a web app hostname binding. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param hostName Name of host + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostNameBinding Host name binding information + * @return the observable to the HostNameBindingInner object + */ + public Observable createOrUpdateSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String hostName, String slot, HostNameBindingInner hostNameBinding) { + return createOrUpdateSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, hostName, slot, hostNameBinding).map(new Func1, HostNameBindingInner>() { + @Override + public HostNameBindingInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7207,7 +8654,7 @@ public ServiceCall createOrUpdateSiteHostNameBindingSlotAs * @param hostNameBinding Host name binding information * @return the observable to the HostNameBindingInner object */ - public Observable> createOrUpdateSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String hostName, String slot, HostNameBindingInner hostNameBinding) { + public Observable> createOrUpdateSiteHostNameBindingSlotWithServiceResponseAsync(String resourceGroupName, String name, String hostName, String slot, HostNameBindingInner hostNameBinding) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7261,10 +8708,10 @@ private ServiceResponse createOrUpdateSiteHostNameBindingS * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteHostNameBindingSlotAsync(resourceGroupName, name, slot, hostName).toBlocking().single(); + public Object deleteSiteHostNameBindingSlot(String resourceGroupName, String name, String slot, String hostName) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, slot, hostName).toBlocking().single().getBody(); } /** @@ -7278,7 +8725,25 @@ public ServiceResponse deleteSiteHostNameBindingSlot(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteHostNameBindingSlotAsync(resourceGroupName, name, slot, hostName), serviceCallback); + return ServiceCall.create(deleteSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, slot, hostName), serviceCallback); + } + + /** + * Deletes a host name binding. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param hostName Name of host + * @return the observable to the Object object + */ + public Observable deleteSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName) { + return deleteSiteHostNameBindingSlotWithServiceResponseAsync(resourceGroupName, name, slot, hostName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7290,7 +8755,7 @@ public ServiceCall deleteSiteHostNameBindingSlotAsync(String resourceGro * @param hostName Name of host * @return the observable to the Object object */ - public Observable> deleteSiteHostNameBindingSlotAsync(String resourceGroupName, String name, String slot, String hostName) { + public Observable> deleteSiteHostNameBindingSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, String hostName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7338,10 +8803,10 @@ private ServiceResponse deleteSiteHostNameBindingSlotDelegate(Response getSiteConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteConfigAsync(resourceGroupName, name).toBlocking().single(); + public SiteConfigInner getSiteConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteConfigWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -7353,7 +8818,23 @@ public ServiceResponse getSiteConfig(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getSiteConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteConfigAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteConfigWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the configuration of the web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the SiteConfigInner object + */ + public Observable getSiteConfigAsync(String resourceGroupName, String name) { + return getSiteConfigWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SiteConfigInner>() { + @Override + public SiteConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7363,7 +8844,7 @@ public ServiceCall getSiteConfigAsync(String resourceGroupName, * @param name Name of web app * @return the observable to the SiteConfigInner object */ - public Observable> getSiteConfigAsync(String resourceGroupName, String name) { + public Observable> getSiteConfigWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7406,10 +8887,10 @@ private ServiceResponse getSiteConfigDelegate(Response createOrUpdateSiteConfig(String resourceGroupName, String name, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteConfigAsync(resourceGroupName, name, siteConfig).toBlocking().single(); + public SiteConfigInner createOrUpdateSiteConfig(String resourceGroupName, String name, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteConfigWithServiceResponseAsync(resourceGroupName, name, siteConfig).toBlocking().single().getBody(); } /** @@ -7422,7 +8903,24 @@ public ServiceResponse createOrUpdateSiteConfig(String resource * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteConfigAsync(String resourceGroupName, String name, SiteConfigInner siteConfig, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteConfigAsync(resourceGroupName, name, siteConfig), serviceCallback); + return ServiceCall.create(createOrUpdateSiteConfigWithServiceResponseAsync(resourceGroupName, name, siteConfig), serviceCallback); + } + + /** + * Update the configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param siteConfig Request body that contains the configuraiton setting for the web app + * @return the observable to the SiteConfigInner object + */ + public Observable createOrUpdateSiteConfigAsync(String resourceGroupName, String name, SiteConfigInner siteConfig) { + return createOrUpdateSiteConfigWithServiceResponseAsync(resourceGroupName, name, siteConfig).map(new Func1, SiteConfigInner>() { + @Override + public SiteConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7433,7 +8931,7 @@ public ServiceCall createOrUpdateSiteConfigAsync(String resourc * @param siteConfig Request body that contains the configuraiton setting for the web app * @return the observable to the SiteConfigInner object */ - public Observable> createOrUpdateSiteConfigAsync(String resourceGroupName, String name, SiteConfigInner siteConfig) { + public Observable> createOrUpdateSiteConfigWithServiceResponseAsync(String resourceGroupName, String name, SiteConfigInner siteConfig) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7480,10 +8978,10 @@ private ServiceResponse createOrUpdateSiteConfigDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfigInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfigInner object if successful. */ - public ServiceResponse updateSiteConfig(String resourceGroupName, String name, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { - return updateSiteConfigAsync(resourceGroupName, name, siteConfig).toBlocking().single(); + public SiteConfigInner updateSiteConfig(String resourceGroupName, String name, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { + return updateSiteConfigWithServiceResponseAsync(resourceGroupName, name, siteConfig).toBlocking().single().getBody(); } /** @@ -7496,7 +8994,24 @@ public ServiceResponse updateSiteConfig(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall updateSiteConfigAsync(String resourceGroupName, String name, SiteConfigInner siteConfig, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteConfigAsync(resourceGroupName, name, siteConfig), serviceCallback); + return ServiceCall.create(updateSiteConfigWithServiceResponseAsync(resourceGroupName, name, siteConfig), serviceCallback); + } + + /** + * Update the configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param siteConfig Request body that contains the configuraiton setting for the web app + * @return the observable to the SiteConfigInner object + */ + public Observable updateSiteConfigAsync(String resourceGroupName, String name, SiteConfigInner siteConfig) { + return updateSiteConfigWithServiceResponseAsync(resourceGroupName, name, siteConfig).map(new Func1, SiteConfigInner>() { + @Override + public SiteConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7507,7 +9022,7 @@ public ServiceCall updateSiteConfigAsync(String resourceGroupNa * @param siteConfig Request body that contains the configuraiton setting for the web app * @return the observable to the SiteConfigInner object */ - public Observable> updateSiteConfigAsync(String resourceGroupName, String name, SiteConfigInner siteConfig) { + public Observable> updateSiteConfigWithServiceResponseAsync(String resourceGroupName, String name, SiteConfigInner siteConfig) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7554,10 +9069,10 @@ private ServiceResponse updateSiteConfigDelegate(Response getSiteConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteConfigSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public SiteConfigInner getSiteConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -7570,7 +9085,24 @@ public ServiceResponse getSiteConfigSlot(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall getSiteConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteConfigSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(getSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the configuration of the web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the SiteConfigInner object + */ + public Observable getSiteConfigSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, SiteConfigInner>() { + @Override + public SiteConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7581,7 +9113,7 @@ public ServiceCall getSiteConfigSlotAsync(String resourceGroupN * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the SiteConfigInner object */ - public Observable> getSiteConfigSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> getSiteConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7628,10 +9160,10 @@ private ServiceResponse getSiteConfigSlotDelegate(Response createOrUpdateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteConfigSlotAsync(resourceGroupName, name, slot, siteConfig).toBlocking().single(); + public SiteConfigInner createOrUpdateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteConfig).toBlocking().single().getBody(); } /** @@ -7645,7 +9177,25 @@ public ServiceResponse createOrUpdateSiteConfigSlot(String reso * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteConfigSlotAsync(resourceGroupName, name, slot, siteConfig), serviceCallback); + return ServiceCall.create(createOrUpdateSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteConfig), serviceCallback); + } + + /** + * Update the configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteConfig Request body that contains the configuraiton setting for the web app + * @return the observable to the SiteConfigInner object + */ + public Observable createOrUpdateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) { + return createOrUpdateSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteConfig).map(new Func1, SiteConfigInner>() { + @Override + public SiteConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7657,7 +9207,7 @@ public ServiceCall createOrUpdateSiteConfigSlotAsync(String res * @param siteConfig Request body that contains the configuraiton setting for the web app * @return the observable to the SiteConfigInner object */ - public Observable> createOrUpdateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) { + public Observable> createOrUpdateSiteConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7708,10 +9258,10 @@ private ServiceResponse createOrUpdateSiteConfigSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteConfigInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteConfigInner object if successful. */ - public ServiceResponse updateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { - return updateSiteConfigSlotAsync(resourceGroupName, name, slot, siteConfig).toBlocking().single(); + public SiteConfigInner updateSiteConfigSlot(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) throws CloudException, IOException, IllegalArgumentException { + return updateSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteConfig).toBlocking().single().getBody(); } /** @@ -7725,7 +9275,25 @@ public ServiceResponse updateSiteConfigSlot(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall updateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteConfigSlotAsync(resourceGroupName, name, slot, siteConfig), serviceCallback); + return ServiceCall.create(updateSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteConfig), serviceCallback); + } + + /** + * Update the configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteConfig Request body that contains the configuraiton setting for the web app + * @return the observable to the SiteConfigInner object + */ + public Observable updateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) { + return updateSiteConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteConfig).map(new Func1, SiteConfigInner>() { + @Override + public SiteConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7737,7 +9305,7 @@ public ServiceCall updateSiteConfigSlotAsync(String resourceGro * @param siteConfig Request body that contains the configuraiton setting for the web app * @return the observable to the SiteConfigInner object */ - public Observable> updateSiteConfigSlotAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) { + public Observable> updateSiteConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteConfigInner siteConfig) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7786,10 +9354,10 @@ private ServiceResponse updateSiteConfigSlotDelegate(Response getSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteSourceControlAsync(resourceGroupName, name).toBlocking().single(); + public SiteSourceControlInner getSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteSourceControlWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -7801,7 +9369,7 @@ public ServiceResponse getSiteSourceControl(String resou * @return the {@link ServiceCall} object */ public ServiceCall getSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteSourceControlAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteSourceControlWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -7811,7 +9379,23 @@ public ServiceCall getSiteSourceControlAsync(String reso * @param name Name of web app * @return the observable to the SiteSourceControlInner object */ - public Observable> getSiteSourceControlAsync(String resourceGroupName, String name) { + public Observable getSiteSourceControlAsync(String resourceGroupName, String name) { + return getSiteSourceControlWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SiteSourceControlInner>() { + @Override + public SiteSourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Get the source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the SiteSourceControlInner object + */ + public Observable> getSiteSourceControlWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7854,10 +9438,10 @@ private ServiceResponse getSiteSourceControlDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControlInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControlInner object if successful. */ - public ServiceResponse createOrUpdateSiteSourceControl(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteSourceControlAsync(resourceGroupName, name, siteSourceControl).toBlocking().single(); + public SiteSourceControlInner createOrUpdateSiteSourceControl(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteSourceControlWithServiceResponseAsync(resourceGroupName, name, siteSourceControl).toBlocking().single().getBody(); } /** @@ -7870,7 +9454,24 @@ public ServiceResponse createOrUpdateSiteSourceControl(S * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteSourceControlAsync(resourceGroupName, name, siteSourceControl), serviceCallback); + return ServiceCall.create(createOrUpdateSiteSourceControlWithServiceResponseAsync(resourceGroupName, name, siteSourceControl), serviceCallback); + } + + /** + * Update the source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param siteSourceControl Request body that contains the source control parameters + * @return the observable to the SiteSourceControlInner object + */ + public Observable createOrUpdateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { + return createOrUpdateSiteSourceControlWithServiceResponseAsync(resourceGroupName, name, siteSourceControl).map(new Func1, SiteSourceControlInner>() { + @Override + public SiteSourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7881,7 +9482,7 @@ public ServiceCall createOrUpdateSiteSourceControlAsync( * @param siteSourceControl Request body that contains the source control parameters * @return the observable to the SiteSourceControlInner object */ - public Observable> createOrUpdateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { + public Observable> createOrUpdateSiteSourceControlWithServiceResponseAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7927,10 +9528,22 @@ private ServiceResponse createOrUpdateSiteSourceControlD * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. + */ + public Object deleteSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteSourceControlWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); + } + + /** + * Delete source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceCall} object */ - public ServiceResponse deleteSiteSourceControl(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteSourceControlAsync(resourceGroupName, name).toBlocking().single(); + public ServiceCall deleteSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { + return ServiceCall.create(deleteSiteSourceControlWithServiceResponseAsync(resourceGroupName, name), serviceCallback); } /** @@ -7938,11 +9551,15 @@ public ServiceResponse deleteSiteSourceControl(String resourceGroupName, * * @param resourceGroupName Name of resource group * @param name Name of web app - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @return the {@link ServiceCall} object + * @return the observable to the Object object */ - public ServiceCall deleteSiteSourceControlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteSourceControlAsync(resourceGroupName, name), serviceCallback); + public Observable deleteSiteSourceControlAsync(String resourceGroupName, String name) { + return deleteSiteSourceControlWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -7952,7 +9569,7 @@ public ServiceCall deleteSiteSourceControlAsync(String resourceGroupName * @param name Name of web app * @return the observable to the Object object */ - public Observable> deleteSiteSourceControlAsync(String resourceGroupName, String name) { + public Observable> deleteSiteSourceControlWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -7995,10 +9612,10 @@ private ServiceResponse deleteSiteSourceControlDelegate(Response updateSiteSourceControl(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { - return updateSiteSourceControlAsync(resourceGroupName, name, siteSourceControl).toBlocking().single(); + public SiteSourceControlInner updateSiteSourceControl(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + return updateSiteSourceControlWithServiceResponseAsync(resourceGroupName, name, siteSourceControl).toBlocking().single().getBody(); } /** @@ -8011,7 +9628,24 @@ public ServiceResponse updateSiteSourceControl(String re * @return the {@link ServiceCall} object */ public ServiceCall updateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteSourceControlAsync(resourceGroupName, name, siteSourceControl), serviceCallback); + return ServiceCall.create(updateSiteSourceControlWithServiceResponseAsync(resourceGroupName, name, siteSourceControl), serviceCallback); + } + + /** + * Update the source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param siteSourceControl Request body that contains the source control parameters + * @return the observable to the SiteSourceControlInner object + */ + public Observable updateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { + return updateSiteSourceControlWithServiceResponseAsync(resourceGroupName, name, siteSourceControl).map(new Func1, SiteSourceControlInner>() { + @Override + public SiteSourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8022,7 +9656,7 @@ public ServiceCall updateSiteSourceControlAsync(String r * @param siteSourceControl Request body that contains the source control parameters * @return the observable to the SiteSourceControlInner object */ - public Observable> updateSiteSourceControlAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { + public Observable> updateSiteSourceControlWithServiceResponseAsync(String resourceGroupName, String name, SiteSourceControlInner siteSourceControl) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8069,10 +9703,10 @@ private ServiceResponse updateSiteSourceControlDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControlInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControlInner object if successful. */ - public ServiceResponse getSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteSourceControlSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public SiteSourceControlInner getSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -8085,7 +9719,24 @@ public ServiceResponse getSiteSourceControlSlot(String r * @return the {@link ServiceCall} object */ public ServiceCall getSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteSourceControlSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(getSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Get the source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the SiteSourceControlInner object + */ + public Observable getSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, SiteSourceControlInner>() { + @Override + public SiteSourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8096,7 +9747,7 @@ public ServiceCall getSiteSourceControlSlotAsync(String * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the SiteSourceControlInner object */ - public Observable> getSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> getSiteSourceControlSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8143,10 +9794,10 @@ private ServiceResponse getSiteSourceControlSlotDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteSourceControlInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteSourceControlInner object if successful. */ - public ServiceResponse createOrUpdateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl).toBlocking().single(); + public SiteSourceControlInner createOrUpdateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteSourceControl).toBlocking().single().getBody(); } /** @@ -8160,7 +9811,7 @@ public ServiceResponse createOrUpdateSiteSourceControlSl * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl), serviceCallback); + return ServiceCall.create(createOrUpdateSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteSourceControl), serviceCallback); } /** @@ -8172,7 +9823,25 @@ public ServiceCall createOrUpdateSiteSourceControlSlotAs * @param siteSourceControl Request body that contains the source control parameters * @return the observable to the SiteSourceControlInner object */ - public Observable> createOrUpdateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + public Observable createOrUpdateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + return createOrUpdateSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteSourceControl).map(new Func1, SiteSourceControlInner>() { + @Override + public SiteSourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Update the source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteSourceControl Request body that contains the source control parameters + * @return the observable to the SiteSourceControlInner object + */ + public Observable> createOrUpdateSiteSourceControlSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8222,10 +9891,10 @@ private ServiceResponse createOrUpdateSiteSourceControlS * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteSourceControlSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object deleteSiteSourceControlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -8238,7 +9907,24 @@ public ServiceResponse deleteSiteSourceControlSlot(String resourceGroupN * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteSourceControlSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(deleteSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Delete source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable deleteSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot) { + return deleteSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8249,7 +9935,7 @@ public ServiceCall deleteSiteSourceControlSlotAsync(String resourceGroup * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> deleteSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> deleteSiteSourceControlSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8296,10 +9982,10 @@ private ServiceResponse deleteSiteSourceControlSlotDelegate(Response updateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { - return updateSiteSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl).toBlocking().single(); + public SiteSourceControlInner updateSiteSourceControlSlot(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) throws CloudException, IOException, IllegalArgumentException { + return updateSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteSourceControl).toBlocking().single().getBody(); } /** @@ -8313,7 +9999,25 @@ public ServiceResponse updateSiteSourceControlSlot(Strin * @return the {@link ServiceCall} object */ public ServiceCall updateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteSourceControlSlotAsync(resourceGroupName, name, slot, siteSourceControl), serviceCallback); + return ServiceCall.create(updateSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteSourceControl), serviceCallback); + } + + /** + * Update the source control configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteSourceControl Request body that contains the source control parameters + * @return the observable to the SiteSourceControlInner object + */ + public Observable updateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + return updateSiteSourceControlSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteSourceControl).map(new Func1, SiteSourceControlInner>() { + @Override + public SiteSourceControlInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8325,7 +10029,7 @@ public ServiceCall updateSiteSourceControlSlotAsync(Stri * @param siteSourceControl Request body that contains the source control parameters * @return the observable to the SiteSourceControlInner object */ - public Observable> updateSiteSourceControlSlotAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { + public Observable> updateSiteSourceControlSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteSourceControlInner siteSourceControl) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8375,10 +10079,10 @@ private ServiceResponse updateSiteSourceControlSlotDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse listSiteAppSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSiteAppSettingsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public StringDictionaryInner listSiteAppSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSiteAppSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -8391,7 +10095,24 @@ public ServiceResponse listSiteAppSettingsSlot(String res * @return the {@link ServiceCall} object */ public ServiceCall listSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteAppSettingsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSiteAppSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the application settings of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the StringDictionaryInner object + */ + public Observable listSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot) { + return listSiteAppSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8402,7 +10123,7 @@ public ServiceCall listSiteAppSettingsSlotAsync(String re * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the StringDictionaryInner object */ - public Observable> listSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSiteAppSettingsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8447,10 +10168,10 @@ private ServiceResponse listSiteAppSettingsSlotDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse listSiteAppSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSiteAppSettingsAsync(resourceGroupName, name).toBlocking().single(); + public StringDictionaryInner listSiteAppSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSiteAppSettingsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -8462,7 +10183,23 @@ public ServiceResponse listSiteAppSettings(String resourc * @return the {@link ServiceCall} object */ public ServiceCall listSiteAppSettingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteAppSettingsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSiteAppSettingsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the application settings of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the StringDictionaryInner object + */ + public Observable listSiteAppSettingsAsync(String resourceGroupName, String name) { + return listSiteAppSettingsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8472,7 +10209,7 @@ public ServiceCall listSiteAppSettingsAsync(String resour * @param name Name of web app * @return the observable to the StringDictionaryInner object */ - public Observable> listSiteAppSettingsAsync(String resourceGroupName, String name) { + public Observable> listSiteAppSettingsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8515,10 +10252,10 @@ private ServiceResponse listSiteAppSettingsDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse updateSiteAppSettings(String resourceGroupName, String name, StringDictionaryInner appSettings) throws CloudException, IOException, IllegalArgumentException { - return updateSiteAppSettingsAsync(resourceGroupName, name, appSettings).toBlocking().single(); + public StringDictionaryInner updateSiteAppSettings(String resourceGroupName, String name, StringDictionaryInner appSettings) throws CloudException, IOException, IllegalArgumentException { + return updateSiteAppSettingsWithServiceResponseAsync(resourceGroupName, name, appSettings).toBlocking().single().getBody(); } /** @@ -8531,7 +10268,24 @@ public ServiceResponse updateSiteAppSettings(String resou * @return the {@link ServiceCall} object */ public ServiceCall updateSiteAppSettingsAsync(String resourceGroupName, String name, StringDictionaryInner appSettings, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteAppSettingsAsync(resourceGroupName, name, appSettings), serviceCallback); + return ServiceCall.create(updateSiteAppSettingsWithServiceResponseAsync(resourceGroupName, name, appSettings), serviceCallback); + } + + /** + * Updates the application settings of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param appSettings Application settings of web app + * @return the observable to the StringDictionaryInner object + */ + public Observable updateSiteAppSettingsAsync(String resourceGroupName, String name, StringDictionaryInner appSettings) { + return updateSiteAppSettingsWithServiceResponseAsync(resourceGroupName, name, appSettings).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8542,7 +10296,7 @@ public ServiceCall updateSiteAppSettingsAsync(String reso * @param appSettings Application settings of web app * @return the observable to the StringDictionaryInner object */ - public Observable> updateSiteAppSettingsAsync(String resourceGroupName, String name, StringDictionaryInner appSettings) { + public Observable> updateSiteAppSettingsWithServiceResponseAsync(String resourceGroupName, String name, StringDictionaryInner appSettings) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8590,10 +10344,10 @@ private ServiceResponse updateSiteAppSettingsDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse updateSiteAppSettingsSlot(String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) throws CloudException, IOException, IllegalArgumentException { - return updateSiteAppSettingsSlotAsync(resourceGroupName, name, slot, appSettings).toBlocking().single(); + public StringDictionaryInner updateSiteAppSettingsSlot(String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) throws CloudException, IOException, IllegalArgumentException { + return updateSiteAppSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot, appSettings).toBlocking().single().getBody(); } /** @@ -8607,7 +10361,25 @@ public ServiceResponse updateSiteAppSettingsSlot(String r * @return the {@link ServiceCall} object */ public ServiceCall updateSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, StringDictionaryInner appSettings, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteAppSettingsSlotAsync(resourceGroupName, name, slot, appSettings), serviceCallback); + return ServiceCall.create(updateSiteAppSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot, appSettings), serviceCallback); + } + + /** + * Updates the application settings of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param appSettings Application settings of web app + * @return the observable to the StringDictionaryInner object + */ + public Observable updateSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) { + return updateSiteAppSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot, appSettings).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8619,7 +10391,7 @@ public ServiceCall updateSiteAppSettingsSlotAsync(String * @param appSettings Application settings of web app * @return the observable to the StringDictionaryInner object */ - public Observable> updateSiteAppSettingsSlotAsync(String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) { + public Observable> updateSiteAppSettingsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, StringDictionaryInner appSettings) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8668,10 +10440,10 @@ private ServiceResponse updateSiteAppSettingsSlotDelegate * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionaryInner object if successful. */ - public ServiceResponse listSiteConnectionStrings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSiteConnectionStringsAsync(resourceGroupName, name).toBlocking().single(); + public ConnectionStringDictionaryInner listSiteConnectionStrings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSiteConnectionStringsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -8683,7 +10455,23 @@ public ServiceResponse listSiteConnectionString * @return the {@link ServiceCall} object */ public ServiceCall listSiteConnectionStringsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteConnectionStringsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSiteConnectionStringsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the connection strings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the ConnectionStringDictionaryInner object + */ + public Observable listSiteConnectionStringsAsync(String resourceGroupName, String name) { + return listSiteConnectionStringsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, ConnectionStringDictionaryInner>() { + @Override + public ConnectionStringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8693,7 +10481,7 @@ public ServiceCall listSiteConnectionStringsAsy * @param name Name of web app * @return the observable to the ConnectionStringDictionaryInner object */ - public Observable> listSiteConnectionStringsAsync(String resourceGroupName, String name) { + public Observable> listSiteConnectionStringsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8736,10 +10524,10 @@ private ServiceResponse listSiteConnectionStrin * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionaryInner object if successful. */ - public ServiceResponse listSiteConnectionStringsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSiteConnectionStringsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public ConnectionStringDictionaryInner listSiteConnectionStringsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSiteConnectionStringsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -8752,7 +10540,24 @@ public ServiceResponse listSiteConnectionString * @return the {@link ServiceCall} object */ public ServiceCall listSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteConnectionStringsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSiteConnectionStringsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the connection strings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the ConnectionStringDictionaryInner object + */ + public Observable listSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot) { + return listSiteConnectionStringsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, ConnectionStringDictionaryInner>() { + @Override + public ConnectionStringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8763,7 +10568,7 @@ public ServiceCall listSiteConnectionStringsSlo * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the ConnectionStringDictionaryInner object */ - public Observable> listSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSiteConnectionStringsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8809,10 +10614,10 @@ private ServiceResponse listSiteConnectionStrin * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionaryInner object if successful. */ - public ServiceResponse updateSiteConnectionStrings(String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) throws CloudException, IOException, IllegalArgumentException { - return updateSiteConnectionStringsAsync(resourceGroupName, name, connectionStrings).toBlocking().single(); + public ConnectionStringDictionaryInner updateSiteConnectionStrings(String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) throws CloudException, IOException, IllegalArgumentException { + return updateSiteConnectionStringsWithServiceResponseAsync(resourceGroupName, name, connectionStrings).toBlocking().single().getBody(); } /** @@ -8825,7 +10630,24 @@ public ServiceResponse updateSiteConnectionStri * @return the {@link ServiceCall} object */ public ServiceCall updateSiteConnectionStringsAsync(String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteConnectionStringsAsync(resourceGroupName, name, connectionStrings), serviceCallback); + return ServiceCall.create(updateSiteConnectionStringsWithServiceResponseAsync(resourceGroupName, name, connectionStrings), serviceCallback); + } + + /** + * Updates the connection strings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param connectionStrings Connection strings associated with web app + * @return the observable to the ConnectionStringDictionaryInner object + */ + public Observable updateSiteConnectionStringsAsync(String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) { + return updateSiteConnectionStringsWithServiceResponseAsync(resourceGroupName, name, connectionStrings).map(new Func1, ConnectionStringDictionaryInner>() { + @Override + public ConnectionStringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8836,7 +10658,7 @@ public ServiceCall updateSiteConnectionStringsA * @param connectionStrings Connection strings associated with web app * @return the observable to the ConnectionStringDictionaryInner object */ - public Observable> updateSiteConnectionStringsAsync(String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) { + public Observable> updateSiteConnectionStringsWithServiceResponseAsync(String resourceGroupName, String name, ConnectionStringDictionaryInner connectionStrings) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8884,10 +10706,10 @@ private ServiceResponse updateSiteConnectionStr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the ConnectionStringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the ConnectionStringDictionaryInner object if successful. */ - public ServiceResponse updateSiteConnectionStringsSlot(String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) throws CloudException, IOException, IllegalArgumentException { - return updateSiteConnectionStringsSlotAsync(resourceGroupName, name, slot, connectionStrings).toBlocking().single(); + public ConnectionStringDictionaryInner updateSiteConnectionStringsSlot(String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) throws CloudException, IOException, IllegalArgumentException { + return updateSiteConnectionStringsSlotWithServiceResponseAsync(resourceGroupName, name, slot, connectionStrings).toBlocking().single().getBody(); } /** @@ -8901,7 +10723,25 @@ public ServiceResponse updateSiteConnectionStri * @return the {@link ServiceCall} object */ public ServiceCall updateSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteConnectionStringsSlotAsync(resourceGroupName, name, slot, connectionStrings), serviceCallback); + return ServiceCall.create(updateSiteConnectionStringsSlotWithServiceResponseAsync(resourceGroupName, name, slot, connectionStrings), serviceCallback); + } + + /** + * Updates the connection strings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param connectionStrings Connection strings associated with web app + * @return the observable to the ConnectionStringDictionaryInner object + */ + public Observable updateSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) { + return updateSiteConnectionStringsSlotWithServiceResponseAsync(resourceGroupName, name, slot, connectionStrings).map(new Func1, ConnectionStringDictionaryInner>() { + @Override + public ConnectionStringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8913,7 +10753,7 @@ public ServiceCall updateSiteConnectionStringsS * @param connectionStrings Connection strings associated with web app * @return the observable to the ConnectionStringDictionaryInner object */ - public Observable> updateSiteConnectionStringsSlotAsync(String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) { + public Observable> updateSiteConnectionStringsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, ConnectionStringDictionaryInner connectionStrings) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -8962,10 +10802,10 @@ private ServiceResponse updateSiteConnectionStr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettingsInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettingsInner object if successful. */ - public ServiceResponse listSiteAuthSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSiteAuthSettingsAsync(resourceGroupName, name).toBlocking().single(); + public SiteAuthSettingsInner listSiteAuthSettings(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSiteAuthSettingsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -8977,7 +10817,23 @@ public ServiceResponse listSiteAuthSettings(String resour * @return the {@link ServiceCall} object */ public ServiceCall listSiteAuthSettingsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteAuthSettingsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSiteAuthSettingsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the Authentication / Authorization settings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the SiteAuthSettingsInner object + */ + public Observable listSiteAuthSettingsAsync(String resourceGroupName, String name) { + return listSiteAuthSettingsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SiteAuthSettingsInner>() { + @Override + public SiteAuthSettingsInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -8987,7 +10843,7 @@ public ServiceCall listSiteAuthSettingsAsync(String resou * @param name Name of web app * @return the observable to the SiteAuthSettingsInner object */ - public Observable> listSiteAuthSettingsAsync(String resourceGroupName, String name) { + public Observable> listSiteAuthSettingsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9030,10 +10886,10 @@ private ServiceResponse listSiteAuthSettingsDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettingsInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettingsInner object if successful. */ - public ServiceResponse listSiteAuthSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSiteAuthSettingsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public SiteAuthSettingsInner listSiteAuthSettingsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSiteAuthSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -9046,7 +10902,24 @@ public ServiceResponse listSiteAuthSettingsSlot(String re * @return the {@link ServiceCall} object */ public ServiceCall listSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteAuthSettingsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSiteAuthSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the Authentication / Authorization settings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the SiteAuthSettingsInner object + */ + public Observable listSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot) { + return listSiteAuthSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, SiteAuthSettingsInner>() { + @Override + public SiteAuthSettingsInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9057,7 +10930,7 @@ public ServiceCall listSiteAuthSettingsSlotAsync(String r * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the SiteAuthSettingsInner object */ - public Observable> listSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSiteAuthSettingsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9103,10 +10976,10 @@ private ServiceResponse listSiteAuthSettingsSlotDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettingsInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettingsInner object if successful. */ - public ServiceResponse updateSiteAuthSettings(String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { - return updateSiteAuthSettingsAsync(resourceGroupName, name, siteAuthSettings).toBlocking().single(); + public SiteAuthSettingsInner updateSiteAuthSettings(String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { + return updateSiteAuthSettingsWithServiceResponseAsync(resourceGroupName, name, siteAuthSettings).toBlocking().single().getBody(); } /** @@ -9119,7 +10992,24 @@ public ServiceResponse updateSiteAuthSettings(String reso * @return the {@link ServiceCall} object */ public ServiceCall updateSiteAuthSettingsAsync(String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteAuthSettingsAsync(resourceGroupName, name, siteAuthSettings), serviceCallback); + return ServiceCall.create(updateSiteAuthSettingsWithServiceResponseAsync(resourceGroupName, name, siteAuthSettings), serviceCallback); + } + + /** + * Updates the Authentication / Authorization settings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param siteAuthSettings Auth settings associated with web app + * @return the observable to the SiteAuthSettingsInner object + */ + public Observable updateSiteAuthSettingsAsync(String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) { + return updateSiteAuthSettingsWithServiceResponseAsync(resourceGroupName, name, siteAuthSettings).map(new Func1, SiteAuthSettingsInner>() { + @Override + public SiteAuthSettingsInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9130,7 +11020,7 @@ public ServiceCall updateSiteAuthSettingsAsync(String res * @param siteAuthSettings Auth settings associated with web app * @return the observable to the SiteAuthSettingsInner object */ - public Observable> updateSiteAuthSettingsAsync(String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) { + public Observable> updateSiteAuthSettingsWithServiceResponseAsync(String resourceGroupName, String name, SiteAuthSettingsInner siteAuthSettings) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9178,10 +11068,10 @@ private ServiceResponse updateSiteAuthSettingsDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteAuthSettingsInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteAuthSettingsInner object if successful. */ - public ServiceResponse updateSiteAuthSettingsSlot(String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { - return updateSiteAuthSettingsSlotAsync(resourceGroupName, name, slot, siteAuthSettings).toBlocking().single(); + public SiteAuthSettingsInner updateSiteAuthSettingsSlot(String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) throws CloudException, IOException, IllegalArgumentException { + return updateSiteAuthSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteAuthSettings).toBlocking().single().getBody(); } /** @@ -9195,7 +11085,25 @@ public ServiceResponse updateSiteAuthSettingsSlot(String * @return the {@link ServiceCall} object */ public ServiceCall updateSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteAuthSettingsSlotAsync(resourceGroupName, name, slot, siteAuthSettings), serviceCallback); + return ServiceCall.create(updateSiteAuthSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteAuthSettings), serviceCallback); + } + + /** + * Updates the Authentication / Authorization settings associated with web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteAuthSettings Auth settings associated with web app + * @return the observable to the SiteAuthSettingsInner object + */ + public Observable updateSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) { + return updateSiteAuthSettingsSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteAuthSettings).map(new Func1, SiteAuthSettingsInner>() { + @Override + public SiteAuthSettingsInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9207,7 +11115,7 @@ public ServiceCall updateSiteAuthSettingsSlotAsync(String * @param siteAuthSettings Auth settings associated with web app * @return the observable to the SiteAuthSettingsInner object */ - public Observable> updateSiteAuthSettingsSlotAsync(String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) { + public Observable> updateSiteAuthSettingsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteAuthSettingsInner siteAuthSettings) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9257,10 +11165,10 @@ private ServiceResponse updateSiteAuthSettingsSlotDelegat * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the UserInner object wrapped in ServiceResponse if successful. + * @return the UserInner object if successful. */ - public ServiceResponse listSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return listSitePublishingCredentialsAsync(resourceGroupName, name).toBlocking().last(); + public UserInner listSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return listSitePublishingCredentialsWithServiceResponseAsync(resourceGroupName, name).toBlocking().last().getBody(); } /** @@ -9272,7 +11180,23 @@ public ServiceResponse listSitePublishingCredentials(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall listSitePublishingCredentialsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePublishingCredentialsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSitePublishingCredentialsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the web app publishing credentials. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable for the request + */ + public Observable listSitePublishingCredentialsAsync(String resourceGroupName, String name) { + return listSitePublishingCredentialsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9282,7 +11206,7 @@ public ServiceCall listSitePublishingCredentialsAsync(String resource * @param name Name of web app * @return the observable for the request */ - public Observable> listSitePublishingCredentialsAsync(String resourceGroupName, String name) { + public Observable> listSitePublishingCredentialsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9307,10 +11231,10 @@ public Observable> listSitePublishingCredentialsAsync * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the UserInner object wrapped in {@link ServiceResponse} if successful. + * @return the UserInner object if successful. */ - public ServiceResponse beginListSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return beginListSitePublishingCredentialsAsync(resourceGroupName, name).toBlocking().single(); + public UserInner beginListSitePublishingCredentials(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return beginListSitePublishingCredentialsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -9322,7 +11246,23 @@ public ServiceResponse beginListSitePublishingCredentials(String reso * @return the {@link ServiceCall} object */ public ServiceCall beginListSitePublishingCredentialsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginListSitePublishingCredentialsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(beginListSitePublishingCredentialsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the web app publishing credentials. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the UserInner object + */ + public Observable beginListSitePublishingCredentialsAsync(String resourceGroupName, String name) { + return beginListSitePublishingCredentialsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9332,7 +11272,7 @@ public ServiceCall beginListSitePublishingCredentialsAsync(String res * @param name Name of web app * @return the observable to the UserInner object */ - public Observable> beginListSitePublishingCredentialsAsync(String resourceGroupName, String name) { + public Observable> beginListSitePublishingCredentialsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9376,10 +11316,10 @@ private ServiceResponse beginListSitePublishingCredentialsDelegate(Re * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the UserInner object wrapped in ServiceResponse if successful. + * @return the UserInner object if successful. */ - public ServiceResponse listSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return listSitePublishingCredentialsSlotAsync(resourceGroupName, name, slot).toBlocking().last(); + public UserInner listSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return listSitePublishingCredentialsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().last().getBody(); } /** @@ -9392,7 +11332,24 @@ public ServiceResponse listSitePublishingCredentialsSlot(String resou * @return the {@link ServiceCall} object */ public ServiceCall listSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePublishingCredentialsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSitePublishingCredentialsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the web app publishing credentials. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable for the request + */ + public Observable listSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { + return listSitePublishingCredentialsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9403,7 +11360,7 @@ public ServiceCall listSitePublishingCredentialsSlotAsync(String reso * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable for the request */ - public Observable> listSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSitePublishingCredentialsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9432,10 +11389,23 @@ public Observable> listSitePublishingCredentialsSlotA * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the UserInner object wrapped in {@link ServiceResponse} if successful. + * @return the UserInner object if successful. + */ + public UserInner beginListSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return beginListSitePublishingCredentialsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); + } + + /** + * Gets the web app publishing credentials. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceCall} object */ - public ServiceResponse beginListSitePublishingCredentialsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return beginListSitePublishingCredentialsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public ServiceCall beginListSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { + return ServiceCall.create(beginListSitePublishingCredentialsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); } /** @@ -9444,11 +11414,15 @@ public ServiceResponse beginListSitePublishingCredentialsSlot(String * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @return the {@link ServiceCall} object + * @return the observable to the UserInner object */ - public ServiceCall beginListSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginListSitePublishingCredentialsSlotAsync(resourceGroupName, name, slot), serviceCallback); + public Observable beginListSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { + return beginListSitePublishingCredentialsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, UserInner>() { + @Override + public UserInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9459,7 +11433,7 @@ public ServiceCall beginListSitePublishingCredentialsSlotAsync(String * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the UserInner object */ - public Observable> beginListSitePublishingCredentialsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> beginListSitePublishingCredentialsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9504,10 +11478,10 @@ private ServiceResponse beginListSitePublishingCredentialsSlotDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse listSiteMetadata(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSiteMetadataAsync(resourceGroupName, name).toBlocking().single(); + public StringDictionaryInner listSiteMetadata(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSiteMetadataWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -9519,7 +11493,23 @@ public ServiceResponse listSiteMetadata(String resourceGr * @return the {@link ServiceCall} object */ public ServiceCall listSiteMetadataAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteMetadataAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSiteMetadataWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the web app meta data. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the StringDictionaryInner object + */ + public Observable listSiteMetadataAsync(String resourceGroupName, String name) { + return listSiteMetadataWithServiceResponseAsync(resourceGroupName, name).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9529,7 +11519,7 @@ public ServiceCall listSiteMetadataAsync(String resourceG * @param name Name of web app * @return the observable to the StringDictionaryInner object */ - public Observable> listSiteMetadataAsync(String resourceGroupName, String name) { + public Observable> listSiteMetadataWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9572,10 +11562,10 @@ private ServiceResponse listSiteMetadataDelegate(Response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse listSiteMetadataSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSiteMetadataSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public StringDictionaryInner listSiteMetadataSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSiteMetadataSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -9588,7 +11578,24 @@ public ServiceResponse listSiteMetadataSlot(String resour * @return the {@link ServiceCall} object */ public ServiceCall listSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteMetadataSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSiteMetadataSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the web app meta data. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the StringDictionaryInner object + */ + public Observable listSiteMetadataSlotAsync(String resourceGroupName, String name, String slot) { + return listSiteMetadataSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9599,7 +11606,7 @@ public ServiceCall listSiteMetadataSlotAsync(String resou * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the StringDictionaryInner object */ - public Observable> listSiteMetadataSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSiteMetadataSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9645,10 +11652,10 @@ private ServiceResponse listSiteMetadataSlotDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse updateSiteMetadata(String resourceGroupName, String name, StringDictionaryInner metadata) throws CloudException, IOException, IllegalArgumentException { - return updateSiteMetadataAsync(resourceGroupName, name, metadata).toBlocking().single(); + public StringDictionaryInner updateSiteMetadata(String resourceGroupName, String name, StringDictionaryInner metadata) throws CloudException, IOException, IllegalArgumentException { + return updateSiteMetadataWithServiceResponseAsync(resourceGroupName, name, metadata).toBlocking().single().getBody(); } /** @@ -9661,7 +11668,24 @@ public ServiceResponse updateSiteMetadata(String resource * @return the {@link ServiceCall} object */ public ServiceCall updateSiteMetadataAsync(String resourceGroupName, String name, StringDictionaryInner metadata, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteMetadataAsync(resourceGroupName, name, metadata), serviceCallback); + return ServiceCall.create(updateSiteMetadataWithServiceResponseAsync(resourceGroupName, name, metadata), serviceCallback); + } + + /** + * Updates the meta data for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param metadata Meta data of web app + * @return the observable to the StringDictionaryInner object + */ + public Observable updateSiteMetadataAsync(String resourceGroupName, String name, StringDictionaryInner metadata) { + return updateSiteMetadataWithServiceResponseAsync(resourceGroupName, name, metadata).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9672,7 +11696,7 @@ public ServiceCall updateSiteMetadataAsync(String resourc * @param metadata Meta data of web app * @return the observable to the StringDictionaryInner object */ - public Observable> updateSiteMetadataAsync(String resourceGroupName, String name, StringDictionaryInner metadata) { + public Observable> updateSiteMetadataWithServiceResponseAsync(String resourceGroupName, String name, StringDictionaryInner metadata) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9720,10 +11744,10 @@ private ServiceResponse updateSiteMetadataDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the StringDictionaryInner object wrapped in {@link ServiceResponse} if successful. + * @return the StringDictionaryInner object if successful. */ - public ServiceResponse updateSiteMetadataSlot(String resourceGroupName, String name, String slot, StringDictionaryInner metadata) throws CloudException, IOException, IllegalArgumentException { - return updateSiteMetadataSlotAsync(resourceGroupName, name, slot, metadata).toBlocking().single(); + public StringDictionaryInner updateSiteMetadataSlot(String resourceGroupName, String name, String slot, StringDictionaryInner metadata) throws CloudException, IOException, IllegalArgumentException { + return updateSiteMetadataSlotWithServiceResponseAsync(resourceGroupName, name, slot, metadata).toBlocking().single().getBody(); } /** @@ -9737,7 +11761,25 @@ public ServiceResponse updateSiteMetadataSlot(String reso * @return the {@link ServiceCall} object */ public ServiceCall updateSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, StringDictionaryInner metadata, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteMetadataSlotAsync(resourceGroupName, name, slot, metadata), serviceCallback); + return ServiceCall.create(updateSiteMetadataSlotWithServiceResponseAsync(resourceGroupName, name, slot, metadata), serviceCallback); + } + + /** + * Updates the meta data for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param metadata Meta data of web app + * @return the observable to the StringDictionaryInner object + */ + public Observable updateSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, StringDictionaryInner metadata) { + return updateSiteMetadataSlotWithServiceResponseAsync(resourceGroupName, name, slot, metadata).map(new Func1, StringDictionaryInner>() { + @Override + public StringDictionaryInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9749,7 +11791,7 @@ public ServiceCall updateSiteMetadataSlotAsync(String res * @param metadata Meta data of web app * @return the observable to the StringDictionaryInner object */ - public Observable> updateSiteMetadataSlotAsync(String resourceGroupName, String name, String slot, StringDictionaryInner metadata) { + public Observable> updateSiteMetadataSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, StringDictionaryInner metadata) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9798,10 +11840,10 @@ private ServiceResponse updateSiteMetadataSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfigInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfigInner object if successful. */ - public ServiceResponse getSiteLogsConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteLogsConfigAsync(resourceGroupName, name).toBlocking().single(); + public SiteLogsConfigInner getSiteLogsConfig(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteLogsConfigWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -9813,7 +11855,23 @@ public ServiceResponse getSiteLogsConfig(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall getSiteLogsConfigAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteLogsConfigAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteLogsConfigWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the web app logs configuration. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the SiteLogsConfigInner object + */ + public Observable getSiteLogsConfigAsync(String resourceGroupName, String name) { + return getSiteLogsConfigWithServiceResponseAsync(resourceGroupName, name).map(new Func1, SiteLogsConfigInner>() { + @Override + public SiteLogsConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9823,7 +11881,7 @@ public ServiceCall getSiteLogsConfigAsync(String resourceGr * @param name Name of web app * @return the observable to the SiteLogsConfigInner object */ - public Observable> getSiteLogsConfigAsync(String resourceGroupName, String name) { + public Observable> getSiteLogsConfigWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9866,10 +11924,10 @@ private ServiceResponse getSiteLogsConfigDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfigInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfigInner object if successful. */ - public ServiceResponse updateSiteLogsConfig(String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { - return updateSiteLogsConfigAsync(resourceGroupName, name, siteLogsConfig).toBlocking().single(); + public SiteLogsConfigInner updateSiteLogsConfig(String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { + return updateSiteLogsConfigWithServiceResponseAsync(resourceGroupName, name, siteLogsConfig).toBlocking().single().getBody(); } /** @@ -9882,7 +11940,24 @@ public ServiceResponse updateSiteLogsConfig(String resource * @return the {@link ServiceCall} object */ public ServiceCall updateSiteLogsConfigAsync(String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteLogsConfigAsync(resourceGroupName, name, siteLogsConfig), serviceCallback); + return ServiceCall.create(updateSiteLogsConfigWithServiceResponseAsync(resourceGroupName, name, siteLogsConfig), serviceCallback); + } + + /** + * Updates the meta data for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param siteLogsConfig Site logs configuration + * @return the observable to the SiteLogsConfigInner object + */ + public Observable updateSiteLogsConfigAsync(String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) { + return updateSiteLogsConfigWithServiceResponseAsync(resourceGroupName, name, siteLogsConfig).map(new Func1, SiteLogsConfigInner>() { + @Override + public SiteLogsConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9893,7 +11968,7 @@ public ServiceCall updateSiteLogsConfigAsync(String resourc * @param siteLogsConfig Site logs configuration * @return the observable to the SiteLogsConfigInner object */ - public Observable> updateSiteLogsConfigAsync(String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) { + public Observable> updateSiteLogsConfigWithServiceResponseAsync(String resourceGroupName, String name, SiteLogsConfigInner siteLogsConfig) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -9940,10 +12015,10 @@ private ServiceResponse updateSiteLogsConfigDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfigInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfigInner object if successful. */ - public ServiceResponse getSiteLogsConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteLogsConfigSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public SiteLogsConfigInner getSiteLogsConfigSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteLogsConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -9956,7 +12031,24 @@ public ServiceResponse getSiteLogsConfigSlot(String resourc * @return the {@link ServiceCall} object */ public ServiceCall getSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteLogsConfigSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(getSiteLogsConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the web app logs configuration. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the SiteLogsConfigInner object + */ + public Observable getSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteLogsConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, SiteLogsConfigInner>() { + @Override + public SiteLogsConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -9967,7 +12059,7 @@ public ServiceCall getSiteLogsConfigSlotAsync(String resour * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the SiteLogsConfigInner object */ - public Observable> getSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> getSiteLogsConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10014,10 +12106,10 @@ private ServiceResponse getSiteLogsConfigSlotDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the SiteLogsConfigInner object wrapped in {@link ServiceResponse} if successful. + * @return the SiteLogsConfigInner object if successful. */ - public ServiceResponse updateSiteLogsConfigSlot(String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { - return updateSiteLogsConfigSlotAsync(resourceGroupName, name, slot, siteLogsConfig).toBlocking().single(); + public SiteLogsConfigInner updateSiteLogsConfigSlot(String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) throws CloudException, IOException, IllegalArgumentException { + return updateSiteLogsConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteLogsConfig).toBlocking().single().getBody(); } /** @@ -10031,7 +12123,25 @@ public ServiceResponse updateSiteLogsConfigSlot(String reso * @return the {@link ServiceCall} object */ public ServiceCall updateSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteLogsConfigSlotAsync(resourceGroupName, name, slot, siteLogsConfig), serviceCallback); + return ServiceCall.create(updateSiteLogsConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteLogsConfig), serviceCallback); + } + + /** + * Updates the meta data for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param siteLogsConfig Site logs configuration + * @return the observable to the SiteLogsConfigInner object + */ + public Observable updateSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) { + return updateSiteLogsConfigSlotWithServiceResponseAsync(resourceGroupName, name, slot, siteLogsConfig).map(new Func1, SiteLogsConfigInner>() { + @Override + public SiteLogsConfigInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10043,7 +12153,7 @@ public ServiceCall updateSiteLogsConfigSlotAsync(String res * @param siteLogsConfig Site logs configuration * @return the observable to the SiteLogsConfigInner object */ - public Observable> updateSiteLogsConfigSlotAsync(String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) { + public Observable> updateSiteLogsConfigSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, SiteLogsConfigInner siteLogsConfig) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10091,10 +12201,10 @@ private ServiceResponse updateSiteLogsConfigSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse listSitePremierAddOns(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSitePremierAddOnsAsync(resourceGroupName, name).toBlocking().single(); + public Object listSitePremierAddOns(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSitePremierAddOnsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -10105,7 +12215,22 @@ public ServiceResponse listSitePremierAddOns(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall listSitePremierAddOnsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePremierAddOnsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSitePremierAddOnsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @return the observable to the Object object + */ + public Observable listSitePremierAddOnsAsync(String resourceGroupName, String name) { + return listSitePremierAddOnsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10114,7 +12239,7 @@ public ServiceCall listSitePremierAddOnsAsync(String resourceGroupName, * @param name the String value * @return the observable to the Object object */ - public Observable> listSitePremierAddOnsAsync(String resourceGroupName, String name) { + public Observable> listSitePremierAddOnsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10156,10 +12281,10 @@ private ServiceResponse listSitePremierAddOnsDelegate(Response listSitePremierAddOnsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSitePremierAddOnsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object listSitePremierAddOnsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSitePremierAddOnsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -10171,7 +12296,23 @@ public ServiceResponse listSitePremierAddOnsSlot(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall listSitePremierAddOnsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePremierAddOnsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSitePremierAddOnsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param slot the String value + * @return the observable to the Object object + */ + public Observable listSitePremierAddOnsSlotAsync(String resourceGroupName, String name, String slot) { + return listSitePremierAddOnsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10181,7 +12322,7 @@ public ServiceCall listSitePremierAddOnsSlotAsync(String resourceGroupNa * @param slot the String value * @return the observable to the Object object */ - public Observable> listSitePremierAddOnsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSitePremierAddOnsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10226,10 +12367,10 @@ private ServiceResponse listSitePremierAddOnsSlotDelegate(Response getSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { - return getSitePremierAddOnAsync(resourceGroupName, name, premierAddOnName).toBlocking().single(); + public Object getSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { + return getSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName).toBlocking().single().getBody(); } /** @@ -10241,7 +12382,23 @@ public ServiceResponse getSitePremierAddOn(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall getSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSitePremierAddOnAsync(resourceGroupName, name, premierAddOnName), serviceCallback); + return ServiceCall.create(getSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @return the observable to the Object object + */ + public Observable getSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName) { + return getSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10251,7 +12408,7 @@ public ServiceCall getSitePremierAddOnAsync(String resourceGroupName, St * @param premierAddOnName the String value * @return the observable to the Object object */ - public Observable> getSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName) { + public Observable> getSitePremierAddOnWithServiceResponseAsync(String resourceGroupName, String name, String premierAddOnName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10297,10 +12454,10 @@ private ServiceResponse getSitePremierAddOnDelegate(Response addSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequestInner premierAddOn) throws CloudException, IOException, IllegalArgumentException { - return addSitePremierAddOnAsync(resourceGroupName, name, premierAddOnName, premierAddOn).toBlocking().single(); + public Object addSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequestInner premierAddOn) throws CloudException, IOException, IllegalArgumentException { + return addSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn).toBlocking().single().getBody(); } /** @@ -10313,7 +12470,24 @@ public ServiceResponse addSitePremierAddOn(String resourceGroupName, Str * @return the {@link ServiceCall} object */ public ServiceCall addSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequestInner premierAddOn, final ServiceCallback serviceCallback) { - return ServiceCall.create(addSitePremierAddOnAsync(resourceGroupName, name, premierAddOnName, premierAddOn), serviceCallback); + return ServiceCall.create(addSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param premierAddOn the PremierAddOnRequestInner value + * @return the observable to the Object object + */ + public Observable addSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequestInner premierAddOn) { + return addSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, premierAddOn).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10324,7 +12498,7 @@ public ServiceCall addSitePremierAddOnAsync(String resourceGroupName, St * @param premierAddOn the PremierAddOnRequestInner value * @return the observable to the Object object */ - public Observable> addSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequestInner premierAddOn) { + public Observable> addSitePremierAddOnWithServiceResponseAsync(String resourceGroupName, String name, String premierAddOnName, PremierAddOnRequestInner premierAddOn) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10373,10 +12547,10 @@ private ServiceResponse addSitePremierAddOnDelegate(Response deleteSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { - return deleteSitePremierAddOnAsync(resourceGroupName, name, premierAddOnName).toBlocking().single(); + public Object deleteSitePremierAddOn(String resourceGroupName, String name, String premierAddOnName) throws CloudException, IOException, IllegalArgumentException { + return deleteSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName).toBlocking().single().getBody(); } /** @@ -10388,7 +12562,23 @@ public ServiceResponse deleteSitePremierAddOn(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall deleteSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSitePremierAddOnAsync(resourceGroupName, name, premierAddOnName), serviceCallback); + return ServiceCall.create(deleteSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @return the observable to the Object object + */ + public Observable deleteSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName) { + return deleteSitePremierAddOnWithServiceResponseAsync(resourceGroupName, name, premierAddOnName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10398,7 +12588,7 @@ public ServiceCall deleteSitePremierAddOnAsync(String resourceGroupName, * @param premierAddOnName the String value * @return the observable to the Object object */ - public Observable> deleteSitePremierAddOnAsync(String resourceGroupName, String name, String premierAddOnName) { + public Observable> deleteSitePremierAddOnWithServiceResponseAsync(String resourceGroupName, String name, String premierAddOnName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10444,10 +12634,10 @@ private ServiceResponse deleteSitePremierAddOnDelegate(Response getSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSitePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot).toBlocking().single(); + public Object getSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot).toBlocking().single().getBody(); } /** @@ -10460,7 +12650,24 @@ public ServiceResponse getSitePremierAddOnSlot(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSitePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot), serviceCallback); + return ServiceCall.create(getSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value + * @return the observable to the Object object + */ + public Observable getSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot) { + return getSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10471,7 +12678,7 @@ public ServiceCall getSitePremierAddOnSlotAsync(String resourceGroupName * @param slot the String value * @return the observable to the Object object */ - public Observable> getSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot) { + public Observable> getSitePremierAddOnSlotWithServiceResponseAsync(String resourceGroupName, String name, String premierAddOnName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10521,10 +12728,10 @@ private ServiceResponse getSitePremierAddOnSlotDelegate(Response addSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequestInner premierAddOn) throws CloudException, IOException, IllegalArgumentException { - return addSitePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn).toBlocking().single(); + public Object addSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequestInner premierAddOn) throws CloudException, IOException, IllegalArgumentException { + return addSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn).toBlocking().single().getBody(); } /** @@ -10538,7 +12745,25 @@ public ServiceResponse addSitePremierAddOnSlot(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall addSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequestInner premierAddOn, final ServiceCallback serviceCallback) { - return ServiceCall.create(addSitePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn), serviceCallback); + return ServiceCall.create(addSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value + * @param premierAddOn the PremierAddOnRequestInner value + * @return the observable to the Object object + */ + public Observable addSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequestInner premierAddOn) { + return addSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot, premierAddOn).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10550,7 +12775,7 @@ public ServiceCall addSitePremierAddOnSlotAsync(String resourceGroupName * @param premierAddOn the PremierAddOnRequestInner value * @return the observable to the Object object */ - public Observable> addSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequestInner premierAddOn) { + public Observable> addSitePremierAddOnSlotWithServiceResponseAsync(String resourceGroupName, String name, String premierAddOnName, String slot, PremierAddOnRequestInner premierAddOn) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10603,10 +12828,10 @@ private ServiceResponse addSitePremierAddOnSlotDelegate(Response deleteSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteSitePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot).toBlocking().single(); + public Object deleteSitePremierAddOnSlot(String resourceGroupName, String name, String premierAddOnName, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot).toBlocking().single().getBody(); } /** @@ -10619,7 +12844,24 @@ public ServiceResponse deleteSitePremierAddOnSlot(String resourceGroupNa * @return the {@link ServiceCall} object */ public ServiceCall deleteSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSitePremierAddOnSlotAsync(resourceGroupName, name, premierAddOnName, slot), serviceCallback); + return ServiceCall.create(deleteSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param premierAddOnName the String value + * @param slot the String value + * @return the observable to the Object object + */ + public Observable deleteSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot) { + return deleteSitePremierAddOnSlotWithServiceResponseAsync(resourceGroupName, name, premierAddOnName, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10630,7 +12872,7 @@ public ServiceCall deleteSitePremierAddOnSlotAsync(String resourceGroupN * @param slot the String value * @return the observable to the Object object */ - public Observable> deleteSitePremierAddOnSlotAsync(String resourceGroupName, String name, String premierAddOnName, String slot) { + public Observable> deleteSitePremierAddOnSlotWithServiceResponseAsync(String resourceGroupName, String name, String premierAddOnName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10678,10 +12920,10 @@ private ServiceResponse deleteSitePremierAddOnSlotDelegate(Response getSiteBackupConfiguration(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteBackupConfigurationAsync(resourceGroupName, name).toBlocking().single(); + public BackupRequestInner getSiteBackupConfiguration(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteBackupConfigurationWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -10693,7 +12935,23 @@ public ServiceResponse getSiteBackupConfiguration(String res * @return the {@link ServiceCall} object */ public ServiceCall getSiteBackupConfigurationAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteBackupConfigurationAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteBackupConfigurationWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the backup configuration for a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the BackupRequestInner object + */ + public Observable getSiteBackupConfigurationAsync(String resourceGroupName, String name) { + return getSiteBackupConfigurationWithServiceResponseAsync(resourceGroupName, name).map(new Func1, BackupRequestInner>() { + @Override + public BackupRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10703,7 +12961,7 @@ public ServiceCall getSiteBackupConfigurationAsync(String re * @param name Name of web app * @return the observable to the BackupRequestInner object */ - public Observable> getSiteBackupConfigurationAsync(String resourceGroupName, String name) { + public Observable> getSiteBackupConfigurationWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10746,10 +13004,10 @@ private ServiceResponse getSiteBackupConfigurationDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequestInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupRequestInner object if successful. */ - public ServiceResponse getSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteBackupConfigurationSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public BackupRequestInner getSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteBackupConfigurationSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -10762,7 +13020,24 @@ public ServiceResponse getSiteBackupConfigurationSlot(String * @return the {@link ServiceCall} object */ public ServiceCall getSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteBackupConfigurationSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(getSiteBackupConfigurationSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the backup configuration for a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the BackupRequestInner object + */ + public Observable getSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteBackupConfigurationSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, BackupRequestInner>() { + @Override + public BackupRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10773,7 +13048,7 @@ public ServiceCall getSiteBackupConfigurationSlotAsync(Strin * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the BackupRequestInner object */ - public Observable> getSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> getSiteBackupConfigurationSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10819,10 +13094,10 @@ private ServiceResponse getSiteBackupConfigurationSlotDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequestInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupRequestInner object if successful. */ - public ServiceResponse updateSiteBackupConfiguration(String resourceGroupName, String name, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return updateSiteBackupConfigurationAsync(resourceGroupName, name, request).toBlocking().single(); + public BackupRequestInner updateSiteBackupConfiguration(String resourceGroupName, String name, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return updateSiteBackupConfigurationWithServiceResponseAsync(resourceGroupName, name, request).toBlocking().single().getBody(); } /** @@ -10835,7 +13110,24 @@ public ServiceResponse updateSiteBackupConfiguration(String * @return the {@link ServiceCall} object */ public ServiceCall updateSiteBackupConfigurationAsync(String resourceGroupName, String name, BackupRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteBackupConfigurationAsync(resourceGroupName, name, request), serviceCallback); + return ServiceCall.create(updateSiteBackupConfigurationWithServiceResponseAsync(resourceGroupName, name, request), serviceCallback); + } + + /** + * Updates backup configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on backup request + * @return the observable to the BackupRequestInner object + */ + public Observable updateSiteBackupConfigurationAsync(String resourceGroupName, String name, BackupRequestInner request) { + return updateSiteBackupConfigurationWithServiceResponseAsync(resourceGroupName, name, request).map(new Func1, BackupRequestInner>() { + @Override + public BackupRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10846,7 +13138,7 @@ public ServiceCall updateSiteBackupConfigurationAsync(String * @param request Information on backup request * @return the observable to the BackupRequestInner object */ - public Observable> updateSiteBackupConfigurationAsync(String resourceGroupName, String name, BackupRequestInner request) { + public Observable> updateSiteBackupConfigurationWithServiceResponseAsync(String resourceGroupName, String name, BackupRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10894,10 +13186,10 @@ private ServiceResponse updateSiteBackupConfigurationDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupRequestInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupRequestInner object if successful. */ - public ServiceResponse updateSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return updateSiteBackupConfigurationSlotAsync(resourceGroupName, name, slot, request).toBlocking().single(); + public BackupRequestInner updateSiteBackupConfigurationSlot(String resourceGroupName, String name, String slot, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return updateSiteBackupConfigurationSlotWithServiceResponseAsync(resourceGroupName, name, slot, request).toBlocking().single().getBody(); } /** @@ -10911,7 +13203,25 @@ public ServiceResponse updateSiteBackupConfigurationSlot(Str * @return the {@link ServiceCall} object */ public ServiceCall updateSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, BackupRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteBackupConfigurationSlotAsync(resourceGroupName, name, slot, request), serviceCallback); + return ServiceCall.create(updateSiteBackupConfigurationSlotWithServiceResponseAsync(resourceGroupName, name, slot, request), serviceCallback); + } + + /** + * Updates backup configuration of web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request + * @return the observable to the BackupRequestInner object + */ + public Observable updateSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, BackupRequestInner request) { + return updateSiteBackupConfigurationSlotWithServiceResponseAsync(resourceGroupName, name, slot, request).map(new Func1, BackupRequestInner>() { + @Override + public BackupRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -10923,7 +13233,7 @@ public ServiceCall updateSiteBackupConfigurationSlotAsync(St * @param request Information on backup request * @return the observable to the BackupRequestInner object */ - public Observable> updateSiteBackupConfigurationSlotAsync(String resourceGroupName, String name, String slot, BackupRequestInner request) { + public Observable> updateSiteBackupConfigurationSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, BackupRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -10973,10 +13283,10 @@ private ServiceResponse updateSiteBackupConfigurationSlotDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItemInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItemInner object if successful. */ - public ServiceResponse backupSite(String resourceGroupName, String name, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return backupSiteAsync(resourceGroupName, name, request).toBlocking().single(); + public BackupItemInner backupSite(String resourceGroupName, String name, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return backupSiteWithServiceResponseAsync(resourceGroupName, name, request).toBlocking().single().getBody(); } /** @@ -10988,8 +13298,25 @@ public ServiceResponse backupSite(String resourceGroupName, Str * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall backupSiteAsync(String resourceGroupName, String name, BackupRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(backupSiteAsync(resourceGroupName, name, request), serviceCallback); + public ServiceCall backupSiteAsync(String resourceGroupName, String name, BackupRequestInner request, final ServiceCallback serviceCallback) { + return ServiceCall.create(backupSiteWithServiceResponseAsync(resourceGroupName, name, request), serviceCallback); + } + + /** + * Creates web app backup. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on backup request + * @return the observable to the BackupItemInner object + */ + public Observable backupSiteAsync(String resourceGroupName, String name, BackupRequestInner request) { + return backupSiteWithServiceResponseAsync(resourceGroupName, name, request).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11000,7 +13327,7 @@ public ServiceCall backupSiteAsync(String resourceGroupName, St * @param request Information on backup request * @return the observable to the BackupItemInner object */ - public Observable> backupSiteAsync(String resourceGroupName, String name, BackupRequestInner request) { + public Observable> backupSiteWithServiceResponseAsync(String resourceGroupName, String name, BackupRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11048,10 +13375,10 @@ private ServiceResponse backupSiteDelegate(Response backupSiteSlot(String resourceGroupName, String name, String slot, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return backupSiteSlotAsync(resourceGroupName, name, slot, request).toBlocking().single(); + public BackupItemInner backupSiteSlot(String resourceGroupName, String name, String slot, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return backupSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, request).toBlocking().single().getBody(); } /** @@ -11065,7 +13392,25 @@ public ServiceResponse backupSiteSlot(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall backupSiteSlotAsync(String resourceGroupName, String name, String slot, BackupRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(backupSiteSlotAsync(resourceGroupName, name, slot, request), serviceCallback); + return ServiceCall.create(backupSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, request), serviceCallback); + } + + /** + * Creates web app backup. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request + * @return the observable to the BackupItemInner object + */ + public Observable backupSiteSlotAsync(String resourceGroupName, String name, String slot, BackupRequestInner request) { + return backupSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, request).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11077,7 +13422,7 @@ public ServiceCall backupSiteSlotAsync(String resourceGroupName * @param request Information on backup request * @return the observable to the BackupItemInner object */ - public Observable> backupSiteSlotAsync(String resourceGroupName, String name, String slot, BackupRequestInner request) { + public Observable> backupSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, BackupRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11127,10 +13472,10 @@ private ServiceResponse backupSiteSlotDelegate(Response discoverSiteRestore(String resourceGroupName, String name, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return discoverSiteRestoreAsync(resourceGroupName, name, request).toBlocking().single(); + public RestoreRequestInner discoverSiteRestore(String resourceGroupName, String name, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return discoverSiteRestoreWithServiceResponseAsync(resourceGroupName, name, request).toBlocking().single().getBody(); } /** @@ -11143,7 +13488,24 @@ public ServiceResponse discoverSiteRestore(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall discoverSiteRestoreAsync(String resourceGroupName, String name, RestoreRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(discoverSiteRestoreAsync(resourceGroupName, name, request), serviceCallback); + return ServiceCall.create(discoverSiteRestoreWithServiceResponseAsync(resourceGroupName, name, request), serviceCallback); + } + + /** + * Discovers existing web app backups that can be restored. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param request Information on restore request + * @return the observable to the RestoreRequestInner object + */ + public Observable discoverSiteRestoreAsync(String resourceGroupName, String name, RestoreRequestInner request) { + return discoverSiteRestoreWithServiceResponseAsync(resourceGroupName, name, request).map(new Func1, RestoreRequestInner>() { + @Override + public RestoreRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11154,7 +13516,7 @@ public ServiceCall discoverSiteRestoreAsync(String resource * @param request Information on restore request * @return the observable to the RestoreRequestInner object */ - public Observable> discoverSiteRestoreAsync(String resourceGroupName, String name, RestoreRequestInner request) { + public Observable> discoverSiteRestoreWithServiceResponseAsync(String resourceGroupName, String name, RestoreRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11202,10 +13564,10 @@ private ServiceResponse discoverSiteRestoreDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RestoreRequestInner object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreRequestInner object if successful. */ - public ServiceResponse discoverSiteRestoreSlot(String resourceGroupName, String name, String slot, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return discoverSiteRestoreSlotAsync(resourceGroupName, name, slot, request).toBlocking().single(); + public RestoreRequestInner discoverSiteRestoreSlot(String resourceGroupName, String name, String slot, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return discoverSiteRestoreSlotWithServiceResponseAsync(resourceGroupName, name, slot, request).toBlocking().single().getBody(); } /** @@ -11219,7 +13581,25 @@ public ServiceResponse discoverSiteRestoreSlot(String resou * @return the {@link ServiceCall} object */ public ServiceCall discoverSiteRestoreSlotAsync(String resourceGroupName, String name, String slot, RestoreRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(discoverSiteRestoreSlotAsync(resourceGroupName, name, slot, request), serviceCallback); + return ServiceCall.create(discoverSiteRestoreSlotWithServiceResponseAsync(resourceGroupName, name, slot, request), serviceCallback); + } + + /** + * Discovers existing web app backups that can be restored. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request + * @return the observable to the RestoreRequestInner object + */ + public Observable discoverSiteRestoreSlotAsync(String resourceGroupName, String name, String slot, RestoreRequestInner request) { + return discoverSiteRestoreSlotWithServiceResponseAsync(resourceGroupName, name, slot, request).map(new Func1, RestoreRequestInner>() { + @Override + public RestoreRequestInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11231,7 +13611,7 @@ public ServiceCall discoverSiteRestoreSlotAsync(String reso * @param request Information on restore request * @return the observable to the RestoreRequestInner object */ - public Observable> discoverSiteRestoreSlotAsync(String resourceGroupName, String name, String slot, RestoreRequestInner request) { + public Observable> discoverSiteRestoreSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, RestoreRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11280,17 +13660,16 @@ private ServiceResponse discoverSiteRestoreSlotDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object if successful. */ - public ServiceResponse> listSiteBackups(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList listSiteBackups(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSiteBackupsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listSiteBackupsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -11318,15 +13697,35 @@ public Observable>> call(String nextPageLi * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<BackupItemInner> object + * @return the observable to the PagedList<BackupItemInner> object + */ + public Observable> listSiteBackupsAsync(final String resourceGroupName, final String name) { + return listSiteBackupsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all available backups for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<BackupItemInner> object */ - public Observable>> listSiteBackupsAsync(final String resourceGroupName, final String name) { + public Observable>> listSiteBackupsWithServiceResponseAsync(final String resourceGroupName, final String name) { return listSiteBackupsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listSiteBackupsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSiteBackupsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -11336,7 +13735,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSiteBackupsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -11381,17 +13780,16 @@ private ServiceResponse> listSiteBackupsDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object if successful. */ - public ServiceResponse> listSiteBackupsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList listSiteBackupsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSiteBackupsSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listSiteBackupsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -11421,15 +13819,36 @@ public Observable>> call(String nextPageLi * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<BackupItemInner> object + * @return the observable to the PagedList<BackupItemInner> object + */ + public Observable> listSiteBackupsSlotAsync(final String resourceGroupName, final String name, final String slot) { + return listSiteBackupsSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all available backups for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<BackupItemInner> object */ - public Observable>> listSiteBackupsSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> listSiteBackupsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return listSiteBackupsSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listSiteBackupsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSiteBackupsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -11440,7 +13859,7 @@ public Observable>> call(ServiceResponse

    > * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSiteBackupsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -11488,10 +13907,10 @@ private ServiceResponse> listSiteBackupsSlotDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItemInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItemInner object if successful. */ - public ServiceResponse getSiteBackupStatus(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { - return getSiteBackupStatusAsync(resourceGroupName, name, backupId).toBlocking().single(); + public BackupItemInner getSiteBackupStatus(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { + return getSiteBackupStatusWithServiceResponseAsync(resourceGroupName, name, backupId).toBlocking().single().getBody(); } /** @@ -11504,7 +13923,24 @@ public ServiceResponse getSiteBackupStatus(String resourceGroup * @return the {@link ServiceCall} object */ public ServiceCall getSiteBackupStatusAsync(String resourceGroupName, String name, String backupId, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteBackupStatusAsync(resourceGroupName, name, backupId), serviceCallback); + return ServiceCall.create(getSiteBackupStatusWithServiceResponseAsync(resourceGroupName, name, backupId), serviceCallback); + } + + /** + * Gets status of a web app backup that may be in progress. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup + * @return the observable to the BackupItemInner object + */ + public Observable getSiteBackupStatusAsync(String resourceGroupName, String name, String backupId) { + return getSiteBackupStatusWithServiceResponseAsync(resourceGroupName, name, backupId).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11515,7 +13951,7 @@ public ServiceCall getSiteBackupStatusAsync(String resourceGrou * @param backupId Id of backup * @return the observable to the BackupItemInner object */ - public Observable> getSiteBackupStatusAsync(String resourceGroupName, String name, String backupId) { + public Observable> getSiteBackupStatusWithServiceResponseAsync(String resourceGroupName, String name, String backupId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11561,10 +13997,10 @@ private ServiceResponse getSiteBackupStatusDelegate(Response deleteBackup(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { - return deleteBackupAsync(resourceGroupName, name, backupId).toBlocking().single(); + public BackupItemInner deleteBackup(String resourceGroupName, String name, String backupId) throws CloudException, IOException, IllegalArgumentException { + return deleteBackupWithServiceResponseAsync(resourceGroupName, name, backupId).toBlocking().single().getBody(); } /** @@ -11577,7 +14013,24 @@ public ServiceResponse deleteBackup(String resourceGroupName, S * @return the {@link ServiceCall} object */ public ServiceCall deleteBackupAsync(String resourceGroupName, String name, String backupId, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteBackupAsync(resourceGroupName, name, backupId), serviceCallback); + return ServiceCall.create(deleteBackupWithServiceResponseAsync(resourceGroupName, name, backupId), serviceCallback); + } + + /** + * Deletes a backup from Azure Storage. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup + * @return the observable to the BackupItemInner object + */ + public Observable deleteBackupAsync(String resourceGroupName, String name, String backupId) { + return deleteBackupWithServiceResponseAsync(resourceGroupName, name, backupId).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11588,7 +14041,7 @@ public ServiceCall deleteBackupAsync(String resourceGroupName, * @param backupId Id of backup * @return the observable to the BackupItemInner object */ - public Observable> deleteBackupAsync(String resourceGroupName, String name, String backupId) { + public Observable> deleteBackupWithServiceResponseAsync(String resourceGroupName, String name, String backupId) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11635,10 +14088,10 @@ private ServiceResponse deleteBackupDelegate(Response getSiteBackupStatusSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteBackupStatusSlotAsync(resourceGroupName, name, backupId, slot).toBlocking().single(); + public BackupItemInner getSiteBackupStatusSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteBackupStatusSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot).toBlocking().single().getBody(); } /** @@ -11652,7 +14105,25 @@ public ServiceResponse getSiteBackupStatusSlot(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall getSiteBackupStatusSlotAsync(String resourceGroupName, String name, String backupId, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteBackupStatusSlotAsync(resourceGroupName, name, backupId, slot), serviceCallback); + return ServiceCall.create(getSiteBackupStatusSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot), serviceCallback); + } + + /** + * Gets status of a web app backup that may be in progress. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the BackupItemInner object + */ + public Observable getSiteBackupStatusSlotAsync(String resourceGroupName, String name, String backupId, String slot) { + return getSiteBackupStatusSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11664,7 +14135,7 @@ public ServiceCall getSiteBackupStatusSlotAsync(String resource * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the BackupItemInner object */ - public Observable> getSiteBackupStatusSlotAsync(String resourceGroupName, String name, String backupId, String slot) { + public Observable> getSiteBackupStatusSlotWithServiceResponseAsync(String resourceGroupName, String name, String backupId, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11714,10 +14185,10 @@ private ServiceResponse getSiteBackupStatusSlotDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItemInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItemInner object if successful. */ - public ServiceResponse deleteBackupSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteBackupSlotAsync(resourceGroupName, name, backupId, slot).toBlocking().single(); + public BackupItemInner deleteBackupSlot(String resourceGroupName, String name, String backupId, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteBackupSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot).toBlocking().single().getBody(); } /** @@ -11731,7 +14202,25 @@ public ServiceResponse deleteBackupSlot(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteBackupSlotAsync(resourceGroupName, name, backupId, slot), serviceCallback); + return ServiceCall.create(deleteBackupSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot), serviceCallback); + } + + /** + * Deletes a backup from Azure Storage. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the BackupItemInner object + */ + public Observable deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot) { + return deleteBackupSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11743,7 +14232,7 @@ public ServiceCall deleteBackupSlotAsync(String resourceGroupNa * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the BackupItemInner object */ - public Observable> deleteBackupSlotAsync(String resourceGroupName, String name, String backupId, String slot) { + public Observable> deleteBackupSlotWithServiceResponseAsync(String resourceGroupName, String name, String backupId, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11794,10 +14283,10 @@ private ServiceResponse deleteBackupSlotDelegate(Response getSiteBackupStatusSecretsSlot(String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return getSiteBackupStatusSecretsSlotAsync(resourceGroupName, name, backupId, slot, request).toBlocking().single(); + public BackupItemInner getSiteBackupStatusSecretsSlot(String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return getSiteBackupStatusSecretsSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request).toBlocking().single().getBody(); } /** @@ -11812,7 +14301,26 @@ public ServiceResponse getSiteBackupStatusSecretsSlot(String re * @return the {@link ServiceCall} object */ public ServiceCall getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteBackupStatusSecretsSlotAsync(resourceGroupName, name, backupId, slot, request), serviceCallback); + return ServiceCall.create(getSiteBackupStatusSecretsSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request), serviceCallback); + } + + /** + * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on backup request + * @return the observable to the BackupItemInner object + */ + public Observable getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) { + return getSiteBackupStatusSecretsSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11825,7 +14333,7 @@ public ServiceCall getSiteBackupStatusSecretsSlotAsync(String r * @param request Information on backup request * @return the observable to the BackupItemInner object */ - public Observable> getSiteBackupStatusSecretsSlotAsync(String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) { + public Observable> getSiteBackupStatusSecretsSlotWithServiceResponseAsync(String resourceGroupName, String name, String backupId, String slot, BackupRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11879,10 +14387,10 @@ private ServiceResponse getSiteBackupStatusSecretsSlotDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the BackupItemInner object wrapped in {@link ServiceResponse} if successful. + * @return the BackupItemInner object if successful. */ - public ServiceResponse getSiteBackupStatusSecrets(String resourceGroupName, String name, String backupId, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return getSiteBackupStatusSecretsAsync(resourceGroupName, name, backupId, request).toBlocking().single(); + public BackupItemInner getSiteBackupStatusSecrets(String resourceGroupName, String name, String backupId, BackupRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return getSiteBackupStatusSecretsWithServiceResponseAsync(resourceGroupName, name, backupId, request).toBlocking().single().getBody(); } /** @@ -11896,7 +14404,25 @@ public ServiceResponse getSiteBackupStatusSecrets(String resour * @return the {@link ServiceCall} object */ public ServiceCall getSiteBackupStatusSecretsAsync(String resourceGroupName, String name, String backupId, BackupRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteBackupStatusSecretsAsync(resourceGroupName, name, backupId, request), serviceCallback); + return ServiceCall.create(getSiteBackupStatusSecretsWithServiceResponseAsync(resourceGroupName, name, backupId, request), serviceCallback); + } + + /** + * Gets status of a web app backup that may be in progress, including secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup if a new URL is passed in the request body. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup + * @param request Information on backup request + * @return the observable to the BackupItemInner object + */ + public Observable getSiteBackupStatusSecretsAsync(String resourceGroupName, String name, String backupId, BackupRequestInner request) { + return getSiteBackupStatusSecretsWithServiceResponseAsync(resourceGroupName, name, backupId, request).map(new Func1, BackupItemInner>() { + @Override + public BackupItemInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11908,7 +14434,7 @@ public ServiceCall getSiteBackupStatusSecretsAsync(String resou * @param request Information on backup request * @return the observable to the BackupItemInner object */ - public Observable> getSiteBackupStatusSecretsAsync(String resourceGroupName, String name, String backupId, BackupRequestInner request) { + public Observable> getSiteBackupStatusSecretsWithServiceResponseAsync(String resourceGroupName, String name, String backupId, BackupRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -11960,10 +14486,10 @@ private ServiceResponse getSiteBackupStatusSecretsDelegate(Resp * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the RestoreResponseInner object wrapped in ServiceResponse if successful. + * @return the RestoreResponseInner object if successful. */ - public ServiceResponse restoreSite(String resourceGroupName, String name, String backupId, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return restoreSiteAsync(resourceGroupName, name, backupId, request).toBlocking().last(); + public RestoreResponseInner restoreSite(String resourceGroupName, String name, String backupId, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return restoreSiteWithServiceResponseAsync(resourceGroupName, name, backupId, request).toBlocking().last().getBody(); } /** @@ -11977,7 +14503,25 @@ public ServiceResponse restoreSite(String resourceGroupNam * @return the {@link ServiceCall} object */ public ServiceCall restoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(restoreSiteAsync(resourceGroupName, name, backupId, request), serviceCallback); + return ServiceCall.create(restoreSiteWithServiceResponseAsync(resourceGroupName, name, backupId, request), serviceCallback); + } + + /** + * Restores a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup to restore + * @param request Information on restore request + * @return the observable for the request + */ + public Observable restoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { + return restoreSiteWithServiceResponseAsync(resourceGroupName, name, backupId, request).map(new Func1, RestoreResponseInner>() { + @Override + public RestoreResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -11989,7 +14533,7 @@ public ServiceCall restoreSiteAsync(String resourceGroupNa * @param request Information on restore request * @return the observable for the request */ - public Observable> restoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { + public Observable> restoreSiteWithServiceResponseAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12023,10 +14567,10 @@ public Observable> restoreSiteAsync(String * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RestoreResponseInner object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreResponseInner object if successful. */ - public ServiceResponse beginRestoreSite(String resourceGroupName, String name, String backupId, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return beginRestoreSiteAsync(resourceGroupName, name, backupId, request).toBlocking().single(); + public RestoreResponseInner beginRestoreSite(String resourceGroupName, String name, String backupId, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return beginRestoreSiteWithServiceResponseAsync(resourceGroupName, name, backupId, request).toBlocking().single().getBody(); } /** @@ -12040,7 +14584,25 @@ public ServiceResponse beginRestoreSite(String resourceGro * @return the {@link ServiceCall} object */ public ServiceCall beginRestoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRestoreSiteAsync(resourceGroupName, name, backupId, request), serviceCallback); + return ServiceCall.create(beginRestoreSiteWithServiceResponseAsync(resourceGroupName, name, backupId, request), serviceCallback); + } + + /** + * Restores a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup to restore + * @param request Information on restore request + * @return the observable to the RestoreResponseInner object + */ + public Observable beginRestoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { + return beginRestoreSiteWithServiceResponseAsync(resourceGroupName, name, backupId, request).map(new Func1, RestoreResponseInner>() { + @Override + public RestoreResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -12052,7 +14614,7 @@ public ServiceCall beginRestoreSiteAsync(String resourceGr * @param request Information on restore request * @return the observable to the RestoreResponseInner object */ - public Observable> beginRestoreSiteAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { + public Observable> beginRestoreSiteWithServiceResponseAsync(String resourceGroupName, String name, String backupId, RestoreRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12105,10 +14667,10 @@ private ServiceResponse beginRestoreSiteDelegate(Response< * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters * @throws InterruptedException exception thrown when long running operation is interrupted - * @return the RestoreResponseInner object wrapped in ServiceResponse if successful. + * @return the RestoreResponseInner object if successful. */ - public ServiceResponse restoreSiteSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException, InterruptedException { - return restoreSiteSlotAsync(resourceGroupName, name, backupId, slot, request).toBlocking().last(); + public RestoreResponseInner restoreSiteSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException, InterruptedException { + return restoreSiteSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request).toBlocking().last().getBody(); } /** @@ -12123,7 +14685,26 @@ public ServiceResponse restoreSiteSlot(String resourceGrou * @return the {@link ServiceCall} object */ public ServiceCall restoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(restoreSiteSlotAsync(resourceGroupName, name, backupId, slot, request), serviceCallback); + return ServiceCall.create(restoreSiteSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request), serviceCallback); + } + + /** + * Restores a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup to restore + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request + * @return the observable for the request + */ + public Observable restoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { + return restoreSiteSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request).map(new Func1, RestoreResponseInner>() { + @Override + public RestoreResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -12136,7 +14717,7 @@ public ServiceCall restoreSiteSlotAsync(String resourceGro * @param request Information on restore request * @return the observable for the request */ - public Observable> restoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { + public Observable> restoreSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12174,10 +14755,10 @@ public Observable> restoreSiteSlotAsync(St * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RestoreResponseInner object wrapped in {@link ServiceResponse} if successful. + * @return the RestoreResponseInner object if successful. */ - public ServiceResponse beginRestoreSiteSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { - return beginRestoreSiteSlotAsync(resourceGroupName, name, backupId, slot, request).toBlocking().single(); + public RestoreResponseInner beginRestoreSiteSlot(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) throws CloudException, IOException, IllegalArgumentException { + return beginRestoreSiteSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request).toBlocking().single().getBody(); } /** @@ -12192,7 +14773,26 @@ public ServiceResponse beginRestoreSiteSlot(String resourc * @return the {@link ServiceCall} object */ public ServiceCall beginRestoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request, final ServiceCallback serviceCallback) { - return ServiceCall.create(beginRestoreSiteSlotAsync(resourceGroupName, name, backupId, slot, request), serviceCallback); + return ServiceCall.create(beginRestoreSiteSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request), serviceCallback); + } + + /** + * Restores a web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param backupId Id of backup to restore + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param request Information on restore request + * @return the observable to the RestoreResponseInner object + */ + public Observable beginRestoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { + return beginRestoreSiteSlotWithServiceResponseAsync(resourceGroupName, name, backupId, slot, request).map(new Func1, RestoreResponseInner>() { + @Override + public RestoreResponseInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -12205,7 +14805,7 @@ public ServiceCall beginRestoreSiteSlotAsync(String resour * @param request Information on restore request * @return the observable to the RestoreResponseInner object */ - public Observable> beginRestoreSiteSlotAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { + public Observable> beginRestoreSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String backupId, String slot, RestoreRequestInner request) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -12257,17 +14857,16 @@ private ServiceResponse beginRestoreSiteSlotDelegate(Respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object if successful. */ - public ServiceResponse> getSiteUsages(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteUsages(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteUsagesSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12295,15 +14894,35 @@ public Observable>> call(String nextPag * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getSiteUsagesAsync(final String resourceGroupName, final String name) { + return getSiteUsagesWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getSiteUsagesAsync(final String resourceGroupName, final String name) { + public Observable>> getSiteUsagesWithServiceResponseAsync(final String resourceGroupName, final String name) { return getSiteUsagesSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12313,7 +14932,7 @@ public Observable>> call(ServiceRespons * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteUsagesSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -12352,17 +14971,16 @@ public Observable>> call(Response> getSiteUsages(final String resourceGroupName, final String name, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteUsages(final String resourceGroupName, final String name, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteUsagesSinglePageAsync(resourceGroupName, name, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12392,15 +15010,36 @@ public Observable>> call(String nextPag * @param resourceGroupName Name of resource group * @param name Name of web app * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getSiteUsagesAsync(final String resourceGroupName, final String name, final String filter) { + return getSiteUsagesWithServiceResponseAsync(resourceGroupName, name, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getSiteUsagesAsync(final String resourceGroupName, final String name, final String filter) { + public Observable>> getSiteUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String filter) { return getSiteUsagesSinglePageAsync(resourceGroupName, name, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12411,7 +15050,7 @@ public Observable>> call(ServiceRespons ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteUsagesSinglePageAsync(final String resourceGroupName, final String name, final String filter) { if (resourceGroupName == null) { @@ -12456,17 +15095,16 @@ private ServiceResponse> getSiteUsagesDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object if successful. */ - public ServiceResponse> getSiteUsagesSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteUsagesSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteUsagesSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteUsagesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12496,15 +15134,36 @@ public Observable>> call(String nextPag * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getSiteUsagesSlotAsync(final String resourceGroupName, final String name, final String slot) { + return getSiteUsagesSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getSiteUsagesSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> getSiteUsagesSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return getSiteUsagesSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteUsagesSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteUsagesSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12515,7 +15174,7 @@ public Observable>> call(ServiceRespons * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteUsagesSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -12558,17 +15217,16 @@ public Observable>> call(Response> getSiteUsagesSlot(final String resourceGroupName, final String name, final String slot, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteUsagesSlot(final String resourceGroupName, final String name, final String slot, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteUsagesSlotSinglePageAsync(resourceGroupName, name, slot, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteUsagesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12600,15 +15258,37 @@ public Observable>> call(String nextPag * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getSiteUsagesSlotAsync(final String resourceGroupName, final String name, final String slot, final String filter) { + return getSiteUsagesSlotWithServiceResponseAsync(resourceGroupName, name, slot, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the quota usage numbers for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getSiteUsagesSlotAsync(final String resourceGroupName, final String name, final String slot, final String filter) { + public Observable>> getSiteUsagesSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot, final String filter) { return getSiteUsagesSlotSinglePageAsync(resourceGroupName, name, slot, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteUsagesSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteUsagesSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12620,7 +15300,7 @@ public Observable>> call(ServiceRespons ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. ServiceResponse> * @param filter Return only usages specified in the filter. Filter is specified by using OData syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteUsagesSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot, final String filter) { if (resourceGroupName == null) { @@ -12667,17 +15347,16 @@ private ServiceResponse> getSiteUsagesSlotDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getSiteMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetrics(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12705,15 +15384,35 @@ public Observable>> call(String nextPa * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getSiteMetricsAsync(final String resourceGroupName, final String name) { + public Observable> getSiteMetricsAsync(final String resourceGroupName, final String name) { + return getSiteMetricsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getSiteMetricsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getSiteMetricsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12723,7 +15422,7 @@ public Observable>> call(ServiceRespon * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -12764,17 +15463,16 @@ public Observable>> call(Response> getSiteMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetrics(final String resourceGroupName, final String name, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricsSinglePageAsync(resourceGroupName, name, details, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12806,15 +15504,37 @@ public Observable>> call(String nextPa * @param name Name of web app * @param details If true, metric details are included in response * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getSiteMetricsAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { + return getSiteMetricsWithServiceResponseAsync(resourceGroupName, name, details, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param details If true, metric details are included in response + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getSiteMetricsAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { + public Observable>> getSiteMetricsWithServiceResponseAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { return getSiteMetricsSinglePageAsync(resourceGroupName, name, details, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12826,7 +15546,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param name Name of web app ServiceResponse> * @param details If true, metric details are included in response ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricsSinglePageAsync(final String resourceGroupName, final String name, final Boolean details, final String filter) { if (resourceGroupName == null) { @@ -12871,17 +15591,16 @@ private ServiceResponse> getSiteMetricsDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getSiteMetricsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricsSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -12911,15 +15630,36 @@ public Observable>> call(String nextPa * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getSiteMetricsSlotAsync(final String resourceGroupName, final String name, final String slot) { + return getSiteMetricsSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getSiteMetricsSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> getSiteMetricsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return getSiteMetricsSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -12930,7 +15670,7 @@ public Observable>> call(ServiceRespon * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -12975,17 +15715,16 @@ public Observable>> call(Response> getSiteMetricsSlot(final String resourceGroupName, final String name, final String slot, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricsSlot(final String resourceGroupName, final String name, final String slot, final Boolean details, final String filter) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricsSlotSinglePageAsync(resourceGroupName, name, slot, details, filter).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -13019,15 +15758,38 @@ public Observable>> call(String nextPa * @param slot Name of web app slot. If not specified then will default to production slot. * @param details If true, metric details are included in response * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getSiteMetricsSlotAsync(final String resourceGroupName, final String name, final String slot, final Boolean details, final String filter) { + return getSiteMetricsSlotWithServiceResponseAsync(resourceGroupName, name, slot, details, filter) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metrics for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param details If true, metric details are included in response + * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getSiteMetricsSlotAsync(final String resourceGroupName, final String name, final String slot, final Boolean details, final String filter) { + public Observable>> getSiteMetricsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot, final Boolean details, final String filter) { return getSiteMetricsSlotSinglePageAsync(resourceGroupName, name, slot, details, filter) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -13040,7 +15802,7 @@ public Observable>> call(ServiceRespon ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. ServiceResponse> * @param details If true, metric details are included in response ServiceResponse> * @param filter Return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot, final Boolean details, final String filter) { if (resourceGroupName == null) { @@ -13088,17 +15850,16 @@ private ServiceResponse> getSiteMetricsSlotDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getSiteMetricDefinitionsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricDefinitionsSlot(final String resourceGroupName, final String name, final String slot) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricDefinitionsSlotSinglePageAsync(resourceGroupName, name, slot).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricDefinitionsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -13128,15 +15889,36 @@ public Observable>> call(String next * @param resourceGroupName Name of resource group * @param name Name of web app * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getSiteMetricDefinitionsSlotAsync(final String resourceGroupName, final String name, final String slot) { + return getSiteMetricDefinitionsSlotWithServiceResponseAsync(resourceGroupName, name, slot) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metric definitions for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getSiteMetricDefinitionsSlotAsync(final String resourceGroupName, final String name, final String slot) { + public Observable>> getSiteMetricDefinitionsSlotWithServiceResponseAsync(final String resourceGroupName, final String name, final String slot) { return getSiteMetricDefinitionsSlotSinglePageAsync(resourceGroupName, name, slot) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricDefinitionsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricDefinitionsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -13147,7 +15929,7 @@ public Observable>> call(ServiceResp ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app ServiceResponse> * @param slot Name of web app slot. If not specified then will default to production slot. - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricDefinitionsSlotSinglePageAsync(final String resourceGroupName, final String name, final String slot) { if (resourceGroupName == null) { @@ -13194,17 +15976,16 @@ private ServiceResponse> getSiteMetricDefinition * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getSiteMetricDefinitions(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricDefinitions(final String resourceGroupName, final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricDefinitionsSinglePageAsync(resourceGroupName, name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -13232,15 +16013,35 @@ public Observable>> call(String next * * @param resourceGroupName Name of resource group * @param name Name of web app - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getSiteMetricDefinitionsAsync(final String resourceGroupName, final String name) { + return getSiteMetricDefinitionsWithServiceResponseAsync(resourceGroupName, name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metric definitions for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getSiteMetricDefinitionsAsync(final String resourceGroupName, final String name) { + public Observable>> getSiteMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name) { return getSiteMetricDefinitionsSinglePageAsync(resourceGroupName, name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricDefinitionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricDefinitionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -13250,7 +16051,7 @@ public Observable>> call(ServiceResp * ServiceResponse> * @param resourceGroupName Name of resource group ServiceResponse> * @param name Name of web app - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricDefinitionsSinglePageAsync(final String resourceGroupName, final String name) { if (resourceGroupName == null) { @@ -13294,10 +16095,10 @@ private ServiceResponse> getSiteMetricDefinition * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object if successful. */ - public ServiceResponse listSitePublishingProfileXml(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSitePublishingProfileXmlAsync(resourceGroupName, name).toBlocking().single(); + public InputStream listSitePublishingProfileXml(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSitePublishingProfileXmlWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -13309,7 +16110,23 @@ public ServiceResponse listSitePublishingProfileXml(String resource * @return the {@link ServiceCall} object */ public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePublishingProfileXmlAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSitePublishingProfileXmlWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the InputStream object + */ + public Observable listSitePublishingProfileXmlAsync(String resourceGroupName, String name) { + return listSitePublishingProfileXmlWithServiceResponseAsync(resourceGroupName, name).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13319,7 +16136,7 @@ public ServiceCall listSitePublishingProfileXmlAsync(String resourc * @param name Name of web app * @return the observable to the InputStream object */ - public Observable> listSitePublishingProfileXmlAsync(String resourceGroupName, String name) { + public Observable> listSitePublishingProfileXmlWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13361,10 +16178,10 @@ public Observable> call(Response resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object if successful. */ - public ServiceResponse listSitePublishingProfileXml(String resourceGroupName, String name, String format) throws CloudException, IOException, IllegalArgumentException { - return listSitePublishingProfileXmlAsync(resourceGroupName, name, format).toBlocking().single(); + public InputStream listSitePublishingProfileXml(String resourceGroupName, String name, String format) throws CloudException, IOException, IllegalArgumentException { + return listSitePublishingProfileXmlWithServiceResponseAsync(resourceGroupName, name, format).toBlocking().single().getBody(); } /** @@ -13380,7 +16197,7 @@ public ServiceResponse listSitePublishingProfileXml(String resource * @return the {@link ServiceCall} object */ public ServiceCall listSitePublishingProfileXmlAsync(String resourceGroupName, String name, String format, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePublishingProfileXmlAsync(resourceGroupName, name, format), serviceCallback); + return ServiceCall.create(listSitePublishingProfileXmlWithServiceResponseAsync(resourceGroupName, name, format), serviceCallback); } /** @@ -13394,7 +16211,27 @@ public ServiceCall listSitePublishingProfileXmlAsync(String resourc Ftp * @return the observable to the InputStream object */ - public Observable> listSitePublishingProfileXmlAsync(String resourceGroupName, String name, String format) { + public Observable listSitePublishingProfileXmlAsync(String resourceGroupName, String name, String format) { + return listSitePublishingProfileXmlWithServiceResponseAsync(resourceGroupName, name, format).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param format Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp + * @return the observable to the InputStream object + */ + public Observable> listSitePublishingProfileXmlWithServiceResponseAsync(String resourceGroupName, String name, String format) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13439,10 +16276,10 @@ private ServiceResponse listSitePublishingProfileXmlDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object if successful. */ - public ServiceResponse listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSitePublishingProfileXmlSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public InputStream listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSitePublishingProfileXmlSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -13455,7 +16292,24 @@ public ServiceResponse listSitePublishingProfileXmlSlot(String reso * @return the {@link ServiceCall} object */ public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePublishingProfileXmlSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSitePublishingProfileXmlSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the InputStream object + */ + public Observable listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot) { + return listSitePublishingProfileXmlSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13466,7 +16320,7 @@ public ServiceCall listSitePublishingProfileXmlSlotAsync(String res * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the InputStream object */ - public Observable> listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSitePublishingProfileXmlSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13512,10 +16366,10 @@ public Observable> call(Response resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the InputStream object wrapped in {@link ServiceResponse} if successful. + * @return the InputStream object if successful. */ - public ServiceResponse listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot, String format) throws CloudException, IOException, IllegalArgumentException { - return listSitePublishingProfileXmlSlotAsync(resourceGroupName, name, slot, format).toBlocking().single(); + public InputStream listSitePublishingProfileXmlSlot(String resourceGroupName, String name, String slot, String format) throws CloudException, IOException, IllegalArgumentException { + return listSitePublishingProfileXmlSlotWithServiceResponseAsync(resourceGroupName, name, slot, format).toBlocking().single().getBody(); } /** @@ -13532,7 +16386,28 @@ public ServiceResponse listSitePublishingProfileXmlSlot(String reso * @return the {@link ServiceCall} object */ public ServiceCall listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, String format, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSitePublishingProfileXmlSlotAsync(resourceGroupName, name, slot, format), serviceCallback); + return ServiceCall.create(listSitePublishingProfileXmlSlotWithServiceResponseAsync(resourceGroupName, name, slot, format), serviceCallback); + } + + /** + * Gets the publishing profile for web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param format Name of the format. Valid values are: + FileZilla3 + WebDeploy -- default + Ftp + * @return the observable to the InputStream object + */ + public Observable listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, String format) { + return listSitePublishingProfileXmlSlotWithServiceResponseAsync(resourceGroupName, name, slot, format).map(new Func1, InputStream>() { + @Override + public InputStream call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13547,7 +16422,7 @@ public ServiceCall listSitePublishingProfileXmlSlotAsync(String res Ftp * @return the observable to the InputStream object */ - public Observable> listSitePublishingProfileXmlSlotAsync(String resourceGroupName, String name, String slot, String format) { + public Observable> listSitePublishingProfileXmlSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, String format) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13595,10 +16470,10 @@ private ServiceResponse listSitePublishingProfileXmlSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse restartSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return restartSiteSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object restartSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return restartSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -13611,7 +16486,24 @@ public ServiceResponse restartSiteSlot(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall restartSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartSiteSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(restartSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable restartSiteSlotAsync(String resourceGroupName, String name, String slot) { + return restartSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13622,7 +16514,7 @@ public ServiceCall restartSiteSlotAsync(String resourceGroupName, String * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> restartSiteSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> restartSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13665,10 +16557,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse restartSiteSlot(String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) throws CloudException, IOException, IllegalArgumentException { - return restartSiteSlotAsync(resourceGroupName, name, slot, softRestart, synchronous).toBlocking().single(); + public Object restartSiteSlot(String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) throws CloudException, IOException, IllegalArgumentException { + return restartSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, softRestart, synchronous).toBlocking().single().getBody(); } /** @@ -13683,7 +16575,26 @@ public ServiceResponse restartSiteSlot(String resourceGroupName, String * @return the {@link ServiceCall} object */ public ServiceCall restartSiteSlotAsync(String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartSiteSlotAsync(resourceGroupName, name, slot, softRestart, synchronous), serviceCallback); + return ServiceCall.create(restartSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, softRestart, synchronous), serviceCallback); + } + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @param softRestart Soft restart applies the configuration settings and restarts the app if necessary. Hard restart always restarts and reprovisions the app + * @param synchronous If true then the API will block until the app has been restarted + * @return the observable to the Object object + */ + public Observable restartSiteSlotAsync(String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) { + return restartSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot, softRestart, synchronous).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13696,7 +16607,7 @@ public ServiceCall restartSiteSlotAsync(String resourceGroupName, String * @param synchronous If true then the API will block until the app has been restarted * @return the observable to the Object object */ - public Observable> restartSiteSlotAsync(String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) { + public Observable> restartSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot, Boolean softRestart, Boolean synchronous) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13741,10 +16652,10 @@ private ServiceResponse restartSiteSlotDelegate(Response r * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse restartSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return restartSiteAsync(resourceGroupName, name).toBlocking().single(); + public Object restartSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return restartSiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -13756,7 +16667,23 @@ public ServiceResponse restartSite(String resourceGroupName, String name * @return the {@link ServiceCall} object */ public ServiceCall restartSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartSiteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(restartSiteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the Object object + */ + public Observable restartSiteAsync(String resourceGroupName, String name) { + return restartSiteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13766,7 +16693,7 @@ public ServiceCall restartSiteAsync(String resourceGroupName, String nam * @param name Name of web app * @return the observable to the Object object */ - public Observable> restartSiteAsync(String resourceGroupName, String name) { + public Observable> restartSiteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13805,10 +16732,10 @@ public Observable> call(Response response) * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse restartSite(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) throws CloudException, IOException, IllegalArgumentException { - return restartSiteAsync(resourceGroupName, name, softRestart, synchronous).toBlocking().single(); + public Object restartSite(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) throws CloudException, IOException, IllegalArgumentException { + return restartSiteWithServiceResponseAsync(resourceGroupName, name, softRestart, synchronous).toBlocking().single().getBody(); } /** @@ -13822,7 +16749,7 @@ public ServiceResponse restartSite(String resourceGroupName, String name * @return the {@link ServiceCall} object */ public ServiceCall restartSiteAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous, final ServiceCallback serviceCallback) { - return ServiceCall.create(restartSiteAsync(resourceGroupName, name, softRestart, synchronous), serviceCallback); + return ServiceCall.create(restartSiteWithServiceResponseAsync(resourceGroupName, name, softRestart, synchronous), serviceCallback); } /** @@ -13834,7 +16761,25 @@ public ServiceCall restartSiteAsync(String resourceGroupName, String nam * @param synchronous If true then the API will block until the app has been restarted * @return the observable to the Object object */ - public Observable> restartSiteAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) { + public Observable restartSiteAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) { + return restartSiteWithServiceResponseAsync(resourceGroupName, name, softRestart, synchronous).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Restarts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param softRestart Soft restart applies the configuration settings and restarts the app if necessary. Hard restart always restarts and reprovisions the app + * @param synchronous If true then the API will block until the app has been restarted + * @return the observable to the Object object + */ + public Observable> restartSiteWithServiceResponseAsync(String resourceGroupName, String name, Boolean softRestart, Boolean synchronous) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13876,10 +16821,10 @@ private ServiceResponse restartSiteDelegate(Response respo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse startSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return startSiteAsync(resourceGroupName, name).toBlocking().single(); + public Object startSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return startSiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -13891,7 +16836,23 @@ public ServiceResponse startSite(String resourceGroupName, String name) * @return the {@link ServiceCall} object */ public ServiceCall startSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(startSiteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(startSiteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Starts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the Object object + */ + public Observable startSiteAsync(String resourceGroupName, String name) { + return startSiteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13901,7 +16862,7 @@ public ServiceCall startSiteAsync(String resourceGroupName, String name, * @param name Name of web app * @return the observable to the Object object */ - public Observable> startSiteAsync(String resourceGroupName, String name) { + public Observable> startSiteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -13944,10 +16905,10 @@ private ServiceResponse startSiteDelegate(Response respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse startSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return startSiteSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object startSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return startSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -13960,7 +16921,24 @@ public ServiceResponse startSiteSlot(String resourceGroupName, String na * @return the {@link ServiceCall} object */ public ServiceCall startSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(startSiteSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(startSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Starts web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable startSiteSlotAsync(String resourceGroupName, String name, String slot) { + return startSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -13971,7 +16949,7 @@ public ServiceCall startSiteSlotAsync(String resourceGroupName, String n * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> startSiteSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> startSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14016,10 +16994,10 @@ private ServiceResponse startSiteSlotDelegate(Response res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse stopSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return stopSiteAsync(resourceGroupName, name).toBlocking().single(); + public Object stopSite(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return stopSiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -14031,7 +17009,23 @@ public ServiceResponse stopSite(String resourceGroupName, String name) t * @return the {@link ServiceCall} object */ public ServiceCall stopSiteAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(stopSiteAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(stopSiteWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Stops web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the Object object + */ + public Observable stopSiteAsync(String resourceGroupName, String name) { + return stopSiteWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14041,7 +17035,7 @@ public ServiceCall stopSiteAsync(String resourceGroupName, String name, * @param name Name of web app * @return the observable to the Object object */ - public Observable> stopSiteAsync(String resourceGroupName, String name) { + public Observable> stopSiteWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14084,10 +17078,10 @@ private ServiceResponse stopSiteDelegate(Response response * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse stopSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return stopSiteSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object stopSiteSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return stopSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -14100,7 +17094,24 @@ public ServiceResponse stopSiteSlot(String resourceGroupName, String nam * @return the {@link ServiceCall} object */ public ServiceCall stopSiteSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(stopSiteSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(stopSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Stops web app. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable stopSiteSlotAsync(String resourceGroupName, String name, String slot) { + return stopSiteSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14111,7 +17122,7 @@ public ServiceCall stopSiteSlotAsync(String resourceGroupName, String na * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> stopSiteSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> stopSiteSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14155,10 +17166,10 @@ private ServiceResponse stopSiteSlotDelegate(Response resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse syncSiteRepository(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return syncSiteRepositoryAsync(resourceGroupName, name).toBlocking().single(); + public Object syncSiteRepository(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return syncSiteRepositoryWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -14169,7 +17180,22 @@ public ServiceResponse syncSiteRepository(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall syncSiteRepositoryAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(syncSiteRepositoryAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(syncSiteRepositoryWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @return the observable to the Object object + */ + public Observable syncSiteRepositoryAsync(String resourceGroupName, String name) { + return syncSiteRepositoryWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14178,7 +17204,7 @@ public ServiceCall syncSiteRepositoryAsync(String resourceGroupName, Str * @param name the String value * @return the observable to the Object object */ - public Observable> syncSiteRepositoryAsync(String resourceGroupName, String name) { + public Observable> syncSiteRepositoryWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14220,10 +17246,10 @@ private ServiceResponse syncSiteRepositoryDelegate(Response syncSiteRepositorySlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return syncSiteRepositorySlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object syncSiteRepositorySlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return syncSiteRepositorySlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -14235,7 +17261,23 @@ public ServiceResponse syncSiteRepositorySlot(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall syncSiteRepositorySlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(syncSiteRepositorySlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(syncSiteRepositorySlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * + * @param resourceGroupName the String value + * @param name the String value + * @param slot the String value + * @return the observable to the Object object + */ + public Observable syncSiteRepositorySlotAsync(String resourceGroupName, String name, String slot) { + return syncSiteRepositorySlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14245,7 +17287,7 @@ public ServiceCall syncSiteRepositorySlotAsync(String resourceGroupName, * @param slot the String value * @return the observable to the Object object */ - public Observable> syncSiteRepositorySlotAsync(String resourceGroupName, String name, String slot) { + public Observable> syncSiteRepositorySlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14291,10 +17333,10 @@ private ServiceResponse syncSiteRepositorySlotDelegate(Response generateNewSitePublishingPasswordSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return generateNewSitePublishingPasswordSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public Object generateNewSitePublishingPasswordSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return generateNewSitePublishingPasswordSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -14307,7 +17349,7 @@ public ServiceResponse generateNewSitePublishingPasswordSlot(String reso * @return the {@link ServiceCall} object */ public ServiceCall generateNewSitePublishingPasswordSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(generateNewSitePublishingPasswordSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(generateNewSitePublishingPasswordSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); } /** @@ -14318,7 +17360,24 @@ public ServiceCall generateNewSitePublishingPasswordSlotAsync(String res * @param slot Name of web app slot. If not specified then will default to production slot. * @return the observable to the Object object */ - public Observable> generateNewSitePublishingPasswordSlotAsync(String resourceGroupName, String name, String slot) { + public Observable generateNewSitePublishingPasswordSlotAsync(String resourceGroupName, String name, String slot) { + return generateNewSitePublishingPasswordSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Generates new random app publishing password. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @param slot Name of web app slot. If not specified then will default to production slot. + * @return the observable to the Object object + */ + public Observable> generateNewSitePublishingPasswordSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14363,10 +17422,10 @@ private ServiceResponse generateNewSitePublishingPasswordSlotDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse generateNewSitePublishingPassword(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return generateNewSitePublishingPasswordAsync(resourceGroupName, name).toBlocking().single(); + public Object generateNewSitePublishingPassword(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return generateNewSitePublishingPasswordWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -14378,7 +17437,23 @@ public ServiceResponse generateNewSitePublishingPassword(String resource * @return the {@link ServiceCall} object */ public ServiceCall generateNewSitePublishingPasswordAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(generateNewSitePublishingPasswordAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(generateNewSitePublishingPasswordWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Generates new random app publishing password. + * + * @param resourceGroupName Name of resource group + * @param name Name of web app + * @return the observable to the Object object + */ + public Observable generateNewSitePublishingPasswordAsync(String resourceGroupName, String name) { + return generateNewSitePublishingPasswordWithServiceResponseAsync(resourceGroupName, name).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14388,7 +17463,7 @@ public ServiceCall generateNewSitePublishingPasswordAsync(String resourc * @param name Name of web app * @return the observable to the Object object */ - public Observable> generateNewSitePublishingPasswordAsync(String resourceGroupName, String name) { + public Observable> generateNewSitePublishingPasswordWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14431,10 +17506,10 @@ private ServiceResponse generateNewSitePublishingPasswordDelegate(Respon * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse getSiteRelayServiceConnection(String resourceGroupName, String name, String entityName) throws CloudException, IOException, IllegalArgumentException { - return getSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName).toBlocking().single(); + public RelayServiceConnectionEntityInner getSiteRelayServiceConnection(String resourceGroupName, String name, String entityName) throws CloudException, IOException, IllegalArgumentException { + return getSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName).toBlocking().single().getBody(); } /** @@ -14447,7 +17522,24 @@ public ServiceResponse getSiteRelayServiceCon * @return the {@link ServiceCall} object */ public ServiceCall getSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName), serviceCallback); + return ServiceCall.create(getSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName), serviceCallback); + } + + /** + * Retrieves a Biztalk Hybrid Connection identified by its entity name. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable getSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName) { + return getSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14458,7 +17550,7 @@ public ServiceCall getSiteRelayServiceConnect * @param entityName The name by which the Hybrid Connection is identified * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> getSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName) { + public Observable> getSiteRelayServiceConnectionWithServiceResponseAsync(String resourceGroupName, String name, String entityName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14505,10 +17597,10 @@ private ServiceResponse getSiteRelayServiceCo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse createOrUpdateSiteRelayServiceConnection(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName, connectionEnvelope).toBlocking().single(); + public RelayServiceConnectionEntityInner createOrUpdateSiteRelayServiceConnection(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -14522,7 +17614,25 @@ public ServiceResponse createOrUpdateSiteRela * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName, connectionEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName, connectionEnvelope), serviceCallback); + } + + /** + * Creates a new association to a Biztalk Hybrid Connection, or updates an existing one. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @param connectionEnvelope The details of the Hybrid Connection + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable createOrUpdateSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) { + return createOrUpdateSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName, connectionEnvelope).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14534,7 +17644,7 @@ public ServiceCall createOrUpdateSiteRelaySer * @param connectionEnvelope The details of the Hybrid Connection * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> createOrUpdateSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) { + public Observable> createOrUpdateSiteRelayServiceConnectionWithServiceResponseAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14584,10 +17694,10 @@ private ServiceResponse createOrUpdateSiteRel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteRelayServiceConnection(String resourceGroupName, String name, String entityName) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName).toBlocking().single(); + public Object deleteSiteRelayServiceConnection(String resourceGroupName, String name, String entityName) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName).toBlocking().single().getBody(); } /** @@ -14600,7 +17710,7 @@ public ServiceResponse deleteSiteRelayServiceConnection(String resourceG * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName), serviceCallback); + return ServiceCall.create(deleteSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName), serviceCallback); } /** @@ -14611,7 +17721,24 @@ public ServiceCall deleteSiteRelayServiceConnectionAsync(String resource * @param entityName The name by which the Hybrid Connection is identified * @return the observable to the Object object */ - public Observable> deleteSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName) { + public Observable deleteSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName) { + return deleteSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Removes the association to a Biztalk Hybrid Connection, identified by its entity name. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @return the observable to the Object object + */ + public Observable> deleteSiteRelayServiceConnectionWithServiceResponseAsync(String resourceGroupName, String name, String entityName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14658,10 +17785,10 @@ private ServiceResponse deleteSiteRelayServiceConnectionDelegate(Respons * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse updateSiteRelayServiceConnection(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName, connectionEnvelope).toBlocking().single(); + public RelayServiceConnectionEntityInner updateSiteRelayServiceConnection(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -14675,7 +17802,25 @@ public ServiceResponse updateSiteRelayService * @return the {@link ServiceCall} object */ public ServiceCall updateSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteRelayServiceConnectionAsync(resourceGroupName, name, entityName, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName, connectionEnvelope), serviceCallback); + } + + /** + * Creates a new association to a Biztalk Hybrid Connection, or updates an existing one. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @param connectionEnvelope The details of the Hybrid Connection + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable updateSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) { + return updateSiteRelayServiceConnectionWithServiceResponseAsync(resourceGroupName, name, entityName, connectionEnvelope).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14687,7 +17832,7 @@ public ServiceCall updateSiteRelayServiceConn * @param connectionEnvelope The details of the Hybrid Connection * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> updateSiteRelayServiceConnectionAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) { + public Observable> updateSiteRelayServiceConnectionWithServiceResponseAsync(String resourceGroupName, String name, String entityName, RelayServiceConnectionEntityInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14738,10 +17883,10 @@ private ServiceResponse updateSiteRelayServic * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse getSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot).toBlocking().single(); + public RelayServiceConnectionEntityInner getSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot).toBlocking().single().getBody(); } /** @@ -14755,7 +17900,25 @@ public ServiceResponse getSiteRelayServiceCon * @return the {@link ServiceCall} object */ public ServiceCall getSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot), serviceCallback); + return ServiceCall.create(getSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot), serviceCallback); + } + + /** + * Retrieves a Biztalk Hybrid Connection identified by its entity name. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @param slot The name of the slot for the web app. + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable getSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot) { + return getSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14767,7 +17930,7 @@ public ServiceCall getSiteRelayServiceConnect * @param slot The name of the slot for the web app. * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> getSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot) { + public Observable> getSiteRelayServiceConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String entityName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14818,10 +17981,10 @@ private ServiceResponse getSiteRelayServiceCo * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse createOrUpdateSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot, connectionEnvelope).toBlocking().single(); + public RelayServiceConnectionEntityInner createOrUpdateSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -14836,7 +17999,26 @@ public ServiceResponse createOrUpdateSiteRela * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot, connectionEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot, connectionEnvelope), serviceCallback); + } + + /** + * Creates a new association to a Biztalk Hybrid Connection, or updates an existing one. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @param slot The name of the slot for the web app. + * @param connectionEnvelope The details of the Hybrid Connection + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable createOrUpdateSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) { + return createOrUpdateSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot, connectionEnvelope).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14849,7 +18031,7 @@ public ServiceCall createOrUpdateSiteRelaySer * @param connectionEnvelope The details of the Hybrid Connection * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> createOrUpdateSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) { + public Observable> createOrUpdateSiteRelayServiceConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14903,10 +18085,10 @@ private ServiceResponse createOrUpdateSiteRel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse deleteSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot) throws CloudException, IOException, IllegalArgumentException { - return deleteSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot).toBlocking().single(); + public Object deleteSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot) throws CloudException, IOException, IllegalArgumentException { + return deleteSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot).toBlocking().single().getBody(); } /** @@ -14920,7 +18102,25 @@ public ServiceResponse deleteSiteRelayServiceConnectionSlot(String resou * @return the {@link ServiceCall} object */ public ServiceCall deleteSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(deleteSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot), serviceCallback); + return ServiceCall.create(deleteSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot), serviceCallback); + } + + /** + * Removes the association to a Biztalk Hybrid Connection, identified by its entity name. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @param slot The name of the slot for the web app. + * @return the observable to the Object object + */ + public Observable deleteSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot) { + return deleteSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -14932,7 +18132,7 @@ public ServiceCall deleteSiteRelayServiceConnectionSlotAsync(String reso * @param slot The name of the slot for the web app. * @return the observable to the Object object */ - public Observable> deleteSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot) { + public Observable> deleteSiteRelayServiceConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String entityName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -14983,10 +18183,10 @@ private ServiceResponse deleteSiteRelayServiceConnectionSlotDelegate(Res * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse updateSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot, connectionEnvelope).toBlocking().single(); + public RelayServiceConnectionEntityInner updateSiteRelayServiceConnectionSlot(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -15001,7 +18201,26 @@ public ServiceResponse updateSiteRelayService * @return the {@link ServiceCall} object */ public ServiceCall updateSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteRelayServiceConnectionSlotAsync(resourceGroupName, name, entityName, slot, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot, connectionEnvelope), serviceCallback); + } + + /** + * Creates a new association to a Biztalk Hybrid Connection, or updates an existing one. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param entityName The name by which the Hybrid Connection is identified + * @param slot The name of the slot for the web app. + * @param connectionEnvelope The details of the Hybrid Connection + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable updateSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) { + return updateSiteRelayServiceConnectionSlotWithServiceResponseAsync(resourceGroupName, name, entityName, slot, connectionEnvelope).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15014,7 +18233,7 @@ public ServiceCall updateSiteRelayServiceConn * @param connectionEnvelope The details of the Hybrid Connection * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> updateSiteRelayServiceConnectionSlotAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) { + public Observable> updateSiteRelayServiceConnectionSlotWithServiceResponseAsync(String resourceGroupName, String name, String entityName, String slot, RelayServiceConnectionEntityInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15067,10 +18286,10 @@ private ServiceResponse updateSiteRelayServic * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse listSiteRelayServiceConnectionsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return listSiteRelayServiceConnectionsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public RelayServiceConnectionEntityInner listSiteRelayServiceConnectionsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return listSiteRelayServiceConnectionsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -15083,7 +18302,24 @@ public ServiceResponse listSiteRelayServiceCo * @return the {@link ServiceCall} object */ public ServiceCall listSiteRelayServiceConnectionsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteRelayServiceConnectionsSlotAsync(resourceGroupName, name, slot), serviceCallback); + return ServiceCall.create(listSiteRelayServiceConnectionsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Retrieves all Biztalk Hybrid Connections associated with this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param slot The name of the slot for the web app. + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable listSiteRelayServiceConnectionsSlotAsync(String resourceGroupName, String name, String slot) { + return listSiteRelayServiceConnectionsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15094,7 +18330,7 @@ public ServiceCall listSiteRelayServiceConnec * @param slot The name of the slot for the web app. * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> listSiteRelayServiceConnectionsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable> listSiteRelayServiceConnectionsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15139,10 +18375,10 @@ private ServiceResponse listSiteRelayServiceC * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the RelayServiceConnectionEntityInner object wrapped in {@link ServiceResponse} if successful. + * @return the RelayServiceConnectionEntityInner object if successful. */ - public ServiceResponse listSiteRelayServiceConnections(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return listSiteRelayServiceConnectionsAsync(resourceGroupName, name).toBlocking().single(); + public RelayServiceConnectionEntityInner listSiteRelayServiceConnections(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return listSiteRelayServiceConnectionsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -15154,7 +18390,23 @@ public ServiceResponse listSiteRelayServiceCo * @return the {@link ServiceCall} object */ public ServiceCall listSiteRelayServiceConnectionsAsync(String resourceGroupName, String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(listSiteRelayServiceConnectionsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(listSiteRelayServiceConnectionsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrieves all Biztalk Hybrid Connections associated with this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @return the observable to the RelayServiceConnectionEntityInner object + */ + public Observable listSiteRelayServiceConnectionsAsync(String resourceGroupName, String name) { + return listSiteRelayServiceConnectionsWithServiceResponseAsync(resourceGroupName, name).map(new Func1, RelayServiceConnectionEntityInner>() { + @Override + public RelayServiceConnectionEntityInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15164,7 +18416,7 @@ public ServiceCall listSiteRelayServiceConnec * @param name The name of the web app * @return the observable to the RelayServiceConnectionEntityInner object */ - public Observable> listSiteRelayServiceConnectionsAsync(String resourceGroupName, String name) { + public Observable> listSiteRelayServiceConnectionsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15209,10 +18461,10 @@ private ServiceResponse listSiteRelayServiceC * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getSiteVnetGatewaySlot(String resourceGroupName, String name, String vnetName, String gatewayName, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteVnetGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot).toBlocking().single(); + public Object getSiteVnetGatewaySlot(String resourceGroupName, String name, String vnetName, String gatewayName, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteVnetGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot).toBlocking().single().getBody(); } /** @@ -15227,7 +18479,26 @@ public ServiceResponse getSiteVnetGatewaySlot(String resourceGroupName, * @return the {@link ServiceCall} object */ public ServiceCall getSiteVnetGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteVnetGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot), serviceCallback); + return ServiceCall.create(getSiteVnetGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot), serviceCallback); + } + + /** + * Retrieves a Virtual Network connection gateway associated with this web app and virtual network. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" + * @param slot The name of the slot for this web app. + * @return the observable to the Object object + */ + public Observable getSiteVnetGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot) { + return getSiteVnetGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15240,7 +18511,7 @@ public ServiceCall getSiteVnetGatewaySlotAsync(String resourceGroupName, * @param slot The name of the slot for this web app. * @return the observable to the Object object */ - public Observable> getSiteVnetGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot) { + public Observable> getSiteVnetGatewaySlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15296,10 +18567,10 @@ private ServiceResponse getSiteVnetGatewaySlotDelegate(Response createOrUpdateSiteVNETConnectionGatewaySlot(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteVNETConnectionGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope).toBlocking().single(); + public VnetGatewayInner createOrUpdateSiteVNETConnectionGatewaySlot(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -15315,7 +18586,27 @@ public ServiceResponse createOrUpdateSiteVNETConnectionGateway * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteVNETConnectionGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteVNETConnectionGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope), serviceCallback); + } + + /** + * Updates the Virtual Network Gateway. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" + * @param slot The name of the slot for this web app. + * @param connectionEnvelope The properties to update this gateway with. + * @return the observable to the VnetGatewayInner object + */ + public Observable createOrUpdateSiteVNETConnectionGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) { + return createOrUpdateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope).map(new Func1, VnetGatewayInner>() { + @Override + public VnetGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15329,7 +18620,7 @@ public ServiceCall createOrUpdateSiteVNETConnectionGatewaySlot * @param connectionEnvelope The properties to update this gateway with. * @return the observable to the VnetGatewayInner object */ - public Observable> createOrUpdateSiteVNETConnectionGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) { + public Observable> createOrUpdateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15388,10 +18679,10 @@ private ServiceResponse createOrUpdateSiteVNETConnectionGatewa * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetGatewayInner object if successful. */ - public ServiceResponse updateSiteVNETConnectionGatewaySlot(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateSiteVNETConnectionGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope).toBlocking().single(); + public VnetGatewayInner updateSiteVNETConnectionGatewaySlot(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -15407,7 +18698,27 @@ public ServiceResponse updateSiteVNETConnectionGatewaySlot(Str * @return the {@link ServiceCall} object */ public ServiceCall updateSiteVNETConnectionGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteVNETConnectionGatewaySlotAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope), serviceCallback); + } + + /** + * Updates the Virtual Network Gateway. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" + * @param slot The name of the slot for this web app. + * @param connectionEnvelope The properties to update this gateway with. + * @return the observable to the VnetGatewayInner object + */ + public Observable updateSiteVNETConnectionGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) { + return updateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, slot, connectionEnvelope).map(new Func1, VnetGatewayInner>() { + @Override + public VnetGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15421,7 +18732,7 @@ public ServiceCall updateSiteVNETConnectionGatewaySlotAsync(St * @param connectionEnvelope The properties to update this gateway with. * @return the observable to the VnetGatewayInner object */ - public Observable> updateSiteVNETConnectionGatewaySlotAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) { + public Observable> updateSiteVNETConnectionGatewaySlotWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName, String slot, VnetGatewayInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15478,10 +18789,10 @@ private ServiceResponse updateSiteVNETConnectionGatewaySlotDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getSiteVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) throws CloudException, IOException, IllegalArgumentException { - return getSiteVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName).toBlocking().single(); + public Object getSiteVnetGateway(String resourceGroupName, String name, String vnetName, String gatewayName) throws CloudException, IOException, IllegalArgumentException { + return getSiteVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName).toBlocking().single().getBody(); } /** @@ -15495,7 +18806,25 @@ public ServiceResponse getSiteVnetGateway(String resourceGroupName, Stri * @return the {@link ServiceCall} object */ public ServiceCall getSiteVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, final ServiceCallback serviceCallback) { - return ServiceCall.create(getSiteVnetGatewayAsync(resourceGroupName, name, vnetName, gatewayName), serviceCallback); + return ServiceCall.create(getSiteVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName), serviceCallback); + } + + /** + * Retrieves a Virtual Network connection gateway associated with this web app and virtual network. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" + * @return the observable to the Object object + */ + public Observable getSiteVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { + return getSiteVnetGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15507,7 +18836,7 @@ public ServiceCall getSiteVnetGatewayAsync(String resourceGroupName, Str * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" * @return the observable to the Object object */ - public Observable> getSiteVnetGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { + public Observable> getSiteVnetGatewayWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15559,10 +18888,10 @@ private ServiceResponse getSiteVnetGatewayDelegate(Response createOrUpdateSiteVNETConnectionGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return createOrUpdateSiteVNETConnectionGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single(); + public VnetGatewayInner createOrUpdateSiteVNETConnectionGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return createOrUpdateSiteVNETConnectionGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -15577,7 +18906,26 @@ public ServiceResponse createOrUpdateSiteVNETConnectionGateway * @return the {@link ServiceCall} object */ public ServiceCall createOrUpdateSiteVNETConnectionGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(createOrUpdateSiteVNETConnectionGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope), serviceCallback); + return ServiceCall.create(createOrUpdateSiteVNETConnectionGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope), serviceCallback); + } + + /** + * Updates the Virtual Network Gateway. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" + * @param connectionEnvelope The properties to update this gateway with. + * @return the observable to the VnetGatewayInner object + */ + public Observable createOrUpdateSiteVNETConnectionGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { + return createOrUpdateSiteVNETConnectionGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).map(new Func1, VnetGatewayInner>() { + @Override + public VnetGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15590,7 +18938,7 @@ public ServiceCall createOrUpdateSiteVNETConnectionGatewayAsyn * @param connectionEnvelope The properties to update this gateway with. * @return the observable to the VnetGatewayInner object */ - public Observable> createOrUpdateSiteVNETConnectionGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { + public Observable> createOrUpdateSiteVNETConnectionGatewayWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15645,10 +18993,10 @@ private ServiceResponse createOrUpdateSiteVNETConnectionGatewa * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the VnetGatewayInner object wrapped in {@link ServiceResponse} if successful. + * @return the VnetGatewayInner object if successful. */ - public ServiceResponse updateSiteVNETConnectionGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { - return updateSiteVNETConnectionGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single(); + public VnetGatewayInner updateSiteVNETConnectionGateway(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) throws CloudException, IOException, IllegalArgumentException { + return updateSiteVNETConnectionGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).toBlocking().single().getBody(); } /** @@ -15663,7 +19011,26 @@ public ServiceResponse updateSiteVNETConnectionGateway(String * @return the {@link ServiceCall} object */ public ServiceCall updateSiteVNETConnectionGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope, final ServiceCallback serviceCallback) { - return ServiceCall.create(updateSiteVNETConnectionGatewayAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope), serviceCallback); + return ServiceCall.create(updateSiteVNETConnectionGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope), serviceCallback); + } + + /** + * Updates the Virtual Network Gateway. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param vnetName The name of the Virtual Network + * @param gatewayName The name of the gateway. The only gateway that exists presently is "primary" + * @param connectionEnvelope The properties to update this gateway with. + * @return the observable to the VnetGatewayInner object + */ + public Observable updateSiteVNETConnectionGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { + return updateSiteVNETConnectionGatewayWithServiceResponseAsync(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope).map(new Func1, VnetGatewayInner>() { + @Override + public VnetGatewayInner call(ServiceResponse response) { + return response.getBody(); + } + }); } /** @@ -15676,7 +19043,7 @@ public ServiceCall updateSiteVNETConnectionGatewayAsync(String * @param connectionEnvelope The properties to update this gateway with. * @return the observable to the VnetGatewayInner object */ - public Observable> updateSiteVNETConnectionGatewayAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { + public Observable> updateSiteVNETConnectionGatewayWithServiceResponseAsync(String resourceGroupName, String name, String vnetName, String gatewayName, VnetGatewayInner connectionEnvelope) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15728,10 +19095,10 @@ private ServiceResponse updateSiteVNETConnectionGatewayDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VnetInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VnetInfoInner> object if successful. */ - public ServiceResponse> getSiteVNETConnections(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { - return getSiteVNETConnectionsAsync(resourceGroupName, name).toBlocking().single(); + public List getSiteVNETConnections(String resourceGroupName, String name) throws CloudException, IOException, IllegalArgumentException { + return getSiteVNETConnectionsWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().getBody(); } /** @@ -15743,7 +19110,23 @@ public ServiceResponse> getSiteVNETConnections(String resour * @return the {@link ServiceCall} object */ public ServiceCall> getSiteVNETConnectionsAsync(String resourceGroupName, String name, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getSiteVNETConnectionsAsync(resourceGroupName, name), serviceCallback); + return ServiceCall.create(getSiteVNETConnectionsWithServiceResponseAsync(resourceGroupName, name), serviceCallback); + } + + /** + * Retrieves a list of all Virtual Network Connections associated with this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @return the observable to the List<VnetInfoInner> object + */ + public Observable> getSiteVNETConnectionsAsync(String resourceGroupName, String name) { + return getSiteVNETConnectionsWithServiceResponseAsync(resourceGroupName, name).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -15753,7 +19136,7 @@ public ServiceCall> getSiteVNETConnectionsAsync(String resou * @param name The name of the web app * @return the observable to the List<VnetInfoInner> object */ - public Observable>> getSiteVNETConnectionsAsync(String resourceGroupName, String name) { + public Observable>> getSiteVNETConnectionsWithServiceResponseAsync(String resourceGroupName, String name) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15796,10 +19179,10 @@ private ServiceResponse> getSiteVNETConnectionsDelegate(Resp * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<VnetInfoInner> object wrapped in {@link ServiceResponse} if successful. + * @return the List<VnetInfoInner> object if successful. */ - public ServiceResponse> getSiteVNETConnectionsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { - return getSiteVNETConnectionsSlotAsync(resourceGroupName, name, slot).toBlocking().single(); + public List getSiteVNETConnectionsSlot(String resourceGroupName, String name, String slot) throws CloudException, IOException, IllegalArgumentException { + return getSiteVNETConnectionsSlotWithServiceResponseAsync(resourceGroupName, name, slot).toBlocking().single().getBody(); } /** @@ -15811,8 +19194,25 @@ public ServiceResponse> getSiteVNETConnectionsSlot(String re * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @return the {@link ServiceCall} object */ - public ServiceCall> getSiteVNETConnectionsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback> serviceCallback) { - return ServiceCall.create(getSiteVNETConnectionsSlotAsync(resourceGroupName, name, slot), serviceCallback); + public ServiceCall> getSiteVNETConnectionsSlotAsync(String resourceGroupName, String name, String slot, final ServiceCallback> serviceCallback) { + return ServiceCall.create(getSiteVNETConnectionsSlotWithServiceResponseAsync(resourceGroupName, name, slot), serviceCallback); + } + + /** + * Retrieves a list of all Virtual Network Connections associated with this web app. + * + * @param resourceGroupName The resource group name + * @param name The name of the web app + * @param slot The name of the slot for this web app. + * @return the observable to the List<VnetInfoInner> object + */ + public Observable> getSiteVNETConnectionsSlotAsync(String resourceGroupName, String name, String slot) { + return getSiteVNETConnectionsSlotWithServiceResponseAsync(resourceGroupName, name, slot).map(new Func1>, List>() { + @Override + public List call(ServiceResponse> response) { + return response.getBody(); + } + }); } /** @@ -15823,7 +19223,7 @@ public ServiceCall> getSiteVNETConnectionsSlotAsync(String r * @param slot The name of the slot for this web app. * @return the observable to the List<VnetInfoInner> object */ - public Observable>> getSiteVNETConnectionsSlotAsync(String resourceGroupName, String name, String slot) { + public Observable>> getSiteVNETConnectionsSlotWithServiceResponseAsync(String resourceGroupName, String name, String slot) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } @@ -15867,17 +19267,16 @@ private ServiceResponse> getSiteVNETConnectionsSlotDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object if successful. */ - public ServiceResponse> getSlotsDifferencesFromProductionNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSlotsDifferencesFromProductionNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSlotsDifferencesFromProductionNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSlotsDifferencesFromProductionNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -15904,15 +19303,34 @@ public Observable>> call(String nextPa * Get the difference in configuration settings between two web app slots. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SlotDifferenceInner> object + * @return the observable to the PagedList<SlotDifferenceInner> object + */ + public Observable> getSlotsDifferencesFromProductionNextAsync(final String nextPageLink) { + return getSlotsDifferencesFromProductionNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get the difference in configuration settings between two web app slots. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SlotDifferenceInner> object */ - public Observable>> getSlotsDifferencesFromProductionNextAsync(final String nextPageLink) { + public Observable>> getSlotsDifferencesFromProductionNextWithServiceResponseAsync(final String nextPageLink) { return getSlotsDifferencesFromProductionNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSlotsDifferencesFromProductionNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSlotsDifferencesFromProductionNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -15921,7 +19339,7 @@ public Observable>> call(ServiceRespon * Get the difference in configuration settings between two web app slots. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSlotsDifferencesFromProductionNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -15955,17 +19373,16 @@ private ServiceResponse> getSlotsDifferencesFromPr * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object if successful. */ - public ServiceResponse> getSlotsDifferencesSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSlotsDifferencesSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSlotsDifferencesSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSlotsDifferencesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -15992,15 +19409,34 @@ public Observable>> call(String nextPa * Get the difference in configuration settings between two web app slots. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SlotDifferenceInner> object + * @return the observable to the PagedList<SlotDifferenceInner> object */ - public Observable>> getSlotsDifferencesSlotNextAsync(final String nextPageLink) { + public Observable> getSlotsDifferencesSlotNextAsync(final String nextPageLink) { + return getSlotsDifferencesSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get the difference in configuration settings between two web app slots. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SlotDifferenceInner> object + */ + public Observable>> getSlotsDifferencesSlotNextWithServiceResponseAsync(final String nextPageLink) { return getSlotsDifferencesSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSlotsDifferencesSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSlotsDifferencesSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16009,7 +19445,7 @@ public Observable>> call(ServiceRespon * Get the difference in configuration settings between two web app slots. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SlotDifferenceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSlotsDifferencesSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16043,17 +19479,16 @@ private ServiceResponse> getSlotsDifferencesSlotNe * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object if successful. */ - public ServiceResponse> getSiteSlotsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteSlotsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteSlotsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteSlotsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16080,15 +19515,34 @@ public Observable>> call(String nextPageLink) { * Gets all the slots for a web apps. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getSiteSlotsNextAsync(final String nextPageLink) { + return getSiteSlotsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all the slots for a web apps. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getSiteSlotsNextAsync(final String nextPageLink) { + public Observable>> getSiteSlotsNextWithServiceResponseAsync(final String nextPageLink) { return getSiteSlotsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteSlotsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteSlotsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16097,7 +19551,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteSlotsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16131,17 +19585,16 @@ private ServiceResponse> getSiteSlotsNextDelegate(Response> getSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSitesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16168,15 +19621,34 @@ public Observable>> call(String nextPageLink) { * Gets the web apps for a subscription in the specified resource group. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInner> object + * @return the observable to the PagedList<SiteInner> object + */ + public Observable> getSitesNextAsync(final String nextPageLink) { + return getSitesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the web apps for a subscription in the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInner> object */ - public Observable>> getSitesNextAsync(final String nextPageLink) { + public Observable>> getSitesNextWithServiceResponseAsync(final String nextPageLink) { return getSitesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16185,7 +19657,7 @@ public Observable>> call(ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSitesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16219,17 +19691,16 @@ private ServiceResponse> getSitesNextDelegate(Response> getDeletedSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeletedSitesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeletedSitesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeletedSitesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16256,15 +19727,34 @@ public Observable>> call(String nextPageL * Gets deleted web apps in subscription. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeletedSiteInner> object + * @return the observable to the PagedList<DeletedSiteInner> object + */ + public Observable> getDeletedSitesNextAsync(final String nextPageLink) { + return getDeletedSitesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets deleted web apps in subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeletedSiteInner> object */ - public Observable>> getDeletedSitesNextAsync(final String nextPageLink) { + public Observable>> getDeletedSitesNextWithServiceResponseAsync(final String nextPageLink) { return getDeletedSitesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeletedSitesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeletedSitesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16273,7 +19763,7 @@ public Observable>> call(ServiceResponse< * Gets deleted web apps in subscription. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeletedSiteInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeletedSitesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16307,17 +19797,16 @@ private ServiceResponse> getDeletedSitesNextDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getDeploymentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeploymentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeploymentsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeploymentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16344,15 +19833,34 @@ public Observable>> call(String nextPageLi * List deployments. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getDeploymentsNextAsync(final String nextPageLink) { + public Observable> getDeploymentsNextAsync(final String nextPageLink) { + return getDeploymentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable>> getDeploymentsNextWithServiceResponseAsync(final String nextPageLink) { return getDeploymentsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeploymentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeploymentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16361,7 +19869,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeploymentsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16395,17 +19903,16 @@ private ServiceResponse> getDeploymentsNextDelegate(Re * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getDeploymentsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getDeploymentsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getDeploymentsSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getDeploymentsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16432,15 +19939,34 @@ public Observable>> call(String nextPageLi * List deployments. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getDeploymentsSlotNextAsync(final String nextPageLink) { + return getDeploymentsSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getDeploymentsSlotNextAsync(final String nextPageLink) { + public Observable>> getDeploymentsSlotNextWithServiceResponseAsync(final String nextPageLink) { return getDeploymentsSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getDeploymentsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getDeploymentsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16449,7 +19975,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getDeploymentsSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16483,17 +20009,16 @@ private ServiceResponse> getDeploymentsSlotNextDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getInstanceDeploymentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getInstanceDeploymentsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getInstanceDeploymentsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getInstanceDeploymentsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16520,15 +20045,34 @@ public Observable>> call(String nextPageLi * List deployments. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getInstanceDeploymentsNextAsync(final String nextPageLink) { + return getInstanceDeploymentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getInstanceDeploymentsNextAsync(final String nextPageLink) { + public Observable>> getInstanceDeploymentsNextWithServiceResponseAsync(final String nextPageLink) { return getInstanceDeploymentsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getInstanceDeploymentsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getInstanceDeploymentsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16537,7 +20081,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getInstanceDeploymentsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16571,17 +20115,16 @@ private ServiceResponse> getInstanceDeploymentsNextDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object if successful. */ - public ServiceResponse> getInstanceDeploymentsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getInstanceDeploymentsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getInstanceDeploymentsSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getInstanceDeploymentsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16608,15 +20151,34 @@ public Observable>> call(String nextPageLi * List deployments. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<DeploymentInner> object + * @return the observable to the PagedList<DeploymentInner> object + */ + public Observable> getInstanceDeploymentsSlotNextAsync(final String nextPageLink) { + return getInstanceDeploymentsSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * List deployments. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<DeploymentInner> object */ - public Observable>> getInstanceDeploymentsSlotNextAsync(final String nextPageLink) { + public Observable>> getInstanceDeploymentsSlotNextWithServiceResponseAsync(final String nextPageLink) { return getInstanceDeploymentsSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getInstanceDeploymentsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getInstanceDeploymentsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16625,7 +20187,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<DeploymentInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getInstanceDeploymentsSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16659,17 +20221,16 @@ private ServiceResponse> getInstanceDeploymentsSlotNex * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object if successful. */ - public ServiceResponse> getSiteInstanceIdentifiersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteInstanceIdentifiersNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteInstanceIdentifiersNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteInstanceIdentifiersNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16696,15 +20257,34 @@ public Observable>> call(String nextPage * Gets all instance of a web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInstanceInner> object + * @return the observable to the PagedList<SiteInstanceInner> object */ - public Observable>> getSiteInstanceIdentifiersNextAsync(final String nextPageLink) { + public Observable> getSiteInstanceIdentifiersNextAsync(final String nextPageLink) { + return getSiteInstanceIdentifiersNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all instance of a web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInstanceInner> object + */ + public Observable>> getSiteInstanceIdentifiersNextWithServiceResponseAsync(final String nextPageLink) { return getSiteInstanceIdentifiersNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteInstanceIdentifiersNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteInstanceIdentifiersNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16713,7 +20293,7 @@ public Observable>> call(ServiceResponse * Gets all instance of a web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteInstanceIdentifiersNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16747,17 +20327,16 @@ private ServiceResponse> getSiteInstanceIdentifiersN * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object if successful. */ - public ServiceResponse> getSiteInstanceIdentifiersSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteInstanceIdentifiersSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteInstanceIdentifiersSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteInstanceIdentifiersSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16784,15 +20363,34 @@ public Observable>> call(String nextPage * Gets all instance of a web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<SiteInstanceInner> object + * @return the observable to the PagedList<SiteInstanceInner> object + */ + public Observable> getSiteInstanceIdentifiersSlotNextAsync(final String nextPageLink) { + return getSiteInstanceIdentifiersSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets all instance of a web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<SiteInstanceInner> object */ - public Observable>> getSiteInstanceIdentifiersSlotNextAsync(final String nextPageLink) { + public Observable>> getSiteInstanceIdentifiersSlotNextWithServiceResponseAsync(final String nextPageLink) { return getSiteInstanceIdentifiersSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteInstanceIdentifiersSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteInstanceIdentifiersSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16801,7 +20399,7 @@ public Observable>> call(ServiceResponse * Gets all instance of a web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<SiteInstanceInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteInstanceIdentifiersSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16835,17 +20433,16 @@ private ServiceResponse> getSiteInstanceIdentifiersS * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object if successful. */ - public ServiceResponse> getSiteHostNameBindingsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteHostNameBindingsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteHostNameBindingsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteHostNameBindingsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16872,15 +20469,34 @@ public Observable>> call(String nextP * Get web app hostname bindings. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<HostNameBindingInner> object + * @return the observable to the PagedList<HostNameBindingInner> object + */ + public Observable> getSiteHostNameBindingsNextAsync(final String nextPageLink) { + return getSiteHostNameBindingsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get web app hostname bindings. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<HostNameBindingInner> object */ - public Observable>> getSiteHostNameBindingsNextAsync(final String nextPageLink) { + public Observable>> getSiteHostNameBindingsNextWithServiceResponseAsync(final String nextPageLink) { return getSiteHostNameBindingsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteHostNameBindingsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteHostNameBindingsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16889,7 +20505,7 @@ public Observable>> call(ServiceRespo * Get web app hostname bindings. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteHostNameBindingsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -16923,17 +20539,16 @@ private ServiceResponse> getSiteHostNameBindingsN * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object if successful. */ - public ServiceResponse> getSiteHostNameBindingsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteHostNameBindingsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteHostNameBindingsSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteHostNameBindingsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -16960,15 +20575,34 @@ public Observable>> call(String nextP * Get web app hostname bindings. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<HostNameBindingInner> object + * @return the observable to the PagedList<HostNameBindingInner> object + */ + public Observable> getSiteHostNameBindingsSlotNextAsync(final String nextPageLink) { + return getSiteHostNameBindingsSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Get web app hostname bindings. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<HostNameBindingInner> object */ - public Observable>> getSiteHostNameBindingsSlotNextAsync(final String nextPageLink) { + public Observable>> getSiteHostNameBindingsSlotNextWithServiceResponseAsync(final String nextPageLink) { return getSiteHostNameBindingsSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteHostNameBindingsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteHostNameBindingsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -16977,7 +20611,7 @@ public Observable>> call(ServiceRespo * Get web app hostname bindings. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<HostNameBindingInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteHostNameBindingsSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17011,17 +20645,16 @@ private ServiceResponse> getSiteHostNameBindingsS * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object if successful. */ - public ServiceResponse> listSiteBackupsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listSiteBackupsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSiteBackupsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listSiteBackupsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17048,15 +20681,34 @@ public Observable>> call(String nextPageLi * Lists all available backups for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<BackupItemInner> object + * @return the observable to the PagedList<BackupItemInner> object */ - public Observable>> listSiteBackupsNextAsync(final String nextPageLink) { + public Observable> listSiteBackupsNextAsync(final String nextPageLink) { + return listSiteBackupsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all available backups for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<BackupItemInner> object + */ + public Observable>> listSiteBackupsNextWithServiceResponseAsync(final String nextPageLink) { return listSiteBackupsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listSiteBackupsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSiteBackupsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17065,7 +20717,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSiteBackupsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17099,17 +20751,16 @@ private ServiceResponse> listSiteBackupsNextDelegate(R * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object if successful. */ - public ServiceResponse> listSiteBackupsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listSiteBackupsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listSiteBackupsSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listSiteBackupsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17136,15 +20787,34 @@ public Observable>> call(String nextPageLi * Lists all available backups for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<BackupItemInner> object + * @return the observable to the PagedList<BackupItemInner> object + */ + public Observable> listSiteBackupsSlotNextAsync(final String nextPageLink) { + return listSiteBackupsSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all available backups for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<BackupItemInner> object */ - public Observable>> listSiteBackupsSlotNextAsync(final String nextPageLink) { + public Observable>> listSiteBackupsSlotNextWithServiceResponseAsync(final String nextPageLink) { return listSiteBackupsSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listSiteBackupsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listSiteBackupsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17153,7 +20823,7 @@ public Observable>> call(ServiceResponse

    > * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<BackupItemInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSiteBackupsSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17187,17 +20857,16 @@ private ServiceResponse> listSiteBackupsSlotNextDelega * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object if successful. */ - public ServiceResponse> getSiteUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteUsagesNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteUsagesNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteUsagesNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17224,15 +20893,34 @@ public Observable>> call(String nextPag * Gets the quota usage numbers for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getSiteUsagesNextAsync(final String nextPageLink) { + return getSiteUsagesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the quota usage numbers for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getSiteUsagesNextAsync(final String nextPageLink) { + public Observable>> getSiteUsagesNextWithServiceResponseAsync(final String nextPageLink) { return getSiteUsagesNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteUsagesNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteUsagesNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17241,7 +20929,7 @@ public Observable>> call(ServiceRespons * Gets the quota usage numbers for web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteUsagesNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17275,17 +20963,16 @@ private ServiceResponse> getSiteUsagesNextDelegate( * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object if successful. */ - public ServiceResponse> getSiteUsagesSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteUsagesSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteUsagesSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteUsagesSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17312,15 +20999,34 @@ public Observable>> call(String nextPag * Gets the quota usage numbers for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<CsmUsageQuotaInner> object + * @return the observable to the PagedList<CsmUsageQuotaInner> object + */ + public Observable> getSiteUsagesSlotNextAsync(final String nextPageLink) { + return getSiteUsagesSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets the quota usage numbers for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<CsmUsageQuotaInner> object */ - public Observable>> getSiteUsagesSlotNextAsync(final String nextPageLink) { + public Observable>> getSiteUsagesSlotNextWithServiceResponseAsync(final String nextPageLink) { return getSiteUsagesSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteUsagesSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteUsagesSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17329,7 +21035,7 @@ public Observable>> call(ServiceRespons * Gets the quota usage numbers for web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<CsmUsageQuotaInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteUsagesSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17363,17 +21069,16 @@ private ServiceResponse> getSiteUsagesSlotNextDeleg * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getSiteMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17400,15 +21105,34 @@ public Observable>> call(String nextPa * Gets metrics for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getSiteMetricsNextAsync(final String nextPageLink) { + public Observable> getSiteMetricsNextAsync(final String nextPageLink) { + return getSiteMetricsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metrics for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable>> getSiteMetricsNextWithServiceResponseAsync(final String nextPageLink) { return getSiteMetricsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17417,7 +21141,7 @@ public Observable>> call(ServiceRespon * Gets metrics for web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17451,17 +21175,16 @@ private ServiceResponse> getSiteMetricsNextDelegat * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object if successful. */ - public ServiceResponse> getSiteMetricsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricsSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17488,15 +21211,34 @@ public Observable>> call(String nextPa * Gets metrics for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<ResourceMetricInner> object + * @return the observable to the PagedList<ResourceMetricInner> object + */ + public Observable> getSiteMetricsSlotNextAsync(final String nextPageLink) { + return getSiteMetricsSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metrics for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<ResourceMetricInner> object */ - public Observable>> getSiteMetricsSlotNextAsync(final String nextPageLink) { + public Observable>> getSiteMetricsSlotNextWithServiceResponseAsync(final String nextPageLink) { return getSiteMetricsSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17505,7 +21247,7 @@ public Observable>> call(ServiceRespon * Gets metrics for web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<ResourceMetricInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricsSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17539,17 +21281,16 @@ private ServiceResponse> getSiteMetricsSlotNextDel * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getSiteMetricDefinitionsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricDefinitionsSlotNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricDefinitionsSlotNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricDefinitionsSlotNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17576,15 +21317,34 @@ public Observable>> call(String next * Gets metric definitions for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getSiteMetricDefinitionsSlotNextAsync(final String nextPageLink) { + return getSiteMetricDefinitionsSlotNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metric definitions for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getSiteMetricDefinitionsSlotNextAsync(final String nextPageLink) { + public Observable>> getSiteMetricDefinitionsSlotNextWithServiceResponseAsync(final String nextPageLink) { return getSiteMetricDefinitionsSlotNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricDefinitionsSlotNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricDefinitionsSlotNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17593,7 +21353,7 @@ public Observable>> call(ServiceResp * Gets metric definitions for web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricDefinitionsSlotNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -17627,17 +21387,16 @@ private ServiceResponse> getSiteMetricDefinition * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object if successful. */ - public ServiceResponse> getSiteMetricDefinitionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getSiteMetricDefinitionsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getSiteMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getSiteMetricDefinitionsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -17664,15 +21423,34 @@ public Observable>> call(String next * Gets metric definitions for web app. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<MetricDefinitionInner> object + * @return the observable to the PagedList<MetricDefinitionInner> object + */ + public Observable> getSiteMetricDefinitionsNextAsync(final String nextPageLink) { + return getSiteMetricDefinitionsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Gets metric definitions for web app. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<MetricDefinitionInner> object */ - public Observable>> getSiteMetricDefinitionsNextAsync(final String nextPageLink) { + public Observable>> getSiteMetricDefinitionsNextWithServiceResponseAsync(final String nextPageLink) { return getSiteMetricDefinitionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getSiteMetricDefinitionsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getSiteMetricDefinitionsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -17681,7 +21459,7 @@ public Observable>> call(ServiceResp * Gets metric definitions for web app. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<MetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getSiteMetricDefinitionsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/TopLevelDomainsInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/TopLevelDomainsInner.java index 85af026a62c8..9fd29283824a 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/TopLevelDomainsInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/TopLevelDomainsInner.java @@ -89,17 +89,16 @@ interface TopLevelDomainsService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TopLevelDomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TopLevelDomainInner> object if successful. */ - public ServiceResponse> getGetTopLevelDomains() throws CloudException, IOException, IllegalArgumentException { + public PagedList getGetTopLevelDomains() throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getGetTopLevelDomainsSinglePageAsync().toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getGetTopLevelDomainsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -123,15 +122,33 @@ public Observable>> call(String nextPa /** * Lists all top level domains supported for registration. * - * @return the observable to the List<TopLevelDomainInner> object + * @return the observable to the PagedList<TopLevelDomainInner> object */ - public Observable>> getGetTopLevelDomainsAsync() { + public Observable> getGetTopLevelDomainsAsync() { + return getGetTopLevelDomainsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all top level domains supported for registration. + * + * @return the observable to the PagedList<TopLevelDomainInner> object + */ + public Observable>> getGetTopLevelDomainsWithServiceResponseAsync() { return getGetTopLevelDomainsSinglePageAsync() .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getGetTopLevelDomainsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getGetTopLevelDomainsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -139,7 +156,7 @@ public Observable>> call(ServiceRespon /** * Lists all top level domains supported for registration. * - * @return the List<TopLevelDomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TopLevelDomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getGetTopLevelDomainsSinglePageAsync() { if (this.client.subscriptionId() == null) { @@ -176,10 +193,10 @@ private ServiceResponse> getGetTopLevelDomainsDele * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the TopLevelDomainInner object wrapped in {@link ServiceResponse} if successful. + * @return the TopLevelDomainInner object if successful. */ - public ServiceResponse getTopLevelDomain(String name) throws CloudException, IOException, IllegalArgumentException { - return getTopLevelDomainAsync(name).toBlocking().single(); + public TopLevelDomainInner getTopLevelDomain(String name) throws CloudException, IOException, IllegalArgumentException { + return getTopLevelDomainWithServiceResponseAsync(name).toBlocking().single().getBody(); } /** @@ -190,7 +207,7 @@ public ServiceResponse getTopLevelDomain(String name) throw * @return the {@link ServiceCall} object */ public ServiceCall getTopLevelDomainAsync(String name, final ServiceCallback serviceCallback) { - return ServiceCall.create(getTopLevelDomainAsync(name), serviceCallback); + return ServiceCall.create(getTopLevelDomainWithServiceResponseAsync(name), serviceCallback); } /** @@ -199,7 +216,22 @@ public ServiceCall getTopLevelDomainAsync(String name, fina * @param name Name of the top level domain * @return the observable to the TopLevelDomainInner object */ - public Observable> getTopLevelDomainAsync(String name) { + public Observable getTopLevelDomainAsync(String name) { + return getTopLevelDomainWithServiceResponseAsync(name).map(new Func1, TopLevelDomainInner>() { + @Override + public TopLevelDomainInner call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Gets details of a top level domain. + * + * @param name Name of the top level domain + * @return the observable to the TopLevelDomainInner object + */ + public Observable> getTopLevelDomainWithServiceResponseAsync(String name) { if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } @@ -237,17 +269,16 @@ private ServiceResponse getTopLevelDomainDelegate(Response< * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TldLegalAgreementInner> object if successful. */ - public ServiceResponse> listTopLevelDomainAgreements(final String name) throws CloudException, IOException, IllegalArgumentException { + public PagedList listTopLevelDomainAgreements(final String name) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listTopLevelDomainAgreementsSinglePageAsync(name).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -273,15 +304,34 @@ public Observable>> call(String nex * Lists legal agreements that user needs to accept before purchasing domain. * * @param name Name of the top level domain - * @return the observable to the List<TldLegalAgreementInner> object + * @return the observable to the PagedList<TldLegalAgreementInner> object */ - public Observable>> listTopLevelDomainAgreementsAsync(final String name) { + public Observable> listTopLevelDomainAgreementsAsync(final String name) { + return listTopLevelDomainAgreementsWithServiceResponseAsync(name) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists legal agreements that user needs to accept before purchasing domain. + * + * @param name Name of the top level domain + * @return the observable to the PagedList<TldLegalAgreementInner> object + */ + public Observable>> listTopLevelDomainAgreementsWithServiceResponseAsync(final String name) { return listTopLevelDomainAgreementsSinglePageAsync(name) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listTopLevelDomainAgreementsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -290,7 +340,7 @@ public Observable>> call(ServiceRes * Lists legal agreements that user needs to accept before purchasing domain. * * @param name Name of the top level domain - * @return the List<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listTopLevelDomainAgreementsSinglePageAsync(final String name) { if (name == null) { @@ -327,17 +377,16 @@ public Observable>> call(Response> listTopLevelDomainAgreements(final String name, final Boolean includePrivacy) throws CloudException, IOException, IllegalArgumentException { + public PagedList listTopLevelDomainAgreements(final String name, final Boolean includePrivacy) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listTopLevelDomainAgreementsSinglePageAsync(name, includePrivacy).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -365,15 +414,35 @@ public Observable>> call(String nex * * @param name Name of the top level domain * @param includePrivacy If true then the list of agreements will inclue agreements for domain privacy as well. - * @return the observable to the List<TldLegalAgreementInner> object + * @return the observable to the PagedList<TldLegalAgreementInner> object + */ + public Observable> listTopLevelDomainAgreementsAsync(final String name, final Boolean includePrivacy) { + return listTopLevelDomainAgreementsWithServiceResponseAsync(name, includePrivacy) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists legal agreements that user needs to accept before purchasing domain. + * + * @param name Name of the top level domain + * @param includePrivacy If true then the list of agreements will inclue agreements for domain privacy as well. + * @return the observable to the PagedList<TldLegalAgreementInner> object */ - public Observable>> listTopLevelDomainAgreementsAsync(final String name, final Boolean includePrivacy) { + public Observable>> listTopLevelDomainAgreementsWithServiceResponseAsync(final String name, final Boolean includePrivacy) { return listTopLevelDomainAgreementsSinglePageAsync(name, includePrivacy) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listTopLevelDomainAgreementsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -383,7 +452,7 @@ public Observable>> call(ServiceRes * ServiceResponse> * @param name Name of the top level domain ServiceResponse> * @param includePrivacy If true then the list of agreements will inclue agreements for domain privacy as well. - * @return the List<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listTopLevelDomainAgreementsSinglePageAsync(final String name, final Boolean includePrivacy) { if (name == null) { @@ -425,17 +494,16 @@ private ServiceResponse> listTopLevelDomainAgre * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TopLevelDomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TopLevelDomainInner> object if successful. */ - public ServiceResponse> getGetTopLevelDomainsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList getGetTopLevelDomainsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = getGetTopLevelDomainsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return getGetTopLevelDomainsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -462,15 +530,34 @@ public Observable>> call(String nextPa * Lists all top level domains supported for registration. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<TopLevelDomainInner> object + * @return the observable to the PagedList<TopLevelDomainInner> object */ - public Observable>> getGetTopLevelDomainsNextAsync(final String nextPageLink) { + public Observable> getGetTopLevelDomainsNextAsync(final String nextPageLink) { + return getGetTopLevelDomainsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists all top level domains supported for registration. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<TopLevelDomainInner> object + */ + public Observable>> getGetTopLevelDomainsNextWithServiceResponseAsync(final String nextPageLink) { return getGetTopLevelDomainsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return getGetTopLevelDomainsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(getGetTopLevelDomainsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -479,7 +566,7 @@ public Observable>> call(ServiceRespon * Lists all top level domains supported for registration. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<TopLevelDomainInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TopLevelDomainInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> getGetTopLevelDomainsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { @@ -513,17 +600,16 @@ private ServiceResponse> getGetTopLevelDomainsNext * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the List<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TldLegalAgreementInner> object if successful. */ - public ServiceResponse> listTopLevelDomainAgreementsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { + public PagedList listTopLevelDomainAgreementsNext(final String nextPageLink) throws CloudException, IOException, IllegalArgumentException { ServiceResponse> response = listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink).toBlocking().single(); - PagedList pagedList = new PagedList(response.getBody()) { + return new PagedList(response.getBody()) { @Override public Page nextPage(String nextPageLink) throws RestException, IOException { return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink).toBlocking().single().getBody(); } }; - return new ServiceResponse>(pagedList, response.getResponse()); } /** @@ -550,15 +636,34 @@ public Observable>> call(String nex * Lists legal agreements that user needs to accept before purchasing domain. * * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the observable to the List<TldLegalAgreementInner> object + * @return the observable to the PagedList<TldLegalAgreementInner> object */ - public Observable>> listTopLevelDomainAgreementsNextAsync(final String nextPageLink) { + public Observable> listTopLevelDomainAgreementsNextAsync(final String nextPageLink) { + return listTopLevelDomainAgreementsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.getBody(); + } + }); + } + + /** + * Lists legal agreements that user needs to accept before purchasing domain. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @return the observable to the PagedList<TldLegalAgreementInner> object + */ + public Observable>> listTopLevelDomainAgreementsNextWithServiceResponseAsync(final String nextPageLink) { return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink) .concatMap(new Func1>, Observable>>>() { @Override public Observable>> call(ServiceResponse> page) { String nextPageLink = page.getBody().getNextPageLink(); - return listTopLevelDomainAgreementsNextSinglePageAsync(nextPageLink); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listTopLevelDomainAgreementsNextWithServiceResponseAsync(nextPageLink)); } }); } @@ -567,7 +672,7 @@ public Observable>> call(ServiceRes * Lists legal agreements that user needs to accept before purchasing domain. * ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @return the List<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. + * @return the PagedList<TldLegalAgreementInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listTopLevelDomainAgreementsNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { diff --git a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/UsagesInner.java b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/UsagesInner.java index 2ef0bb50a337..d36b352b68fd 100644 --- a/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/UsagesInner.java +++ b/azure-mgmt-website/src/main/java/com/microsoft/azure/management/website/implementation/UsagesInner.java @@ -68,10 +68,10 @@ interface UsagesService { * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @throws IllegalArgumentException exception thrown from invalid parameters - * @return the Object object wrapped in {@link ServiceResponse} if successful. + * @return the Object object if successful. */ - public ServiceResponse getUsage(String resourceGroupName, String environmentName, String lastId, int batchSize) throws CloudException, IOException, IllegalArgumentException { - return getUsageAsync(resourceGroupName, environmentName, lastId, batchSize).toBlocking().single(); + public Object getUsage(String resourceGroupName, String environmentName, String lastId, int batchSize) throws CloudException, IOException, IllegalArgumentException { + return getUsageWithServiceResponseAsync(resourceGroupName, environmentName, lastId, batchSize).toBlocking().single().getBody(); } /** @@ -85,7 +85,7 @@ public ServiceResponse getUsage(String resourceGroupName, String environ * @return the {@link ServiceCall} object */ public ServiceCall getUsageAsync(String resourceGroupName, String environmentName, String lastId, int batchSize, final ServiceCallback serviceCallback) { - return ServiceCall.create(getUsageAsync(resourceGroupName, environmentName, lastId, batchSize), serviceCallback); + return ServiceCall.create(getUsageWithServiceResponseAsync(resourceGroupName, environmentName, lastId, batchSize), serviceCallback); } /** @@ -97,7 +97,25 @@ public ServiceCall getUsageAsync(String resourceGroupName, String enviro * @param batchSize size of the batch to be returned. * @return the observable to the Object object */ - public Observable> getUsageAsync(String resourceGroupName, String environmentName, String lastId, int batchSize) { + public Observable getUsageAsync(String resourceGroupName, String environmentName, String lastId, int batchSize) { + return getUsageWithServiceResponseAsync(resourceGroupName, environmentName, lastId, batchSize).map(new Func1, Object>() { + @Override + public Object call(ServiceResponse response) { + return response.getBody(); + } + }); + } + + /** + * Returns usage records for specified subscription and resource groups. + * + * @param resourceGroupName Name of resource group + * @param environmentName Environment name + * @param lastId Last marker that was returned from the batch + * @param batchSize size of the batch to be returned. + * @return the observable to the Object object + */ + public Observable> getUsageWithServiceResponseAsync(String resourceGroupName, String environmentName, String lastId, int batchSize) { if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } diff --git a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceCall.java b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceCall.java index 6fb08726d1cb..c55c189ceea4 100644 --- a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceCall.java +++ b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/AzureServiceCall.java @@ -116,7 +116,7 @@ public void onNext(ServiceResponse> serviceResponse) { } } if (behavior == ListOperationCallback.PagingBehavior.STOP || serviceResponse.getBody().getNextPageLink() == null) { - serviceCall.set(new ServiceResponse<>(lastResponse.getBody().getItems(), lastResponse.getResponse())); + serviceCall.set(lastResponse.getBody().getItems()); } else { serviceCall.setSubscription(next.call(serviceResponse.getBody().getNextPageLink()).single().subscribe(this)); } diff --git a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/ListOperationCallback.java b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/ListOperationCallback.java index 63dc60f9f7c6..3f841b683458 100644 --- a/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/ListOperationCallback.java +++ b/runtimes/azure-client-runtime/src/main/java/com/microsoft/azure/ListOperationCallback.java @@ -8,7 +8,6 @@ package com.microsoft.azure; import com.microsoft.rest.ServiceCallback; -import com.microsoft.rest.ServiceResponse; import java.util.List; @@ -71,7 +70,7 @@ public void load(List result) { } @Override - public void success(ServiceResponse> result) { + public void success(List result) { success(); } diff --git a/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCall.java b/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCall.java index be18dd23a806..960a016b88dd 100644 --- a/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCall.java +++ b/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCall.java @@ -19,7 +19,7 @@ * * @param the type of the returning object */ -public class ServiceCall extends AbstractFuture> { +public class ServiceCall extends AbstractFuture { /** * The Retrofit method invocation. */ @@ -42,7 +42,7 @@ public static ServiceCall create(final Observable> obs .subscribe(new Action1>() { @Override public void call(ServiceResponse t) { - serviceCall.set(t); + serviceCall.set(t.getBody()); } }, new Action1() { @Override @@ -69,9 +69,9 @@ public static ServiceCall create(final Observable> obs @Override public void call(ServiceResponse t) { if (callback != null) { - callback.success(t); + callback.success(t.getBody()); } - serviceCall.set(t); + serviceCall.set(t.getBody()); } }, new Action1() { @Override @@ -102,9 +102,9 @@ public static ServiceCall createWithHeaders(final Observable t) { if (callback != null) { - callback.success(t); + callback.success(t.getBody()); } - serviceCall.set(t); + serviceCall.set(t.getBody()); } }, new Action1() { @Override @@ -136,7 +136,7 @@ protected void setSubscription(Subscription subscription) { * @param result the service response returned. * @return true if successfully reported; false otherwise. */ - public boolean success(ServiceResponse result) { + public boolean success(T result) { return set(result); } diff --git a/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCallback.java b/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCallback.java index dd3791bbb2d1..c3961b880a80 100644 --- a/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCallback.java +++ b/runtimes/client-runtime/src/main/java/com/microsoft/rest/ServiceCallback.java @@ -23,7 +23,7 @@ public abstract class ServiceCallback { /** * Override this method to handle successful REST call results. * - * @param result the ServiceResponse holding the response. + * @param result the result object. */ - public abstract void success(ServiceResponse result); + public abstract void success(T result); }