Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* 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.implementation;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;
import com.microsoft.azure.Resource;

/**
* An enrollment account resource.
*/
@JsonFlatten
public class EnrollmentAccountInner extends Resource {
/**
* The account owner's principal name.
*/
@JsonProperty(value = "properties.principalName", access = JsonProperty.Access.WRITE_ONLY)
private String principalName;

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,30 @@ public class EnrollmentAccountListResultInner {
* The list of enrollment accounts.
*/
@JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
private List<EnrollmentAccountResultInner> value;
private List<EnrollmentAccountInner> value;

/**
* The link (url) to the next page of results.
*/
@JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY)
private String nextLink;

/**
* Get the value value.
*
* @return the value value
*/
public List<EnrollmentAccountResultInner> value() {
public List<EnrollmentAccountInner> value() {
return this.value;
}

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

}
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ private ServiceResponse<EnrollmentAccountListResultInner> listDelegate(Response<
* @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 EnrollmentAccountResultInner object if successful.
* @return the EnrollmentAccountInner object if successful.
*/
public EnrollmentAccountResultInner get(String name) {
public EnrollmentAccountInner get(String name) {
return getWithServiceResponseAsync(name).toBlocking().single().body();
}

Expand All @@ -151,7 +151,7 @@ public EnrollmentAccountResultInner get(String name) {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<EnrollmentAccountResultInner> getAsync(String name, final ServiceCallback<EnrollmentAccountResultInner> serviceCallback) {
public ServiceFuture<EnrollmentAccountInner> getAsync(String name, final ServiceCallback<EnrollmentAccountInner> serviceCallback) {
return ServiceFuture.fromResponse(getWithServiceResponseAsync(name), serviceCallback);
}

Expand All @@ -160,12 +160,12 @@ public ServiceFuture<EnrollmentAccountResultInner> getAsync(String name, final S
*
* @param name Enrollment Account name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the EnrollmentAccountResultInner object
* @return the observable to the EnrollmentAccountInner object
*/
public Observable<EnrollmentAccountResultInner> getAsync(String name) {
return getWithServiceResponseAsync(name).map(new Func1<ServiceResponse<EnrollmentAccountResultInner>, EnrollmentAccountResultInner>() {
public Observable<EnrollmentAccountInner> getAsync(String name) {
return getWithServiceResponseAsync(name).map(new Func1<ServiceResponse<EnrollmentAccountInner>, EnrollmentAccountInner>() {
@Override
public EnrollmentAccountResultInner call(ServiceResponse<EnrollmentAccountResultInner> response) {
public EnrollmentAccountInner call(ServiceResponse<EnrollmentAccountInner> response) {
return response.body();
}
});
Expand All @@ -176,21 +176,21 @@ public EnrollmentAccountResultInner call(ServiceResponse<EnrollmentAccountResult
*
* @param name Enrollment Account name.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the EnrollmentAccountResultInner object
* @return the observable to the EnrollmentAccountInner object
*/
public Observable<ServiceResponse<EnrollmentAccountResultInner>> getWithServiceResponseAsync(String name) {
public Observable<ServiceResponse<EnrollmentAccountInner>> getWithServiceResponseAsync(String name) {
if (name == null) {
throw new IllegalArgumentException("Parameter name 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.get(name, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<EnrollmentAccountResultInner>>>() {
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<EnrollmentAccountInner>>>() {
@Override
public Observable<ServiceResponse<EnrollmentAccountResultInner>> call(Response<ResponseBody> response) {
public Observable<ServiceResponse<EnrollmentAccountInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<EnrollmentAccountResultInner> clientResponse = getDelegate(response);
ServiceResponse<EnrollmentAccountInner> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
Expand All @@ -199,9 +199,9 @@ public Observable<ServiceResponse<EnrollmentAccountResultInner>> call(Response<R
});
}

private ServiceResponse<EnrollmentAccountResultInner> getDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<EnrollmentAccountResultInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<EnrollmentAccountResultInner>() { }.getType())
private ServiceResponse<EnrollmentAccountInner> getDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<EnrollmentAccountInner, ErrorResponseException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<EnrollmentAccountInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
Expand Down