diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/OperationDefinition.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/OperationDefinition.java new file mode 100644 index 00000000000..462557cbc62 --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/OperationDefinition.java @@ -0,0 +1,69 @@ +/** + * 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.resources; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationDefinition model. + */ +public class OperationDefinition { + /** + * The name of the operation. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The operation display definition. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the OperationDefinition object itself. + */ + public OperationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display value. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display value. + * + * @param display the display value to set + * @return the OperationDefinition object itself. + */ + public OperationDefinition withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/OperationDisplay.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/OperationDisplay.java new file mode 100644 index 00000000000..9f31fbf3d74 --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/OperationDisplay.java @@ -0,0 +1,121 @@ +/** + * 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.resources; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationDisplay model. + */ +public class OperationDisplay { + /** + * Operation provider. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Operation resource. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Operation description. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider value. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider value. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource value. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource value. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation value. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation value. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java index 1cdc1907cc5..385f052f5ae 100644 --- a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/FeaturesInner.java @@ -62,6 +62,10 @@ interface FeaturesService { @GET("subscriptions/{subscriptionId}/providers/Microsoft.Features/features") Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @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.resources.Features operations" }) + @GET("providers/Microsoft.Features/operations") + Observable> operations(@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.resources.Features list1" }) @GET("subscriptions/{subscriptionId}/providers/Microsoft.Features/providers/{resourceProviderNamespace}/features") Observable> list1(@Path("resourceProviderNamespace") String resourceProviderNamespace, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -191,6 +195,72 @@ private ServiceResponse> listDelegate(Response operationsAsync(final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(operationsWithServiceResponseAsync(), serviceCallback); + } + + /** + * Gets all the preview feature operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationsListInner object + */ + public Observable operationsAsync() { + return operationsWithServiceResponseAsync().map(new Func1, OperationsListInner>() { + @Override + public OperationsListInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets all the preview feature operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the OperationsListInner object + */ + public Observable> operationsWithServiceResponseAsync() { + return service.operations(this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = operationsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse operationsDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Gets all the preview features in a provider namespace that are available through AFEC for the subscription. * diff --git a/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/OperationsListInner.java b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/OperationsListInner.java new file mode 100644 index 00000000000..c04a4d4fab9 --- /dev/null +++ b/azure-mgmt-resources/src/main/java/com/microsoft/azure/management/resources/implementation/OperationsListInner.java @@ -0,0 +1,45 @@ +/** + * 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.resources.implementation; + +import java.util.List; +import com.microsoft.azure.management.resources.OperationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OperationsListInner model. + */ +public class OperationsListInner { + /** + * The array of feature operations. + */ + @JsonProperty(value = "operations") + private List operations; + + /** + * Get the operations value. + * + * @return the operations value + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations value. + * + * @param operations the operations value to set + * @return the OperationsListInner object itself. + */ + public OperationsListInner withOperations(List operations) { + this.operations = operations; + return this; + } + +}