From a87c17a712c55a119147d42e6ec30b881131d489 Mon Sep 17 00:00:00 2001 From: TJ Egbejimba Date: Thu, 5 Aug 2021 15:12:21 -0700 Subject: [PATCH 1/4] add newest subscription files --- .../resources_resource-manager.txt | 9 +- .../AzSdk.RP.props | 2 +- .../src/Generated/ISubscriptionClient.cs | 22 ++ .../src/Generated/ISubscriptionsOperations.cs | 5 +- .../Models/CheckResourceNameResult.cs | 70 +++++++ .../src/Generated/Models/Location.cs | 12 +- .../src/Generated/Models/LocationMetadata.cs | 15 +- .../src/Generated/Models/LocationType.cs | 60 ++++++ .../Generated/Models/OperationListResult.cs | 65 ++++++ .../src/Generated/Models/Page.cs | 2 +- .../src/Generated/Models/Page1.cs | 2 +- .../src/Generated/Models/RegionCategory.cs | 1 + .../src/Generated/Models/ResourceName.cs | 77 +++++++ .../Generated/Models/ResourceNameStatus.cs | 22 ++ .../Generated/SdkInfo_SubscriptionClient.cs | 6 +- .../src/Generated/SubscriptionClient.cs | 195 +++++++++++++++++- .../Generated/SubscriptionClientExtensions.cs | 67 ++++++ .../src/Generated/SubscriptionsOperations.cs | 10 +- .../SubscriptionsOperationsExtensions.cs | 14 +- ...ft.Azure.Management.ResourceManager.csproj | 11 +- .../src/generate.ps1 | 4 +- 21 files changed, 639 insertions(+), 32 deletions(-) create mode 100644 sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/CheckResourceNameResult.cs create mode 100644 sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationType.cs create mode 100644 sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/OperationListResult.cs create mode 100644 sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceName.cs create mode 100644 sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceNameStatus.cs create mode 100644 sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClientExtensions.cs diff --git a/eng/mgmt/mgmtmetadata/resources_resource-manager.txt b/eng/mgmt/mgmtmetadata/resources_resource-manager.txt index 40a4b8c45c510..e8f019d76f62f 100644 --- a/eng/mgmt/mgmtmetadata/resources_resource-manager.txt +++ b/eng/mgmt/mgmtmetadata/resources_resource-manager.txt @@ -3,12 +3,13 @@ AutoRest installed successfully. Commencing code generation Generating CSharp code Executing AutoRest command -cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/resources/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-templatespecs-2021-05 --csharp.output-folder=C:\azure-sdk-for-net\sdk\resources\Microsoft.Azure.Management.Resource\src\Generated\TemplateSpecs -2021-05-11 18:40:02 UTC +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/resources/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --tag=package-subscriptions-2021-01 --csharp.output-folder=C:\dev\azure-sdk-for-net\sdk\resources\Microsoft.Azure.Management.Resource\src\Generated\Subscriptions +Autorest CSharp Version: 2.3.82 +2021-08-04 23:00:12 UTC Azure-rest-api-specs repository information GitHub fork: Azure Branch: master -Commit: 60be518b4fa1a9fb011a0cb69ae7ca3e1cee06b1 +Commit: c981b81aa26ad4d0d156e034e6782853b4e747a1 AutoRest information Requested version: v2 -Bootstrapper version: autorest@1.9.1 +Bootstrapper version: autorest@3.2.1 diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/AzSdk.RP.props b/sdk/resources/Microsoft.Azure.Management.Resource/AzSdk.RP.props index cbbb650e092a6..56bb9dbd2b2ae 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/AzSdk.RP.props +++ b/sdk/resources/Microsoft.Azure.Management.Resource/AzSdk.RP.props @@ -1,7 +1,7 @@  - Resources_2020-10-01;Features_2015-12-01;ManagementLinkClient_2016-09-01;Resources_2016-09-01;Authorization_2016-09-01;Authorization_2020-09-01;Authorization_2020-07-01-preview;Management_2020-09-01;Management_2020-07-01-preview;PolicyClient_2020-09-01;Management_2020-10-01;ResourceManagementClient_2020-10-01;Resources_2020-01-01;SubscriptionClient_2020-01-01;Resources_2021-05-01;Resources_2021-04-01; + SubscriptionClient_2021-01-01;Resources_2020-10-01;Features_2015-12-01;ManagementLinkClient_2016-09-01;Resources_2016-09-01;Authorization_2016-09-01;Authorization_2020-09-01;Authorization_2020-07-01-preview;Management_2020-09-01;Management_2020-07-01-preview;PolicyClient_2020-09-01;Management_2020-10-01;ResourceManagementClient_2020-10-01;Resources_2020-01-01;SubscriptionClient_2020-01-01;Resources_2021-05-01;Resources_2021-04-01; $(PackageTags);$(CommonTags);$(AzureApiTag); diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionClient.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionClient.cs index 211d9be958e96..f44cf5bfaa5f3 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionClient.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionClient.cs @@ -14,6 +14,10 @@ namespace Microsoft.Azure.Management.ResourceManager using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// All resource groups and resources exist within subscriptions. These @@ -77,5 +81,23 @@ public partial interface ISubscriptionClient : System.IDisposable /// ITenantsOperations Tenants { get; } + /// + /// 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 + /// + /// + /// Resource object with values for resource name and resource type + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task> CheckResourceNameWithHttpMessagesAsync(ResourceName resourceNameDefinition = default(ResourceName), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } } diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionsOperations.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionsOperations.cs index af47db013ad0c..0bd2d19822587 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionsOperations.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/ISubscriptionsOperations.cs @@ -34,6 +34,9 @@ public partial interface ISubscriptionsOperations /// /// The ID of the target subscription. /// + /// + /// Whether to include extended locations. + /// /// /// The headers that will be added to request. /// @@ -49,7 +52,7 @@ public partial interface ISubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, bool? includeExtendedLocations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets details about a specified subscription. /// diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/CheckResourceNameResult.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/CheckResourceNameResult.cs new file mode 100644 index 0000000000000..d34372d05eed2 --- /dev/null +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/CheckResourceNameResult.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ResourceManager.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource Name valid if not a reserved word, does not contain a reserved + /// word and does not start with a reserved word + /// + public partial class CheckResourceNameResult + { + /// + /// Initializes a new instance of the CheckResourceNameResult class. + /// + public CheckResourceNameResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CheckResourceNameResult class. + /// + /// Name of Resource + /// Type of Resource + /// Is the resource name Allowed or Reserved. + /// Possible values include: 'Allowed', 'Reserved' + public CheckResourceNameResult(string name = default(string), string type = default(string), string status = default(string)) + { + Name = name; + Type = type; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of Resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets type of Resource + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets is the resource name Allowed or Reserved. Possible + /// values include: 'Allowed', 'Reserved' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Location.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Location.cs index 5a63b1e836a56..598099f07a501 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Location.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Location.cs @@ -34,16 +34,19 @@ public Location() /// /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. /// The subscription ID. /// The location name. + /// The location type. Possible values include: + /// 'Region', 'EdgeZone' /// The display name of the location. /// The display name of the location /// and its region. /// Metadata of the location, such as lat/long, /// paired region, and others. - public Location(string id = default(string), string subscriptionId = default(string), string name = default(string), string displayName = default(string), string regionalDisplayName = default(string), LocationMetadata metadata = default(LocationMetadata)) + public Location(string id = default(string), string subscriptionId = default(string), string name = default(string), LocationType? type = default(LocationType?), string displayName = default(string), string regionalDisplayName = default(string), LocationMetadata metadata = default(LocationMetadata)) { Id = id; SubscriptionId = subscriptionId; Name = name; + Type = type; DisplayName = displayName; RegionalDisplayName = regionalDisplayName; Metadata = metadata; @@ -74,6 +77,13 @@ public Location() [JsonProperty(PropertyName = "name")] public string Name { get; private set; } + /// + /// Gets the location type. Possible values include: 'Region', + /// 'EdgeZone' + /// + [JsonProperty(PropertyName = "type")] + public LocationType? Type { get; private set; } + /// /// Gets the display name of the location. /// diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationMetadata.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationMetadata.cs index ea30364d5662a..7904ca9a0e3ed 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationMetadata.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationMetadata.cs @@ -34,7 +34,7 @@ public LocationMetadata() /// The type of the region. Possible values /// include: 'Physical', 'Logical' /// The category of the region. Possible - /// values include: 'Recommended', 'Other' + /// values include: 'Recommended', 'Extended', 'Other' /// The geography group of the /// location. /// The longitude of the location. @@ -43,7 +43,9 @@ public LocationMetadata() /// location. /// The regions paired to this /// region. - public LocationMetadata(string regionType = default(string), string regionCategory = default(string), string geographyGroup = default(string), string longitude = default(string), string latitude = default(string), string physicalLocation = default(string), IList pairedRegion = default(IList)) + /// The home location of an edge + /// zone. + public LocationMetadata(string regionType = default(string), string regionCategory = default(string), string geographyGroup = default(string), string longitude = default(string), string latitude = default(string), string physicalLocation = default(string), IList pairedRegion = default(IList), string homeLocation = default(string)) { RegionType = regionType; RegionCategory = regionCategory; @@ -52,6 +54,7 @@ public LocationMetadata() Latitude = latitude; PhysicalLocation = physicalLocation; PairedRegion = pairedRegion; + HomeLocation = homeLocation; CustomInit(); } @@ -69,7 +72,7 @@ public LocationMetadata() /// /// Gets the category of the region. Possible values include: - /// 'Recommended', 'Other' + /// 'Recommended', 'Extended', 'Other' /// [JsonProperty(PropertyName = "regionCategory")] public string RegionCategory { get; private set; } @@ -104,5 +107,11 @@ public LocationMetadata() [JsonProperty(PropertyName = "pairedRegion")] public IList PairedRegion { get; set; } + /// + /// Gets the home location of an edge zone. + /// + [JsonProperty(PropertyName = "homeLocation")] + public string HomeLocation { get; private set; } + } } diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationType.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationType.cs new file mode 100644 index 0000000000000..dc03102a3ca3f --- /dev/null +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/LocationType.cs @@ -0,0 +1,60 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ResourceManager.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for LocationType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum LocationType + { + [EnumMember(Value = "Region")] + Region, + [EnumMember(Value = "EdgeZone")] + EdgeZone + } + internal static class LocationTypeEnumExtension + { + internal static string ToSerializedValue(this LocationType? value) + { + return value == null ? null : ((LocationType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this LocationType value) + { + switch( value ) + { + case LocationType.Region: + return "Region"; + case LocationType.EdgeZone: + return "EdgeZone"; + } + return null; + } + + internal static LocationType? ParseLocationType(this string value) + { + switch( value ) + { + case "Region": + return LocationType.Region; + case "EdgeZone": + return LocationType.EdgeZone; + } + return null; + } + } +} diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/OperationListResult.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/OperationListResult.cs new file mode 100644 index 0000000000000..b75ee39d020d6 --- /dev/null +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/OperationListResult.cs @@ -0,0 +1,65 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ResourceManager.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Result of the request to list Microsoft.Resources operations. It + /// contains a list of operations and a URL link to get the next set of + /// results. + /// + public partial class OperationListResult + { + /// + /// Initializes a new instance of the OperationListResult class. + /// + public OperationListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationListResult class. + /// + /// List of Microsoft.Resources operations. + /// URL to get the next set of operation list + /// results if there are any. + public OperationListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of Microsoft.Resources operations. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; set; } + + /// + /// Gets or sets URL to get the next set of operation list results if + /// there are any. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; set; } + + } +} diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page.cs index c6f2533504c2f..b6856eceff690 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page.cs @@ -26,7 +26,7 @@ public class Page : IPage /// /// Gets the link to the next page. /// - [JsonProperty("nextLink")] + [JsonProperty("")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page1.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page1.cs index cd02c5c3d2c95..62aaea7013be7 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page1.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/Page1.cs @@ -26,7 +26,7 @@ public class Page1 : IPage /// /// Gets the link to the next page. /// - [JsonProperty("")] + [JsonProperty("nextLink")] public string NextPageLink { get; private set; } [JsonProperty("value")] diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/RegionCategory.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/RegionCategory.cs index 0bc9be79dc53d..9c63b1e310f98 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/RegionCategory.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/RegionCategory.cs @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Management.ResourceManager.Models public static class RegionCategory { public const string Recommended = "Recommended"; + public const string Extended = "Extended"; public const string Other = "Other"; } } diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceName.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceName.cs new file mode 100644 index 0000000000000..ca2591d89888e --- /dev/null +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceName.cs @@ -0,0 +1,77 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ResourceManager.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Name and Type of the Resource + /// + public partial class ResourceName + { + /// + /// Initializes a new instance of the ResourceName class. + /// + public ResourceName() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceName class. + /// + /// Name of the resource + /// The type of the resource + public ResourceName(string name, string type) + { + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the type of the resource + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } + } +} diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceNameStatus.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceNameStatus.cs new file mode 100644 index 0000000000000..367ba715abef3 --- /dev/null +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/Models/ResourceNameStatus.cs @@ -0,0 +1,22 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ResourceManager.Models +{ + + /// + /// Defines values for ResourceNameStatus. + /// + public static class ResourceNameStatus + { + public const string Allowed = "Allowed"; + public const string Reserved = "Reserved"; + } +} diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SdkInfo_SubscriptionClient.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SdkInfo_SubscriptionClient.cs index 23c6a7d9d72ec..98a50f71a6744 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SdkInfo_SubscriptionClient.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SdkInfo_SubscriptionClient.cs @@ -19,9 +19,9 @@ public static IEnumerable> ApiInfo_SubscriptionCli { return new Tuple[] { - new Tuple("Resources", "Operations", "2020-01-01"), - new Tuple("SubscriptionClient", "Subscriptions", "2020-01-01"), - new Tuple("SubscriptionClient", "Tenants", "2020-01-01"), + new Tuple("Resources", "checkResourceName", "2021-01-01"), + new Tuple("SubscriptionClient", "Subscriptions", "2021-01-01"), + new Tuple("SubscriptionClient", "Tenants", "2021-01-01"), }.AsEnumerable(); } } diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClient.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClient.cs index 0dac5f27dfa14..49ddcd336c409 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClient.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClient.cs @@ -20,6 +20,8 @@ namespace Microsoft.Azure.Management.ResourceManager using System.Linq; using System.Net; using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// All resource groups and resources exist within subscriptions. These @@ -326,7 +328,7 @@ private void Initialize() Subscriptions = new SubscriptionsOperations(this); Tenants = new TenantsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-01-01"; + ApiVersion = "2021-01-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -358,5 +360,196 @@ private void Initialize() CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } + /// + /// 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 + /// + /// + /// Resource object with values for resource name and resource type + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckResourceNameWithHttpMessagesAsync(ResourceName resourceNameDefinition = default(ResourceName), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceNameDefinition != null) + { + resourceNameDefinition.Validate(); + } + if (ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceNameDefinition", resourceNameDefinition); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckResourceName", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.Resources/checkResourceName").ToString(); + List _queryParameters = new List(); + if (ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(resourceNameDefinition != null) + { + _requestContent = SafeJsonConvert.SerializeObject(resourceNameDefinition, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClientExtensions.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClientExtensions.cs new file mode 100644 index 0000000000000..f641420a8f726 --- /dev/null +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionClientExtensions.cs @@ -0,0 +1,67 @@ +// +// 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. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ResourceManager +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SubscriptionClient. + /// + public static partial class SubscriptionClientExtensions + { + /// + /// 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 + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource object with values for resource name and resource type + /// + public static CheckResourceNameResult CheckResourceName(this ISubscriptionClient operations, ResourceName resourceNameDefinition = default(ResourceName)) + { + return operations.CheckResourceNameAsync(resourceNameDefinition).GetAwaiter().GetResult(); + } + + /// + /// 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 + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource object with values for resource name and resource type + /// + /// + /// The cancellation token. + /// + public static async Task CheckResourceNameAsync(this ISubscriptionClient operations, ResourceName resourceNameDefinition = default(ResourceName), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckResourceNameWithHttpMessagesAsync(resourceNameDefinition, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperations.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperations.cs index 3a87a3ce06ac6..6eba1ee33ec1c 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperations.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperations.cs @@ -61,6 +61,9 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// The ID of the target subscription. /// + /// + /// Whether to include extended locations. + /// /// /// Headers that will be added to request. /// @@ -82,7 +85,7 @@ internal SubscriptionsOperations(SubscriptionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListLocationsWithHttpMessagesAsync(string subscriptionId, bool? includeExtendedLocations = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (subscriptionId == null) { @@ -100,6 +103,7 @@ internal SubscriptionsOperations(SubscriptionClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("subscriptionId", subscriptionId); + tracingParameters.Add("includeExtendedLocations", includeExtendedLocations); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListLocations", tracingParameters); } @@ -112,6 +116,10 @@ internal SubscriptionsOperations(SubscriptionClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (includeExtendedLocations != null) + { + _queryParameters.Add(string.Format("includeExtendedLocations={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeExtendedLocations, Client.SerializationSettings).Trim('"')))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperationsExtensions.cs b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperationsExtensions.cs index adc41a4670a8e..d8a02d02e6188 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperationsExtensions.cs +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Generated/SubscriptionsOperationsExtensions.cs @@ -37,9 +37,12 @@ public static partial class SubscriptionsOperationsExtensions /// /// The ID of the target subscription. /// - public static IEnumerable ListLocations(this ISubscriptionsOperations operations, string subscriptionId) + /// + /// Whether to include extended locations. + /// + public static IEnumerable ListLocations(this ISubscriptionsOperations operations, string subscriptionId, bool? includeExtendedLocations = default(bool?)) { - return operations.ListLocationsAsync(subscriptionId).GetAwaiter().GetResult(); + return operations.ListLocationsAsync(subscriptionId, includeExtendedLocations).GetAwaiter().GetResult(); } /// @@ -56,12 +59,15 @@ public static IEnumerable ListLocations(this ISubscriptionsOperations /// /// The ID of the target subscription. /// + /// + /// Whether to include extended locations. + /// /// /// The cancellation token. /// - public static async Task> ListLocationsAsync(this ISubscriptionsOperations operations, string subscriptionId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListLocationsAsync(this ISubscriptionsOperations operations, string subscriptionId, bool? includeExtendedLocations = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListLocationsWithHttpMessagesAsync(subscriptionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListLocationsWithHttpMessagesAsync(subscriptionId, includeExtendedLocations, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj b/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj index cd635f83d4e2c..35e7c2315f97e 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj @@ -10,18 +10,11 @@ Development of this library has shifted focus to the Azure Unified SDK. The future development will be focused on "Azure.ResourceManager.Resources" (https://www.nuget.org/packages/Azure.ResourceManager.Resources/). Please see the package changelog for more information. Microsoft.Azure.Management.ResourceManager - 3.14.0-preview + 3.15.0-preview Microsoft Azure resource management;resource management;resource groups;Azure Policy diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/generate.ps1 b/sdk/resources/Microsoft.Azure.Management.Resource/src/generate.ps1 index 5c362737b3785..6baba9ee883e8 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/generate.ps1 +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/generate.ps1 @@ -6,10 +6,10 @@ # Start-AutoRestCodeGeneration -ResourceProvider "resources/resource-manager" -SdkRepoRootPath "$PSScriptRoot\..\..\..\.." -AutoRestVersion "v2" -AutoRestCodeGenerationFlags "--tag=package-resources-2021-04" -SdkGenerationDirectory "$PSScriptRoot\Generated\Resources" # Generate package with templatespecs tag -Start-AutoRestCodeGeneration -ResourceProvider "resources/resource-manager" -SdkRepoRootPath "$PSScriptRoot\..\..\..\.." -AutoRestVersion "v2" -AutoRestCodeGenerationFlags "--tag=package-templatespecs-2021-05" -SdkGenerationDirectory "$PSScriptRoot\Generated\TemplateSpecs" +# Start-AutoRestCodeGeneration -ResourceProvider "resources/resource-manager" -SdkRepoRootPath "$PSScriptRoot\..\..\..\.." -AutoRestVersion "v2" -AutoRestCodeGenerationFlags "--tag=package-templatespecs-2021-05" -SdkGenerationDirectory "$PSScriptRoot\Generated\TemplateSpecs" # Generate package with subscriptions tag -#Start-AutoRestCodeGeneration -ResourceProvider "resources/resource-manager" -SdkRepoRootPath "$PSScriptRoot\..\..\..\.." -AutoRestVersion "v2" -AutoRestCodeGenerationFlags "--tag=package-subscriptions-2020-01" -SdkGenerationDirectory "$PSScriptRoot\Generated\Subscriptions" +Start-AutoRestCodeGeneration -ResourceProvider "resources/resource-manager" -SdkRepoRootPath "$PSScriptRoot\..\..\..\.." -AutoRestVersion "v2" -AutoRestCodeGenerationFlags "--tag=package-subscriptions-2021-01" -SdkGenerationDirectory "$PSScriptRoot\Generated\Subscriptions" # Generate package with policy tag # Start-AutoRestCodeGeneration -ResourceProvider "resources/resource-manager" -SdkRepoRootPath "$PSScriptRoot\..\..\..\.." -AutoRestVersion "v2" -AutoRestCodeGenerationFlags "--tag=package-policy-2020-09" -SdkGenerationDirectory "$PSScriptRoot\GeneratedPolicy202009" From 643de642cd1e43d278fa4ed214793229f381185d Mon Sep 17 00:00:00 2001 From: Feng Zhou <55177366+fengzhou-msft@users.noreply.github.com> Date: Fri, 8 Oct 2021 11:23:07 +0800 Subject: [PATCH 2/4] Update Microsoft.Azure.Management.ResourceManager.csproj --- .../src/Microsoft.Azure.Management.ResourceManager.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj b/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj index 35e7c2315f97e..3dbc9622426a4 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj @@ -14,7 +14,7 @@ Microsoft Azure resource management;resource management;resource groups;Azure Policy @@ -25,4 +25,4 @@ - \ No newline at end of file + From 3e380bea13b8f16bd1f2d5435b8ca9b681126edf Mon Sep 17 00:00:00 2001 From: TJ Egbejimba Date: Thu, 14 Oct 2021 12:39:49 -0700 Subject: [PATCH 3/4] fix test errors --- .../ListSubscriptions.json | 24 +++++++-------- .../LiveTenantTests/ListTenants.json | 30 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveSubscriptionTests/ListSubscriptions.json b/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveSubscriptionTests/ListSubscriptions.json index 160626c49664b..f434e2837e3e6 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveSubscriptionTests/ListSubscriptions.json +++ b/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveSubscriptionTests/ListSubscriptions.json @@ -1,19 +1,19 @@ { "Entries": [ { - "RequestUri": "/subscriptions?api-version=2020-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAyMC0wMS0wMQ==", + "RequestUri": "/subscriptions?api-version=2021-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b2af13a9-6f0e-4dc1-ad62-4ba2d084c4de" + "950e681f-297d-4aac-b6f1-65cb7e44f83a" ], "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.29916.01", + "FxVersion/4.6.30321.06", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.19043.", "Microsoft.Azure.Management.ResourceManager.SubscriptionClient/3.13.2.0" @@ -27,16 +27,16 @@ "no-cache" ], "x-ms-ratelimit-remaining-tenant-reads": [ - "11936" + "11996" ], "x-ms-request-id": [ - "db963b18-bfcc-46d9-a3d6-d08c2f4b8221" + "588bae6c-2ba9-41db-8038-989a3126bbb1" ], "x-ms-correlation-request-id": [ - "db963b18-bfcc-46d9-a3d6-d08c2f4b8221" + "588bae6c-2ba9-41db-8038-989a3126bbb1" ], "x-ms-routing-request-id": [ - "WESTUS:20210511T210209Z:db963b18-bfcc-46d9-a3d6-d08c2f4b8221" + "WESTUS3:20210816T060700Z:588bae6c-2ba9-41db-8038-989a3126bbb1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -45,7 +45,7 @@ "nosniff" ], "Date": [ - "Tue, 11 May 2021 21:02:09 GMT" + "Mon, 16 Aug 2021 06:07:00 GMT" ], "Content-Type": [ "application/json; charset=utf-8" @@ -54,15 +54,15 @@ "-1" ], "Content-Length": [ - "510" + "2994" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/45076d1d-a3e0-418b-8187-e1422a8cf5f4\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"tags\": {\r\n \"tagKey1\": \"tagValue1\",\r\n \"tagKey2\": \"tagValue2\"\r\n },\r\n \"subscriptionId\": \"45076d1d-a3e0-418b-8187-e1422a8cf5f4\",\r\n \"tenantId\": \"44ec3bd9-305f-48b9-a0dc-5d3ac5a736e3\",\r\n \"displayName\": \"Visual Studio Enterprise Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Public_2014-09-01\",\r\n \"quotaId\": \"MSDN_2014-09-01\",\r\n \"spendingLimit\": \"On\"\r\n }\r\n }\r\n ],\r\n \"count\": {\r\n \"type\": \"Total\",\r\n \"value\": 1\r\n }\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/996a2f3f-ee01-4ffd-9765-d2c3fc98f30a\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [\r\n {\r\n \"tenantId\": \"d6ad82f3-42af-4a15-ac1e-49e6c08f624e\"\r\n },\r\n {\r\n \"tenantId\": \"2f4a9838-26b7-47ee-be60-ccc1fdec5953\"\r\n }\r\n ],\r\n \"subscriptionId\": \"996a2f3f-ee01-4ffd-9765-d2c3fc98f30a\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Blueprint Assignment Test 1\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/4ce8c9fe-cadc-47d6-9c76-335812fd59df\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"subscriptionId\": \"4ce8c9fe-cadc-47d6-9c76-335812fd59df\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Blueprint Assignment Test 2\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/92722693-40f1-44fe-8c39-9cf6b6353750\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"subscriptionId\": \"92722693-40f1-44fe-8c39-9cf6b6353750\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Blueprint Assignment Test 3\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/a1bfa635-f2bf-42f1-86b5-848c674fc321\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"subscriptionId\": \"a1bfa635-f2bf-42f1-86b5-848c674fc321\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Blueprint Assignment Test 4\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/28cbf98f-381d-4425-9ac4-cf342dab9753\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"subscriptionId\": \"28cbf98f-381d-4425-9ac4-cf342dab9753\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Blueprint Assignment Test 5\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/f9cf50ed-d814-4b95-b76c-c709845f84c9\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"subscriptionId\": \"f9cf50ed-d814-4b95-b76c-c709845f84c9\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Demo 6 - Month Plan\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n },\r\n {\r\n \"id\": \"/subscriptions/7e2bacd2-6c4b-444c-9331-2e76799cbfc9\",\r\n \"authorizationSource\": \"RoleBased\",\r\n \"managedByTenants\": [],\r\n \"subscriptionId\": \"7e2bacd2-6c4b-444c-9331-2e76799cbfc9\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"displayName\": \"Blueprint Web Scout Test\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"Internal_2014-09-01\",\r\n \"quotaId\": \"Internal_2014-09-01\",\r\n \"spendingLimit\": \"Off\"\r\n }\r\n }\r\n ],\r\n \"count\": {\r\n \"type\": \"Total\",\r\n \"value\": 7\r\n }\r\n}", "StatusCode": 200 } ], "Names": {}, "Variables": { - "SubscriptionId": "45076d1d-a3e0-418b-8187-e1422a8cf5f4" + "SubscriptionId": "a1bfa635-f2bf-42f1-86b5-848c674fc321" } } \ No newline at end of file diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveTenantTests/ListTenants.json b/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveTenantTests/ListTenants.json index 4231bfdcdd4bc..b5f9304d9c3b8 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveTenantTests/ListTenants.json +++ b/sdk/resources/Microsoft.Azure.Management.Resource/tests/SessionRecords/LiveTenantTests/ListTenants.json @@ -1,19 +1,19 @@ { "Entries": [ { - "RequestUri": "/tenants?api-version=2020-01-01", - "EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAyMC0wMS0wMQ==", + "RequestUri": "/tenants?api-version=2021-01-01", + "EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAyMS0wMS0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "c62023b4-6eac-4a39-830b-9981db5dee04" + "6233b408-c4aa-48f2-9eef-527851e0f23f" ], - "Accept-Language": [ + "accept-language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.29916.01", + "FxVersion/4.6.26614.01", "OSName/Windows", "OSVersion/Microsoft.Windows.10.0.19043.", "Microsoft.Azure.Management.ResourceManager.SubscriptionClient/3.13.2.0" @@ -23,6 +23,9 @@ "Cache-Control": [ "no-cache" ], + "Date": [ + "Thu, 14 Oct 2021 18:11:56 GMT" + ], "Pragma": [ "no-cache" ], @@ -30,13 +33,13 @@ "11999" ], "x-ms-request-id": [ - "42a20122-927a-4f9d-8d91-20b38eefe570" + "adc43a5d-0c92-4fe2-b71e-14cb15afb140" ], "x-ms-correlation-request-id": [ - "42a20122-927a-4f9d-8d91-20b38eefe570" + "adc43a5d-0c92-4fe2-b71e-14cb15afb140" ], "x-ms-routing-request-id": [ - "SOUTHCENTRALUS:20210511T202131Z:42a20122-927a-4f9d-8d91-20b38eefe570" + "WESTUS2:20211014T181157Z:adc43a5d-0c92-4fe2-b71e-14cb15afb140" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -44,25 +47,22 @@ "X-Content-Type-Options": [ "nosniff" ], - "Date": [ - "Tue, 11 May 2021 20:21:31 GMT" + "Content-Length": [ + "140" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" - ], - "Content-Length": [ - "140" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/44ec3bd9-305f-48b9-a0dc-5d3ac5a736e3\",\r\n \"tenantId\": \"44ec3bd9-305f-48b9-a0dc-5d3ac5a736e3\",\r\n \"tenantCategory\": \"Home\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"tenantCategory\": \"Home\"\r\n }\r\n ]\r\n}", "StatusCode": 200 } ], "Names": {}, "Variables": { - "SubscriptionId": "45076d1d-a3e0-418b-8187-e1422a8cf5f4" + "SubscriptionId": "a1bfa635-f2bf-42f1-86b5-848c674fc321" } } \ No newline at end of file From 5a9b6f5c36420d667768b0ca1c62073d6df897c5 Mon Sep 17 00:00:00 2001 From: Mingzhe Huang Date: Mon, 18 Oct 2021 16:34:12 +0800 Subject: [PATCH 4/4] Update Microsoft.Azure.Management.ResourceManager.csproj --- .../src/Microsoft.Azure.Management.ResourceManager.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj b/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj index 3dbc9622426a4..00337a19774fd 100644 --- a/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj +++ b/sdk/resources/Microsoft.Azure.Management.Resource/src/Microsoft.Azure.Management.ResourceManager.csproj @@ -14,7 +14,7 @@ Microsoft Azure resource management;resource management;resource groups;Azure Policy