Subscriptions: upgrade to package-subscriptions-2020-01 (#1239)

* upgrade subscriptions to package-subscriptions-2020-01

* generate package-subscriptions-2020-01

* update session records
This commit is contained in:
Chuang 2020-07-21 16:13:20 +08:00 коммит произвёл GitHub
Родитель cd135cc0c0
Коммит dea0fe4f66
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
17 изменённых файлов: 637 добавлений и 117 удалений

Просмотреть файл

@ -324,7 +324,7 @@
"dir": "azure-mgmt-resources",
"source": "specification/resources/resource-manager/readme.md",
"package": "com.microsoft.azure.management.resources",
"args": "--tag=package-subscriptions-2016-06"
"args": "--tag=package-subscriptions-2020-01"
},
"trafficmanager": {
"dir": "azure-mgmt-trafficmanager",

Просмотреть файл

@ -0,0 +1,32 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Information about a tenant managing the subscription.
*/
public class ManagedByTenant {
/**
* The tenant ID of the managing tenant. This is a GUID.
*/
@JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY)
private String tenantId;
/**
* Get the tenant ID of the managing tenant. This is a GUID.
*
* @return the tenantId value
*/
public String tenantId() {
return this.tenantId;
}
}

Просмотреть файл

@ -0,0 +1,69 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Name and Type of the Resource.
*/
public class ResourceName {
/**
* Name of the resource.
*/
@JsonProperty(value = "name", required = true)
private String name;
/**
* The type of the resource.
*/
@JsonProperty(value = "type", required = true)
private String type;
/**
* Get name of the resource.
*
* @return the name value
*/
public String name() {
return this.name;
}
/**
* Set name of the resource.
*
* @param name the name value to set
* @return the ResourceName object itself.
*/
public ResourceName withName(String name) {
this.name = name;
return this;
}
/**
* Get the type of the resource.
*
* @return the type value
*/
public String type() {
return this.type;
}
/**
* Set the type of the resource.
*
* @param type the type value to set
* @return the ResourceName object itself.
*/
public ResourceName withType(String type) {
this.type = type;
return this;
}
}

Просмотреть файл

@ -0,0 +1,41 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.resources;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;
/**
* Defines values for ResourceNameStatus.
*/
public final class ResourceNameStatus extends ExpandableStringEnum<ResourceNameStatus> {
/** Static value Allowed for ResourceNameStatus. */
public static final ResourceNameStatus ALLOWED = fromString("Allowed");
/** Static value Reserved for ResourceNameStatus. */
public static final ResourceNameStatus RESERVED = fromString("Reserved");
/**
* Creates or finds a ResourceNameStatus from its string representation.
* @param name a name to look for
* @return the corresponding ResourceNameStatus
*/
@JsonCreator
public static ResourceNameStatus fromString(String name) {
return fromString(name, ResourceNameStatus.class);
}
/**
* @return known ResourceNameStatus values
*/
public static Collection<ResourceNameStatus> values() {
return values(ResourceNameStatus.class);
}
}

Просмотреть файл

@ -13,6 +13,8 @@ import com.microsoft.azure.management.resources.fluentcore.model.Indexable;
import com.microsoft.azure.management.resources.fluentcore.model.HasInner;
import com.microsoft.azure.management.resources.implementation.SubscriptionInner;
import java.util.List;
/**
* An immutable client-side representation of an Azure subscription.
*/
@ -26,6 +28,11 @@ public interface Subscription extends
*/
String subscriptionId();
/**
* @return the UUID of the subscription tenant
*/
String tenantId();
/**
* @return the name of the subscription for humans to read
*/
@ -41,6 +48,11 @@ public interface Subscription extends
*/
SubscriptionPolicies subscriptionPolicies();
/**
* @return the array containing the tenants managing the subscription
*/
List<ManagedByTenant> managedByTenants();
/**
* List the locations the subscription has access to.
*

Просмотреть файл

@ -37,7 +37,7 @@ public class SubscriptionPolicies {
private SpendingLimit spendingLimit;
/**
* Get the locationPlacementId value.
* Get the subscription location placement ID. The ID indicates which regions are visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions.
*
* @return the locationPlacementId value
*/
@ -46,7 +46,7 @@ public class SubscriptionPolicies {
}
/**
* Get the quotaId value.
* Get the subscription quota ID.
*
* @return the quotaId value
*/
@ -55,7 +55,7 @@ public class SubscriptionPolicies {
}
/**
* Get the spendingLimit value.
* Get the subscription spending limit. Possible values include: 'On', 'Off', 'CurrentPeriodOff'.
*
* @return the spendingLimit value
*/

Просмотреть файл

@ -0,0 +1,98 @@
/**
* 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 com.microsoft.azure.management.resources.ResourceNameStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Resource Name valid if not a reserved word, does not contain a reserved word
* and does not start with a reserved word.
*/
public class CheckResourceNameResultInner {
/**
* Name of Resource.
*/
@JsonProperty(value = "name")
private String name;
/**
* Type of Resource.
*/
@JsonProperty(value = "type")
private String type;
/**
* Is the resource name Allowed or Reserved. Possible values include:
* 'Allowed', 'Reserved'.
*/
@JsonProperty(value = "status")
private ResourceNameStatus status;
/**
* Get name of Resource.
*
* @return the name value
*/
public String name() {
return this.name;
}
/**
* Set name of Resource.
*
* @param name the name value to set
* @return the CheckResourceNameResultInner object itself.
*/
public CheckResourceNameResultInner withName(String name) {
this.name = name;
return this;
}
/**
* Get type of Resource.
*
* @return the type value
*/
public String type() {
return this.type;
}
/**
* Set type of Resource.
*
* @param type the type value to set
* @return the CheckResourceNameResultInner object itself.
*/
public CheckResourceNameResultInner withType(String type) {
this.type = type;
return this;
}
/**
* Get is the resource name Allowed or Reserved. Possible values include: 'Allowed', 'Reserved'.
*
* @return the status value
*/
public ResourceNameStatus status() {
return this.status;
}
/**
* Set is the resource name Allowed or Reserved. Possible values include: 'Allowed', 'Reserved'.
*
* @param status the status value to set
* @return the CheckResourceNameResultInner object itself.
*/
public CheckResourceNameResultInner withStatus(ResourceNameStatus status) {
this.status = status;
return this;
}
}

Просмотреть файл

@ -8,15 +8,34 @@
package com.microsoft.azure.management.resources.implementation;
import com.google.common.reflect.TypeToken;
import com.microsoft.azure.AzureClient;
import com.microsoft.azure.AzureServiceClient;
import com.microsoft.azure.management.resources.ErrorResponseException;
import com.microsoft.azure.management.resources.ResourceName;
import com.microsoft.rest.credentials.ServiceClientCredentials;
import com.microsoft.rest.RestClient;
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 okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.Response;
import rx.functions.Func1;
import rx.Observable;
/**
* Initializes a new instance of the SubscriptionClientImpl class.
*/
public class SubscriptionClientImpl extends AzureServiceClient {
/** The Retrofit service to perform REST calls. */
private SubscriptionClientService service;
/** the {@link AzureClient} used for long running operations. */
private AzureClient azureClient;
@ -40,11 +59,11 @@ public class SubscriptionClientImpl extends AzureServiceClient {
return this.apiVersion;
}
/** Gets or sets the preferred language for the response. */
/** The preferred language for the response. */
private String acceptLanguage;
/**
* Gets Gets or sets the preferred language for the response.
* Gets The preferred language for the response.
*
* @return the acceptLanguage value.
*/
@ -53,7 +72,7 @@ public class SubscriptionClientImpl extends AzureServiceClient {
}
/**
* Sets Gets or sets the preferred language for the response.
* Sets The preferred language for the response.
*
* @param acceptLanguage the acceptLanguage value.
* @return the service client itself
@ -63,11 +82,11 @@ public class SubscriptionClientImpl extends AzureServiceClient {
return this;
}
/** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */
/** The retry timeout in seconds for Long Running Operations. Default value is 30. */
private int longRunningOperationRetryTimeout;
/**
* Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
* Gets The retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @return the longRunningOperationRetryTimeout value.
*/
@ -76,7 +95,7 @@ public class SubscriptionClientImpl extends AzureServiceClient {
}
/**
* Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30.
* Sets The retry timeout in seconds for Long Running Operations. Default value is 30.
*
* @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value.
* @return the service client itself
@ -86,11 +105,11 @@ public class SubscriptionClientImpl extends AzureServiceClient {
return this;
}
/** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
/** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */
private boolean generateClientRequestId;
/**
* Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
* Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
* @return the generateClientRequestId value.
*/
@ -99,7 +118,7 @@ public class SubscriptionClientImpl extends AzureServiceClient {
}
/**
* Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
* Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
* @param generateClientRequestId the generateClientRequestId value.
* @return the service client itself
@ -166,13 +185,14 @@ public class SubscriptionClientImpl extends AzureServiceClient {
}
protected void initialize() {
this.apiVersion = "2016-06-01";
this.apiVersion = "2020-01-01";
this.acceptLanguage = "en-US";
this.longRunningOperationRetryTimeout = 30;
this.generateClientRequestId = true;
this.subscriptions = new SubscriptionsInner(restClient().retrofit(), this);
this.tenants = new TenantsInner(restClient().retrofit(), this);
this.azureClient = new AzureClient(this);
initializeService();
}
/**
@ -182,6 +202,167 @@ public class SubscriptionClientImpl extends AzureServiceClient {
*/
@Override
public String userAgent() {
return String.format("%s (%s, %s)", super.userAgent(), "SubscriptionClient", "2016-06-01");
return String.format("%s (%s, %s)", super.userAgent(), "SubscriptionClient", "2020-01-01");
}
private void initializeService() {
service = restClient().retrofit().create(SubscriptionClientService.class);
}
/**
* The interface defining all the services for SubscriptionClient to be
* used by Retrofit to perform actually REST calls.
*/
interface SubscriptionClientService {
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.resources.SubscriptionClient checkResourceName" })
@POST("providers/Microsoft.Resources/checkResourceName")
Observable<Response<ResponseBody>> checkResourceName(@Body ResourceName resourceNameDefinition, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the CheckResourceNameResultInner object if successful.
*/
public CheckResourceNameResultInner checkResourceName() {
return checkResourceNameWithServiceResponseAsync().toBlocking().single().body();
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @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<CheckResourceNameResultInner> checkResourceNameAsync(final ServiceCallback<CheckResourceNameResultInner> serviceCallback) {
return ServiceFuture.fromResponse(checkResourceNameWithServiceResponseAsync(), serviceCallback);
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckResourceNameResultInner object
*/
public Observable<CheckResourceNameResultInner> checkResourceNameAsync() {
return checkResourceNameWithServiceResponseAsync().map(new Func1<ServiceResponse<CheckResourceNameResultInner>, CheckResourceNameResultInner>() {
@Override
public CheckResourceNameResultInner call(ServiceResponse<CheckResourceNameResultInner> response) {
return response.body();
}
});
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckResourceNameResultInner object
*/
public Observable<ServiceResponse<CheckResourceNameResultInner>> checkResourceNameWithServiceResponseAsync() {
if (this.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
}
final ResourceName resourceNameDefinition = null;
return service.checkResourceName(resourceNameDefinition, this.apiVersion(), this.acceptLanguage(), this.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CheckResourceNameResultInner>>>() {
@Override
public Observable<ServiceResponse<CheckResourceNameResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<CheckResourceNameResultInner> clientResponse = checkResourceNameDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @param resourceNameDefinition Resource object with values for resource name and resource type
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws ErrorResponseException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the CheckResourceNameResultInner object if successful.
*/
public CheckResourceNameResultInner checkResourceName(ResourceName resourceNameDefinition) {
return checkResourceNameWithServiceResponseAsync(resourceNameDefinition).toBlocking().single().body();
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @param resourceNameDefinition Resource object with values for resource name and resource type
* @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<CheckResourceNameResultInner> checkResourceNameAsync(ResourceName resourceNameDefinition, final ServiceCallback<CheckResourceNameResultInner> serviceCallback) {
return ServiceFuture.fromResponse(checkResourceNameWithServiceResponseAsync(resourceNameDefinition), serviceCallback);
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @param resourceNameDefinition Resource object with values for resource name and resource type
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckResourceNameResultInner object
*/
public Observable<CheckResourceNameResultInner> checkResourceNameAsync(ResourceName resourceNameDefinition) {
return checkResourceNameWithServiceResponseAsync(resourceNameDefinition).map(new Func1<ServiceResponse<CheckResourceNameResultInner>, CheckResourceNameResultInner>() {
@Override
public CheckResourceNameResultInner call(ServiceResponse<CheckResourceNameResultInner> response) {
return response.body();
}
});
}
/**
* Checks resource name validity.
* A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word.
*
* @param resourceNameDefinition Resource object with values for resource name and resource type
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the CheckResourceNameResultInner object
*/
public Observable<ServiceResponse<CheckResourceNameResultInner>> checkResourceNameWithServiceResponseAsync(ResourceName resourceNameDefinition) {
if (this.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
}
Validator.validate(resourceNameDefinition);
return service.checkResourceName(resourceNameDefinition, this.apiVersion(), this.acceptLanguage(), this.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<CheckResourceNameResultInner>>>() {
@Override
public Observable<ServiceResponse<CheckResourceNameResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<CheckResourceNameResultInner> clientResponse = checkResourceNameDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
private ServiceResponse<CheckResourceNameResultInner> checkResourceNameDelegate(Response<ResponseBody> response) throws ErrorResponseException, IOException, IllegalArgumentException {
return this.restClient().responseBuilderFactory().<CheckResourceNameResultInner, ErrorResponseException>newInstance(this.serializerAdapter())
.register(200, new TypeToken<CheckResourceNameResultInner>() { }.getType())
.registerError(ErrorResponseException.class)
.build(response);
}
}

Просмотреть файл

@ -9,6 +9,7 @@ package com.microsoft.azure.management.resources.implementation;
import com.microsoft.azure.Page;
import com.microsoft.azure.PagedList;
import com.microsoft.azure.management.resources.Location;
import com.microsoft.azure.management.resources.ManagedByTenant;
import com.microsoft.azure.management.resources.Subscription;
import com.microsoft.azure.management.resources.SubscriptionPolicies;
import com.microsoft.azure.management.resources.SubscriptionState;
@ -39,6 +40,11 @@ final class SubscriptionImpl extends
return this.inner().subscriptionId();
}
@Override
public String tenantId() {
return this.inner().tenantId();
}
@Override
public String displayName() {
return this.inner().displayName();
@ -54,6 +60,11 @@ final class SubscriptionImpl extends
return this.inner().subscriptionPolicies();
}
@Override
public List<ManagedByTenant> managedByTenants() {
return this.inner().managedByTenants();
}
@Override
public PagedList<Location> listLocations() {
PagedListConverter<LocationInner, Location> converter = new PagedListConverter<LocationInner, Location>() {

Просмотреть файл

@ -10,6 +10,9 @@ package com.microsoft.azure.management.resources.implementation;
import com.microsoft.azure.management.resources.SubscriptionState;
import com.microsoft.azure.management.resources.SubscriptionPolicies;
import java.util.List;
import com.microsoft.azure.management.resources.ManagedByTenant;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
@ -35,6 +38,12 @@ public class SubscriptionInner {
@JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY)
private String displayName;
/**
* The subscription tenant ID.
*/
@JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY)
private String tenantId;
/**
* The subscription state. Possible values are Enabled, Warned, PastDue,
* Disabled, and Deleted. Possible values include: 'Enabled', 'Warned',
@ -58,7 +67,19 @@ public class SubscriptionInner {
private String authorizationSource;
/**
* Get the id value.
* An array containing the tenants managing the subscription.
*/
@JsonProperty(value = "managedByTenants")
private List<ManagedByTenant> managedByTenants;
/**
* The tags attached to the subscription.
*/
@JsonProperty(value = "tags")
private Map<String, String> tags;
/**
* Get the fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000.
*
* @return the id value
*/
@ -67,7 +88,7 @@ public class SubscriptionInner {
}
/**
* Get the subscriptionId value.
* Get the subscription ID.
*
* @return the subscriptionId value
*/
@ -76,7 +97,7 @@ public class SubscriptionInner {
}
/**
* Get the displayName value.
* Get the subscription display name.
*
* @return the displayName value
*/
@ -85,7 +106,16 @@ public class SubscriptionInner {
}
/**
* Get the state value.
* Get the subscription tenant ID.
*
* @return the tenantId value
*/
public String tenantId() {
return this.tenantId;
}
/**
* Get the subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. Possible values include: 'Enabled', 'Warned', 'PastDue', 'Disabled', 'Deleted'.
*
* @return the state value
*/
@ -94,7 +124,7 @@ public class SubscriptionInner {
}
/**
* Get the subscriptionPolicies value.
* Get the subscription policies.
*
* @return the subscriptionPolicies value
*/
@ -103,7 +133,7 @@ public class SubscriptionInner {
}
/**
* Set the subscriptionPolicies value.
* Set the subscription policies.
*
* @param subscriptionPolicies the subscriptionPolicies value to set
* @return the SubscriptionInner object itself.
@ -114,7 +144,7 @@ public class SubscriptionInner {
}
/**
* Get the authorizationSource value.
* Get the authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'.
*
* @return the authorizationSource value
*/
@ -123,7 +153,7 @@ public class SubscriptionInner {
}
/**
* Set the authorizationSource value.
* Set the authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'.
*
* @param authorizationSource the authorizationSource value to set
* @return the SubscriptionInner object itself.
@ -133,4 +163,44 @@ public class SubscriptionInner {
return this;
}
/**
* Get an array containing the tenants managing the subscription.
*
* @return the managedByTenants value
*/
public List<ManagedByTenant> managedByTenants() {
return this.managedByTenants;
}
/**
* Set an array containing the tenants managing the subscription.
*
* @param managedByTenants the managedByTenants value to set
* @return the SubscriptionInner object itself.
*/
public SubscriptionInner withManagedByTenants(List<ManagedByTenant> managedByTenants) {
this.managedByTenants = managedByTenants;
return this;
}
/**
* Get the tags attached to the subscription.
*
* @return the tags value
*/
public Map<String, String> tags() {
return this.tags;
}
/**
* Set the tags attached to the subscription.
*
* @param tags the tags value to set
* @return the SubscriptionInner object itself.
*/
public SubscriptionInner withTags(Map<String, String> tags) {
this.tags = tags;
return this;
}
}

Просмотреть файл

@ -139,8 +139,12 @@ public class SubscriptionsInner {
@Override
public Observable<ServiceResponse<List<LocationInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<LocationInner>> result = listLocationsDelegate(response);
ServiceResponse<List<LocationInner>> clientResponse = new ServiceResponse<List<LocationInner>>(result.body().items(), result.response());
ServiceResponse<PageImpl1<LocationInner>> result = listLocationsDelegate(response);
List<LocationInner> items = null;
if (result.body() != null) {
items = result.body().items();
}
ServiceResponse<List<LocationInner>> clientResponse = new ServiceResponse<List<LocationInner>>(items, result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
@ -149,9 +153,9 @@ public class SubscriptionsInner {
});
}
private ServiceResponse<PageImpl<LocationInner>> listLocationsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<LocationInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<LocationInner>>() { }.getType())
private ServiceResponse<PageImpl1<LocationInner>> listLocationsDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl1<LocationInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl1<LocationInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
@ -320,7 +324,7 @@ public class SubscriptionsInner {
@Override
public Observable<ServiceResponse<Page<SubscriptionInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl1<SubscriptionInner>> result = listDelegate(response);
ServiceResponse<PageImpl<SubscriptionInner>> result = listDelegate(response);
return Observable.just(new ServiceResponse<Page<SubscriptionInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
@ -329,9 +333,9 @@ public class SubscriptionsInner {
});
}
private ServiceResponse<PageImpl1<SubscriptionInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl1<SubscriptionInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl1<SubscriptionInner>>() { }.getType())
private ServiceResponse<PageImpl<SubscriptionInner>> listDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<SubscriptionInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<SubscriptionInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}
@ -417,7 +421,7 @@ public class SubscriptionsInner {
/**
* Gets all subscriptions for a tenant.
*
ServiceResponse<PageImpl1<SubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
ServiceResponse<PageImpl<SubscriptionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList&lt;SubscriptionInner&gt; object wrapped in {@link ServiceResponse} if successful.
*/
@ -431,7 +435,7 @@ public class SubscriptionsInner {
@Override
public Observable<ServiceResponse<Page<SubscriptionInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl1<SubscriptionInner>> result = listNextDelegate(response);
ServiceResponse<PageImpl<SubscriptionInner>> result = listNextDelegate(response);
return Observable.just(new ServiceResponse<Page<SubscriptionInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
@ -440,9 +444,9 @@ public class SubscriptionsInner {
});
}
private ServiceResponse<PageImpl1<SubscriptionInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl1<SubscriptionInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl1<SubscriptionInner>>() { }.getType())
private ServiceResponse<PageImpl<SubscriptionInner>> listNextDelegate(Response<ResponseBody> response) throws CloudException, IOException, IllegalArgumentException {
return this.client.restClient().responseBuilderFactory().<PageImpl<SubscriptionInner>, CloudException>newInstance(this.client.serializerAdapter())
.register(200, new TypeToken<PageImpl<SubscriptionInner>>() { }.getType())
.registerError(CloudException.class)
.build(response);
}

Просмотреть файл

@ -31,6 +31,8 @@ public class SubscriptionsTests extends TestBase {
public void canListSubscriptions() throws Exception {
PagedList<Subscription> subscriptions = resourceManager.subscriptions().list();
Assert.assertTrue(subscriptions.size() > 0);
Subscription subscription = subscriptions.get(0);
Assert.assertNotNull(subscription.tenantId());
}
@Test

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,28 +1,28 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
"Uri" : "http://localhost:1234/subscriptions?api-version=2016-06-01",
"Uri" : "http://localhost:1234/subscriptions?api-version=2020-01-01",
"Headers" : {
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:f82fa839f6b46fd84edc56e01cf7c8c6d4faaa2190534aff5c1d17095f0a3c13 Java:1.8.0_221 (SubscriptionClient, 2016-06-01)",
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:6329c03b535ec33cd37fb229b82c5babb3cb7866e991f6299f1b3716d621b34d Java:1.8.0_221 (SubscriptionClient, 2020-01-01)",
"Content-Type" : "application/json; charset=utf-8"
},
"Response" : {
"date" : "Sat, 19 Oct 2019 12:05:44 GMT",
"content-length" : "353",
"date" : "Tue, 21 Jul 2020 05:47:07 GMT",
"content-length" : "460",
"expires" : "-1",
"vary" : "Accept-Encoding",
"retry-after" : "0",
"StatusCode" : "200",
"pragma" : "no-cache",
"strict-transport-security" : "max-age=31536000; includeSubDomains",
"x-ms-correlation-request-id" : "e8568752-6f87-4b16-8ed6-cf909b65f09b",
"x-ms-ratelimit-remaining-tenant-reads" : "11999",
"x-ms-correlation-request-id" : "a99b6275-19a8-4218-a007-2af6cdc4d6e1",
"x-ms-ratelimit-remaining-tenant-reads" : "11998",
"x-content-type-options" : "nosniff",
"x-ms-routing-request-id" : "SOUTHEASTASIA:20191019T120544Z:e8568752-6f87-4b16-8ed6-cf909b65f09b",
"x-ms-routing-request-id" : "KOREASOUTH:20200721T054708Z:a99b6275-19a8-4218-a007-2af6cdc4d6e1",
"content-type" : "application/json; charset=utf-8",
"cache-control" : "no-cache",
"x-ms-request-id" : "e8568752-6f87-4b16-8ed6-cf909b65f09b",
"Body" : "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000\",\"authorizationSource\":\"RoleBased\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"displayName\":\"Java Libs Tests with TTL = 2 Days\",\"state\":\"Enabled\",\"subscriptionPolicies\":{\"locationPlacementId\":\"Internal_2014-09-01\",\"quotaId\":\"Internal_2014-09-01\",\"spendingLimit\":\"Off\"}}]}"
"x-ms-request-id" : "a99b6275-19a8-4218-a007-2af6cdc4d6e1",
"Body" : "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000\",\"authorizationSource\":\"RoleBased\",\"managedByTenants\":[],\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"displayName\":\"Java Libs Tests with TTL = 7 Days\",\"state\":\"Enabled\",\"subscriptionPolicies\":{\"locationPlacementId\":\"Internal_2014-09-01\",\"quotaId\":\"Internal_2014-09-01\",\"spendingLimit\":\"Off\"}}],\"count\":{\"type\":\"Total\",\"value\":1}}"
}
} ],
"variables" : [ ]

Просмотреть файл

@ -1,28 +1,28 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
"Uri" : "http://localhost:1234/tenants?api-version=2016-06-01",
"Uri" : "http://localhost:1234/tenants?api-version=2020-01-01",
"Headers" : {
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:f82fa839f6b46fd84edc56e01cf7c8c6d4faaa2190534aff5c1d17095f0a3c13 Java:1.8.0_221 (SubscriptionClient, 2016-06-01)",
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:6329c03b535ec33cd37fb229b82c5babb3cb7866e991f6299f1b3716d621b34d Java:1.8.0_221 (SubscriptionClient, 2020-01-01)",
"Content-Type" : "application/json; charset=utf-8"
},
"Response" : {
"date" : "Sat, 19 Oct 2019 12:05:46 GMT",
"content-length" : "116",
"date" : "Tue, 21 Jul 2020 05:42:16 GMT",
"content-length" : "140",
"expires" : "-1",
"vary" : "Accept-Encoding",
"retry-after" : "0",
"StatusCode" : "200",
"pragma" : "no-cache",
"strict-transport-security" : "max-age=31536000; includeSubDomains",
"x-ms-correlation-request-id" : "17b0a5aa-5b06-4fd7-a4c0-8e540fbcd3dc",
"x-ms-ratelimit-remaining-tenant-reads" : "11999",
"x-ms-correlation-request-id" : "fa30ccf2-0f07-4d75-95c3-83beb49bfc3a",
"x-ms-ratelimit-remaining-tenant-reads" : "11998",
"x-content-type-options" : "nosniff",
"x-ms-routing-request-id" : "SOUTHEASTASIA:20191019T120546Z:17b0a5aa-5b06-4fd7-a4c0-8e540fbcd3dc",
"x-ms-routing-request-id" : "KOREASOUTH:20200721T054216Z:fa30ccf2-0f07-4d75-95c3-83beb49bfc3a",
"content-type" : "application/json; charset=utf-8",
"cache-control" : "no-cache",
"x-ms-request-id" : "17b0a5aa-5b06-4fd7-a4c0-8e540fbcd3dc",
"Body" : "{\"value\":[{\"id\":\"/tenants/00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\"}]}"
"x-ms-request-id" : "fa30ccf2-0f07-4d75-95c3-83beb49bfc3a",
"Body" : "{\"value\":[{\"id\":\"/tenants/00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"tenantCategory\":\"Home\"}]}"
}
} ],
"variables" : [ ]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -1,53 +1,53 @@
{
"networkCallRecords" : [ {
"Method" : "GET",
"Uri" : "http://localhost:1234/subscriptions?api-version=2016-06-01",
"Uri" : "http://localhost:1234/subscriptions?api-version=2020-01-01",
"Headers" : {
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:d916ff2a485200f321d6cba23dc3377b781cd392a6e37bf910c332cb391ba0cc Java:1.8.0_202 (SubscriptionClient, 2016-06-01)",
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:6329c03b535ec33cd37fb229b82c5babb3cb7866e991f6299f1b3716d621b34d Java:1.8.0_221 (SubscriptionClient, 2020-01-01)",
"Content-Type" : "application/json; charset=utf-8"
},
"Response" : {
"date" : "Sun, 02 Feb 2020 22:12:27 GMT",
"content-length" : "353",
"date" : "Tue, 21 Jul 2020 05:40:58 GMT",
"content-length" : "460",
"expires" : "-1",
"vary" : "Accept-Encoding",
"retry-after" : "0",
"StatusCode" : "200",
"pragma" : "no-cache",
"strict-transport-security" : "max-age=31536000; includeSubDomains",
"x-ms-correlation-request-id" : "0c999ebd-d861-45c5-9d06-28ccc94bb2fc",
"x-ms-correlation-request-id" : "64b9373f-6934-41f7-bf3e-e7c995c334dd",
"x-ms-ratelimit-remaining-tenant-reads" : "11999",
"x-content-type-options" : "nosniff",
"x-ms-routing-request-id" : "JAPANEAST:20200202T221227Z:0c999ebd-d861-45c5-9d06-28ccc94bb2fc",
"x-ms-routing-request-id" : "KOREASOUTH:20200721T054059Z:64b9373f-6934-41f7-bf3e-e7c995c334dd",
"content-type" : "application/json; charset=utf-8",
"cache-control" : "no-cache",
"x-ms-request-id" : "0c999ebd-d861-45c5-9d06-28ccc94bb2fc",
"Body" : "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000\",\"authorizationSource\":\"RoleBased\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"displayName\":\"Java Libs Tests with TTL = 7 Days\",\"state\":\"Enabled\",\"subscriptionPolicies\":{\"locationPlacementId\":\"Internal_2014-09-01\",\"quotaId\":\"Internal_2014-09-01\",\"spendingLimit\":\"Off\"}}]}"
"x-ms-request-id" : "64b9373f-6934-41f7-bf3e-e7c995c334dd",
"Body" : "{\"value\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000\",\"authorizationSource\":\"RoleBased\",\"managedByTenants\":[],\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"displayName\":\"Java Libs Tests with TTL = 7 Days\",\"state\":\"Enabled\",\"subscriptionPolicies\":{\"locationPlacementId\":\"Internal_2014-09-01\",\"quotaId\":\"Internal_2014-09-01\",\"spendingLimit\":\"Off\"}}],\"count\":{\"type\":\"Total\",\"value\":1}}"
}
}, {
"Method" : "GET",
"Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2016-06-01",
"Uri" : "http://localhost:1234/subscriptions/00000000-0000-0000-0000-000000000000?api-version=2020-01-01",
"Headers" : {
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:d916ff2a485200f321d6cba23dc3377b781cd392a6e37bf910c332cb391ba0cc Java:1.8.0_202 (SubscriptionClient, 2016-06-01)",
"User-Agent" : "Azure-SDK-For-Java/null OS:Windows 10/10.0 MacAddressHash:6329c03b535ec33cd37fb229b82c5babb3cb7866e991f6299f1b3716d621b34d Java:1.8.0_221 (SubscriptionClient, 2020-01-01)",
"Content-Type" : "application/json; charset=utf-8"
},
"Response" : {
"date" : "Sun, 02 Feb 2020 22:12:27 GMT",
"content-length" : "341",
"date" : "Tue, 21 Jul 2020 05:41:00 GMT",
"content-length" : "413",
"expires" : "-1",
"vary" : "Accept-Encoding",
"retry-after" : "0",
"x-ms-ratelimit-remaining-subscription-reads" : "11938",
"x-ms-ratelimit-remaining-subscription-reads" : "11999",
"StatusCode" : "200",
"pragma" : "no-cache",
"strict-transport-security" : "max-age=31536000; includeSubDomains",
"x-ms-correlation-request-id" : "574b7f97-61e4-48dc-83ba-352b89b2fec4",
"x-ms-correlation-request-id" : "7351530b-d39d-40bd-a177-608068448512",
"x-content-type-options" : "nosniff",
"x-ms-routing-request-id" : "JAPANEAST:20200202T221228Z:574b7f97-61e4-48dc-83ba-352b89b2fec4",
"x-ms-routing-request-id" : "KOREASOUTH:20200721T054100Z:7351530b-d39d-40bd-a177-608068448512",
"content-type" : "application/json; charset=utf-8",
"cache-control" : "no-cache",
"x-ms-request-id" : "574b7f97-61e4-48dc-83ba-352b89b2fec4",
"Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000\",\"authorizationSource\":\"RoleBased\",\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"displayName\":\"Java Libs Tests with TTL = 7 Days\",\"state\":\"Enabled\",\"subscriptionPolicies\":{\"locationPlacementId\":\"Internal_2014-09-01\",\"quotaId\":\"Internal_2014-09-01\",\"spendingLimit\":\"Off\"}}"
"x-ms-request-id" : "7351530b-d39d-40bd-a177-608068448512",
"Body" : "{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000\",\"authorizationSource\":\"RoleBased\",\"managedByTenants\":[],\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"displayName\":\"Java Libs Tests with TTL = 7 Days\",\"state\":\"Enabled\",\"subscriptionPolicies\":{\"locationPlacementId\":\"Internal_2014-09-01\",\"quotaId\":\"Internal_2014-09-01\",\"spendingLimit\":\"Off\"}}"
}
} ],
"variables" : [ ]