Skip to content

Commit

Permalink
Generated from 09d9848f00395376b7e1360fe4372d15349bc401 (#70)
Browse files Browse the repository at this point in the history
Address review comments.
  • Loading branch information
openapi-sdkautomation[bot] authored and SDK Automation committed Aug 23, 2019
1 parent 29ce18c commit faf454d
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 48 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> listByBillingAccountAsync(String billingAccountName);
Observable<DepartmentListResult> listByBillingAccountNameAsync(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> listByBillingAccountAsync(String billingAccountName);
Observable<EnrollmentAccountListResult> listByBillingAccountNameAsync(String billingAccountName);

/**
* Get the enrollment account by id.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ 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> listByBillingAccountAsync(String billingAccountName) {
public Observable<DepartmentListResult> listByBillingAccountNameAsync(String billingAccountName) {
DepartmentsInner client = this.inner();
return client.listByBillingAccountAsync(billingAccountName)
return client.listByBillingAccountNameAsync(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 listByBillingAccount" })
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.billing.v2019_10_01_preview.Departments listByBillingAccountName" })
@GET("providers/Microsoft.Billing/billingAccounts/{billingAccountName}/departments")
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);
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);

@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 listByBillingAccount(String billingAccountName) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName).toBlocking().single().body();
public DepartmentListResultInner listByBillingAccountName(String billingAccountName) {
return listByBillingAccountNameWithServiceResponseAsync(billingAccountName).toBlocking().single().body();
}

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

/**
Expand All @@ -93,8 +93,8 @@ public ServiceFuture<DepartmentListResultInner> listByBillingAccountAsync(String
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DepartmentListResultInner object
*/
public Observable<DepartmentListResultInner> listByBillingAccountAsync(String billingAccountName) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName).map(new Func1<ServiceResponse<DepartmentListResultInner>, DepartmentListResultInner>() {
public Observable<DepartmentListResultInner> listByBillingAccountNameAsync(String billingAccountName) {
return listByBillingAccountNameWithServiceResponseAsync(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>> listByBillingAccountWithServiceResponseAsync(String billingAccountName) {
public Observable<ServiceResponse<DepartmentListResultInner>> listByBillingAccountNameWithServiceResponseAsync(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.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent())
return service.listByBillingAccountName(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 = listByBillingAccountDelegate(response);
ServiceResponse<DepartmentListResultInner> clientResponse = listByBillingAccountNameDelegate(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 listByBillingAccount(String billingAccountName, String expand, String filter) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body();
public DepartmentListResultInner listByBillingAccountName(String billingAccountName, String expand, String filter) {
return listByBillingAccountNameWithServiceResponseAsync(billingAccountName, expand, filter).toBlocking().single().body();
}

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

/**
Expand All @@ -170,8 +170,8 @@ public ServiceFuture<DepartmentListResultInner> listByBillingAccountAsync(String
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the DepartmentListResultInner object
*/
public Observable<DepartmentListResultInner> listByBillingAccountAsync(String billingAccountName, String expand, String filter) {
return listByBillingAccountWithServiceResponseAsync(billingAccountName, expand, filter).map(new Func1<ServiceResponse<DepartmentListResultInner>, DepartmentListResultInner>() {
public Observable<DepartmentListResultInner> listByBillingAccountNameAsync(String billingAccountName, String expand, String filter) {
return listByBillingAccountNameWithServiceResponseAsync(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>> listByBillingAccountWithServiceResponseAsync(String billingAccountName, String expand, String filter) {
public Observable<ServiceResponse<DepartmentListResultInner>> listByBillingAccountNameWithServiceResponseAsync(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.listByBillingAccount(billingAccountName, this.client.apiVersion(), expand, filter, this.client.acceptLanguage(), this.client.userAgent())
return service.listByBillingAccountName(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 = listByBillingAccountDelegate(response);
ServiceResponse<DepartmentListResultInner> clientResponse = listByBillingAccountNameDelegate(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> listByBillingAccountDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
private ServiceResponse<DepartmentListResultInner> listByBillingAccountNameDelegate(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> listByBillingAccountAsync(String billingAccountName) {
public Observable<EnrollmentAccountListResult> listByBillingAccountNameAsync(String billingAccountName) {
EnrollmentAccountsInner client = this.inner();
return client.listByBillingAccountAsync(billingAccountName)
return client.listByBillingAccountNameAsync(billingAccountName)
.map(new Func1<EnrollmentAccountListResultInner, EnrollmentAccountListResult>() {
@Override
public EnrollmentAccountListResult call(EnrollmentAccountListResultInner inner) {
Expand Down
Loading

0 comments on commit faf454d

Please sign in to comment.