diff --git a/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/OperationDisplay.java b/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/OperationDisplay.java new file mode 100644 index 000000000000..13e97b37c8ae --- /dev/null +++ b/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/OperationDisplay.java @@ -0,0 +1,95 @@ +/** + * 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.features.v2015_12_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.Features. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Get service provider: Microsoft.Features. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft.Features. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed: Profile, endpoint, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type: Read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + +} diff --git a/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeatureClientImpl.java b/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeatureClientImpl.java index db2b6732bd67..ce25e29aead6 100644 --- a/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeatureClientImpl.java +++ b/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeatureClientImpl.java @@ -8,15 +8,36 @@ package com.microsoft.azure.management.features.v2015_12_01.implementation; +import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; /** * Initializes a new instance of the FeatureClientImpl class. */ public class FeatureClientImpl extends AzureServiceClient { + /** The Retrofit service to perform REST calls. */ + private FeatureClientService service; /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -182,6 +203,7 @@ protected void initialize() { this.generateClientRequestId = true; this.features = new FeaturesInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); + initializeService(); } /** @@ -193,4 +215,239 @@ protected void initialize() { public String userAgent() { return String.format("%s (%s, %s)", super.userAgent(), "FeatureClient", "2015-12-01"); } + + private void initializeService() { + service = restClient().retrofit().create(FeatureClientService.class); + } + + /** + * The interface defining all the services for FeatureClient to be + * used by Retrofit to perform actually REST calls. + */ + interface FeatureClientService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.features.v2015_12_01.FeatureClient listOperations" }) + @GET("providers/Microsoft.Features/operations") + Observable> listOperations(@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.features.v2015_12_01.FeatureClient listOperationsNext" }) + @GET + Observable> listOperationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @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 PagedList<OperationInner> object if successful. + */ + public PagedList listOperations() { + ServiceResponse> response = listOperationsSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listOperationsAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listOperationsSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listOperationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listOperationsAsync() { + return listOperationsWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listOperationsWithServiceResponseAsync() { + return listOperationsSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listOperationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listOperationsSinglePageAsync() { + if (this.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); + } + return service.listOperations(this.apiVersion(), this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listOperationsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listOperationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<OperationInner> object if successful. + */ + public PagedList listOperationsNext(final String nextPageLink) { + ServiceResponse> response = listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listOperationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listOperationsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listOperationsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listOperationsNextAsync(final String nextPageLink) { + return listOperationsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listOperationsNextWithServiceResponseAsync(final String nextPageLink) { + return listOperationsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listOperationsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Microsoft.Features REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listOperationsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listOperationsNext(nextUrl, this.acceptLanguage(), this.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listOperationsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listOperationsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + } diff --git a/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/OperationInner.java b/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/OperationInner.java new file mode 100644 index 000000000000..a31eb8d629a0 --- /dev/null +++ b/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * 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.features.v2015_12_01.implementation; + +import com.microsoft.azure.management.features.v2015_12_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Microsoft.Features operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/locks/resource-manager/v2016_09_01/pom.xml b/locks/resource-manager/v2016_09_01/pom.xml index 709a030f6d8d..cbd6ad0dae96 100644 --- a/locks/resource-manager/v2016_09_01/pom.xml +++ b/locks/resource-manager/v2016_09_01/pom.xml @@ -17,8 +17,8 @@ azure-mgmt-locks 1.0.0-beta jar - Microsoft Azure SDK for Features Management - This package contains Microsoft Features Management SDK. + Microsoft Azure SDK for Authorization Management + This package contains Microsoft Authorization Management SDK. https://github.com/Azure/azure-libraries-for-java diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/AuthorizationOperations.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/AuthorizationOperations.java new file mode 100644 index 000000000000..6318ce0b2cdb --- /dev/null +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/AuthorizationOperations.java @@ -0,0 +1,27 @@ +/** + * 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.locks.v2016_09_01; + +import rx.Observable; +import com.microsoft.azure.management.locks.v2016_09_01.implementation.AuthorizationOperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AuthorizationOperations. + */ +public interface AuthorizationOperations extends HasInner { + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/Operation.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/Operation.java new file mode 100644 index 000000000000..8c7fe1172342 --- /dev/null +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/Operation.java @@ -0,0 +1,30 @@ +/** + * 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.locks.v2016_09_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.locks.v2016_09_01.implementation.LocksManager; +import com.microsoft.azure.management.locks.v2016_09_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/AuthorizationOperationsImpl.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/AuthorizationOperationsImpl.java new file mode 100644 index 000000000000..b6a2594aec75 --- /dev/null +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/AuthorizationOperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.locks.v2016_09_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.locks.v2016_09_01.AuthorizationOperations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.locks.v2016_09_01.Operation; + +class AuthorizationOperationsImpl extends WrapperImpl implements AuthorizationOperations { + private final LocksManager manager; + + AuthorizationOperationsImpl(LocksManager manager) { + super(manager.inner().authorizationOperations()); + this.manager = manager; + } + + public LocksManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + AuthorizationOperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/AuthorizationOperationsInner.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/AuthorizationOperationsInner.java new file mode 100644 index 000000000000..a5e92ba6383e --- /dev/null +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/AuthorizationOperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.locks.v2016_09_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AuthorizationOperations. + */ +public class AuthorizationOperationsInner { + /** The Retrofit service to perform REST calls. */ + private AuthorizationOperationsService service; + /** The service client containing this operation class. */ + private ManagementLockClientImpl client; + + /** + * Initializes an instance of AuthorizationOperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AuthorizationOperationsInner(Retrofit retrofit, ManagementLockClientImpl client) { + this.service = retrofit.create(AuthorizationOperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AuthorizationOperations to be + * used by Retrofit to perform actually REST calls. + */ + interface AuthorizationOperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.locks.v2016_09_01.AuthorizationOperations list" }) + @GET("providers/Microsoft.Authorization/operations") + Observable> list(@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.locks.v2016_09_01.AuthorizationOperations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @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 PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Microsoft.Authorization REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/LocksManager.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/LocksManager.java index 1f5d2ceaccb2..199858cac37d 100644 --- a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/LocksManager.java +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/LocksManager.java @@ -16,14 +16,16 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.locks.v2016_09_01.AuthorizationOperations; import com.microsoft.azure.management.locks.v2016_09_01.ManagementLocks; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; /** - * Entry point to Azure Features resource management. + * Entry point to Azure Authorization resource management. */ public final class LocksManager extends ManagerCore { + private AuthorizationOperations authorizationOperations; private ManagementLocks managementLocks; /** * Get a Configurable instance that can be used to create LocksManager with optional configuration. @@ -34,7 +36,7 @@ public static Configurable configure() { return new LocksManager.ConfigurableImpl(); } /** - * Creates an instance of LocksManager that exposes Features resource management API entry points. + * Creates an instance of LocksManager that exposes Authorization resource management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID @@ -49,7 +51,7 @@ public static LocksManager authenticate(AzureTokenCredentials credentials, Strin .build(), subscriptionId); } /** - * Creates an instance of LocksManager that exposes Features resource management API entry points. + * Creates an instance of LocksManager that exposes Authorization resource management API entry points. * * @param restClient the RestClient to be used for API calls. * @param subscriptionId the subscription UUID @@ -63,15 +65,25 @@ public static LocksManager authenticate(RestClient restClient, String subscripti */ public interface Configurable extends AzureConfigurable { /** - * Creates an instance of LocksManager that exposes Features management API entry points. + * Creates an instance of LocksManager that exposes Authorization management API entry points. * * @param credentials the credentials to use * @param subscriptionId the subscription UUID - * @return the interface exposing Features management API entry points that work across subscriptions + * @return the interface exposing Authorization management API entry points that work across subscriptions */ LocksManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } + /** + * @return Entry point to manage AuthorizationOperations. + */ + public AuthorizationOperations authorizationOperations() { + if (this.authorizationOperations == null) { + this.authorizationOperations = new AuthorizationOperationsImpl(this); + } + return this.authorizationOperations; + } + /** * @return Entry point to manage ManagementLocks. */ diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLockClientImpl.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLockClientImpl.java index 9a154d916f9b..74fe2d392ed5 100644 --- a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLockClientImpl.java +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLockClientImpl.java @@ -8,36 +8,15 @@ package com.microsoft.azure.management.locks.v2016_09_01.implementation; -import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureClient; import com.microsoft.azure.AzureServiceClient; -import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; -import com.microsoft.azure.ListOperationCallback; -import com.microsoft.azure.Page; -import com.microsoft.azure.PagedList; import com.microsoft.rest.credentials.ServiceClientCredentials; import com.microsoft.rest.RestClient; -import com.microsoft.rest.ServiceFuture; -import com.microsoft.rest.ServiceResponse; -import java.io.IOException; -import java.util.List; -import okhttp3.ResponseBody; -import retrofit2.http.GET; -import retrofit2.http.Header; -import retrofit2.http.Headers; -import retrofit2.http.Query; -import retrofit2.http.Url; -import retrofit2.Response; -import rx.functions.Func1; -import rx.Observable; /** * Initializes a new instance of the ManagementLockClientImpl class. */ public class ManagementLockClientImpl extends AzureServiceClient { - /** The Retrofit service to perform REST calls. */ - private ManagementLockClientService service; /** the {@link AzureClient} used for long running operations. */ private AzureClient azureClient; @@ -153,6 +132,19 @@ public ManagementLockClientImpl withGenerateClientRequestId(boolean generateClie return this; } + /** + * The AuthorizationOperationsInner object to access its operations. + */ + private AuthorizationOperationsInner authorizationOperations; + + /** + * Gets the AuthorizationOperationsInner object to access its operations. + * @return the AuthorizationOperationsInner object. + */ + public AuthorizationOperationsInner authorizationOperations() { + return this.authorizationOperations; + } + /** * The ManagementLocksInner object to access its operations. */ @@ -201,9 +193,9 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.authorizationOperations = new AuthorizationOperationsInner(restClient().retrofit(), this); this.managementLocks = new ManagementLocksInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); - initializeService(); } /** @@ -215,239 +207,4 @@ protected void initialize() { public String userAgent() { return String.format("%s (%s, %s)", super.userAgent(), "ManagementLockClient", "2016-09-01"); } - - private void initializeService() { - service = restClient().retrofit().create(ManagementLockClientService.class); - } - - /** - * The interface defining all the services for ManagementLockClient to be - * used by Retrofit to perform actually REST calls. - */ - interface ManagementLockClientService { - @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.locks.v2016_09_01.ManagementLockClient listOperations" }) - @GET("providers/Microsoft.Features/operations") - Observable> listOperations(@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.locks.v2016_09_01.ManagementLockClient listOperationsNext" }) - @GET - Observable> listOperationsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); - - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @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 PagedList<OperationInner> object if successful. - */ - public PagedList listOperations() { - ServiceResponse> response = listOperationsSinglePageAsync().toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listOperationsAsync(final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listOperationsSinglePageAsync(), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable> listOperationsAsync() { - return listOperationsWithServiceResponseAsync() - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable>> listOperationsWithServiceResponseAsync() { - return listOperationsSinglePageAsync() - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listOperationsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listOperationsSinglePageAsync() { - if (this.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); - } - return service.listOperations(this.apiVersion(), this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listOperationsDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listOperationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @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 PagedList<OperationInner> object if successful. - */ - public PagedList listOperationsNext(final String nextPageLink) { - ServiceResponse> response = listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single(); - return new PagedList(response.body()) { - @Override - public Page nextPage(String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); - } - }; - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @param serviceFuture the ServiceFuture object tracking the Retrofit calls - * @param serviceCallback the async ServiceCallback to handle successful and failed responses. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the {@link ServiceFuture} object - */ - public ServiceFuture> listOperationsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { - return AzureServiceFuture.fromPageResponse( - listOperationsNextSinglePageAsync(nextPageLink), - new Func1>>>() { - @Override - public Observable>> call(String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink); - } - }, - serviceCallback); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable> listOperationsNextAsync(final String nextPageLink) { - return listOperationsNextWithServiceResponseAsync(nextPageLink) - .map(new Func1>, Page>() { - @Override - public Page call(ServiceResponse> response) { - return response.body(); - } - }); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the PagedList<OperationInner> object - */ - public Observable>> listOperationsNextWithServiceResponseAsync(final String nextPageLink) { - return listOperationsNextSinglePageAsync(nextPageLink) - .concatMap(new Func1>, Observable>>>() { - @Override - public Observable>> call(ServiceResponse> page) { - String nextPageLink = page.body().nextPageLink(); - if (nextPageLink == null) { - return Observable.just(page); - } - return Observable.just(page).concatWith(listOperationsNextWithServiceResponseAsync(nextPageLink)); - } - }); - } - - /** - * Lists all of the available Microsoft.Authorization REST API operations. - * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. - */ - public Observable>> listOperationsNextSinglePageAsync(final String nextPageLink) { - if (nextPageLink == null) { - throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); - } - String nextUrl = String.format("%s", nextPageLink); - return service.listOperationsNext(nextUrl, this.acceptLanguage(), this.userAgent()) - .flatMap(new Func1, Observable>>>() { - @Override - public Observable>> call(Response response) { - try { - ServiceResponse> result = listOperationsNextDelegate(response); - return Observable.just(new ServiceResponse>(result.body(), result.response())); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse> listOperationsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.restClient().responseBuilderFactory()., CloudException>newInstance(this.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - } diff --git a/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/OperationImpl.java b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..67990129fe2b --- /dev/null +++ b/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * 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.locks.v2016_09_01.implementation; + +import com.microsoft.azure.management.locks.v2016_09_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.locks.v2016_09_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final LocksManager manager; + OperationImpl(OperationInner inner, LocksManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public LocksManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/resources/resource-manager/v2016_06_01/pom.xml b/resources/resource-manager/v2016_06_01/pom.xml index b16009df8b60..683657fb1d6d 100644 --- a/resources/resource-manager/v2016_06_01/pom.xml +++ b/resources/resource-manager/v2016_06_01/pom.xml @@ -14,11 +14,11 @@ 0.0.2-beta ../../../pom.xml - azure-mgmt- + azure-mgmt-resources 1.0.0-beta jar - Microsoft Azure SDK for Management - This package contains Microsoft Management SDK. + Microsoft Azure SDK for Resources Management + This package contains Microsoft Resources Management SDK. https://github.com/Azure/azure-libraries-for-java diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Location.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Location.java index df4a8a443b54..00dedf79b0be 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Location.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Location.java @@ -11,12 +11,12 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.management.resources.v2016_06_01.implementation.LocationInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.resources.v2016_06_01.implementation.Manager; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.ResourcesManager; /** * Type representing Location. */ -public interface Location extends HasInner, HasManager { +public interface Location extends HasInner, HasManager { /** * @return the displayName value. */ diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Operation.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Operation.java new file mode 100644 index 000000000000..f2c7d03aa6f1 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Operation.java @@ -0,0 +1,30 @@ +/** + * 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.v2016_06_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.ResourcesManager; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.OperationInner; + +/** + * Type representing Operation. + */ +public interface Operation extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplay display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/OperationDisplay.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/OperationDisplay.java new file mode 100644 index 000000000000..bc8fe4a66686 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/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.v2016_06_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The object that represents the operation. + */ +public class OperationDisplay { + /** + * Service provider: Microsoft.Resources. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * Resource on which the operation is performed: Profile, endpoint, etc. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * Operation type: Read, write, delete, etc. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * Description of the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get service provider: Microsoft.Resources. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set service provider: Microsoft.Resources. + * + * @param provider the provider value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get resource on which the operation is performed: Profile, endpoint, etc. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set resource on which the operation is performed: Profile, endpoint, etc. + * + * @param resource the resource value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get operation type: Read, write, delete, etc. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set operation type: Read, write, delete, etc. + * + * @param operation the operation value to set + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get description of the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set description of the operation. + * + * @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/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Operations.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Operations.java new file mode 100644 index 000000000000..1ad07783bc39 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Operations.java @@ -0,0 +1,27 @@ +/** + * 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.v2016_06_01; + +import rx.Observable; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscription.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscription.java index c970233ba78e..bb67055ccf7b 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscription.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/Subscription.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.resources.v2016_06_01.implementation.Manager; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.ResourcesManager; import com.microsoft.azure.management.resources.v2016_06_01.implementation.SubscriptionInner; /** * Type representing Subscription. */ -public interface Subscription extends HasInner, HasManager { +public interface Subscription extends HasInner, HasManager { /** * @return the authorizationSource value. */ diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/TenantIdDescription.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/TenantIdDescription.java index e4892daf5c03..b6cfdcae5612 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/TenantIdDescription.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/TenantIdDescription.java @@ -10,13 +10,13 @@ import com.microsoft.azure.arm.model.HasInner; import com.microsoft.azure.arm.resources.models.HasManager; -import com.microsoft.azure.management.resources.v2016_06_01.implementation.Manager; +import com.microsoft.azure.management.resources.v2016_06_01.implementation.ResourcesManager; import com.microsoft.azure.management.resources.v2016_06_01.implementation.TenantIdDescriptionInner; /** * Type representing TenantIdDescription. */ -public interface TenantIdDescription extends HasInner, HasManager { +public interface TenantIdDescription extends HasInner, HasManager { /** * @return the id value. */ diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/LocationImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/LocationImpl.java index d8417d855de7..b4dc5cf0ae0b 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/LocationImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/LocationImpl.java @@ -13,15 +13,15 @@ import rx.Observable; class LocationImpl extends WrapperImpl implements Location { - private final Manager manager; + private final ResourcesManager manager; - LocationImpl(LocationInner inner, Manager manager) { + LocationImpl(LocationInner inner, ResourcesManager manager) { super(inner); this.manager = manager; } @Override - public Manager manager() { + public ResourcesManager manager() { return this.manager; } diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationImpl.java new file mode 100644 index 000000000000..b0fb2fec8d2c --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationImpl.java @@ -0,0 +1,37 @@ +/** + * 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.v2016_06_01.implementation; + +import com.microsoft.azure.management.resources.v2016_06_01.Operation; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resources.v2016_06_01.OperationDisplay; + +class OperationImpl extends WrapperImpl implements Operation { + private final ResourcesManager manager; + OperationImpl(OperationInner inner, ResourcesManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ResourcesManager manager() { + return this.manager; + } + + @Override + public OperationDisplay display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationInner.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationInner.java new file mode 100644 index 000000000000..08a6947d99e9 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationInner.java @@ -0,0 +1,70 @@ +/** + * 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.v2016_06_01.implementation; + +import com.microsoft.azure.management.resources.v2016_06_01.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Microsoft.Resources operation. + */ +public class OperationInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The object that represents the operation. + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the object that represents the operation. + * + * @return the display value + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the object that represents the operation. + * + * @param display the display value to set + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationsImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationsImpl.java new file mode 100644 index 000000000000..c7a1e8589d41 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.resources.v2016_06_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.resources.v2016_06_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.resources.v2016_06_01.Operation; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ResourcesManager manager; + + OperationsImpl(ResourcesManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ResourcesManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Operation call(OperationInner inner) { + return new OperationImpl(inner, manager()); + } + }); + } + +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationsInner.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationsInner.java new file mode 100644 index 000000000000..fcee524bcb21 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * 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.v2016_06_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private SubscriptionClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, SubscriptionClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.v2016_06_01.Operations list" }) + @GET("providers/Microsoft.Resources/operations") + Observable> list(@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.v2016_06_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @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 PagedList<OperationInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @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 PagedList<OperationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Microsoft.Resources REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl.java index f7c2708ca2c0..a3cf958c7fb1 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl.java @@ -22,7 +22,7 @@ public class PageImpl implements Page { /** * The link to the next page. */ - @JsonProperty("") + @JsonProperty("nextLink") private String nextPageLink; /** diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl1.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl1.java index 5b3a6612486f..b4dccf8d3ced 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl1.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/PageImpl1.java @@ -22,7 +22,7 @@ public class PageImpl1 implements Page { /** * The link to the next page. */ - @JsonProperty("nextLink") + @JsonProperty("") private String nextPageLink; /** diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/ResourcesManager.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/ResourcesManager.java new file mode 100644 index 000000000000..271c128902d2 --- /dev/null +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/ResourcesManager.java @@ -0,0 +1,120 @@ +/** + * 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.v2016_06_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.resources.v2016_06_01.Operations; +import com.microsoft.azure.management.resources.v2016_06_01.Subscriptions; +import com.microsoft.azure.management.resources.v2016_06_01.Tenants; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure Resources resource management. + */ +public final class ResourcesManager extends ManagerCore { + private Operations operations; + private Subscriptions subscriptions; + private Tenants tenants; + /** + * Get a Configurable instance that can be used to create ResourcesManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ResourcesManager.ConfigurableImpl(); + } + /** + * Creates an instance of ResourcesManager that exposes Resources resource management API entry points. + * + * @param credentials the credentials to use + * @return the ResourcesManager + */ + public static ResourcesManager authenticate(AzureTokenCredentials credentials) { + return new ResourcesManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build()); + } + /** + * Creates an instance of ResourcesManager that exposes Resources resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @return the ResourcesManager + */ + public static ResourcesManager authenticate(RestClient restClient) { + return new ResourcesManager(restClient); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ResourcesManager that exposes Resources management API entry points. + * + * @param credentials the credentials to use + * @return the interface exposing Resources management API entry points that work across subscriptions + */ + ResourcesManager authenticate(AzureTokenCredentials credentials); + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Subscriptions. + */ + public Subscriptions subscriptions() { + if (this.subscriptions == null) { + this.subscriptions = new SubscriptionsImpl(this); + } + return this.subscriptions; + } + + /** + * @return Entry point to manage Tenants. + */ + public Tenants tenants() { + if (this.tenants == null) { + this.tenants = new TenantsImpl(this); + } + return this.tenants; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ResourcesManager authenticate(AzureTokenCredentials credentials) { + return ResourcesManager.authenticate(buildRestClient(credentials)); + } + } + private ResourcesManager(RestClient restClient) { + super( + restClient, + null, + new SubscriptionClientImpl(restClient)); + } +} diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionClientImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionClientImpl.java index e306938366f2..af8bb88688cc 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionClientImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionClientImpl.java @@ -109,6 +109,19 @@ public SubscriptionClientImpl withGenerateClientRequestId(boolean generateClient return this; } + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + /** * The SubscriptionsInner object to access its operations. */ @@ -170,6 +183,7 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.operations = new OperationsInner(restClient().retrofit(), this); this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this); this.tenants = new TenantsInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionImpl.java index b463156e6001..9853ea3bba1c 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionImpl.java @@ -14,14 +14,14 @@ import com.microsoft.azure.management.resources.v2016_06_01.SubscriptionPolicies; class SubscriptionImpl extends WrapperImpl implements Subscription { - private final Manager manager; - SubscriptionImpl(SubscriptionInner inner, Manager manager) { + private final ResourcesManager manager; + SubscriptionImpl(SubscriptionInner inner, ResourcesManager manager) { super(inner); this.manager = manager; } @Override - public Manager manager() { + public ResourcesManager manager() { return this.manager; } diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java index 73ce48bb8aac..66683dfc4cfa 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsImpl.java @@ -19,14 +19,14 @@ import com.microsoft.azure.management.resources.v2016_06_01.Location; class SubscriptionsImpl extends WrapperImpl implements Subscriptions { - private final Manager manager; + private final ResourcesManager manager; - SubscriptionsImpl(Manager manager) { + SubscriptionsImpl(ResourcesManager manager) { super(manager.inner().subscriptions()); this.manager = manager; } - public Manager manager() { + public ResourcesManager manager() { return this.manager; } diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsInner.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsInner.java index f06fa1cb52ce..6c970f5c3654 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsInner.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/SubscriptionsInner.java @@ -139,7 +139,7 @@ public Observable>> listLocationsWithService @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listLocationsDelegate(response); + ServiceResponse> result = listLocationsDelegate(response); List items = null; if (result.body() != null) { items = result.body().items(); @@ -153,9 +153,9 @@ public Observable>> call(Response> listLocationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listLocationsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -324,7 +324,7 @@ public Observable>> listSinglePageAsync( @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -333,9 +333,9 @@ public Observable>> call(Response> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -421,7 +421,7 @@ public Observable>> call(ServiceResponse /** * Gets all subscriptions for a tenant. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<SubscriptionInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -435,7 +435,7 @@ public Observable>> listNextSinglePageAs @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -444,9 +444,9 @@ public Observable>> call(Response> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantIdDescriptionImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantIdDescriptionImpl.java index defc1823ffb3..1935c312615f 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantIdDescriptionImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantIdDescriptionImpl.java @@ -12,14 +12,14 @@ import com.microsoft.azure.arm.model.implementation.WrapperImpl; class TenantIdDescriptionImpl extends WrapperImpl implements TenantIdDescription { - private final Manager manager; - TenantIdDescriptionImpl(TenantIdDescriptionInner inner, Manager manager) { + private final ResourcesManager manager; + TenantIdDescriptionImpl(TenantIdDescriptionInner inner, ResourcesManager manager) { super(inner); this.manager = manager; } @Override - public Manager manager() { + public ResourcesManager manager() { return this.manager; } diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsImpl.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsImpl.java index 977976c2a56c..72bb3b1074c6 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsImpl.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsImpl.java @@ -17,14 +17,14 @@ import com.microsoft.azure.management.resources.v2016_06_01.TenantIdDescription; class TenantsImpl extends WrapperImpl implements Tenants { - private final Manager manager; + private final ResourcesManager manager; - TenantsImpl(Manager manager) { + TenantsImpl(ResourcesManager manager) { super(manager.inner().tenants()); this.manager = manager; } - public Manager manager() { + public ResourcesManager manager() { return this.manager; } diff --git a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsInner.java b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsInner.java index 3b48bfec9d34..9309d0e622d2 100644 --- a/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsInner.java +++ b/resources/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/resources/v2016_06_01/implementation/TenantsInner.java @@ -153,7 +153,7 @@ public Observable>> listSinglePag @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listDelegate(response); + ServiceResponse> result = listDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -162,9 +162,9 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); } @@ -250,7 +250,7 @@ public Observable>> call(ServiceR /** * Gets the tenants for your account. * - ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList<TenantIdDescriptionInner> object wrapped in {@link ServiceResponse} if successful. */ @@ -264,7 +264,7 @@ public Observable>> listNextSingl @Override public Observable>> call(Response response) { try { - ServiceResponse> result = listNextDelegate(response); + ServiceResponse> result = listNextDelegate(response); return Observable.just(new ServiceResponse>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); @@ -273,9 +273,9 @@ public Observable>> call(Response }); } - private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken>() { }.getType()) + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) .registerError(CloudException.class) .build(response); }