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 21, 2019
1 parent 3be8239 commit eb81a5c
Show file tree
Hide file tree
Showing 14 changed files with 479 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
@@ -0,0 +1,31 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.billing.v2019_10_01_preview;

import com.microsoft.azure.arm.model.HasInner;
import com.microsoft.azure.arm.resources.models.HasManager;
import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.BillingManager;
import com.microsoft.azure.management.billing.v2019_10_01_preview.implementation.ValidateTransferListResponseInner;
import java.util.List;

/**
* Type representing ValidateTransferListResponse.
*/
public interface ValidateTransferListResponse extends HasInner<ValidateTransferListResponseInner>, HasManager<BillingManager> {
/**
* @return the nextLink value.
*/
String nextLink();

/**
* @return the value value.
*/
List<ValidateTransferResponse> value();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.billing.v2019_10_01_preview;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;

/**
* Transfer validation response.
*/
@JsonFlatten
public class ValidateTransferResponse {
/**
* The status of validation.
*/
@JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY)
private String status;

/**
* The product id for which this result applies.
*/
@JsonProperty(value = "properties.productId", access = JsonProperty.Access.WRITE_ONLY)
private String productId;

/**
* Array of validation results.
*/
@JsonProperty(value = "properties.results")
private List<ValidationResultProperties> results;

/**
* Get the status of validation.
*
* @return the status value
*/
public String status() {
return this.status;
}

/**
* Get the product id for which this result applies.
*
* @return the productId value
*/
public String productId() {
return this.productId;
}

/**
* Get array of validation results.
*
* @return the results value
*/
public List<ValidationResultProperties> results() {
return this.results;
}

/**
* Set array of validation results.
*
* @param results the results value to set
* @return the ValidateTransferResponse object itself.
*/
public ValidateTransferResponse withResults(List<ValidationResultProperties> results) {
this.results = results;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.billing.v2019_10_01_preview;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The properties of the validation result.
*/
public class ValidationResultProperties {
/**
* Result Level.
*/
@JsonProperty(value = "level", access = JsonProperty.Access.WRITE_ONLY)
private String level;

/**
* Result Code.
*/
@JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY)
private String code;

/**
* The validation message.
*/
@JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY)
private String message;

/**
* Get result Level.
*
* @return the level value
*/
public String level() {
return this.level;
}

/**
* Get result Code.
*
* @return the code value
*/
public String code() {
return this.code;
}

/**
* Get the validation message.
*
* @return the message value
*/
public String message() {
return this.message;
}

}
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 eb81a5c

Please sign in to comment.