From 10f6ad0c6416ee7b84427b30a3068fec2005e6aa Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Wed, 24 Mar 2021 16:18:02 -0700 Subject: [PATCH 1/8] Change the accessbility to virtual for Resource.Id --- .../Azure.ResourceManager.Core/src/Resources/Resource.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs index 86a35ac05cf7..a8638d1c689b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Resources/Resource.cs @@ -14,7 +14,7 @@ public abstract class Resource : IEquatable, IEquatable, IComp /// /// Gets or sets the resource identifier. /// - public abstract ResourceIdentifier Id { get; protected set; } + public virtual ResourceIdentifier Id { get; protected set; } /// /// Gets the name. From 0b813f20b88e9c0ff9eb4a12737e41e3e1e00b1a Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Tue, 29 Jun 2021 10:15:11 -0700 Subject: [PATCH 2/8] Add SubscriptionContainer tests --- .../src/Generated/SubscriptionContainer.cs | 28 ++++- .../Scenario/SubscriptionContainerTests.cs | 16 ++- .../SubscriptionContainerTests/Get().json | 99 +++++++++++++++++ .../Get()Async.json | 100 ++++++++++++++++++ 4 files changed, 234 insertions(+), 9 deletions(-) create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json create mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs index 6bb1bc63ed20..b9426ccd0e0d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs @@ -144,9 +144,19 @@ protected override void Validate(ResourceIdentifier identifier) /// subscriptionGuid cannot be null or a whitespace. public Response Get(string subscriptionGuid, CancellationToken cancellationToken = default) { - return new SubscriptionOperations( - new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), - subscriptionGuid).Get(cancellationToken); + using var scope = Diagnostics.CreateScope("SubscriptionContainer.Get"); + scope.Start(); + try + { + return new SubscriptionOperations( + new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), + subscriptionGuid).Get(cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -158,9 +168,19 @@ public Response Get(string subscriptionGuid, CancellationToken can /// subscriptionGuid cannot be null or a whitespace. public virtual Task> GetAsync(string subscriptionGuid, CancellationToken cancellationToken = default) { - return new SubscriptionOperations( + using var scope = Diagnostics.CreateScope("SubscriptionContainer.Get"); + scope.Start(); + try + { + return new SubscriptionOperations( new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), subscriptionGuid).GetAsync(cancellationToken); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs index 1ffff268e8c4..aef5b79a0c5a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/Scenario/SubscriptionContainerTests.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Azure.Core.TestFramework; using NUnit.Framework; @@ -31,7 +28,7 @@ public async Task List() [RecordedTest] public async Task TryGet() { - var foo = await Client.GetSubscriptions().TryGetAsync("/subscriptions/"+ new Guid().ToString()).ConfigureAwait(false); + var foo = await Client.GetSubscriptions().TryGetAsync("/subscriptions/" + new Guid().ToString()).ConfigureAwait(false); Assert.IsNull(foo); string subscriptionId = Client.DefaultSubscription.Id.SubscriptionId; var subscription = await Client.GetSubscriptions().TryGetAsync("/subscriptions/" + subscriptionId).ConfigureAwait(false); @@ -41,7 +38,16 @@ public async Task TryGet() [TestCase] [RecordedTest] - public async Task DoesExist() + public async Task Get() + { + string subscriptionId = Client.DefaultSubscription.Id.SubscriptionId; + Subscription result = await Client.GetSubscriptions().GetAsync(subscriptionId).ConfigureAwait(false); + Assert.AreEqual(subscriptionId, result.Id.SubscriptionId); + } + + [TestCase] + [RecordedTest] + public async Task DoesExist() { var expectFalse = await Client.GetSubscriptions().DoesExistAsync("/subscriptions/" + new Guid().ToString()).ConfigureAwait(false); Assert.IsFalse(expectFalse); diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json new file mode 100644 index 000000000000..77d0469d16ea --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json @@ -0,0 +1,99 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "x-ms-client-request-id": "3e85fc12538b48dd9a8b265a4e852d47", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "043e1831-a1c6-4703-bde5-6afdaa2e7783", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "043e1831-a1c6-4703-bde5-6afdaa2e7783", + "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:043e1831-a1c6-4703-bde5-6afdaa2e7783" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "tagKey1": "tagValue1", + "tagKey2": "tagValue2" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-4c593686b8ee0844b740f5b7572bf93c-1c70aeade0f8b449-00", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "5fd53698-d2c5-4de8-af5e-fc16e6516d12", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "5fd53698-d2c5-4de8-af5e-fc16e6516d12", + "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:5fd53698-d2c5-4de8-af5e-fc16e6516d12" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "tagKey1": "tagValue1", + "tagKey2": "tagValue2" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1163362173", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json new file mode 100644 index 000000000000..9dea7a7bc39a --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json @@ -0,0 +1,100 @@ +{ + "Entries": [ + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "Request-Id": "|448bafb9-491dfa02f9249676.", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "x-ms-client-request-id": "3e85fc12538b48dd9a8b265a4e852d47", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "6345de16-4529-4fcd-9389-c1ea8fff85fa", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "6345de16-4529-4fcd-9389-c1ea8fff85fa", + "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:6345de16-4529-4fcd-9389-c1ea8fff85fa" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "tagKey1": "tagValue1", + "tagKey2": "tagValue2" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + }, + { + "RequestUri": "https://management.azure.com/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c?api-version=2019-11-01", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "application/json", + "Authorization": "Sanitized", + "traceparent": "00-fd0b66b456a81d4793985b6093f25659-d90a119f97fae847-00", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", + "x-ms-return-client-request-id": "true" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Cache-Control": "no-cache", + "Content-Length": "450", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Expires": "-1", + "Pragma": "no-cache", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains", + "X-Content-Type-Options": "nosniff", + "x-ms-correlation-request-id": "e277b71b-3098-47f2-b8c2-a7d578cf31d9", + "x-ms-ratelimit-remaining-subscription-reads": "11993", + "x-ms-request-id": "e277b71b-3098-47f2-b8c2-a7d578cf31d9", + "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:e277b71b-3098-47f2-b8c2-a7d578cf31d9" + }, + "ResponseBody": { + "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "authorizationSource": "RoleBased", + "managedByTenants": [], + "tags": { + "tagKey1": "tagValue1", + "tagKey2": "tagValue2" + }, + "subscriptionId": "db1ab6f0-4769-4b27-930e-01e2ef9c123c", + "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "displayName": "Azure SDK sandbox", + "state": "Enabled", + "subscriptionPolicies": { + "locationPlacementId": "Internal_2014-09-01", + "quotaId": "Internal_2014-09-01", + "spendingLimit": "Off" + } + } + } + ], + "Variables": { + "RandomSeed": "1163362173", + "SUBSCRIPTION_ID": "db1ab6f0-4769-4b27-930e-01e2ef9c123c" + } +} \ No newline at end of file From 6652e8074f2848c4529e3825f0f6a9e13e40f6dd Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Wed, 30 Jun 2021 16:42:54 -0700 Subject: [PATCH 3/8] Delete two obsolete LRO classes --- .../ResourcesCreateOrUpdateOperation.cs | 73 ------------------- .../src/Generated/ResourcesUpdateOperation.cs | 73 ------------------- 2 files changed, 146 deletions(-) delete mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesCreateOrUpdateOperation.cs delete mode 100644 sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesUpdateOperation.cs diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesCreateOrUpdateOperation.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesCreateOrUpdateOperation.cs deleted file mode 100644 index 9d2570183d13..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesCreateOrUpdateOperation.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.Core -{ - /// Creates a resource. - public partial class ResourcesCreateOrUpdateOperation : Operation, IOperationSource - { - private readonly OperationOrResponseInternals _operation; - private readonly OperationsBase _parentOperation; - - /// Initializes a new instance of ResourcesCreateOrUpdateOperation for mocking. - protected ResourcesCreateOrUpdateOperation() - { - } - - internal ResourcesCreateOrUpdateOperation(OperationsBase parentOperation, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) - { - _operation = new OperationOrResponseInternals(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ResourcesCreateOrUpdateOperation"); - _parentOperation = parentOperation; - } - /// - public override string Id => ""; - - /// - public override GenericResource Value => _operation.Value; - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override bool HasValue => _operation.HasValue; - - /// - public override Response GetRawResponse() => _operation.GetRawResponse(); - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); - - GenericResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return new GenericResource(_parentOperation, GenericResourceData.DeserializeGenericResource(document.RootElement)); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return new GenericResource(_parentOperation, GenericResourceData.DeserializeGenericResource(document.RootElement)); - } - } -} diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesUpdateOperation.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesUpdateOperation.cs deleted file mode 100644 index 469b2138262c..000000000000 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/ResourcesUpdateOperation.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.Core -{ - /// Updates a resource. - public partial class ResourcesUpdateOperation : Operation, IOperationSource - { - private readonly OperationOrResponseInternals _operation; - private readonly OperationsBase _parentOperation; - - /// Initializes a new instance of ResourcesUpdateOperation for mocking. - protected ResourcesUpdateOperation() - { - } - - internal ResourcesUpdateOperation(OperationsBase parentOperation, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response) - { - _operation = new OperationOrResponseInternals(this, clientDiagnostics, pipeline, request, response, OperationFinalStateVia.Location, "ResourcesUpdateOperation"); - _parentOperation = parentOperation; - } - /// - public override string Id => ""; - - /// - public override GenericResource Value => _operation.Value; - - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// - public override bool HasValue => _operation.HasValue; - - /// - public override Response GetRawResponse() => _operation.GetRawResponse(); - - /// - public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - - /// - public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - - /// - public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); - - GenericResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return new GenericResource(_parentOperation, GenericResourceData.DeserializeGenericResource(document.RootElement)); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return new GenericResource(_parentOperation, GenericResourceData.DeserializeGenericResource(document.RootElement)); - } - } -} From 79f7b425e9addf27d1e1a354b38eb4da83195a88 Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Tue, 6 Jul 2021 12:14:13 -0700 Subject: [PATCH 4/8] Change to use Get() from its rest client --- .../src/Generated/SubscriptionContainer.cs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs index b9426ccd0e0d..d6a2dcd85943 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs @@ -142,15 +142,14 @@ protected override void Validate(ResourceIdentifier identifier) /// A token to allow the caller to cancel the call to the service. The default value is . /// A response with the operation for this subscription. /// subscriptionGuid cannot be null or a whitespace. - public Response Get(string subscriptionGuid, CancellationToken cancellationToken = default) + public Subscription Get(string subscriptionGuid, CancellationToken cancellationToken = default) { using var scope = Diagnostics.CreateScope("SubscriptionContainer.Get"); scope.Start(); try { - return new SubscriptionOperations( - new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), - subscriptionGuid).Get(cancellationToken); + SubscriptionData result = RestClient.Get(subscriptionGuid, cancellationToken).Value; + return Converter().Invoke(result); } catch (Exception e) { @@ -166,15 +165,14 @@ public Response Get(string subscriptionGuid, CancellationToken can /// A token to allow the caller to cancel the call to the service. The default value is . /// A that on completion returns a response with the operation for this subscription. /// subscriptionGuid cannot be null or a whitespace. - public virtual Task> GetAsync(string subscriptionGuid, CancellationToken cancellationToken = default) + public virtual async Task GetAsync(string subscriptionGuid, CancellationToken cancellationToken = default) { using var scope = Diagnostics.CreateScope("SubscriptionContainer.Get"); scope.Start(); try { - return new SubscriptionOperations( - new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), - subscriptionGuid).GetAsync(cancellationToken); + SubscriptionData result = await RestClient.GetAsync(subscriptionGuid, cancellationToken).ConfigureAwait(false); + return Converter().Invoke(result); } catch (Exception e) { From 19ffa3d0f12a356e5c7f9693f5e06b2a27b304da Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Tue, 6 Jul 2021 12:14:40 -0700 Subject: [PATCH 5/8] Update test records --- .../SubscriptionContainerTests/Get().json | 26 +++++++++--------- .../Get()Async.json | 27 +++++++++---------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json index 77d0469d16ea..bf7e121da5ea 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json @@ -6,7 +6,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "3e85fc12538b48dd9a8b265a4e852d47", "x-ms-return-client-request-id": "true" }, @@ -16,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Date": "Tue, 06 Jul 2021 19:10:43 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "043e1831-a1c6-4703-bde5-6afdaa2e7783", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "043e1831-a1c6-4703-bde5-6afdaa2e7783", - "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:043e1831-a1c6-4703-bde5-6afdaa2e7783" + "x-ms-correlation-request-id": "ebb6f965-549f-4e12-b713-cf3c1c0542b7", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "ebb6f965-549f-4e12-b713-cf3c1c0542b7", + "x-ms-routing-request-id": "WESTUS2:20210706T191043Z:ebb6f965-549f-4e12-b713-cf3c1c0542b7" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -51,8 +51,8 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-4c593686b8ee0844b740f5b7572bf93c-1c70aeade0f8b449-00", - "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "traceparent": "00-2e7b7a237295c94fb30ed88cbf813b33-4b00b1362e1ded4e-00", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", "x-ms-return-client-request-id": "true" }, @@ -62,15 +62,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Date": "Tue, 06 Jul 2021 19:10:43 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "5fd53698-d2c5-4de8-af5e-fc16e6516d12", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "5fd53698-d2c5-4de8-af5e-fc16e6516d12", - "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:5fd53698-d2c5-4de8-af5e-fc16e6516d12" + "x-ms-correlation-request-id": "3a0cd10d-a7ed-4a99-a400-950237eaf6d8", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "3a0cd10d-a7ed-4a99-a400-950237eaf6d8", + "x-ms-routing-request-id": "WESTUS2:20210706T191044Z:3a0cd10d-a7ed-4a99-a400-950237eaf6d8" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json index 9dea7a7bc39a..2b36c53edc24 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json @@ -6,8 +6,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "Request-Id": "|448bafb9-491dfa02f9249676.", - "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "3e85fc12538b48dd9a8b265a4e852d47", "x-ms-return-client-request-id": "true" }, @@ -17,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Date": "Tue, 06 Jul 2021 19:10:43 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "6345de16-4529-4fcd-9389-c1ea8fff85fa", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "6345de16-4529-4fcd-9389-c1ea8fff85fa", - "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:6345de16-4529-4fcd-9389-c1ea8fff85fa" + "x-ms-correlation-request-id": "424556d2-284b-4dd7-a403-01b56e4f6267", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "424556d2-284b-4dd7-a403-01b56e4f6267", + "x-ms-routing-request-id": "WESTUS2:20210706T191043Z:424556d2-284b-4dd7-a403-01b56e4f6267" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -52,8 +51,8 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-fd0b66b456a81d4793985b6093f25659-d90a119f97fae847-00", - "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210630.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", + "traceparent": "00-30fac7a58d056a4589502bd3b2046791-4dac2fb97c3a8a4d-00", + "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", "x-ms-return-client-request-id": "true" }, @@ -63,15 +62,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Wed, 30 Jun 2021 23:29:48 GMT", + "Date": "Tue, 06 Jul 2021 19:10:43 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "e277b71b-3098-47f2-b8c2-a7d578cf31d9", - "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "e277b71b-3098-47f2-b8c2-a7d578cf31d9", - "x-ms-routing-request-id": "WESTUS2:20210630T232948Z:e277b71b-3098-47f2-b8c2-a7d578cf31d9" + "x-ms-correlation-request-id": "878915ce-21e3-4a79-964a-1295ac3d7c80", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "878915ce-21e3-4a79-964a-1295ac3d7c80", + "x-ms-routing-request-id": "WESTUS2:20210706T191044Z:878915ce-21e3-4a79-964a-1295ac3d7c80" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", From b86b38cd2b91c0bf07828daf9796979955dcd75a Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Tue, 6 Jul 2021 12:29:10 -0700 Subject: [PATCH 6/8] Change return type back to Response --- .../src/Generated/SubscriptionContainer.cs | 12 ++++++------ .../SubscriptionContainerTests/Get().json | 18 +++++++++--------- .../SubscriptionContainerTests/Get()Async.json | 18 +++++++++--------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs index d6a2dcd85943..c52acd3290ee 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs @@ -142,14 +142,14 @@ protected override void Validate(ResourceIdentifier identifier) /// A token to allow the caller to cancel the call to the service. The default value is . /// A response with the operation for this subscription. /// subscriptionGuid cannot be null or a whitespace. - public Subscription Get(string subscriptionGuid, CancellationToken cancellationToken = default) + public Response Get(string subscriptionGuid, CancellationToken cancellationToken = default) { using var scope = Diagnostics.CreateScope("SubscriptionContainer.Get"); scope.Start(); try { - SubscriptionData result = RestClient.Get(subscriptionGuid, cancellationToken).Value; - return Converter().Invoke(result); + var response = RestClient.Get(subscriptionGuid, cancellationToken); + return Response.FromValue(Converter().Invoke(response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -165,14 +165,14 @@ public Subscription Get(string subscriptionGuid, CancellationToken cancellationT /// A token to allow the caller to cancel the call to the service. The default value is . /// A that on completion returns a response with the operation for this subscription. /// subscriptionGuid cannot be null or a whitespace. - public virtual async Task GetAsync(string subscriptionGuid, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string subscriptionGuid, CancellationToken cancellationToken = default) { using var scope = Diagnostics.CreateScope("SubscriptionContainer.Get"); scope.Start(); try { - SubscriptionData result = await RestClient.GetAsync(subscriptionGuid, cancellationToken).ConfigureAwait(false); - return Converter().Invoke(result); + var response = await RestClient.GetAsync(subscriptionGuid, cancellationToken).ConfigureAwait(false); + return Response.FromValue(Converter().Invoke(response.Value), response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json index bf7e121da5ea..d353a913cf6a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json @@ -16,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:10:43 GMT", + "Date": "Tue, 06 Jul 2021 19:26:53 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "ebb6f965-549f-4e12-b713-cf3c1c0542b7", + "x-ms-correlation-request-id": "639cae88-88ee-4e99-8fa7-31712930ea48", "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "ebb6f965-549f-4e12-b713-cf3c1c0542b7", - "x-ms-routing-request-id": "WESTUS2:20210706T191043Z:ebb6f965-549f-4e12-b713-cf3c1c0542b7" + "x-ms-request-id": "639cae88-88ee-4e99-8fa7-31712930ea48", + "x-ms-routing-request-id": "WESTUS2:20210706T192653Z:639cae88-88ee-4e99-8fa7-31712930ea48" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -51,7 +51,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-2e7b7a237295c94fb30ed88cbf813b33-4b00b1362e1ded4e-00", + "traceparent": "00-63473dc90ac3cd408cc156b5ef0b2ae1-6dae3b5c07655541-00", "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", "x-ms-return-client-request-id": "true" @@ -62,15 +62,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:10:43 GMT", + "Date": "Tue, 06 Jul 2021 19:26:54 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3a0cd10d-a7ed-4a99-a400-950237eaf6d8", + "x-ms-correlation-request-id": "40907cba-47a2-4b2e-ba3b-6175bdceafa6", "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "3a0cd10d-a7ed-4a99-a400-950237eaf6d8", - "x-ms-routing-request-id": "WESTUS2:20210706T191044Z:3a0cd10d-a7ed-4a99-a400-950237eaf6d8" + "x-ms-request-id": "40907cba-47a2-4b2e-ba3b-6175bdceafa6", + "x-ms-routing-request-id": "WESTUS2:20210706T192654Z:40907cba-47a2-4b2e-ba3b-6175bdceafa6" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json index 2b36c53edc24..f7853d599f66 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json @@ -16,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:10:43 GMT", + "Date": "Tue, 06 Jul 2021 19:26:53 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "424556d2-284b-4dd7-a403-01b56e4f6267", + "x-ms-correlation-request-id": "3af6a559-dd59-46c2-826c-54611a9acf92", "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "424556d2-284b-4dd7-a403-01b56e4f6267", - "x-ms-routing-request-id": "WESTUS2:20210706T191043Z:424556d2-284b-4dd7-a403-01b56e4f6267" + "x-ms-request-id": "3af6a559-dd59-46c2-826c-54611a9acf92", + "x-ms-routing-request-id": "WESTUS2:20210706T192653Z:3af6a559-dd59-46c2-826c-54611a9acf92" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -51,7 +51,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-30fac7a58d056a4589502bd3b2046791-4dac2fb97c3a8a4d-00", + "traceparent": "00-14084e06a5f7ea42a797dfcc05eb2ee1-b70219ba5efdbc4c-00", "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", "x-ms-return-client-request-id": "true" @@ -62,15 +62,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:10:43 GMT", + "Date": "Tue, 06 Jul 2021 19:26:53 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "878915ce-21e3-4a79-964a-1295ac3d7c80", + "x-ms-correlation-request-id": "30117b88-9a51-4b79-9727-f7c01ea4a772", "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "878915ce-21e3-4a79-964a-1295ac3d7c80", - "x-ms-routing-request-id": "WESTUS2:20210706T191044Z:878915ce-21e3-4a79-964a-1295ac3d7c80" + "x-ms-request-id": "30117b88-9a51-4b79-9727-f7c01ea4a772", + "x-ms-routing-request-id": "WESTUS2:20210706T192654Z:30117b88-9a51-4b79-9727-f7c01ea4a772" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", From a7173aac5887c7d5fb763bdf8cf9e7f2e2f76a11 Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Tue, 6 Jul 2021 13:28:47 -0700 Subject: [PATCH 7/8] Get rid of Converter() --- .../src/Generated/SubscriptionContainer.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs index c52acd3290ee..0ff4c6e1a6fd 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/src/Generated/SubscriptionContainer.cs @@ -149,7 +149,7 @@ public Response Get(string subscriptionGuid, CancellationToken can try { var response = RestClient.Get(subscriptionGuid, cancellationToken); - return Response.FromValue(Converter().Invoke(response.Value), response.GetRawResponse()); + return Response.FromValue(new Subscription(this, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -172,7 +172,7 @@ public virtual async Task> GetAsync(string subscriptionGu try { var response = await RestClient.GetAsync(subscriptionGuid, cancellationToken).ConfigureAwait(false); - return Response.FromValue(Converter().Invoke(response.Value), response.GetRawResponse()); + return Response.FromValue(new Subscription(this, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -190,11 +190,5 @@ protected override ResourceOperationsBase Converter() - { - return s => new Subscription(new SubscriptionOperations(new ClientContext(ClientOptions, Credential, BaseUri, Pipeline), s.Id), s); - } } } From 6d8e2f845006ac4721ca46c6fb177fadc17476b0 Mon Sep 17 00:00:00 2001 From: YalinLi0312 Date: Tue, 6 Jul 2021 14:08:36 -0700 Subject: [PATCH 8/8] Update records --- .../SubscriptionContainerTests/Get().json | 22 +++++++++--------- .../Get()Async.json | 23 ++++++++++--------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json index d353a913cf6a..60bf8fa1ad4b 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get().json @@ -16,15 +16,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:26:53 GMT", + "Date": "Tue, 06 Jul 2021 20:32:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "639cae88-88ee-4e99-8fa7-31712930ea48", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "639cae88-88ee-4e99-8fa7-31712930ea48", - "x-ms-routing-request-id": "WESTUS2:20210706T192653Z:639cae88-88ee-4e99-8fa7-31712930ea48" + "x-ms-correlation-request-id": "52feaa40-89e0-406c-99bc-bcc862ee002b", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "52feaa40-89e0-406c-99bc-bcc862ee002b", + "x-ms-routing-request-id": "WESTUS2:20210706T203233Z:52feaa40-89e0-406c-99bc-bcc862ee002b" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -51,7 +51,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-63473dc90ac3cd408cc156b5ef0b2ae1-6dae3b5c07655541-00", + "traceparent": "00-8b782cd7fb0c134582e38486a9413367-27454a08c81d0a4b-00", "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", "x-ms-return-client-request-id": "true" @@ -62,15 +62,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:26:54 GMT", + "Date": "Tue, 06 Jul 2021 20:32:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "40907cba-47a2-4b2e-ba3b-6175bdceafa6", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "40907cba-47a2-4b2e-ba3b-6175bdceafa6", - "x-ms-routing-request-id": "WESTUS2:20210706T192654Z:40907cba-47a2-4b2e-ba3b-6175bdceafa6" + "x-ms-correlation-request-id": "3fe18db1-28e3-4fed-9d67-f209c7c00f6d", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "3fe18db1-28e3-4fed-9d67-f209c7c00f6d", + "x-ms-routing-request-id": "WESTUS2:20210706T203233Z:3fe18db1-28e3-4fed-9d67-f209c7c00f6d" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", diff --git a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json index f7853d599f66..23e8a94738e8 100644 --- a/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json +++ b/sdk/resourcemanager/Azure.ResourceManager.Core/tests/SessionRecords/SubscriptionContainerTests/Get()Async.json @@ -6,6 +6,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", + "Request-Id": "|a07f6a94-4bec862981a82377.", "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "3e85fc12538b48dd9a8b265a4e852d47", "x-ms-return-client-request-id": "true" @@ -16,15 +17,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:26:53 GMT", + "Date": "Tue, 06 Jul 2021 20:32:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "3af6a559-dd59-46c2-826c-54611a9acf92", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "3af6a559-dd59-46c2-826c-54611a9acf92", - "x-ms-routing-request-id": "WESTUS2:20210706T192653Z:3af6a559-dd59-46c2-826c-54611a9acf92" + "x-ms-correlation-request-id": "0c54e7dd-6472-4747-8f86-04c9fd0fa8f9", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "0c54e7dd-6472-4747-8f86-04c9fd0fa8f9", + "x-ms-routing-request-id": "WESTUS2:20210706T203233Z:0c54e7dd-6472-4747-8f86-04c9fd0fa8f9" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c", @@ -51,7 +52,7 @@ "RequestHeaders": { "Accept": "application/json", "Authorization": "Sanitized", - "traceparent": "00-14084e06a5f7ea42a797dfcc05eb2ee1-b70219ba5efdbc4c-00", + "traceparent": "00-00f818ed75bea24f8ab2decf15c5f7b7-daae7cdc04674e40-00", "User-Agent": "azsdk-net-ResourceManager.Core/1.0.0-alpha.20210706.1 (.NET Framework 4.8.4300.0; Microsoft Windows 10.0.19043 )", "x-ms-client-request-id": "35d84112dc513ac26fb053d476335d71", "x-ms-return-client-request-id": "true" @@ -62,15 +63,15 @@ "Cache-Control": "no-cache", "Content-Length": "450", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Jul 2021 19:26:53 GMT", + "Date": "Tue, 06 Jul 2021 20:32:33 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "30117b88-9a51-4b79-9727-f7c01ea4a772", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "30117b88-9a51-4b79-9727-f7c01ea4a772", - "x-ms-routing-request-id": "WESTUS2:20210706T192654Z:30117b88-9a51-4b79-9727-f7c01ea4a772" + "x-ms-correlation-request-id": "567e1055-d76b-4205-9b39-a945c56d87de", + "x-ms-ratelimit-remaining-subscription-reads": "11994", + "x-ms-request-id": "567e1055-d76b-4205-9b39-a945c56d87de", + "x-ms-routing-request-id": "WESTUS2:20210706T203233Z:567e1055-d76b-4205-9b39-a945c56d87de" }, "ResponseBody": { "id": "/subscriptions/db1ab6f0-4769-4b27-930e-01e2ef9c123c",