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.
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */
package com.microsoft.azure.management.resources.implementation; import 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.management.resources.Tags; import com.microsoft.azure.management.resources.TagsPatchResource; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException; import java.util.List; import okhttp3.ResponseBody; import retrofit2.http.Body; import retrofit2.http.GET; import retrofit2.http.Header; import retrofit2.http.Headers; import retrofit2.http.HTTP; import retrofit2.http.PATCH; import retrofit2.http.Path; import retrofit2.http.PUT; 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 TagOperations.
/** * An instance of this class provides access to all the operations defined * in TagOperations. */
public class TagOperationsInner {
The Retrofit service to perform REST calls.
/** The Retrofit service to perform REST calls. */
private TagOperationsService service;
The service client containing this operation class.
/** The service client containing this operation class. */
private ResourceManagementClientImpl client;
Initializes an instance of TagOperationsInner.
Params:
  • retrofit – the Retrofit instance built from a Retrofit Builder.
  • client – the instance of the service client containing this operation class.
/** * Initializes an instance of TagOperationsInner. * * @param retrofit the Retrofit instance built from a Retrofit Builder. * @param client the instance of the service client containing this operation class. */
public TagOperationsInner(Retrofit retrofit, ResourceManagementClientImpl client) { this.service = retrofit.create(TagOperationsService.class); this.client = client; }
The interface defining all the services for TagOperations to be used by Retrofit to perform actually REST calls.
/** * The interface defining all the services for TagOperations to be * used by Retrofit to perform actually REST calls. */
interface TagOperationsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations deleteValue" }) @HTTP(path = "subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> deleteValue(@Path("tagName") String tagName, @Path("tagValue") String tagValue, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations createOrUpdateValue" }) @PUT("subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}") Observable<Response<ResponseBody>> createOrUpdateValue(@Path("tagName") String tagName, @Path("tagValue") String tagValue, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations createOrUpdate" }) @PUT("subscriptions/{subscriptionId}/tagNames/{tagName}") Observable<Response<ResponseBody>> createOrUpdate(@Path("tagName") String tagName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations delete" }) @HTTP(path = "subscriptions/{subscriptionId}/tagNames/{tagName}", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> delete(@Path("tagName") String tagName, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations list" }) @GET("subscriptions/{subscriptionId}/tagNames") Observable<Response<ResponseBody>> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations createOrUpdateAtScope" }) @PUT("{scope}/providers/Microsoft.Resources/tags/default") Observable<Response<ResponseBody>> createOrUpdateAtScope(@Path(value = "scope", encoded = true) String scope, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body TagsResourceInner parameters, @Header("User-Agent") String userAgent); @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.TagOperations updateAtScope" }) @PATCH("{scope}/providers/Microsoft.Resources/tags/default") Observable<Response<ResponseBody>> updateAtScope(@Path(value = "scope", encoded = true) String scope, @Query("api-version") String apiVersion, @Body TagsPatchResource parameters, @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.TagOperations getAtScope" }) @GET("{scope}/providers/Microsoft.Resources/tags/default") Observable<Response<ResponseBody>> getAtScope(@Path(value = "scope", encoded = true) String scope, @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.TagOperations deleteAtScope" }) @HTTP(path = "{scope}/providers/Microsoft.Resources/tags/default", method = "DELETE", hasBody = true) Observable<Response<ResponseBody>> deleteAtScope(@Path(value = "scope", encoded = true) String scope, @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.TagOperations listNext" }) @GET Observable<Response<ResponseBody>> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); }
Deletes a predefined tag value for a predefined tag name. This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to delete.
Throws:
/** * Deletes a predefined tag value for a predefined tag name. * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource. * * @param tagName The name of the tag. * @param tagValue The value of the tag to delete. * @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 */
public void deleteValue(String tagName, String tagValue) { deleteValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().body(); }
Deletes a predefined tag value for a predefined tag name. This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to delete.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes a predefined tag value for a predefined tag name. * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource. * * @param tagName The name of the tag. * @param tagValue The value of the tag to delete. * @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<Void> deleteValueAsync(String tagName, String tagValue, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); }
Deletes a predefined tag value for a predefined tag name. This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to delete.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes a predefined tag value for a predefined tag name. * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource. * * @param tagName The name of the tag. * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> deleteValueAsync(String tagName, String tagValue) { return deleteValueWithServiceResponseAsync(tagName, tagValue).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes a predefined tag value for a predefined tag name. This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to delete.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes a predefined tag value for a predefined tag name. * This operation allows deleting a value from the list of predefined values for an existing predefined tag name. The value being deleted must not be in use as a tag value for the given tag name for any resource. * * @param tagName The name of the tag. * @param tagValue The value of the tag to delete. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> deleteValueWithServiceResponseAsync(String tagName, String tagValue) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } if (tagValue == null) { throw new IllegalArgumentException("Parameter tagValue is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.deleteValue(tagName, tagValue, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteValueDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> deleteValueDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Creates a predefined value for a predefined tag name. This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to create.
Throws:
Returns:the TagValueInner object if successful.
/** * Creates a predefined value for a predefined tag name. * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters. * * @param tagName The name of the tag. * @param tagValue The value of the tag to create. * @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 TagValueInner object if successful. */
public TagValueInner createOrUpdateValue(String tagName, String tagValue) { return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).toBlocking().single().body(); }
Creates a predefined value for a predefined tag name. This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to create.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates a predefined value for a predefined tag name. * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters. * * @param tagName The name of the tag. * @param tagValue The value of the tag to create. * @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<TagValueInner> createOrUpdateValueAsync(String tagName, String tagValue, final ServiceCallback<TagValueInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateValueWithServiceResponseAsync(tagName, tagValue), serviceCallback); }
Creates a predefined value for a predefined tag name. This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to create.
Throws:
Returns:the observable to the TagValueInner object
/** * Creates a predefined value for a predefined tag name. * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters. * * @param tagName The name of the tag. * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagValueInner object */
public Observable<TagValueInner> createOrUpdateValueAsync(String tagName, String tagValue) { return createOrUpdateValueWithServiceResponseAsync(tagName, tagValue).map(new Func1<ServiceResponse<TagValueInner>, TagValueInner>() { @Override public TagValueInner call(ServiceResponse<TagValueInner> response) { return response.body(); } }); }
Creates a predefined value for a predefined tag name. This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters.
Params:
  • tagName – The name of the tag.
  • tagValue – The value of the tag to create.
Throws:
Returns:the observable to the TagValueInner object
/** * Creates a predefined value for a predefined tag name. * This operation allows adding a value to the list of predefined values for an existing predefined tag name. A tag value can have a maximum of 256 characters. * * @param tagName The name of the tag. * @param tagValue The value of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagValueInner object */
public Observable<ServiceResponse<TagValueInner>> createOrUpdateValueWithServiceResponseAsync(String tagName, String tagValue) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } if (tagValue == null) { throw new IllegalArgumentException("Parameter tagValue is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.createOrUpdateValue(tagName, tagValue, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TagValueInner>>>() { @Override public Observable<ServiceResponse<TagValueInner>> call(Response<ResponseBody> response) { try { ServiceResponse<TagValueInner> clientResponse = createOrUpdateValueDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<TagValueInner> createOrUpdateValueDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<TagValueInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<TagValueInner>() { }.getType()) .register(201, new TypeToken<TagValueInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Creates a predefined tag name. This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
Params:
  • tagName – The name of the tag to create.
Throws:
Returns:the TagDetailsInner object if successful.
/** * Creates a predefined tag name. * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. * * @param tagName The name of the tag to create. * @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 TagDetailsInner object if successful. */
public TagDetailsInner createOrUpdate(String tagName) { return createOrUpdateWithServiceResponseAsync(tagName).toBlocking().single().body(); }
Creates a predefined tag name. This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
Params:
  • tagName – The name of the tag to create.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates a predefined tag name. * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. * * @param tagName The name of the tag to create. * @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<TagDetailsInner> createOrUpdateAsync(String tagName, final ServiceCallback<TagDetailsInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(tagName), serviceCallback); }
Creates a predefined tag name. This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
Params:
  • tagName – The name of the tag to create.
Throws:
Returns:the observable to the TagDetailsInner object
/** * Creates a predefined tag name. * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. * * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagDetailsInner object */
public Observable<TagDetailsInner> createOrUpdateAsync(String tagName) { return createOrUpdateWithServiceResponseAsync(tagName).map(new Func1<ServiceResponse<TagDetailsInner>, TagDetailsInner>() { @Override public TagDetailsInner call(ServiceResponse<TagDetailsInner> response) { return response.body(); } }); }
Creates a predefined tag name. This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'.
Params:
  • tagName – The name of the tag to create.
Throws:
Returns:the observable to the TagDetailsInner object
/** * Creates a predefined tag name. * This operation allows adding a name to the list of predefined tag names for the given subscription. A tag name can have a maximum of 512 characters and is case-insensitive. Tag names cannot have the following prefixes which are reserved for Azure use: 'microsoft', 'azure', 'windows'. * * @param tagName The name of the tag to create. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagDetailsInner object */
public Observable<ServiceResponse<TagDetailsInner>> createOrUpdateWithServiceResponseAsync(String tagName) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.createOrUpdate(tagName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TagDetailsInner>>>() { @Override public Observable<ServiceResponse<TagDetailsInner>> call(Response<ResponseBody> response) { try { ServiceResponse<TagDetailsInner> clientResponse = createOrUpdateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<TagDetailsInner> createOrUpdateDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<TagDetailsInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<TagDetailsInner>() { }.getType()) .register(201, new TypeToken<TagDetailsInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Deletes a predefined tag name. This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.
Params:
  • tagName – The name of the tag.
Throws:
/** * Deletes a predefined tag name. * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted. * * @param tagName The name of the tag. * @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 */
public void delete(String tagName) { deleteWithServiceResponseAsync(tagName).toBlocking().single().body(); }
Deletes a predefined tag name. This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.
Params:
  • tagName – The name of the tag.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes a predefined tag name. * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted. * * @param tagName The name of the tag. * @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<Void> deleteAsync(String tagName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(tagName), serviceCallback); }
Deletes a predefined tag name. This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.
Params:
  • tagName – The name of the tag.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes a predefined tag name. * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted. * * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> deleteAsync(String tagName) { return deleteWithServiceResponseAsync(tagName).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes a predefined tag name. This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted.
Params:
  • tagName – The name of the tag.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes a predefined tag name. * This operation allows deleting a name from the list of predefined tag names for the given subscription. The name being deleted must not be in use as a tag name for any resource. All predefined values for the given name must have already been deleted. * * @param tagName The name of the tag. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> deleteWithServiceResponseAsync(String tagName) { if (tagName == null) { throw new IllegalArgumentException("Parameter tagName is required and cannot be null."); } if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.delete(tagName, this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> deleteDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .register(204, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
  • CloudException – thrown if the request is rejected by server
  • RuntimeException – all other wrapped checked exceptions if the request fails to be sent
Returns:the PagedList<TagDetailsInner> object if successful.
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @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&lt;TagDetailsInner&gt; object if successful. */
public PagedList<TagDetailsInner> list() { ServiceResponse<Page<TagDetailsInner>> response = listSinglePageAsync().toBlocking().single(); return new PagedList<TagDetailsInner>(response.body()) { @Override public Page<TagDetailsInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Params:
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @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<List<TagDetailsInner>> listAsync(final ListOperationCallback<TagDetailsInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(), new Func1<String, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
Returns:the observable to the PagedList<TagDetailsInner> object
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;TagDetailsInner&gt; object */
public Observable<Page<TagDetailsInner>> listAsync() { return listWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<TagDetailsInner>>, Page<TagDetailsInner>>() { @Override public Page<TagDetailsInner> call(ServiceResponse<Page<TagDetailsInner>> response) { return response.body(); } }); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
Returns:the observable to the PagedList<TagDetailsInner> object
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the PagedList&lt;TagDetailsInner&gt; object */
public Observable<ServiceResponse<Page<TagDetailsInner>>> listWithServiceResponseAsync() { return listSinglePageAsync() .concatMap(new Func1<ServiceResponse<Page<TagDetailsInner>>, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(ServiceResponse<Page<TagDetailsInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Throws:
  • IllegalArgumentException – thrown if parameters fail the validation
Returns:the PagedList<TagDetailsInner> object wrapped in ServiceResponse if successful.
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;TagDetailsInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<TagDetailsInner>>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<TagDetailsInner>> result = listDelegate(response); return Observable.just(new ServiceResponse<Page<TagDetailsInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<TagDetailsInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<TagDetailsInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<TagDetailsInner>>() { }.getType()) .registerError(CloudException.class) .build(response); }
Creates or updates the entire set of tags on a resource or subscription. This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.
Params:
  • scope – The resource scope.
  • properties – The set of tags.
Throws:
Returns:the TagsResourceInner object if successful.
/** * Creates or updates the entire set of tags on a resource or subscription. * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. * * @param scope The resource scope. * @param properties The set of tags. * @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 TagsResourceInner object if successful. */
public TagsResourceInner createOrUpdateAtScope(String scope, Tags properties) { return createOrUpdateAtScopeWithServiceResponseAsync(scope, properties).toBlocking().single().body(); }
Creates or updates the entire set of tags on a resource or subscription. This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.
Params:
  • scope – The resource scope.
  • properties – The set of tags.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Creates or updates the entire set of tags on a resource or subscription. * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. * * @param scope The resource scope. * @param properties The set of tags. * @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<TagsResourceInner> createOrUpdateAtScopeAsync(String scope, Tags properties, final ServiceCallback<TagsResourceInner> serviceCallback) { return ServiceFuture.fromResponse(createOrUpdateAtScopeWithServiceResponseAsync(scope, properties), serviceCallback); }
Creates or updates the entire set of tags on a resource or subscription. This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.
Params:
  • scope – The resource scope.
  • properties – The set of tags.
Throws:
Returns:the observable to the TagsResourceInner object
/** * Creates or updates the entire set of tags on a resource or subscription. * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. * * @param scope The resource scope. * @param properties The set of tags. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagsResourceInner object */
public Observable<TagsResourceInner> createOrUpdateAtScopeAsync(String scope, Tags properties) { return createOrUpdateAtScopeWithServiceResponseAsync(scope, properties).map(new Func1<ServiceResponse<TagsResourceInner>, TagsResourceInner>() { @Override public TagsResourceInner call(ServiceResponse<TagsResourceInner> response) { return response.body(); } }); }
Creates or updates the entire set of tags on a resource or subscription. This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags.
Params:
  • scope – The resource scope.
  • properties – The set of tags.
Throws:
Returns:the observable to the TagsResourceInner object
/** * Creates or updates the entire set of tags on a resource or subscription. * This operation allows adding or replacing the entire set of tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags. * * @param scope The resource scope. * @param properties The set of tags. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagsResourceInner object */
public Observable<ServiceResponse<TagsResourceInner>> createOrUpdateAtScopeWithServiceResponseAsync(String scope, Tags properties) { if (scope == null) { throw new IllegalArgumentException("Parameter scope is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } if (properties == null) { throw new IllegalArgumentException("Parameter properties is required and cannot be null."); } Validator.validate(properties); TagsResourceInner parameters = new TagsResourceInner(); parameters.withProperties(properties); return service.createOrUpdateAtScope(scope, this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TagsResourceInner>>>() { @Override public Observable<ServiceResponse<TagsResourceInner>> call(Response<ResponseBody> response) { try { ServiceResponse<TagsResourceInner> clientResponse = createOrUpdateAtScopeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<TagsResourceInner> createOrUpdateAtScopeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<TagsResourceInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<TagsResourceInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Selectively updates the set of tags on a resource or subscription. This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
Params:
  • scope – The resource scope.
  • parameters – the TagsPatchResource value
Throws:
Returns:the TagsResourceInner object if successful.
/** * Selectively updates the set of tags on a resource or subscription. * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs. * * @param scope The resource scope. * @param parameters the TagsPatchResource value * @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 TagsResourceInner object if successful. */
public TagsResourceInner updateAtScope(String scope, TagsPatchResource parameters) { return updateAtScopeWithServiceResponseAsync(scope, parameters).toBlocking().single().body(); }
Selectively updates the set of tags on a resource or subscription. This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
Params:
  • scope – The resource scope.
  • parameters – the TagsPatchResource value
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Selectively updates the set of tags on a resource or subscription. * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs. * * @param scope The resource scope. * @param parameters the TagsPatchResource value * @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<TagsResourceInner> updateAtScopeAsync(String scope, TagsPatchResource parameters, final ServiceCallback<TagsResourceInner> serviceCallback) { return ServiceFuture.fromResponse(updateAtScopeWithServiceResponseAsync(scope, parameters), serviceCallback); }
Selectively updates the set of tags on a resource or subscription. This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
Params:
  • scope – The resource scope.
  • parameters – the TagsPatchResource value
Throws:
Returns:the observable to the TagsResourceInner object
/** * Selectively updates the set of tags on a resource or subscription. * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs. * * @param scope The resource scope. * @param parameters the TagsPatchResource value * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagsResourceInner object */
public Observable<TagsResourceInner> updateAtScopeAsync(String scope, TagsPatchResource parameters) { return updateAtScopeWithServiceResponseAsync(scope, parameters).map(new Func1<ServiceResponse<TagsResourceInner>, TagsResourceInner>() { @Override public TagsResourceInner call(ServiceResponse<TagsResourceInner> response) { return response.body(); } }); }
Selectively updates the set of tags on a resource or subscription. This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs.
Params:
  • scope – The resource scope.
  • parameters – the TagsPatchResource value
Throws:
Returns:the observable to the TagsResourceInner object
/** * Selectively updates the set of tags on a resource or subscription. * This operation allows replacing, merging or selectively deleting tags on the specified resource or subscription. The specified entity can have a maximum of 50 tags at the end of the operation. The 'replace' option replaces the entire set of existing tags with a new set. The 'merge' option allows adding tags with new names and updating the values of tags with existing names. The 'delete' option allows selectively deleting tags based on given names or name/value pairs. * * @param scope The resource scope. * @param parameters the TagsPatchResource value * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagsResourceInner object */
public Observable<ServiceResponse<TagsResourceInner>> updateAtScopeWithServiceResponseAsync(String scope, TagsPatchResource parameters) { if (scope == null) { throw new IllegalArgumentException("Parameter scope is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } if (parameters == null) { throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); } Validator.validate(parameters); return service.updateAtScope(scope, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TagsResourceInner>>>() { @Override public Observable<ServiceResponse<TagsResourceInner>> call(Response<ResponseBody> response) { try { ServiceResponse<TagsResourceInner> clientResponse = updateAtScopeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<TagsResourceInner> updateAtScopeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<TagsResourceInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<TagsResourceInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Gets the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
Throws:
Returns:the TagsResourceInner object if successful.
/** * Gets the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @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 TagsResourceInner object if successful. */
public TagsResourceInner getAtScope(String scope) { return getAtScopeWithServiceResponseAsync(scope).toBlocking().single().body(); }
Gets the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @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<TagsResourceInner> getAtScopeAsync(String scope, final ServiceCallback<TagsResourceInner> serviceCallback) { return ServiceFuture.fromResponse(getAtScopeWithServiceResponseAsync(scope), serviceCallback); }
Gets the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
Throws:
Returns:the observable to the TagsResourceInner object
/** * Gets the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagsResourceInner object */
public Observable<TagsResourceInner> getAtScopeAsync(String scope) { return getAtScopeWithServiceResponseAsync(scope).map(new Func1<ServiceResponse<TagsResourceInner>, TagsResourceInner>() { @Override public TagsResourceInner call(ServiceResponse<TagsResourceInner> response) { return response.body(); } }); }
Gets the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
Throws:
Returns:the observable to the TagsResourceInner object
/** * Gets the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the TagsResourceInner object */
public Observable<ServiceResponse<TagsResourceInner>> getAtScopeWithServiceResponseAsync(String scope) { if (scope == null) { throw new IllegalArgumentException("Parameter scope is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.getAtScope(scope, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<TagsResourceInner>>>() { @Override public Observable<ServiceResponse<TagsResourceInner>> call(Response<ResponseBody> response) { try { ServiceResponse<TagsResourceInner> clientResponse = getAtScopeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<TagsResourceInner> getAtScopeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<TagsResourceInner, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<TagsResourceInner>() { }.getType()) .registerError(CloudException.class) .build(response); }
Deletes the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
Throws:
/** * Deletes the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @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 */
public void deleteAtScope(String scope) { deleteAtScopeWithServiceResponseAsync(scope).toBlocking().single().body(); }
Deletes the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Deletes the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @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<Void> deleteAtScopeAsync(String scope, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteAtScopeWithServiceResponseAsync(scope), serviceCallback); }
Deletes the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<Void> deleteAtScopeAsync(String scope) { return deleteAtScopeWithServiceResponseAsync(scope).map(new Func1<ServiceResponse<Void>, Void>() { @Override public Void call(ServiceResponse<Void> response) { return response.body(); } }); }
Deletes the entire set of tags on a resource or subscription.
Params:
  • scope – The resource scope.
Throws:
Returns:the ServiceResponse object if successful.
/** * Deletes the entire set of tags on a resource or subscription. * * @param scope The resource scope. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
public Observable<ServiceResponse<Void>> deleteAtScopeWithServiceResponseAsync(String scope) { if (scope == null) { throw new IllegalArgumentException("Parameter scope is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } return service.deleteAtScope(scope, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() { @Override public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) { try { ServiceResponse<Void> clientResponse = deleteAtScopeDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<Void> deleteAtScopeDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<Void, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<Void>() { }.getType()) .registerError(CloudException.class) .build(response); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<TagDetailsInner> object if successful.
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @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&lt;TagDetailsInner&gt; object if successful. */
public PagedList<TagDetailsInner> listNext(final String nextPageLink) { ServiceResponse<Page<TagDetailsInner>> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); return new PagedList<TagDetailsInner>(response.body()) { @Override public Page<TagDetailsInner> nextPage(String nextPageLink) { return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); } }; }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
  • serviceFuture – the ServiceFuture object tracking the Retrofit calls
  • serviceCallback – the async ServiceCallback to handle successful and failed responses.
Throws:
Returns:the ServiceFuture object
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @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<List<TagDetailsInner>> listNextAsync(final String nextPageLink, final ServiceFuture<List<TagDetailsInner>> serviceFuture, final ListOperationCallback<TagDetailsInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listNextSinglePageAsync(nextPageLink), new Func1<String, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(String nextPageLink) { return listNextSinglePageAsync(nextPageLink); } }, serviceCallback); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<TagDetailsInner> object
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @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&lt;TagDetailsInner&gt; object */
public Observable<Page<TagDetailsInner>> listNextAsync(final String nextPageLink) { return listNextWithServiceResponseAsync(nextPageLink) .map(new Func1<ServiceResponse<Page<TagDetailsInner>>, Page<TagDetailsInner>>() { @Override public Page<TagDetailsInner> call(ServiceResponse<Page<TagDetailsInner>> response) { return response.body(); } }); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result.
Params:
  • nextPageLink – The NextLink from the previous successful call to List operation.
Throws:
Returns:the observable to the PagedList<TagDetailsInner> object
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * * @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&lt;TagDetailsInner&gt; object */
public Observable<ServiceResponse<Page<TagDetailsInner>>> listNextWithServiceResponseAsync(final String nextPageLink) { return listNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<TagDetailsInner>>, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(ServiceResponse<Page<TagDetailsInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); } }); }
Gets a summary of tag usage under the subscription. This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation.
Throws:
Returns:the PagedList<TagDetailsInner> object wrapped in ServiceResponse if successful.
/** * Gets a summary of tag usage under the subscription. * This operation performs a union of predefined tags, resource tags, resource group tags and subscription tags, and returns a summary of usage for each tag name and value under the given subscription. In case of a large number of tags, this operation may return a previously cached result. * ServiceResponse<PageImpl<TagDetailsInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;TagDetailsInner&gt; object wrapped in {@link ServiceResponse} if successful. */
public Observable<ServiceResponse<Page<TagDetailsInner>>> 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<Response<ResponseBody>, Observable<ServiceResponse<Page<TagDetailsInner>>>>() { @Override public Observable<ServiceResponse<Page<TagDetailsInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<TagDetailsInner>> result = listNextDelegate(response); return Observable.just(new ServiceResponse<Page<TagDetailsInner>>(result.body(), result.response())); } catch (Throwable t) { return Observable.error(t); } } }); } private ServiceResponse<PageImpl<TagDetailsInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException { return this.client.restClient().responseBuilderFactory().<PageImpl<TagDetailsInner>, CloudException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken<PageImpl<TagDetailsInner>>() { }.getType()) .registerError(CloudException.class) .build(response); } }