Skip to content

Commit

Permalink
Generated from 57a1d14a611271e5520af855d2626ae81ed092d2 (#48)
Browse files Browse the repository at this point in the history
Address PR feedback.
  • Loading branch information
openapi-sdkautomation[bot] authored and SDK Automation committed Aug 23, 2019
1 parent 60b108f commit 29ce18c
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface Departments extends HasInner<DepartmentsInner> {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<DepartmentListResult> listByBillingAccountNameAsync(String billingAccountName);
Observable<DepartmentListResult> listByBillingAccountAsync(String billingAccountName);

/**
* Get the department by id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface EnrollmentAccounts extends HasInner<EnrollmentAccountsInner> {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/
Observable<EnrollmentAccountListResult> listByBillingAccountNameAsync(String billingAccountName);
Observable<EnrollmentAccountListResult> listByBillingAccountAsync(String billingAccountName);

/**
* Get the enrollment account by id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,6 @@ public interface RecipientTransfers extends HasInner<RecipientTransfersInner> {
*/
Observable<RecipientTransferDetails> 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<ValidateTransferListResponse> validateAsync(String transferName);

/**
* Declines the transfer with given transfer Id.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ private DepartmentImpl wrapModel(DepartmentInner inner) {
}

@Override
public Observable<DepartmentListResult> listByBillingAccountNameAsync(String billingAccountName) {
public Observable<DepartmentListResult> listByBillingAccountAsync(String billingAccountName) {
DepartmentsInner client = this.inner();
return client.listByBillingAccountNameAsync(billingAccountName)
return client.listByBillingAccountAsync(billingAccountName)
.map(new Func1<DepartmentListResultInner, DepartmentListResult>() {
@Override
public DepartmentListResult call(DepartmentListResultInner inner) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response<ResponseBody>> 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<Response<ResponseBody>> 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}")
Expand All @@ -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();
}

/**
Expand All @@ -82,8 +82,8 @@ public DepartmentListResultInner listByBillingAccountName(String billingAccountN
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<DepartmentListResultInner> listByBillingAccountNameAsync(String billingAccountName, final ServiceCallback<DepartmentListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName), serviceCallback);
public ServiceFuture<DepartmentListResultInner> listByBillingAccountAsync(String billingAccountName, final ServiceCallback<DepartmentListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName), serviceCallback);
}

/**
Expand All @@ -93,8 +93,8 @@ public ServiceFuture<DepartmentListResultInner> listByBillingAccountNameAsync(St
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DepartmentListResultInner object
*/
public Observable<DepartmentListResultInner> listByBillingAccountNameAsync(String billingAccountName) {
return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).map(new Func1<ServiceResponse<DepartmentListResultInner>, DepartmentListResultInner>() {
public Observable<DepartmentListResultInner> listByBillingAccountAsync(String billingAccountName) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1<ServiceResponse<DepartmentListResultInner>, DepartmentListResultInner>() {
@Override
public DepartmentListResultInner call(ServiceResponse<DepartmentListResultInner> response) {
return response.body();
Expand All @@ -109,7 +109,7 @@ public DepartmentListResultInner call(ServiceResponse<DepartmentListResultInner>
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DepartmentListResultInner object
*/
public Observable<ServiceResponse<DepartmentListResultInner>> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName) {
public Observable<ServiceResponse<DepartmentListResultInner>> listByBillingAccountWithServiceResponseAsync(String billingAccountName) {
if (billingAccountName == null) {
throw new IllegalArgumentException("Parameter billingAccountName is required and cannot be null.");
}
Expand All @@ -118,12 +118,12 @@ public Observable<ServiceResponse<DepartmentListResultInner>> 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<Response<ResponseBody>, Observable<ServiceResponse<DepartmentListResultInner>>>() {
@Override
public Observable<ServiceResponse<DepartmentListResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<DepartmentListResultInner> clientResponse = listByBillingAccountNameDelegate(response);
ServiceResponse<DepartmentListResultInner> clientResponse = listByBillingAccountDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
Expand All @@ -143,8 +143,8 @@ public Observable<ServiceResponse<DepartmentListResultInner>> call(Response<Resp
* @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, String expand, String filter) {
return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body();
public DepartmentListResultInner listByBillingAccount(String billingAccountName, String expand, String filter) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body();
}

/**
Expand All @@ -157,8 +157,8 @@ public DepartmentListResultInner listByBillingAccountName(String billingAccountN
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<DepartmentListResultInner> listByBillingAccountNameAsync(String billingAccountName, String expand, String filter, final ServiceCallback<DepartmentListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback);
public ServiceFuture<DepartmentListResultInner> listByBillingAccountAsync(String billingAccountName, String expand, String filter, final ServiceCallback<DepartmentListResultInner> serviceCallback) {
return ServiceFuture.fromResponse(listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter), serviceCallback);
}

/**
Expand All @@ -170,8 +170,8 @@ public ServiceFuture<DepartmentListResultInner> listByBillingAccountNameAsync(St
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DepartmentListResultInner object
*/
public Observable<DepartmentListResultInner> listByBillingAccountNameAsync(String billingAccountName, String expand, String filter) {
return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1<ServiceResponse<DepartmentListResultInner>, DepartmentListResultInner>() {
public Observable<DepartmentListResultInner> listByBillingAccountAsync(String billingAccountName, String expand, String filter) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1<ServiceResponse<DepartmentListResultInner>, DepartmentListResultInner>() {
@Override
public DepartmentListResultInner call(ServiceResponse<DepartmentListResultInner> response) {
return response.body();
Expand All @@ -188,19 +188,19 @@ public DepartmentListResultInner call(ServiceResponse<DepartmentListResultInner>
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DepartmentListResultInner object
*/
public Observable<ServiceResponse<DepartmentListResultInner>> listByBillingAccountNameWithServiceResponseAsync(String billingAccountName, String expand, String filter) {
public Observable<ServiceResponse<DepartmentListResultInner>> 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<Response<ResponseBody>, Observable<ServiceResponse<DepartmentListResultInner>>>() {
@Override
public Observable<ServiceResponse<DepartmentListResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<DepartmentListResultInner> clientResponse = listByBillingAccountNameDelegate(response);
ServiceResponse<DepartmentListResultInner> clientResponse = listByBillingAccountDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
Expand All @@ -209,7 +209,7 @@ public Observable<ServiceResponse<DepartmentListResultInner>> call(Response<Resp
});
}

private ServiceResponse<DepartmentListResultInner> listByBillingAccountNameDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
private ServiceResponse<DepartmentListResultInner> listByBillingAccountDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<DepartmentListResultInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<DepartmentListResultInner>() { }.getType())
.registerError(ErrorResponseException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ private EnrollmentAccountImpl wrapModel(EnrollmentAccountInner inner) {
}

@Override
public Observable<EnrollmentAccountListResult> listByBillingAccountNameAsync(String billingAccountName) {
public Observable<EnrollmentAccountListResult> listByBillingAccountAsync(String billingAccountName) {
EnrollmentAccountsInner client = this.inner();
return client.listByBillingAccountNameAsync(billingAccountName)
return client.listByBillingAccountAsync(billingAccountName)
.map(new Func1<EnrollmentAccountListResultInner, EnrollmentAccountListResult>() {
@Override
public EnrollmentAccountListResult call(EnrollmentAccountListResultInner inner) {
Expand Down
Loading

0 comments on commit 29ce18c

Please sign in to comment.