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,109 @@
/**
* 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.containerservice.implementation;

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

/**
* Describes the properties of a Compute Operation value.
*/
@JsonFlatten
public class OperationValueInner {
/**
* The origin of the compute operation.
*/
@JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
private String origin;

/**
* The name of the compute operation.
*/
@JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
private String name;

/**
* The display name of the compute operation.
*/
@JsonProperty(value = "display.operation", access = JsonProperty.Access.WRITE_ONLY)
private String operation;

/**
* The display name of the resource the operation applies to.
*/
@JsonProperty(value = "display.resource", access = JsonProperty.Access.WRITE_ONLY)
private String resource;

/**
* The description of the operation.
*/
@JsonProperty(value = "display.description", access = JsonProperty.Access.WRITE_ONLY)
private String description;

/**
* The resource provider for the operation.
*/
@JsonProperty(value = "display.provider", access = JsonProperty.Access.WRITE_ONLY)
private String provider;

/**
* Get the origin of the compute operation.
*
* @return the origin value
*/
public String origin() {
return this.origin;
}

/**
* Get the name of the compute operation.
*
* @return the name value
*/
public String name() {
return this.name;
}

/**
* Get the display name of the compute operation.
*
* @return the operation value
*/
public String operation() {
return this.operation;
}

/**
* Get the display name of the resource the operation applies to.
*
* @return the resource value
*/
public String resource() {
return this.resource;
}

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

/**
* Get the resource provider for the operation.
*
* @return the provider value
*/
public String provider() {
return this.provider;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ interface OperationsService {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the List<ComputeOperationValueInner> object if successful.
* @return the List<OperationValueInner> object if successful.
*/
public List<ComputeOperationValueInner> list() {
public List<OperationValueInner> list() {
return listWithServiceResponseAsync().toBlocking().single().body();
}

Expand All @@ -76,20 +76,20 @@ public List<ComputeOperationValueInner> list() {
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
public ServiceFuture<List<ComputeOperationValueInner>> listAsync(final ServiceCallback<List<ComputeOperationValueInner>> serviceCallback) {
public ServiceFuture<List<OperationValueInner>> listAsync(final ServiceCallback<List<OperationValueInner>> serviceCallback) {
return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback);
}

/**
* Gets a list of compute operations.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List&lt;ComputeOperationValueInner&gt; object
* @return the observable to the List&lt;OperationValueInner&gt; object
*/
public Observable<List<ComputeOperationValueInner>> listAsync() {
return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<ComputeOperationValueInner>>, List<ComputeOperationValueInner>>() {
public Observable<List<OperationValueInner>> listAsync() {
return listWithServiceResponseAsync().map(new Func1<ServiceResponse<List<OperationValueInner>>, List<OperationValueInner>>() {
@Override
public List<ComputeOperationValueInner> call(ServiceResponse<List<ComputeOperationValueInner>> response) {
public List<OperationValueInner> call(ServiceResponse<List<OperationValueInner>> response) {
return response.body();
}
});
Expand All @@ -99,21 +99,21 @@ public List<ComputeOperationValueInner> call(ServiceResponse<List<ComputeOperati
* Gets a list of compute operations.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List&lt;ComputeOperationValueInner&gt; object
* @return the observable to the List&lt;OperationValueInner&gt; object
*/
public Observable<ServiceResponse<List<ComputeOperationValueInner>>> listWithServiceResponseAsync() {
public Observable<ServiceResponse<List<OperationValueInner>>> listWithServiceResponseAsync() {
final String apiVersion = "2018-03-31";
return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<ComputeOperationValueInner>>>>() {
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<OperationValueInner>>>>() {
@Override
public Observable<ServiceResponse<List<ComputeOperationValueInner>>> call(Response<ResponseBody> response) {
public Observable<ServiceResponse<List<OperationValueInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl1<ComputeOperationValueInner>> result = listDelegate(response);
List<ComputeOperationValueInner> items = null;
ServiceResponse<PageImpl1<OperationValueInner>> result = listDelegate(response);
List<OperationValueInner> items = null;
if (result.body() != null) {
items = result.body().items();
}
ServiceResponse<List<ComputeOperationValueInner>> clientResponse = new ServiceResponse<List<ComputeOperationValueInner>>(items, result.response());
ServiceResponse<List<OperationValueInner>> clientResponse = new ServiceResponse<List<OperationValueInner>>(items, result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
Expand All @@ -122,9 +122,9 @@ public Observable<ServiceResponse<List<ComputeOperationValueInner>>> call(Respon
});
}

private ServiceResponse<PageImpl1<ComputeOperationValueInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException {
return this.client.restClient().responseBuilderFactory().<PageImpl1<ComputeOperationValueInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl1<ComputeOperationValueInner>>() { }.getType())
private ServiceResponse<PageImpl1<OperationValueInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException {
return this.client.restClient().responseBuilderFactory().<PageImpl1<OperationValueInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl1<OperationValueInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
Expand Down