From 29ce18c1a53b8a6b0bdc0c90d60ad93cf0d81675 Mon Sep 17 00:00:00 2001 From: "openapi-bot[bot]" <37845953+openapi-bot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2019 03:06:33 +0000 Subject: [PATCH] Generated from 57a1d14a611271e5520af855d2626ae81ed092d2 (#48) Address PR feedback. --- .../v2019_10_01_preview/Departments.java | 2 +- .../EnrollmentAccounts.java | 2 +- .../RecipientTransfers.java | 9 -- .../implementation/DepartmentsImpl.java | 4 +- .../implementation/DepartmentsInner.java | 42 ++--- .../EnrollmentAccountsImpl.java | 4 +- .../EnrollmentAccountsInner.java | 42 ++--- .../RecipientTransfersImpl.java | 13 -- .../RecipientTransfersInner.java | 153 ------------------ 9 files changed, 48 insertions(+), 223 deletions(-) diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java index ee3ec99c8b898..fca31e4619c91 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/Departments.java @@ -23,7 +23,7 @@ public interface Departments extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listByBillingAccountNameAsync(String billingAccountName); + Observable listByBillingAccountAsync(String billingAccountName); /** * Get the department by id. diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java index 223746844310e..fd18081164f1d 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/EnrollmentAccounts.java @@ -23,7 +23,7 @@ public interface EnrollmentAccounts extends HasInner { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable for the request */ - Observable listByBillingAccountNameAsync(String billingAccountName); + Observable listByBillingAccountAsync(String billingAccountName); /** * Get the enrollment account by id. diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java index ee71b2f440ccc..fa53ce2e0008b 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/RecipientTransfers.java @@ -25,15 +25,6 @@ public interface RecipientTransfers extends HasInner { */ Observable acceptAsync(String transferName); - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - Observable validateAsync(String transferName); - /** * Declines the transfer with given transfer Id. * diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java index e4f534ea3c37c..be5024abca751 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsImpl.java @@ -33,9 +33,9 @@ private DepartmentImpl wrapModel(DepartmentInner inner) { } @Override - public Observable listByBillingAccountNameAsync(String billingAccountName) { + public Observable listByBillingAccountAsync(String billingAccountName) { DepartmentsInner client = this.inner(); - return client.listByBillingAccountNameAsync(billingAccountName) + return client.listByBillingAccountAsync(billingAccountName) .map(new Func1() { @Override public DepartmentListResult call(DepartmentListResultInner inner) { diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java index ecc73c61fd1a9..662ab394fff20 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/DepartmentsInner.java @@ -51,9 +51,9 @@ public DepartmentsInner(Retrofit retrofit, BillingManagementClientImpl client) { * used by Retrofit to perform actually REST calls. */ interface DepartmentsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Departments listByBillingAccountName" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Departments listByBillingAccount" }) @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments") - Observable> listByBillingAccountName(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Departments get" }) @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments/{departmentName}") @@ -70,8 +70,8 @@ interface DepartmentsService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the DepartmentListResultInner object if successful. */ - public DepartmentListResultInner listByBillingAccountName(String billingAccountName) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + public DepartmentListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); } /** @@ -82,8 +82,8 @@ public DepartmentListResultInner listByBillingAccountName(String billingAccountN * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName), serviceCallback); + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); } /** @@ -93,8 +93,8 @@ public ServiceFuture listByBillingAccountNameAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DepartmentListResultInner object */ - public Observable listByBillingAccountNameAsync(String billingAccountName) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).map(new Func1, DepartmentListResultInner>() { + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, DepartmentListResultInner>() { @Override public DepartmentListResultInner call(ServiceResponse response) { return response.body(); @@ -109,7 +109,7 @@ public DepartmentListResultInner call(ServiceResponse * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DepartmentListResultInner object */ - public Observable> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName) { + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { if (billingAccountName == null) { throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); } @@ -118,12 +118,12 @@ public Observable> listByBillingAccou } final String expand = null; final String filter = null; - return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + ServiceResponse clientResponse = listByBillingAccountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -143,8 +143,8 @@ public Observable> call(Response listByBillingAccountNameAsync(String billingAccountName, String expand, String filter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback); + public ServiceFuture listByBillingAccountAsync(String billingAccountName, String expand, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback); } /** @@ -170,8 +170,8 @@ public ServiceFuture listByBillingAccountNameAsync(St * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DepartmentListResultInner object */ - public Observable listByBillingAccountNameAsync(String billingAccountName, String expand, String filter) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1, DepartmentListResultInner>() { + public Observable listByBillingAccountAsync(String billingAccountName, String expand, String filter) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1, DepartmentListResultInner>() { @Override public DepartmentListResultInner call(ServiceResponse response) { return response.body(); @@ -188,19 +188,19 @@ public DepartmentListResultInner call(ServiceResponse * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the DepartmentListResultInner object */ - public Observable> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName, String expand, String filter) { + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName, String expand, String filter) { if (billingAccountName == null) { throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + ServiceResponse clientResponse = listByBillingAccountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -209,7 +209,7 @@ public Observable> call(Response listByBillingAccountNameDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java index 937bbde483b6e..20d8743915a58 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsImpl.java @@ -33,9 +33,9 @@ private EnrollmentAccountImpl wrapModel(EnrollmentAccountInner inner) { } @Override - public Observable listByBillingAccountNameAsync(String billingAccountName) { + public Observable listByBillingAccountAsync(String billingAccountName) { EnrollmentAccountsInner client = this.inner(); - return client.listByBillingAccountNameAsync(billingAccountName) + return client.listByBillingAccountAsync(billingAccountName) .map(new Func1() { @Override public EnrollmentAccountListResult call(EnrollmentAccountListResultInner inner) { diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java index 37e09e04fe11a..536f275a2d580 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/EnrollmentAccountsInner.java @@ -51,9 +51,9 @@ public EnrollmentAccountsInner(Retrofit retrofit, BillingManagementClientImpl cl * used by Retrofit to perform actually REST calls. */ interface EnrollmentAccountsService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts listByBillingAccountName" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts listByBillingAccount" }) @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts") - Observable> listByBillingAccountName(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> listByBillingAccount(@Path("billingAccountName") String billingAccountName, @Query("api-version") String apiVersion, @Query("$expand") String expand, @Query("$filter") String filter, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.EnrollmentAccounts getByEnrollmentAccountId" }) @GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}") @@ -70,8 +70,8 @@ interface EnrollmentAccountsService { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the EnrollmentAccountListResultInner object if successful. */ - public EnrollmentAccountListResultInner listByBillingAccountName(String billingAccountName) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); + public EnrollmentAccountListResultInner listByBillingAccount(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body(); } /** @@ -82,8 +82,8 @@ public EnrollmentAccountListResultInner listByBillingAccountName(String billingA * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName), serviceCallback); + public ServiceFuture listByBillingAccountAsync(String billingAccountName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback); } /** @@ -93,8 +93,8 @@ public ServiceFuture listByBillingAccountNameA * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EnrollmentAccountListResultInner object */ - public Observable listByBillingAccountNameAsync(String billingAccountName) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).map(new Func1, EnrollmentAccountListResultInner>() { + public Observable listByBillingAccountAsync(String billingAccountName) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1, EnrollmentAccountListResultInner>() { @Override public EnrollmentAccountListResultInner call(ServiceResponse response) { return response.body(); @@ -109,7 +109,7 @@ public EnrollmentAccountListResultInner call(ServiceResponse> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName) { + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName) { if (billingAccountName == null) { throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); } @@ -118,12 +118,12 @@ public Observable> listByBilli } final String expand = null; final String filter = null; - return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + ServiceResponse clientResponse = listByBillingAccountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -143,8 +143,8 @@ public Observable> call(Respon * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the EnrollmentAccountListResultInner object if successful. */ - public EnrollmentAccountListResultInner listByBillingAccountName(String billingAccountName, String expand, String filter) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body(); + public EnrollmentAccountListResultInner listByBillingAccount(String billingAccountName, String expand, String filter) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body(); } /** @@ -157,8 +157,8 @@ public EnrollmentAccountListResultInner listByBillingAccountName(String billingA * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listByBillingAccountNameAsync(String billingAccountName, String expand, String filter, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback); + public ServiceFuture listByBillingAccountAsync(String billingAccountName, String expand, String filter, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback); } /** @@ -170,8 +170,8 @@ public ServiceFuture listByBillingAccountNameA * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the EnrollmentAccountListResultInner object */ - public Observable listByBillingAccountNameAsync(String billingAccountName, String expand, String filter) { - return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1, EnrollmentAccountListResultInner>() { + public Observable listByBillingAccountAsync(String billingAccountName, String expand, String filter) { + return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1, EnrollmentAccountListResultInner>() { @Override public EnrollmentAccountListResultInner call(ServiceResponse response) { return response.body(); @@ -188,19 +188,19 @@ public EnrollmentAccountListResultInner call(ServiceResponse> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName, String expand, String filter) { + public Observable> listByBillingAccountWithServiceResponseAsync(String billingAccountName, String expand, String filter) { if (billingAccountName == null) { throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } - return service.listByBillingAccountName(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) + return service.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { try { - ServiceResponse clientResponse = listByBillingAccountNameDelegate(response); + ServiceResponse clientResponse = listByBillingAccountDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); @@ -209,7 +209,7 @@ public Observable> call(Respon }); } - private ServiceResponse listByBillingAccountNameDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + private ServiceResponse listByBillingAccountDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .registerError(ErrorResponseException.class) diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java index c189864fb1a6b..fe51097b546ac 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersImpl.java @@ -15,7 +15,6 @@ import rx.Observable; import com.microsoft.azure.Page; import com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransferDetails; -import com.microsoft.azure.management.billing.v2019_10_01_preview.ValidateTransferListResponse; class RecipientTransfersImpl extends WrapperImpl implements RecipientTransfers { private final BillingManager manager; @@ -41,18 +40,6 @@ public RecipientTransferDetails call(RecipientTransferDetailsInner inner) { }); } - @Override - public Observable validateAsync(String transferName) { - RecipientTransfersInner client = this.inner(); - return client.validateAsync(transferName) - .map(new Func1() { - @Override - public ValidateTransferListResponse call(ValidateTransferListResponseInner inner) { - return new ValidateTransferListResponseImpl(inner, manager()); - } - }); - } - @Override public Observable declineAsync(String transferName) { RecipientTransfersInner client = this.inner(); diff --git a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java index d09881ea19db8..1669ea16f254d 100644 --- a/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java +++ b/billing/resource-manager/v2019_10_01_preview/src/main/java/com/microsoft/azure/management/billing/v2019_10_01_preview/implementation/RecipientTransfersInner.java @@ -65,10 +65,6 @@ interface RecipientTransfersService { @POST("providers/Microsoft.Billing/transfers/{transferName}/acceptTransfer") Observable> accept(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Body AcceptTransferRequest parameters, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers validate" }) - @POST("providers/Microsoft.Billing/transfers/{transferName}/validateTransfer") - Observable> validate(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Body AcceptTransferRequest parameters, @Header("User-Agent") String userAgent); - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.RecipientTransfers decline" }) @POST("providers/Microsoft.Billing/transfers/{transferName}/declineTransfer") Observable> decline(@Path("transferName") String transferName, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -236,155 +232,6 @@ private ServiceResponse acceptDelegate(Response validateAsync(String transferName, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(validateWithServiceResponseAsync(transferName), serviceCallback); - } - - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ValidateTransferListResponseInner object - */ - public Observable validateAsync(String transferName) { - return validateWithServiceResponseAsync(transferName).map(new Func1, ValidateTransferListResponseInner>() { - @Override - public ValidateTransferListResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ValidateTransferListResponseInner object - */ - public Observable> validateWithServiceResponseAsync(String transferName) { - if (transferName == null) { - throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); - } - final List productDetails = null; - AcceptTransferRequest parameters = new AcceptTransferRequest(); - parameters.withProductDetails(null); - return service.validate(transferName, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = validateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @param productDetails Request parameters to accept transfer. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws ErrorResponseException thrown if the request is rejected by server - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent - * @return the ValidateTransferListResponseInner object if successful. - */ - public ValidateTransferListResponseInner validate(String transferName, List productDetails) { - return validateWithServiceResponseAsync(transferName, productDetails).toBlocking().single().body(); - } - - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @param productDetails Request parameters to accept transfer. - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture validateAsync(String transferName, List productDetails, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(validateWithServiceResponseAsync(transferName, productDetails), serviceCallback); - } - - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @param productDetails Request parameters to accept transfer. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ValidateTransferListResponseInner object - */ - public Observable validateAsync(String transferName, List productDetails) { - return validateWithServiceResponseAsync(transferName, productDetails).map(new Func1, ValidateTransferListResponseInner>() { - @Override - public ValidateTransferListResponseInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Validates if the products can be transferred in the context of the given transfer name. - * - * @param transferName Transfer Name. - * @param productDetails Request parameters to accept transfer. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the ValidateTransferListResponseInner object - */ - public Observable> validateWithServiceResponseAsync(String transferName, List productDetails) { - if (transferName == null) { - throw new IllegalArgumentException("Parameter transferName is required and cannot be null."); - } - Validator.validate(productDetails); - AcceptTransferRequest parameters = new AcceptTransferRequest(); - parameters.withProductDetails(productDetails); - return service.validate(transferName, this.client.acceptLanguage(), parameters, this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = validateDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse validateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(ErrorResponseException.class) - .build(response); - } - /** * Declines the transfer with given transfer Id. *