From 713748e5273642c12b1b3400dd41edf6218abbdb Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 8 Jul 2019 15:16:29 -0700 Subject: [PATCH 01/15] Rename Request to HttpRequest --- .../src/ConfigurationClient.cs | 53 +- .../Diagnostics/HttpPipelineEventSource.cs | 13 +- .../src/Pipeline/HttpClientTransport.cs | 5 +- .../Azure.Core/src/Pipeline/HttpPipeline.cs | 7 +- .../src/Pipeline/HttpPipelineMessage.cs | 3 +- .../src/Pipeline/HttpPipelineTransport.cs | 3 +- sdk/core/Azure.Core/src/Request.cs | 5 +- sdk/core/Azure.Core/src/RequestHeaders.cs | 6 +- sdk/core/Azure.Core/tests/EventSourceTests.cs | 7 +- .../HttpClientTransportFunctionalTests.cs | 8 +- .../tests/HttpClientTransportTests.cs | 21 +- .../tests/HttpPipelineBuilderTest.cs | 5 +- sdk/core/Azure.Core/tests/PipelineTestBase.cs | 3 +- sdk/core/Azure.Core/tests/PolicyTestBase.cs | 3 +- .../Azure.Core/tests/RetriableStreamTests.cs | 9 +- .../tests/TestFramework/MockRequest.cs | 3 +- .../Azure.Core/tests/TestFramework/Mocks.cs | 5 +- .../tests/TestFramework/PlaybackTransport.cs | 3 +- .../tests/TestFramework/RecordMatcher.cs | 5 +- .../tests/TestFramework/RecordSession.cs | 3 +- .../tests/TestFramework/RecordTransport.cs | 7 +- .../TestFramework/SyncAsyncPolicyTestBase.cs | 5 +- .../Azure.Identity/src/AadIdentityClient.cs | 21 +- .../src/ManagedIdentityClient.cs | 25 +- .../src/KeyClient_private.cs | 29 +- .../src/SecretClient.cs | 29 +- .../src/Generated/BlobRestClient.cs | 608 +++++++++--------- .../src/Generated/FileRestClient.cs | 186 +++--- .../src/Generated/QueueRestClient.cs | 96 +-- 29 files changed, 600 insertions(+), 576 deletions(-) diff --git a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs index d5072394f410a..892d7cda2739b 100644 --- a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs @@ -8,6 +8,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Http; using Azure.Core.Pipeline; using Azure.Core.Pipeline.Policies; @@ -90,7 +91,7 @@ public virtual Response Add(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> AddAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateAddRequest(setting)) + using (HttpRequest request = CreateAddRequest(setting)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -112,7 +113,7 @@ public virtual async Task> AddAsync(Configuration /// A controlling the request lifetime. public virtual Response Add(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateAddRequest(setting)) + using (HttpRequest request = CreateAddRequest(setting)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -127,7 +128,7 @@ public virtual Response Add(ConfigurationSetting setting, } } - private Request CreateAddRequest(ConfigurationSetting setting) + private HttpRequest CreateAddRequest(ConfigurationSetting setting) { if (setting == null) throw new ArgumentNullException(nameof(setting)); @@ -183,7 +184,7 @@ public virtual Response Set(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> SetAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateSetRequest(setting)) + using (HttpRequest request = CreateSetRequest(setting)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -206,7 +207,7 @@ public virtual async Task> SetAsync(Configuration /// A controlling the request lifetime. public virtual Response Set(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateSetRequest(setting)) + using (HttpRequest request = CreateSetRequest(setting)) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -222,14 +223,14 @@ public virtual Response Set(ConfigurationSetting setting, } } - private Request CreateSetRequest(ConfigurationSetting setting) + private HttpRequest CreateSetRequest(ConfigurationSetting setting) { if (setting == null) throw new ArgumentNullException(nameof(setting)); if (string.IsNullOrEmpty(setting.Key)) throw new ArgumentNullException($"{nameof(setting)}.{nameof(setting.Key)}"); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); ReadOnlyMemory content = Serialize(setting); request.Method = RequestMethod.Put; @@ -282,7 +283,7 @@ public virtual Response Update(string key, string value, s /// A controlling the request lifetime. public virtual async Task> UpdateAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateUpdateRequest(setting)) + using (HttpRequest request = CreateUpdateRequest(setting)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -303,7 +304,7 @@ public virtual async Task> UpdateAsync(Configurat /// A controlling the request lifetime. public virtual Response Update(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateUpdateRequest(setting)) + using (HttpRequest request = CreateUpdateRequest(setting)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -317,14 +318,14 @@ public virtual Response Update(ConfigurationSetting settin } } - private Request CreateUpdateRequest(ConfigurationSetting setting) + private HttpRequest CreateUpdateRequest(ConfigurationSetting setting) { if (setting == null) throw new ArgumentNullException(nameof(setting)); if (string.IsNullOrEmpty(setting.Key)) throw new ArgumentNullException($"{nameof(setting)}.{nameof(setting.Key)}"); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); ReadOnlyMemory content = Serialize(setting); request.Method = RequestMethod.Put; @@ -356,7 +357,7 @@ private Request CreateUpdateRequest(ConfigurationSetting setting) /// A controlling the request lifetime. public virtual async Task DeleteAsync(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using (Request request = CreateDeleteRequest(key, label, etag)) + using (HttpRequest request = CreateDeleteRequest(key, label, etag)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -382,7 +383,7 @@ public virtual async Task DeleteAsync(string key, string label = defau /// A controlling the request lifetime. public virtual Response Delete(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using (Request request = CreateDeleteRequest(key, label, etag)) + using (HttpRequest request = CreateDeleteRequest(key, label, etag)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -397,12 +398,12 @@ public virtual Response Delete(string key, string label = default, ETag etag = d } } - private Request CreateDeleteRequest(string key, string label, ETag etag) + private HttpRequest CreateDeleteRequest(string key, string label, ETag etag) { if (string.IsNullOrEmpty(key)) throw new ArgumentNullException(nameof(key)); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Delete; BuildUriForKvRoute(request.UriBuilder, key, label); @@ -423,7 +424,7 @@ private Request CreateDeleteRequest(string key, string label, ETag etag) /// A controlling the request lifetime. public virtual async Task> GetAsync(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRequest(key, label, acceptDateTime)) + using (HttpRequest request = CreateGetRequest(key, label, acceptDateTime)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -446,7 +447,7 @@ public virtual async Task> GetAsync(string key, s /// A controlling the request lifetime. public virtual Response Get(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRequest(key, label, acceptDateTime)) + using (HttpRequest request = CreateGetRequest(key, label, acceptDateTime)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -480,12 +481,12 @@ public virtual IEnumerable> GetRevisions(SettingS return PageResponseEnumerator.CreateEnumerable(nextLink => GetRevisionsPage(selector, nextLink, cancellationToken)); } - private Request CreateGetRequest(string key, string label, DateTimeOffset acceptDateTime) + private HttpRequest CreateGetRequest(string key, string label, DateTimeOffset acceptDateTime) { if (string.IsNullOrEmpty(key)) throw new ArgumentNullException($"{nameof(key)}"); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; BuildUriForKvRoute(request.UriBuilder, key, label); request.Headers.Add(MediaTypeKeyValueApplicationHeader); @@ -507,7 +508,7 @@ private Request CreateGetRequest(string key, string label, DateTimeOffset accept /// A controlling the request lifetime. private async Task> GetSettingsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateBatchRequest(selector, pageLink)) + using (HttpRequest request = CreateBatchRequest(selector, pageLink)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -530,7 +531,7 @@ private async Task> GetSettingsPageAsync(Sett /// A controlling the request lifetime. private PageResponse GetSettingsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateBatchRequest(selector, pageLink)) + using (HttpRequest request = CreateBatchRequest(selector, pageLink)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -546,9 +547,9 @@ private PageResponse GetSettingsPage(SettingSelector selec } } - private Request CreateBatchRequest(SettingSelector selector, string pageLink) + private HttpRequest CreateBatchRequest(SettingSelector selector, string pageLink) { - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; BuildUriForGetBatch(request.UriBuilder, selector, pageLink); request.Headers.Add(MediaTypeKeyValueApplicationHeader); @@ -569,7 +570,7 @@ private Request CreateBatchRequest(SettingSelector selector, string pageLink) /// A controlling the request lifetime. private async Task> GetRevisionsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRevisionsRequest(selector, pageLink)) + using (HttpRequest request = CreateGetRevisionsRequest(selector, pageLink)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -592,7 +593,7 @@ private async Task> GetRevisionsPageAsync(Set /// A controlling the request lifetime. private PageResponse GetRevisionsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRevisionsRequest(selector, pageLink)) + using (HttpRequest request = CreateGetRevisionsRequest(selector, pageLink)) { Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) @@ -607,7 +608,7 @@ private PageResponse GetRevisionsPage(SettingSelector sele } } - private Request CreateGetRevisionsRequest(SettingSelector selector, string pageLink) + private HttpRequest CreateGetRevisionsRequest(SettingSelector selector, string pageLink) { var request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; diff --git a/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs b/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs index d0dc215a85d26..af28b24e73701 100644 --- a/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs +++ b/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs @@ -9,6 +9,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; // TODO (pri 2): we should log correction/activity // TODO (pri 2): we should log exceptions @@ -46,7 +47,7 @@ private HttpPipelineEventSource() : base(EventSourceName) { } // TODO (pri 2): this logs just the URI. We need more [NonEvent] - public void Request(Request request) + public void Request(HttpRequest request) { if (IsEnabled(EventLevel.Informational, EventKeywords.None)) { @@ -55,7 +56,7 @@ public void Request(Request request) } [NonEvent] - public async Task RequestContentAsync(Request request, CancellationToken cancellationToken) + public async Task RequestContentAsync(HttpRequest request, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -64,7 +65,7 @@ public async Task RequestContentAsync(Request request, CancellationToken cancell } [NonEvent] - public void RequestContent(Request request, CancellationToken cancellationToken) + public void RequestContent(HttpRequest request, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -73,7 +74,7 @@ public void RequestContent(Request request, CancellationToken cancellationToken) } [NonEvent] - public async Task RequestContentTextAsync(Request request, Encoding encoding, CancellationToken cancellationToken) + public async Task RequestContentTextAsync(HttpRequest request, Encoding encoding, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -82,7 +83,7 @@ public async Task RequestContentTextAsync(Request request, Encoding encoding, Ca } [NonEvent] - public void RequestContentText(Request request, Encoding encoding, CancellationToken cancellationToken) + public void RequestContentText(HttpRequest request, Encoding encoding, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -205,7 +206,7 @@ public void ResponseDelay(Response response, long delayMilliseconds) } [NonEvent] - public void RequestRetrying(Request request, int retryNumber) + public void RequestRetrying(HttpRequest request, int retryNumber) { RequestRetrying(request.ClientRequestId, retryNumber); } diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs index 9ab862d9f5394..a694111e80d40 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs @@ -10,6 +10,7 @@ using System.Net.Http.Headers; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; namespace Azure.Core.Pipeline { @@ -32,7 +33,7 @@ public HttpClientTransport(HttpClient client) public static readonly HttpClientTransport Shared = new HttpClientTransport(); - public sealed override Request CreateRequest() + public sealed override HttpRequest CreateRequest() => new PipelineRequest(); public override void Process(HttpPipelineMessage message) @@ -143,7 +144,7 @@ private static string JoinHeaderValues(IEnumerable values) return string.Join(",", values); } - sealed class PipelineRequest : Request + sealed class PipelineRequest : HttpRequest { private bool _wasSent = false; private readonly HttpRequestMessage _requestMessage; diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs index a55527c596c35..cf3817bc2dd60 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; namespace Azure.Core.Pipeline { @@ -28,11 +29,11 @@ public HttpPipeline(HttpPipelineTransport transport, HttpPipelinePolicy[] polici _pipeline = all; } - public Request CreateRequest() + public HttpRequest CreateRequest() => _transport.CreateRequest(); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public async Task SendRequestAsync(Request request, CancellationToken cancellationToken) + public async Task SendRequestAsync(HttpRequest request, CancellationToken cancellationToken) { var message = new HttpPipelineMessage(cancellationToken); message.Request = request; @@ -42,7 +43,7 @@ public async Task SendRequestAsync(Request request, CancellationToken } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Response SendRequest(Request request, CancellationToken cancellationToken) + public Response SendRequest(HttpRequest request, CancellationToken cancellationToken) { var message = new HttpPipelineMessage(cancellationToken); message.Request = request; diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs index 323a89c8ac6ff..98965bec542c0 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Threading; +using Azure.Core.Http; namespace Azure.Core.Pipeline { @@ -17,7 +18,7 @@ public HttpPipelineMessage(CancellationToken cancellationToken) CancellationToken = cancellationToken; } - public Request Request { get; set; } + public HttpRequest Request { get; set; } public Response Response { get; set; } diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs index 1c7a88f55f771..ed5603d1def85 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs @@ -3,6 +3,7 @@ using System; using System.Threading.Tasks; +using Azure.Core.Http; namespace Azure.Core.Pipeline { @@ -12,6 +13,6 @@ public abstract class HttpPipelineTransport public abstract Task ProcessAsync(HttpPipelineMessage message); - public abstract Request CreateRequest(); + public abstract HttpRequest CreateRequest(); } } diff --git a/sdk/core/Azure.Core/src/Request.cs b/sdk/core/Azure.Core/src/Request.cs index 35296639da108..af99059e45ecd 100644 --- a/sdk/core/Azure.Core/src/Request.cs +++ b/sdk/core/Azure.Core/src/Request.cs @@ -3,12 +3,11 @@ using System; using System.Collections.Generic; -using Azure.Core; using Azure.Core.Pipeline; -namespace Azure +namespace Azure.Core.Http { - public abstract class Request : IDisposable + public abstract class HttpRequest : IDisposable { public virtual HttpPipelineUriBuilder UriBuilder { get; set; } = new HttpPipelineUriBuilder(); diff --git a/sdk/core/Azure.Core/src/RequestHeaders.cs b/sdk/core/Azure.Core/src/RequestHeaders.cs index 7cc79a3e5e159..7fbf170587dc4 100644 --- a/sdk/core/Azure.Core/src/RequestHeaders.cs +++ b/sdk/core/Azure.Core/src/RequestHeaders.cs @@ -5,13 +5,13 @@ using System.Collections.Generic; using Azure.Core.Pipeline; -namespace Azure +namespace Azure.Core.Http { public readonly struct RequestHeaders: IEnumerable { - private readonly Request _request; + private readonly HttpRequest _request; - public RequestHeaders(Request request) + public RequestHeaders(HttpRequest request) { _request = request; } diff --git a/sdk/core/Azure.Core/tests/EventSourceTests.cs b/sdk/core/Azure.Core/tests/EventSourceTests.cs index 179c63cdc97ff..781040b2e0eea 100644 --- a/sdk/core/Azure.Core/tests/EventSourceTests.cs +++ b/sdk/core/Azure.Core/tests/EventSourceTests.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core.Diagnostics; +using Azure.Core.Http; using Azure.Core.Pipeline; using Azure.Core.Pipeline.Policies; using Azure.Core.Testing; @@ -78,7 +79,7 @@ public async Task SendingRequestProducesEvents() var pipeline = new HttpPipeline(mockTransport, new []{ LoggingPolicy.Shared }); string requestId; - using (Request request = pipeline.CreateRequest()) + using (HttpRequest request = pipeline.CreateRequest()) { request.SetRequestLine(RequestMethod.Get, new Uri("https://contoso.a.io")); request.Headers.Add("Date", "3/26/2019"); @@ -140,7 +141,7 @@ public async Task RequestContentIsLoggedAsText() var pipeline = new HttpPipeline(mockTransport, new []{ LoggingPolicy.Shared }); string requestId; - using (Request request = pipeline.CreateRequest()) + using (HttpRequest request = pipeline.CreateRequest()) { request.SetRequestLine(RequestMethod.Get, new Uri("https://contoso.a.io")); request.Content = HttpPipelineRequestContent.Create(Encoding.UTF8.GetBytes("Hello world")); @@ -310,7 +311,7 @@ private async Task SendRequest(bool isSeekable, Action s var mockTransport = CreateMockTransport(mockResponse); var pipeline = new HttpPipeline(mockTransport, new[] { LoggingPolicy.Shared }); - using (Request request = pipeline.CreateRequest()) + using (HttpRequest request = pipeline.CreateRequest()) { request.SetRequestLine(RequestMethod.Get, new Uri("https://contoso.a.io")); diff --git a/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs b/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs index 9fa7ca6aecca0..f65f931055020 100644 --- a/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs +++ b/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs @@ -1,7 +1,8 @@ using System; +using System.Text; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; -using Microsoft.AspNetCore.Http; using NUnit.Framework; namespace Azure.Core.Tests @@ -19,13 +20,14 @@ public async Task ProxySettingsAreReadFromEnvironment(string envVar, string url) using (TestServer testServer = new TestServer(async context => { context.Response.Headers["Via"] = "Test-Proxy"; - await context.Response.WriteAsync("Hello"); + byte[] buffer = Encoding.UTF8.GetBytes("Hello"); + await context.Response.Body.WriteAsync(buffer, 0, buffer.Length); })) { Environment.SetEnvironmentVariable(envVar, testServer.Address.ToString()); var transport = new HttpClientTransport(); - Request request = transport.CreateRequest(); + HttpRequest request = transport.CreateRequest(); request.UriBuilder.Uri = new Uri(url); Response response = await ExecuteRequest(request, transport); Assert.True(response.Headers.TryGetValue("Via", out var via)); diff --git a/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs b/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs index 641f8177c62e7..110a04ac31af2 100644 --- a/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs +++ b/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs @@ -10,6 +10,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; using NUnit.Framework; @@ -211,7 +212,7 @@ public async Task CanGetAndAddRequestHeaders(string headerName, string headerVal }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = CreateRequest(transport); + HttpRequest request = CreateRequest(transport); request.Headers.Add(headerName, headerValue); @@ -244,7 +245,7 @@ public async Task CanSetRequestHeaders(string headerName, string headerValue, bo }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = CreateRequest(transport); + HttpRequest request = CreateRequest(transport); request.Headers.Add(headerName, "Random value"); request.Headers.SetValue(headerName, headerValue); @@ -276,7 +277,7 @@ public async Task CanRemoveHeaders(string headerName, string headerValue, bool c }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = CreateRequest(transport); + HttpRequest request = CreateRequest(transport); request.Headers.Add(headerName, headerValue); Assert.True(request.Headers.Remove(headerName)); @@ -356,7 +357,7 @@ public async Task CanAddMultipleValuesToRequestHeader(string headerName, string }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = CreateRequest(transport); + HttpRequest request = CreateRequest(transport); request.Headers.Add(headerName, headerValue); request.Headers.Add(headerName, anotherHeaderValue); @@ -421,7 +422,7 @@ public async Task CanGetAndSetMultiValueResponseHeaders(string headerName, strin CollectionAssert.Contains(response.Headers, new HttpHeader(headerName, joinedHeaderValues)); } - private static Request CreateRequest(HttpClientTransport transport, byte[] bytes = null) + private static HttpRequest CreateRequest(HttpClientTransport transport, byte[] bytes = null) { var request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); @@ -473,7 +474,7 @@ public async Task ContentStreamIsReturnedSynchronously() var mockHandler = new MockHttpClientHandler(httpRequestMessage => Task.FromResult(httpResponseMessage)); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = transport.CreateRequest(); + HttpRequest request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); Response response = await ExecuteRequest(request, transport); @@ -514,7 +515,7 @@ public async Task OriginalContentStreamIsReturnedIfNotAsync() var mockHandler = new MockHttpClientHandler(httpRequestMessage => Task.FromResult(httpResponseMessage)); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = transport.CreateRequest(); + HttpRequest request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); Response response = await ExecuteRequest(request, transport); @@ -535,7 +536,7 @@ public async Task ReasonPhraseIsExposed() var mockHandler = new MockHttpClientHandler(httpRequestMessage => Task.FromResult(httpResponseMessage)); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = transport.CreateRequest(); + HttpRequest request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); Response response = await ExecuteRequest(request, transport); @@ -556,7 +557,7 @@ public async Task StreamRequestContentCanBeSentMultipleTimes() }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - Request request = transport.CreateRequest(); + HttpRequest request = transport.CreateRequest(); request.Content = HttpPipelineRequestContent.Create(new MemoryStream(new byte[] { 1, 2, 3} )); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); @@ -581,7 +582,7 @@ public async Task RequestContentIsNotDisposedOnSend() DisposeTrackingContent disposeTrackingContent = new DisposeTrackingContent(); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - using (Request request = transport.CreateRequest()) + using (HttpRequest request = transport.CreateRequest()) { request.Content = disposeTrackingContent; request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); diff --git a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs index 203f1fcfcabf1..f954957d07ad6 100644 --- a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs +++ b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs @@ -5,6 +5,7 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; using Azure.Core.Testing; using NUnit.Framework; @@ -27,7 +28,7 @@ public async Task CanAddCustomPolicy(HttpPipelinePosition position, int expected HttpPipeline pipeline = HttpPipelineBuilder.Build(options, false); - using Request request = transport.CreateRequest(); + using HttpRequest request = transport.CreateRequest(); request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); @@ -46,7 +47,7 @@ public async Task UsesAssemblyNameAndInformationalVersionForTelemetryPolicySetti HttpPipeline pipeline = HttpPipelineBuilder.Build(options, false); - using Request request = transport.CreateRequest(); + using HttpRequest request = transport.CreateRequest(); request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); diff --git a/sdk/core/Azure.Core/tests/PipelineTestBase.cs b/sdk/core/Azure.Core/tests/PipelineTestBase.cs index 315a64c5059bb..e9905450530ef 100644 --- a/sdk/core/Azure.Core/tests/PipelineTestBase.cs +++ b/sdk/core/Azure.Core/tests/PipelineTestBase.cs @@ -3,13 +3,14 @@ using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; namespace Azure.Core.Tests { public class PipelineTestBase { - protected static async Task ExecuteRequest(Request request, HttpClientTransport transport) + protected static async Task ExecuteRequest(HttpRequest request, HttpClientTransport transport) { var message = new HttpPipelineMessage(CancellationToken.None) { Request = request }; await transport.ProcessAsync(message); diff --git a/sdk/core/Azure.Core/tests/PolicyTestBase.cs b/sdk/core/Azure.Core/tests/PolicyTestBase.cs index 39d043477943d..7f48bf9cbf719 100644 --- a/sdk/core/Azure.Core/tests/PolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/PolicyTestBase.cs @@ -4,6 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; using NUnit.Framework; @@ -15,7 +16,7 @@ protected static Task SendGetRequest(HttpPipelineTransport transport, { Assert.IsInstanceOf(policy, "Use SyncAsyncPolicyTestBase base type for non-sync policies"); - using (Request request = transport.CreateRequest()) + using (HttpRequest request = transport.CreateRequest()) { request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); diff --git a/sdk/core/Azure.Core/tests/RetriableStreamTests.cs b/sdk/core/Azure.Core/tests/RetriableStreamTests.cs index c73528fb34ae0..82ed7664c8b04 100644 --- a/sdk/core/Azure.Core/tests/RetriableStreamTests.cs +++ b/sdk/core/Azure.Core/tests/RetriableStreamTests.cs @@ -5,6 +5,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; using Azure.Core.Testing; using NUnit.Framework; @@ -240,21 +241,21 @@ private Task ReadAsync(Stream stream, byte[] buffer, int offset, int length private static Response SendTestRequest(HttpPipeline pipeline, long offset) { - using Request request = CreateRequest(pipeline, offset); + using HttpRequest request = CreateRequest(pipeline, offset); return pipeline.SendRequest(request, CancellationToken.None); } private static Task SendTestRequestAsync(HttpPipeline pipeline, long offset) { - using Request request = CreateRequest(pipeline, offset); + using HttpRequest request = CreateRequest(pipeline, offset); return pipeline.SendRequestAsync(request, CancellationToken.None); } - private static Request CreateRequest(HttpPipeline pipeline, long offset) + private static HttpRequest CreateRequest(HttpPipeline pipeline, long offset) { - Request request = pipeline.CreateRequest(); + HttpRequest request = pipeline.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com")); request.Headers.Add("Range", "bytes=" + offset); return request; diff --git a/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs b/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs index 90b55825c8e9d..060ddb053b890 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs @@ -4,11 +4,12 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.Core.Http; using Azure.Core.Pipeline; namespace Azure.Core.Testing { - public class MockRequest : Request + public class MockRequest : HttpRequest { public MockRequest() { diff --git a/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs b/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs index 6cc7676c2262a..8b0ceb16e102d 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -using Azure.Core.Pipeline; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Azure.Core.Pipeline; +using Azure.Core.Http; namespace Azure.Core.Testing { @@ -35,7 +36,7 @@ public MockTransport(Func responseFactory) _responseFactory = responseFactory; } - public override Request CreateRequest() + public override HttpRequest CreateRequest() => new MockRequest(); public override void Process(HttpPipelineMessage message) diff --git a/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs b/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs index e47342c81c311..98301aae12397 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; namespace Azure.Core.Testing @@ -60,7 +61,7 @@ public override async Task ProcessAsync(HttpPipelineMessage message) message.Response = GetResponse(_session.Lookup(message.Request, _matcher)); } - public override Request CreateRequest() + public override HttpRequest CreateRequest() { lock (_random) { diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs index 8d3b0ad7cf070..8a8438ee30f07 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using Azure.Core.Http; namespace Azure.Core.Testing { @@ -25,7 +26,7 @@ public RecordMatcher(RecordedTestSanitizer sanitizer) "User-Agent" }; - public virtual int FindMatch(Request request, IList entries, out string failureMessage) + public virtual int FindMatch(HttpRequest request, IList entries, out string failureMessage) { SortedDictionary headers = new SortedDictionary(StringComparer.OrdinalIgnoreCase); @@ -67,7 +68,7 @@ public virtual int FindMatch(Request request, IList entries, out st { failureMessage = $"{messagePrefix} (Best match: {entries[0].RequestMethod} {entries[0].RequestUri})"; } - + return -1; } diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs index bb9bff19a0a94..f667a720cdbce 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Text.Json; +using Azure.Core.Http; namespace Azure.Core.Testing { @@ -62,7 +63,7 @@ public void Record(RecordEntry entry) } } - public RecordEntry Lookup(Request request, RecordMatcher matcher) + public RecordEntry Lookup(HttpRequest request, RecordMatcher matcher) { lock (Entries) { diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs index 8d6df6dc8cccc..8dc324cdbe79e 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; namespace Azure.Core.Testing @@ -60,9 +61,9 @@ private void Record(HttpPipelineMessage message) } } - public override Request CreateRequest() + public override HttpRequest CreateRequest() { - Request request = _innerTransport.CreateRequest(); + HttpRequest request = _innerTransport.CreateRequest(); lock (_random) { @@ -73,7 +74,7 @@ public override Request CreateRequest() return request; } - public RecordEntry CreateEntry(Request request, Response response) + public RecordEntry CreateEntry(HttpRequest request, Response response) { var entry = new RecordEntry { diff --git a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs index 3089e9e2236a9..8ea0673074e77 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs @@ -4,6 +4,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; using Azure.Core.Pipeline; using NUnit.Framework; @@ -17,7 +18,7 @@ public SyncAsyncPolicyTestBase(bool isAsync) : base(isAsync) { } - protected Task SendRequestAsync(HttpPipeline pipeline, Request request, CancellationToken cancellationToken = default) + protected Task SendRequestAsync(HttpPipeline pipeline, HttpRequest request, CancellationToken cancellationToken = default) { return IsAsync ? pipeline.SendRequestAsync(request, cancellationToken) : Task.FromResult(pipeline.SendRequest(request, cancellationToken)); } @@ -26,7 +27,7 @@ protected async Task SendGetRequest(HttpPipelineTransport transport, H { await Task.Yield(); - using (Request request = transport.CreateRequest()) + using (HttpRequest request = transport.CreateRequest()) { request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); diff --git a/sdk/identity/Azure.Identity/src/AadIdentityClient.cs b/sdk/identity/Azure.Identity/src/AadIdentityClient.cs index b63de842d4bcd..98ee36fcf83f4 100644 --- a/sdk/identity/Azure.Identity/src/AadIdentityClient.cs +++ b/sdk/identity/Azure.Identity/src/AadIdentityClient.cs @@ -16,6 +16,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; namespace Azure.Identity { @@ -42,7 +43,7 @@ public AadIdentityClient(IdentityClientOptions options = null) public virtual async Task AuthenticateAsync(string tenantId, string clientId, string clientSecret, string[] scopes, CancellationToken cancellationToken = default) { - using (Request request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) + using (HttpRequest request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) { try { @@ -57,7 +58,7 @@ public virtual async Task AuthenticateAsync(string tenantId, string public virtual AccessToken Authenticate(string tenantId, string clientId, string clientSecret, string[] scopes, CancellationToken cancellationToken = default) { - using (Request request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) + using (HttpRequest request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) { try { @@ -72,7 +73,7 @@ public virtual AccessToken Authenticate(string tenantId, string clientId, string public virtual async Task AuthenticateAsync(string tenantId, string clientId, X509Certificate2 clientCertificate, string[] scopes, CancellationToken cancellationToken = default) { - using (Request request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) + using (HttpRequest request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) { try { @@ -87,7 +88,7 @@ public virtual async Task AuthenticateAsync(string tenantId, string public virtual AccessToken Authenticate(string tenantId, string clientId, X509Certificate2 clientCertificate, string[] scopes, CancellationToken cancellationToken = default) { - using (Request request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) + using (HttpRequest request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) { try { @@ -99,7 +100,7 @@ public virtual AccessToken Authenticate(string tenantId, string clientId, X509Ce } } } - private async Task SendAuthRequestAsync(Request request, CancellationToken cancellationToken) + private async Task SendAuthRequestAsync(HttpRequest request, CancellationToken cancellationToken) { var response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -113,7 +114,7 @@ private async Task SendAuthRequestAsync(Request request, Cancellati throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } - private AccessToken SendAuthRequest(Request request, CancellationToken cancellationToken) + private AccessToken SendAuthRequest(HttpRequest request, CancellationToken cancellationToken) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -127,9 +128,9 @@ private AccessToken SendAuthRequest(Request request, CancellationToken cancellat throw response.CreateRequestFailedException(); } - private Request CreateClientSecretAuthRequest(string tenantId, string clientId, string clientSecret, string[] scopes) + private HttpRequest CreateClientSecretAuthRequest(string tenantId, string clientId, string clientSecret, string[] scopes) { - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Post; @@ -150,9 +151,9 @@ private Request CreateClientSecretAuthRequest(string tenantId, string clientId, return request; } - private Request CreateClientCertificateAuthRequest(string tenantId, string clientId, X509Certificate2 clientCertficate, string[] scopes) + private HttpRequest CreateClientCertificateAuthRequest(string tenantId, string clientId, X509Certificate2 clientCertficate, string[] scopes) { - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Post; diff --git a/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs b/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs index 4b14a1e61af72..ca0021d8f670b 100644 --- a/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs +++ b/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs @@ -9,6 +9,7 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; namespace Azure.Identity { @@ -97,7 +98,7 @@ public virtual AccessToken Authenticate(string[] scopes, string clientId = null, private async Task SendAuthRequestAsync(MsiType msiType, string[] scopes, string clientId, CancellationToken cancellationToken) { - using (Request request = CreateAuthRequest(msiType, scopes, clientId)) + using (HttpRequest request = CreateAuthRequest(msiType, scopes, clientId)) { var response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -114,7 +115,7 @@ private async Task SendAuthRequestAsync(MsiType msiType, string[] s private AccessToken SendAuthRequest(MsiType msiType, string[] scopes, string clientId, CancellationToken cancellationToken) { - using (Request request = CreateAuthRequest(msiType, scopes, clientId)) + using (HttpRequest request = CreateAuthRequest(msiType, scopes, clientId)) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -129,7 +130,7 @@ private AccessToken SendAuthRequest(MsiType msiType, string[] scopes, string cli } } - private Request CreateAuthRequest(MsiType msiType, string[] scopes, string clientId) + private HttpRequest CreateAuthRequest(MsiType msiType, string[] scopes, string clientId) { switch (msiType) { @@ -274,7 +275,7 @@ private bool ImdsAvailable(CancellationToken cancellationToken) // send a request without the Metadata header. This will result in a failed request, // but we're just interested in if we get a response before the timeout of 500ms // if we don't get a response we assume the imds endpoint is not available - using (Request request = _pipeline.CreateRequest()) + using (HttpRequest request = _pipeline.CreateRequest()) { request.Method = RequestMethod.Get; @@ -306,7 +307,7 @@ private async Task ImdsAvailableAsync(CancellationToken cancellationToken) // send a request without the Metadata header. This will result in a failed request, // but we're just interested in if we get a response before the timeout of 500ms // if we don't get a response we assume the imds endpoint is not available - using (Request request = _pipeline.CreateRequest()) + using (HttpRequest request = _pipeline.CreateRequest()) { request.Method = RequestMethod.Get; @@ -333,12 +334,12 @@ private async Task ImdsAvailableAsync(CancellationToken cancellationToken) } } - private Request CreateImdsAuthRequest(string[] scopes, string clientId) + private HttpRequest CreateImdsAuthRequest(string[] scopes, string clientId) { // covert the scopes to a resource string string resource = ScopeUtilities.ScopesToResource(scopes); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; @@ -358,12 +359,12 @@ private Request CreateImdsAuthRequest(string[] scopes, string clientId) return request; } - private Request CreateAppServiceAuthRequest(string[] scopes, string clientId) + private HttpRequest CreateAppServiceAuthRequest(string[] scopes, string clientId) { // covert the scopes to a resource string string resource = ScopeUtilities.ScopesToResource(scopes); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; @@ -383,12 +384,12 @@ private Request CreateAppServiceAuthRequest(string[] scopes, string clientId) return request; } - private Request CreateCloudShellAuthRequest(string[] scopes, string clientId) + private HttpRequest CreateCloudShellAuthRequest(string[] scopes, string clientId) { // covert the scopes to a resource string string resource = ScopeUtilities.ScopesToResource(scopes); - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Method = RequestMethod.Post; @@ -459,7 +460,7 @@ private static AccessToken Deserialize(JsonElement json) { // the seconds from epoch may be returned as a Json number or a Json string which is a number // depending on the environment. If neither of these are the case we throw an AuthException. - if (!(expiresOnProp.Type == JsonValueType.Number && expiresOnProp.TryGetInt64(out long expiresOnSec)) && + if (!(expiresOnProp.Type == JsonValueType.Number && expiresOnProp.TryGetInt64(out long expiresOnSec)) && !(expiresOnProp.Type == JsonValueType.String && long.TryParse(expiresOnProp.GetString(), out expiresOnSec))) { throw new AuthenticationFailedException(AuthenticationResponseInvalidFormatError); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs index 7062e7d8b65b7..a8cfd4205af4b 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs @@ -3,6 +3,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure.Core.Http; namespace Azure.Security.KeyVault.Keys { @@ -16,7 +17,7 @@ private async Task> SendRequestAsync(Reques where TContent : Model where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -29,7 +30,7 @@ private async Task> SendRequestAsync(Reques private async Task> SendRequestAsync(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -39,13 +40,13 @@ private async Task> SendRequestAsync(RequestMethod me private async Task SendRequestAsync(RequestMethod method, CancellationToken cancellationToken, params string[] path) { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { return await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); } } - private async Task SendRequestAsync(Request request, CancellationToken cancellationToken) + private async Task SendRequestAsync(HttpRequest request, CancellationToken cancellationToken) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -64,7 +65,7 @@ private Response SendRequest(RequestMethod method, T where TContent : Model where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -77,7 +78,7 @@ private Response SendRequest(RequestMethod method, T private Response SendRequest(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { Response response = SendRequest(request, cancellationToken); @@ -87,13 +88,13 @@ private Response SendRequest(RequestMethod method, Func> GetPageAsync(Uri firstPageUri, string nex firstPageUri = new Uri(nextLink); } - using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -191,7 +192,7 @@ private PageResponse GetPage(Uri firstPageUri, string nextLink, Func it firstPageUri = new Uri(nextLink); } - using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = SendRequest(request, cancellationToken); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs index 9501b46c4bce6..493d90d0cecfc 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Http; using Azure.Core.Pipeline; using Azure.Core.Pipeline.Policies; @@ -513,7 +514,7 @@ private async Task> SendRequestAsync(Reques where TContent : Model where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -527,7 +528,7 @@ private Response SendRequest(RequestMethod method, T where TContent : Model where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -540,7 +541,7 @@ private Response SendRequest(RequestMethod method, T private async Task> SendRequestAsync(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -551,7 +552,7 @@ private async Task> SendRequestAsync(RequestMethod me private Response SendRequest(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { Response response = SendRequest(request, cancellationToken); @@ -560,7 +561,7 @@ private Response SendRequest(RequestMethod method, Func SendRequestAsync(RequestMethod method, CancellationToken cancellationToken, params string[] path) { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { return await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); } @@ -568,13 +569,13 @@ private async Task SendRequestAsync(RequestMethod method, Cancellation private Response SendRequest(RequestMethod method, CancellationToken cancellationToken, params string[] path) { - using (Request request = CreateRequest(method, path)) + using (HttpRequest request = CreateRequest(method, path)) { return SendRequest(request, cancellationToken); } } - private async Task SendRequestAsync(Request request, CancellationToken cancellationToken) + private async Task SendRequestAsync(HttpRequest request, CancellationToken cancellationToken) { var response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -588,7 +589,7 @@ private async Task SendRequestAsync(Request request, CancellationToken throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } - private Response SendRequest(Request request, CancellationToken cancellationToken) + private Response SendRequest(HttpRequest request, CancellationToken cancellationToken) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -612,7 +613,7 @@ private async Task> GetPageAsync(Uri firstPageUri, string nex firstPageUri = new Uri(nextLink); } - using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -634,7 +635,7 @@ private PageResponse GetPage(Uri firstPageUri, string nextLink, Func it firstPageUri = new Uri(nextLink); } - using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = SendRequest(request, cancellationToken); @@ -647,9 +648,9 @@ private PageResponse GetPage(Uri firstPageUri, string nextLink, Func it } } - private Request CreateRequest(RequestMethod method, Uri uri) + private HttpRequest CreateRequest(RequestMethod method, Uri uri) { - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Headers.Add(HttpHeader.Common.JsonContentType); request.Headers.Add(HttpHeader.Names.Accept, "application/json"); @@ -659,9 +660,9 @@ private Request CreateRequest(RequestMethod method, Uri uri) return request; } - private Request CreateRequest(RequestMethod method, params string[] path) + private HttpRequest CreateRequest(RequestMethod method, params string[] path) { - Request request = _pipeline.CreateRequest(); + HttpRequest request = _pipeline.CreateRequest(); request.Headers.Add(HttpHeader.Common.JsonContentType); request.Headers.Add(HttpHeader.Names.Accept, "application/json"); diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index 6c1503f12a5c4..0808261c4516c 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. @@ -38,7 +38,7 @@ public static partial class Service bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, blobServiceProperties, @@ -64,7 +64,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.SetPropertiesAsync Request. - internal static Azure.Request SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.BlobServiceProperties blobServiceProperties, @@ -82,7 +82,7 @@ internal static Azure.Request SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -92,14 +92,14 @@ internal static Azure.Request SetPropertiesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } // Create the body System.Xml.Linq.XElement _body = Azure.Storage.Blobs.Models.BlobServiceProperties.ToXml(blobServiceProperties, "StorageServiceProperties", ""); string _text = _body.ToString(); _request.Headers.SetValue("Content-Type", "application/xml"); - _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); _request.Content = Azure.Core.Pipeline.HttpPipelineRequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); return _request; @@ -150,7 +150,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -174,7 +174,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -187,7 +187,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -197,7 +197,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } return _request; @@ -258,7 +258,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetStatisticsAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetStatisticsAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -282,7 +282,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetStatisticsAsync Request. - internal static Azure.Request GetStatisticsAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -295,7 +295,7 @@ internal static Azure.Request GetStatisticsAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -305,7 +305,7 @@ internal static Azure.Request GetStatisticsAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } return _request; @@ -374,7 +374,7 @@ internal static Azure.Request GetStatisticsAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListContainersSegmentAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListContainersSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -406,7 +406,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.ListContainersSegmentAsync Request. - internal static Azure.Request ListContainersSegmentAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListContainersSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -423,7 +423,7 @@ internal static Azure.Request ListContainersSegmentAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -436,7 +436,7 @@ internal static Azure.Request ListContainersSegmentAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } return _request; @@ -499,7 +499,7 @@ internal static Azure.Request ListContainersSegmentAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetUserDelegationKeyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetUserDelegationKeyAsync_CreateRequest( pipeline, resourceUri, keyInfo, @@ -525,7 +525,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetUserDelegationKeyAsync Request. - internal static Azure.Request GetUserDelegationKeyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetUserDelegationKeyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.KeyInfo keyInfo, @@ -543,7 +543,7 @@ internal static Azure.Request GetUserDelegationKeyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Post; @@ -553,14 +553,14 @@ internal static Azure.Request GetUserDelegationKeyAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } // Create the body System.Xml.Linq.XElement _body = Azure.Storage.Blobs.Models.KeyInfo.ToXml(keyInfo, "KeyInfo", ""); string _text = _body.ToString(); _request.Headers.SetValue("Content-Type", "application/xml"); - _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); _request.Content = Azure.Core.Pipeline.HttpPipelineRequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); return _request; @@ -605,7 +605,7 @@ internal static Azure.Request GetUserDelegationKeyAsync_CreateRequest( #region Service.GetAccountInfoAsync /// - /// Returns the sku name and account kind + /// Returns the sku name and account kind /// /// The URL of the service account, container, or blob that is the targe of the desired operation. /// Whether to invoke the operation asynchronously. The default value is true. @@ -617,7 +617,7 @@ internal static Azure.Request GetUserDelegationKeyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetAccountInfoAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetAccountInfoAsync_CreateRequest( pipeline, resourceUri)) { @@ -637,7 +637,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// /// The URL of the service account, container, or blob that is the targe of the desired operation. /// The Service.GetAccountInfoAsync Request. - internal static Azure.Request GetAccountInfoAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetAccountInfoAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri) { @@ -648,7 +648,7 @@ internal static Azure.Request GetAccountInfoAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -657,7 +657,7 @@ internal static Azure.Request GetAccountInfoAsync_CreateRequest( _request.UriBuilder.AppendQuery("comp", "properties"); // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); return _request; } @@ -739,7 +739,7 @@ public static partial class Container bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -767,7 +767,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specifies whether data in the container may be accessed publicly and the level of access /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -782,7 +782,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -791,11 +791,11 @@ internal static Azure.Request CreateAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); - if (metadata != null) { + _request.Headers.SetValue("x-ms-version", "2018-11-09"); + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (access != null) { _request.Headers.SetValue("x-ms-blob-public-access", Azure.Storage.Blobs.BlobRestClient.Serialization.ToString(access.Value)); } @@ -871,7 +871,7 @@ internal static Azure.Request CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -897,7 +897,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -911,7 +911,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -920,7 +920,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -1042,7 +1042,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1072,7 +1072,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1088,7 +1088,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -1097,7 +1097,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -1157,7 +1157,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1187,7 +1187,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.SetMetadataAsync Request. - internal static Azure.Request SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1203,7 +1203,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1213,12 +1213,12 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } - if (metadata != null) { + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -1294,7 +1294,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1320,7 +1320,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.GetAccessPolicyAsync Request. - internal static Azure.Request GetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1334,7 +1334,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1344,7 +1344,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -1436,7 +1436,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, permissions, @@ -1470,7 +1470,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.SetAccessPolicyAsync Request. - internal static Azure.Request SetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Collections.Generic.IEnumerable permissions = default, @@ -1488,7 +1488,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1498,7 +1498,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (access != null) { _request.Headers.SetValue("x-ms-blob-public-access", Azure.Storage.Blobs.BlobRestClient.Serialization.ToString(access.Value)); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -1516,7 +1516,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( } string _text = _body.ToString(); _request.Headers.SetValue("Content-Type", "application/xml"); - _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); _request.Content = Azure.Core.Pipeline.HttpPipelineRequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); return _request; @@ -1595,7 +1595,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = AcquireLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = AcquireLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1627,7 +1627,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.AcquireLeaseAsync Request. - internal static Azure.Request AcquireLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1644,7 +1644,7 @@ internal static Azure.Request AcquireLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1654,8 +1654,8 @@ internal static Azure.Request AcquireLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "acquire"); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "acquire"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (duration != null) { _request.Headers.SetValue("x-ms-lease-duration", duration.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } if (proposedLeaseId != null) { _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -1740,7 +1740,7 @@ internal static Azure.Request AcquireLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ReleaseLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ReleaseLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -1770,7 +1770,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ReleaseLeaseAsync Request. - internal static Azure.Request ReleaseLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -1790,7 +1790,7 @@ internal static Azure.Request ReleaseLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1800,9 +1800,9 @@ internal static Azure.Request ReleaseLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "release"); - _request.Headers.SetValue("x-ms-lease-id", leaseId); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "release"); + _request.Headers.SetValue("x-ms-lease-id", leaseId); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -1881,7 +1881,7 @@ internal static Azure.Request ReleaseLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = RenewLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = RenewLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -1911,7 +1911,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.RenewLeaseAsync Request. - internal static Azure.Request RenewLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -1931,7 +1931,7 @@ internal static Azure.Request RenewLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1941,9 +1941,9 @@ internal static Azure.Request RenewLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "renew"); - _request.Headers.SetValue("x-ms-lease-id", leaseId); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "renew"); + _request.Headers.SetValue("x-ms-lease-id", leaseId); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -2026,7 +2026,7 @@ internal static Azure.Request RenewLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = BreakLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = BreakLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -2056,7 +2056,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.BreakLeaseAsync Request. - internal static Azure.Request BreakLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -2072,7 +2072,7 @@ internal static Azure.Request BreakLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2082,8 +2082,8 @@ internal static Azure.Request BreakLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "break"); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "break"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (breakPeriod != null) { _request.Headers.SetValue("x-ms-lease-break-period", breakPeriod.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -2181,7 +2181,7 @@ internal static Azure.Request BreakLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ChangeLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ChangeLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -2213,7 +2213,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ChangeLeaseAsync Request. - internal static Azure.Request ChangeLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -2238,7 +2238,7 @@ internal static Azure.Request ChangeLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2248,10 +2248,10 @@ internal static Azure.Request ChangeLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "change"); - _request.Headers.SetValue("x-ms-lease-id", leaseId); - _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "change"); + _request.Headers.SetValue("x-ms-lease-id", leaseId); + _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -2336,7 +2336,7 @@ internal static Azure.Request ChangeLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListBlobsFlatSegmentAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListBlobsFlatSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -2368,7 +2368,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ListBlobsFlatSegmentAsync Request. - internal static Azure.Request ListBlobsFlatSegmentAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListBlobsFlatSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -2385,7 +2385,7 @@ internal static Azure.Request ListBlobsFlatSegmentAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2399,7 +2399,7 @@ internal static Azure.Request ListBlobsFlatSegmentAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } return _request; @@ -2470,7 +2470,7 @@ internal static Azure.Request ListBlobsFlatSegmentAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListBlobsHierarchySegmentAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListBlobsHierarchySegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -2504,7 +2504,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ListBlobsHierarchySegmentAsync Request. - internal static Azure.Request ListBlobsHierarchySegmentAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListBlobsHierarchySegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -2522,7 +2522,7 @@ internal static Azure.Request ListBlobsHierarchySegmentAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2537,7 +2537,7 @@ internal static Azure.Request ListBlobsHierarchySegmentAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } return _request; @@ -2622,7 +2622,7 @@ public static partial class Blob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DownloadAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DownloadAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -2662,7 +2662,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.DownloadAsync Request. - internal static Azure.Request DownloadAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -2683,7 +2683,7 @@ internal static Azure.Request DownloadAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2692,12 +2692,12 @@ internal static Azure.Request DownloadAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (range != null) { _request.Headers.SetValue("x-ms-range", range); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } - if (rangeGetContentHash != null) { + if (rangeGetContentHash != null) { #pragma warning disable CA1308 // Normalize strings to uppercase - _request.Headers.SetValue("x-ms-range-get-content-md5", rangeGetContentHash.Value.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant()); + _request.Headers.SetValue("x-ms-range-get-content-md5", rangeGetContentHash.Value.ToString(System.Globalization.CultureInfo.InvariantCulture).ToLowerInvariant()); #pragma warning restore CA1308 // Normalize strings to uppercase } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -3050,7 +3050,7 @@ internal static Azure.Request DownloadAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -3086,7 +3086,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -3105,7 +3105,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Head; @@ -3114,7 +3114,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -3344,7 +3344,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -3382,7 +3382,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -3402,7 +3402,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -3411,7 +3411,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (deleteSnapshots != null) { _request.Headers.SetValue("x-ms-delete-snapshots", Azure.Storage.Blobs.BlobRestClient.Serialization.ToString(deleteSnapshots.Value)); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -3468,7 +3468,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UndeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UndeleteAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3492,7 +3492,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.UndeleteAsync Request. - internal static Azure.Request UndeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UndeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3505,7 +3505,7 @@ internal static Azure.Request UndeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3514,7 +3514,7 @@ internal static Azure.Request UndeleteAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } return _request; @@ -3587,7 +3587,7 @@ internal static Azure.Response UndeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetHttpHeadersAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetHttpHeadersAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3633,7 +3633,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Optional. Sets the blob's Content-Disposition header. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.SetHttpHeadersAsync Request. - internal static Azure.Request SetHttpHeadersAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetHttpHeadersAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3657,7 +3657,7 @@ internal static Azure.Request SetHttpHeadersAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3666,20 +3666,20 @@ internal static Azure.Request SetHttpHeadersAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (blobCacheControl != null) { _request.Headers.SetValue("x-ms-blob-cache-control", blobCacheControl); } if (blobContentType != null) { _request.Headers.SetValue("x-ms-blob-content-type", blobContentType); } if (blobContentHash != null) { _request.Headers.SetValue("x-ms-blob-content-md5", System.Convert.ToBase64String(blobContentHash)); } - if (blobContentEncoding != null) { + if (blobContentEncoding != null) { foreach (string _item in blobContentEncoding) { - _request.Headers.SetValue("x-ms-blob-content-encoding", _item); + _request.Headers.SetValue("x-ms-blob-content-encoding", _item); } } - if (blobContentLanguage != null) { + if (blobContentLanguage != null) { foreach (string _item in blobContentLanguage) { - _request.Headers.SetValue("x-ms-blob-content-language", _item); + _request.Headers.SetValue("x-ms-blob-content-language", _item); } } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -3786,7 +3786,7 @@ internal static Azure.Request SetHttpHeadersAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3822,7 +3822,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.SetMetadataAsync Request. - internal static Azure.Request SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3841,7 +3841,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3850,11 +3850,11 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); - if (metadata != null) { + _request.Headers.SetValue("x-ms-version", "2018-11-09"); + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -3960,7 +3960,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = AcquireLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = AcquireLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3996,7 +3996,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.AcquireLeaseAsync Request. - internal static Azure.Request AcquireLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -4015,7 +4015,7 @@ internal static Azure.Request AcquireLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4024,8 +4024,8 @@ internal static Azure.Request AcquireLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "acquire"); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "acquire"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (duration != null) { _request.Headers.SetValue("x-ms-lease-duration", duration.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } if (proposedLeaseId != null) { _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -4116,7 +4116,7 @@ internal static Azure.Request AcquireLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ReleaseLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ReleaseLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -4150,7 +4150,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.ReleaseLeaseAsync Request. - internal static Azure.Request ReleaseLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -4172,7 +4172,7 @@ internal static Azure.Request ReleaseLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4181,9 +4181,9 @@ internal static Azure.Request ReleaseLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "release"); - _request.Headers.SetValue("x-ms-lease-id", leaseId); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "release"); + _request.Headers.SetValue("x-ms-lease-id", leaseId); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } @@ -4268,7 +4268,7 @@ internal static Azure.Request ReleaseLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = RenewLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = RenewLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -4302,7 +4302,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.RenewLeaseAsync Request. - internal static Azure.Request RenewLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -4324,7 +4324,7 @@ internal static Azure.Request RenewLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4333,9 +4333,9 @@ internal static Azure.Request RenewLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "renew"); - _request.Headers.SetValue("x-ms-lease-id", leaseId); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "renew"); + _request.Headers.SetValue("x-ms-lease-id", leaseId); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } @@ -4426,7 +4426,7 @@ internal static Azure.Request RenewLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ChangeLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ChangeLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -4462,7 +4462,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.ChangeLeaseAsync Request. - internal static Azure.Request ChangeLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -4489,7 +4489,7 @@ internal static Azure.Request ChangeLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4498,10 +4498,10 @@ internal static Azure.Request ChangeLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "change"); - _request.Headers.SetValue("x-ms-lease-id", leaseId); - _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "change"); + _request.Headers.SetValue("x-ms-lease-id", leaseId); + _request.Headers.SetValue("x-ms-proposed-lease-id", proposedLeaseId); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } @@ -4590,7 +4590,7 @@ internal static Azure.Request ChangeLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = BreakLeaseAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = BreakLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -4624,7 +4624,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.BreakLeaseAsync Request. - internal static Azure.Request BreakLeaseAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -4642,7 +4642,7 @@ internal static Azure.Request BreakLeaseAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4651,8 +4651,8 @@ internal static Azure.Request BreakLeaseAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-lease-action", "break"); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-lease-action", "break"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (breakPeriod != null) { _request.Headers.SetValue("x-ms-lease-break-period", breakPeriod.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -4756,7 +4756,7 @@ internal static Azure.Request BreakLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateSnapshotAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateSnapshotAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -4792,7 +4792,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.CreateSnapshotAsync Request. - internal static Azure.Request CreateSnapshotAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -4811,7 +4811,7 @@ internal static Azure.Request CreateSnapshotAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4820,11 +4820,11 @@ internal static Azure.Request CreateSnapshotAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); - if (metadata != null) { + _request.Headers.SetValue("x-ms-version", "2018-11-09"); + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -4928,7 +4928,7 @@ internal static Azure.Request CreateSnapshotAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = StartCopyFromUriAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = StartCopyFromUriAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -4974,7 +4974,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.StartCopyFromUriAsync Request. - internal static Azure.Request StartCopyFromUriAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest StartCopyFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -5002,7 +5002,7 @@ internal static Azure.Request StartCopyFromUriAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5010,12 +5010,12 @@ internal static Azure.Request StartCopyFromUriAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-copy-source", copySource.ToString()); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); - if (metadata != null) { + _request.Headers.SetValue("x-ms-copy-source", copySource.ToString()); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (sourceIfModifiedSince != null) { _request.Headers.SetValue("x-ms-source-if-modified-since", sourceIfModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -5127,7 +5127,7 @@ internal static Azure.Request StartCopyFromUriAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CopyFromUriAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CopyFromUriAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -5173,7 +5173,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.CopyFromUriAsync Request. - internal static Azure.Request CopyFromUriAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CopyFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -5201,7 +5201,7 @@ internal static Azure.Request CopyFromUriAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5209,13 +5209,13 @@ internal static Azure.Request CopyFromUriAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-requires-sync", "true"); - _request.Headers.SetValue("x-ms-copy-source", copySource.ToString()); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); - if (metadata != null) { + _request.Headers.SetValue("x-ms-requires-sync", "true"); + _request.Headers.SetValue("x-ms-copy-source", copySource.ToString()); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (sourceIfModifiedSince != null) { _request.Headers.SetValue("x-ms-source-if-modified-since", sourceIfModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -5309,7 +5309,7 @@ internal static Azure.Request CopyFromUriAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = AbortCopyFromUriAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = AbortCopyFromUriAsync_CreateRequest( pipeline, resourceUri, copyId, @@ -5337,7 +5337,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.AbortCopyFromUriAsync Request. - internal static Azure.Request AbortCopyFromUriAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest AbortCopyFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string copyId, @@ -5356,7 +5356,7 @@ internal static Azure.Request AbortCopyFromUriAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5366,8 +5366,8 @@ internal static Azure.Request AbortCopyFromUriAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-copy-action", "abort"); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-copy-action", "abort"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -5423,7 +5423,7 @@ internal static Azure.Response AbortCopyFromUriAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetTierAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetTierAsync_CreateRequest( pipeline, resourceUri, tier, @@ -5451,7 +5451,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// The Blob.SetTierAsync Request. - internal static Azure.Request SetTierAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetTierAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.AccessTier tier, @@ -5470,7 +5470,7 @@ internal static Azure.Request SetTierAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5479,8 +5479,8 @@ internal static Azure.Request SetTierAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-access-tier", tier); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-access-tier", tier); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -5574,7 +5574,7 @@ public static partial class PageBlob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, contentLength, @@ -5628,7 +5628,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long contentLength, @@ -5656,7 +5656,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5664,29 +5664,29 @@ internal static Azure.Request CreateAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-blob-type", "PageBlob"); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-blob-content-length", blobContentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-blob-type", "PageBlob"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-blob-content-length", blobContentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (blobContentType != null) { _request.Headers.SetValue("x-ms-blob-content-type", blobContentType); } - if (blobContentEncoding != null) { + if (blobContentEncoding != null) { foreach (string _item in blobContentEncoding) { - _request.Headers.SetValue("x-ms-blob-content-encoding", _item); + _request.Headers.SetValue("x-ms-blob-content-encoding", _item); } } - if (blobContentLanguage != null) { + if (blobContentLanguage != null) { foreach (string _item in blobContentLanguage) { - _request.Headers.SetValue("x-ms-blob-content-language", _item); + _request.Headers.SetValue("x-ms-blob-content-language", _item); } } if (blobContentHash != null) { _request.Headers.SetValue("x-ms-blob-content-md5", System.Convert.ToBase64String(blobContentHash)); } if (blobCacheControl != null) { _request.Headers.SetValue("x-ms-blob-cache-control", blobCacheControl); } - if (metadata != null) { + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -5798,7 +5798,7 @@ internal static Azure.Request CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UploadPagesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UploadPagesAsync_CreateRequest( pipeline, resourceUri, body, @@ -5846,7 +5846,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.UploadPagesAsync Request. - internal static Azure.Request UploadPagesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UploadPagesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.IO.Stream body, @@ -5875,7 +5875,7 @@ internal static Azure.Request UploadPagesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5884,9 +5884,9 @@ internal static Azure.Request UploadPagesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-page-write", "update"); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-page-write", "update"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (transactionalContentHash != null) { _request.Headers.SetValue("Content-MD5", System.Convert.ToBase64String(transactionalContentHash)); } if (range != null) { _request.Headers.SetValue("x-ms-range", range); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -5998,7 +5998,7 @@ internal static Azure.Request UploadPagesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ClearPagesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ClearPagesAsync_CreateRequest( pipeline, resourceUri, contentLength, @@ -6042,7 +6042,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.ClearPagesAsync Request. - internal static Azure.Request ClearPagesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ClearPagesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long contentLength, @@ -6065,7 +6065,7 @@ internal static Azure.Request ClearPagesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -6074,9 +6074,9 @@ internal static Azure.Request ClearPagesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-page-write", "clear"); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-page-write", "clear"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (range != null) { _request.Headers.SetValue("x-ms-range", range); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifSequenceNumberLessThanOrEqualTo != null) { _request.Headers.SetValue("x-ms-if-sequence-number-le", ifSequenceNumberLessThanOrEqualTo.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } @@ -6198,7 +6198,7 @@ internal static Azure.Request ClearPagesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UploadPagesFromUriAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UploadPagesFromUriAsync_CreateRequest( pipeline, resourceUri, sourceUri, @@ -6256,7 +6256,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.UploadPagesFromUriAsync Request. - internal static Azure.Request UploadPagesFromUriAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UploadPagesFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri sourceUri, @@ -6298,7 +6298,7 @@ internal static Azure.Request UploadPagesFromUriAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -6307,12 +6307,12 @@ internal static Azure.Request UploadPagesFromUriAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-page-write", "update"); - _request.Headers.SetValue("x-ms-copy-source", sourceUri.ToString()); - _request.Headers.SetValue("x-ms-source-range", sourceRange); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-range", range); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-page-write", "update"); + _request.Headers.SetValue("x-ms-copy-source", sourceUri.ToString()); + _request.Headers.SetValue("x-ms-source-range", sourceRange); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-range", range); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (sourceContentHash != null) { _request.Headers.SetValue("x-ms-source-content-md5", System.Convert.ToBase64String(sourceContentHash)); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifSequenceNumberLessThanOrEqualTo != null) { _request.Headers.SetValue("x-ms-if-sequence-number-le", ifSequenceNumberLessThanOrEqualTo.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } @@ -6432,7 +6432,7 @@ internal static Azure.Request UploadPagesFromUriAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPageRangesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPageRangesAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -6470,7 +6470,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.GetPageRangesAsync Request. - internal static Azure.Request GetPageRangesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPageRangesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -6490,7 +6490,7 @@ internal static Azure.Request GetPageRangesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -6500,7 +6500,7 @@ internal static Azure.Request GetPageRangesAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (range != null) { _request.Headers.SetValue("x-ms-range", range); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -6613,7 +6613,7 @@ internal static Azure.Request GetPageRangesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPageRangesDiffAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPageRangesDiffAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -6653,7 +6653,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.GetPageRangesDiffAsync Request. - internal static Azure.Request GetPageRangesDiffAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPageRangesDiffAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -6674,7 +6674,7 @@ internal static Azure.Request GetPageRangesDiffAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -6685,7 +6685,7 @@ internal static Azure.Request GetPageRangesDiffAsync_CreateRequest( if (prevsnapshot != null) { _request.UriBuilder.AppendQuery("prevsnapshot", System.Uri.EscapeDataString(prevsnapshot)); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (range != null) { _request.Headers.SetValue("x-ms-range", range); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -6794,7 +6794,7 @@ internal static Azure.Request GetPageRangesDiffAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ResizeAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ResizeAsync_CreateRequest( pipeline, resourceUri, blobContentLength, @@ -6830,7 +6830,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.ResizeAsync Request. - internal static Azure.Request ResizeAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ResizeAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long blobContentLength, @@ -6849,7 +6849,7 @@ internal static Azure.Request ResizeAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -6858,8 +6858,8 @@ internal static Azure.Request ResizeAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-blob-content-length", blobContentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-blob-content-length", blobContentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -6953,7 +6953,7 @@ internal static Azure.Request ResizeAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UpdateSequenceNumberAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UpdateSequenceNumberAsync_CreateRequest( pipeline, resourceUri, sequenceNumberAction, @@ -6991,7 +6991,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.UpdateSequenceNumberAsync Request. - internal static Azure.Request UpdateSequenceNumberAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UpdateSequenceNumberAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.SequenceNumberAction sequenceNumberAction, @@ -7011,7 +7011,7 @@ internal static Azure.Request UpdateSequenceNumberAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7020,8 +7020,8 @@ internal static Azure.Request UpdateSequenceNumberAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-sequence-number-action", Azure.Storage.Blobs.BlobRestClient.Serialization.ToString(sequenceNumberAction)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-sequence-number-action", Azure.Storage.Blobs.BlobRestClient.Serialization.ToString(sequenceNumberAction)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } @@ -7112,7 +7112,7 @@ internal static Azure.Request UpdateSequenceNumberAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CopyIncrementalAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CopyIncrementalAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -7146,7 +7146,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.CopyIncrementalAsync Request. - internal static Azure.Request CopyIncrementalAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CopyIncrementalAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -7168,7 +7168,7 @@ internal static Azure.Request CopyIncrementalAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7177,8 +7177,8 @@ internal static Azure.Request CopyIncrementalAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-copy-source", copySource.ToString()); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-copy-source", copySource.ToString()); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Value.ToString("R", System.Globalization.CultureInfo.InvariantCulture)); } if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); } @@ -7295,7 +7295,7 @@ public static partial class AppendBlob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, contentLength, @@ -7345,7 +7345,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The AppendBlob.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long contentLength, @@ -7371,7 +7371,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7379,28 +7379,28 @@ internal static Azure.Request CreateAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-blob-type", "AppendBlob"); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-blob-type", "AppendBlob"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (blobContentType != null) { _request.Headers.SetValue("x-ms-blob-content-type", blobContentType); } - if (blobContentEncoding != null) { + if (blobContentEncoding != null) { foreach (string _item in blobContentEncoding) { - _request.Headers.SetValue("x-ms-blob-content-encoding", _item); + _request.Headers.SetValue("x-ms-blob-content-encoding", _item); } } - if (blobContentLanguage != null) { + if (blobContentLanguage != null) { foreach (string _item in blobContentLanguage) { - _request.Headers.SetValue("x-ms-blob-content-language", _item); + _request.Headers.SetValue("x-ms-blob-content-language", _item); } } if (blobContentHash != null) { _request.Headers.SetValue("x-ms-blob-content-md5", System.Convert.ToBase64String(blobContentHash)); } if (blobCacheControl != null) { _request.Headers.SetValue("x-ms-blob-cache-control", blobCacheControl); } - if (metadata != null) { + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -7507,7 +7507,7 @@ internal static Azure.Request CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = AppendBlockAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = AppendBlockAsync_CreateRequest( pipeline, resourceUri, body, @@ -7551,7 +7551,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The AppendBlob.AppendBlockAsync Request. - internal static Azure.Request AppendBlockAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest AppendBlockAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.IO.Stream body, @@ -7578,7 +7578,7 @@ internal static Azure.Request AppendBlockAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7587,8 +7587,8 @@ internal static Azure.Request AppendBlockAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (transactionalContentHash != null) { _request.Headers.SetValue("Content-MD5", System.Convert.ToBase64String(transactionalContentHash)); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (maxSize != null) { _request.Headers.SetValue("x-ms-blob-condition-maxsize", maxSize.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } @@ -7716,7 +7716,7 @@ internal static Azure.Request AppendBlockAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = AppendBlockFromUriAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = AppendBlockFromUriAsync_CreateRequest( pipeline, resourceUri, sourceUri, @@ -7770,7 +7770,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The AppendBlob.AppendBlockFromUriAsync Request. - internal static Azure.Request AppendBlockFromUriAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest AppendBlockFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri sourceUri, @@ -7802,7 +7802,7 @@ internal static Azure.Request AppendBlockFromUriAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7811,9 +7811,9 @@ internal static Azure.Request AppendBlockFromUriAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-copy-source", sourceUri.ToString()); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-copy-source", sourceUri.ToString()); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (sourceRange != null) { _request.Headers.SetValue("x-ms-source-range", sourceRange); } if (sourceContentHash != null) { _request.Headers.SetValue("x-ms-source-content-md5", System.Convert.ToBase64String(sourceContentHash)); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -7963,7 +7963,7 @@ public static partial class BlockBlob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UploadAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UploadAsync_CreateRequest( pipeline, resourceUri, body, @@ -8015,7 +8015,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.UploadAsync Request. - internal static Azure.Request UploadAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UploadAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.IO.Stream body, @@ -8046,7 +8046,7 @@ internal static Azure.Request UploadAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8054,28 +8054,28 @@ internal static Azure.Request UploadAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-blob-type", "BlockBlob"); - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-blob-type", "BlockBlob"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (blobContentType != null) { _request.Headers.SetValue("x-ms-blob-content-type", blobContentType); } - if (blobContentEncoding != null) { + if (blobContentEncoding != null) { foreach (string _item in blobContentEncoding) { - _request.Headers.SetValue("x-ms-blob-content-encoding", _item); + _request.Headers.SetValue("x-ms-blob-content-encoding", _item); } } - if (blobContentLanguage != null) { + if (blobContentLanguage != null) { foreach (string _item in blobContentLanguage) { - _request.Headers.SetValue("x-ms-blob-content-language", _item); + _request.Headers.SetValue("x-ms-blob-content-language", _item); } } if (blobContentHash != null) { _request.Headers.SetValue("x-ms-blob-content-md5", System.Convert.ToBase64String(blobContentHash)); } if (blobCacheControl != null) { _request.Headers.SetValue("x-ms-blob-cache-control", blobCacheControl); } - if (metadata != null) { + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -8175,7 +8175,7 @@ internal static Azure.Request UploadAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = StageBlockAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = StageBlockAsync_CreateRequest( pipeline, resourceUri, blockId, @@ -8209,7 +8209,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.StageBlockAsync Request. - internal static Azure.Request StageBlockAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest StageBlockAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string blockId, @@ -8235,7 +8235,7 @@ internal static Azure.Request StageBlockAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8245,8 +8245,8 @@ internal static Azure.Request StageBlockAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (transactionalContentHash != null) { _request.Headers.SetValue("Content-MD5", System.Convert.ToBase64String(transactionalContentHash)); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } @@ -8338,7 +8338,7 @@ internal static Azure.Request StageBlockAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = StageBlockFromUriAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = StageBlockFromUriAsync_CreateRequest( pipeline, resourceUri, blockId, @@ -8382,7 +8382,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.StageBlockFromUriAsync Request. - internal static Azure.Request StageBlockFromUriAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest StageBlockFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string blockId, @@ -8413,7 +8413,7 @@ internal static Azure.Request StageBlockFromUriAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8423,9 +8423,9 @@ internal static Azure.Request StageBlockFromUriAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); - _request.Headers.SetValue("x-ms-copy-source", sourceUri.ToString()); - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("x-ms-copy-source", sourceUri.ToString()); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (sourceRange != null) { _request.Headers.SetValue("x-ms-source-range", sourceRange); } if (sourceContentHash != null) { _request.Headers.SetValue("x-ms-source-content-md5", System.Convert.ToBase64String(sourceContentHash)); } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -8538,7 +8538,7 @@ internal static Azure.Request StageBlockFromUriAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CommitBlockListAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CommitBlockListAsync_CreateRequest( pipeline, resourceUri, blocks, @@ -8587,7 +8587,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.CommitBlockListAsync Request. - internal static Azure.Request CommitBlockListAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CommitBlockListAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.BlockLookupList blocks, @@ -8617,7 +8617,7 @@ internal static Azure.Request CommitBlockListAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8626,26 +8626,26 @@ internal static Azure.Request CommitBlockListAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (blobCacheControl != null) { _request.Headers.SetValue("x-ms-blob-cache-control", blobCacheControl); } if (blobContentType != null) { _request.Headers.SetValue("x-ms-blob-content-type", blobContentType); } - if (blobContentEncoding != null) { + if (blobContentEncoding != null) { foreach (string _item in blobContentEncoding) { - _request.Headers.SetValue("x-ms-blob-content-encoding", _item); + _request.Headers.SetValue("x-ms-blob-content-encoding", _item); } } - if (blobContentLanguage != null) { + if (blobContentLanguage != null) { foreach (string _item in blobContentLanguage) { - _request.Headers.SetValue("x-ms-blob-content-language", _item); + _request.Headers.SetValue("x-ms-blob-content-language", _item); } } if (blobContentHash != null) { _request.Headers.SetValue("x-ms-blob-content-md5", System.Convert.ToBase64String(blobContentHash)); } - if (metadata != null) { + if (metadata != null) { foreach (System.Collections.Generic.KeyValuePair _pair in metadata) { - _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); + _request.Headers.SetValue("x-ms-meta-" + _pair.Key, _pair.Value); } } if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } @@ -8660,7 +8660,7 @@ internal static Azure.Request CommitBlockListAsync_CreateRequest( System.Xml.Linq.XElement _body = Azure.Storage.Blobs.Models.BlockLookupList.ToXml(blocks, "BlockList", ""); string _text = _body.ToString(); _request.Headers.SetValue("Content-Type", "application/xml"); - _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); + _request.Headers.SetValue("Content-Length", _text.Length.ToString(System.Globalization.CultureInfo.InvariantCulture)); _request.Content = Azure.Core.Pipeline.HttpPipelineRequestContent.Create(System.Text.Encoding.UTF8.GetBytes(_text)); return _request; @@ -8745,7 +8745,7 @@ internal static Azure.Request CommitBlockListAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetBlockListAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetBlockListAsync_CreateRequest( pipeline, resourceUri, listType, @@ -8775,7 +8775,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.GetBlockListAsync Request. - internal static Azure.Request GetBlockListAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetBlockListAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.BlockListType listType, @@ -8791,7 +8791,7 @@ internal static Azure.Request GetBlockListAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -8802,7 +8802,7 @@ internal static Azure.Request GetBlockListAsync_CreateRequest( if (timeout != null) { _request.UriBuilder.AppendQuery("timeout", System.Uri.EscapeDataString(timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); } // Add request headers - _request.Headers.SetValue("x-ms-version", "2018-11-09"); + _request.Headers.SetValue("x-ms-version", "2018-11-09"); if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); } if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } diff --git a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs index be05f28c2f7d5..8a57e038a38c9 100644 --- a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs @@ -36,7 +36,7 @@ public static partial class Service bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, properties, @@ -60,7 +60,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The StorageService properties. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Service.SetPropertiesAsync Request. - internal static Azure.Request SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Files.Models.FileServiceProperties properties, @@ -77,7 +77,7 @@ internal static Azure.Request SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -142,7 +142,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -164,7 +164,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Service.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -176,7 +176,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -252,7 +252,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListSharesSegmentAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListSharesSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -282,7 +282,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Include this parameter to specify one or more datasets to include in the response. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Service.ListSharesSegmentAsync Request. - internal static Azure.Request ListSharesSegmentAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListSharesSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -298,7 +298,7 @@ internal static Azure.Request ListSharesSegmentAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -381,7 +381,7 @@ public static partial class Share bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -407,7 +407,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// A name-value pair to associate with a file storage object. /// Specifies the maximum size of the share, in gigabytes. /// The Share.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -421,7 +421,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -507,7 +507,7 @@ internal static Azure.Request CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -531,7 +531,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -544,7 +544,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -638,7 +638,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -664,7 +664,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the option include to delete the base share and all of its snapshots. /// The Share.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -678,7 +678,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -739,7 +739,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateSnapshotAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateSnapshotAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -763,7 +763,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Share.CreateSnapshotAsync Request. - internal static Azure.Request CreateSnapshotAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -776,7 +776,7 @@ internal static Azure.Request CreateSnapshotAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -866,7 +866,7 @@ internal static Azure.Request CreateSnapshotAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetQuotaAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetQuotaAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -890,7 +890,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the maximum size of the share, in gigabytes. /// The Share.SetQuotaAsync Request. - internal static Azure.Request SetQuotaAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetQuotaAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -903,7 +903,7 @@ internal static Azure.Request SetQuotaAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -984,7 +984,7 @@ internal static Azure.Request SetQuotaAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1008,7 +1008,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Share.SetMetadataAsync Request. - internal static Azure.Request SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1021,7 +1021,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1105,7 +1105,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -1127,7 +1127,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.GetAccessPolicyAsync Request. - internal static Azure.Request GetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -1139,7 +1139,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1213,7 +1213,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, permissions, @@ -1237,7 +1237,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The ACL for the share. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.SetAccessPolicyAsync Request. - internal static Azure.Request SetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Collections.Generic.IEnumerable permissions = default, @@ -1250,7 +1250,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1342,7 +1342,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetStatisticsAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetStatisticsAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -1364,7 +1364,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.GetStatisticsAsync Request. - internal static Azure.Request GetStatisticsAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -1376,7 +1376,7 @@ internal static Azure.Request GetStatisticsAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1454,7 +1454,7 @@ public static partial class Directory bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1478,7 +1478,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Directory.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1491,7 +1491,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1576,7 +1576,7 @@ internal static Azure.Request CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -1600,7 +1600,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Directory.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -1613,7 +1613,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1703,7 +1703,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -1725,7 +1725,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Directory.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -1737,7 +1737,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -1796,7 +1796,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1820,7 +1820,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Directory.SetMetadataAsync Request. - internal static Azure.Request SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1833,7 +1833,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1925,7 +1925,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListFilesAndDirectoriesSegmentAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListFilesAndDirectoriesSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -1955,7 +1955,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Directory.ListFilesAndDirectoriesSegmentAsync Request. - internal static Azure.Request ListFilesAndDirectoriesSegmentAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListFilesAndDirectoriesSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -1971,7 +1971,7 @@ internal static Azure.Request ListFilesAndDirectoriesSegmentAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2051,7 +2051,7 @@ internal static Azure.Request ListFilesAndDirectoriesSegmentAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListHandlesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListHandlesAsync_CreateRequest( pipeline, resourceUri, marker, @@ -2081,7 +2081,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. /// The Directory.ListHandlesAsync Request. - internal static Azure.Request ListHandlesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string marker = default, @@ -2097,7 +2097,7 @@ internal static Azure.Request ListHandlesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2180,7 +2180,7 @@ internal static Azure.Request ListHandlesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ForceCloseHandlesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ForceCloseHandlesAsync_CreateRequest( pipeline, resourceUri, handleId, @@ -2210,7 +2210,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. /// The Directory.ForceCloseHandlesAsync Request. - internal static Azure.Request ForceCloseHandlesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ForceCloseHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string handleId, @@ -2230,7 +2230,7 @@ internal static Azure.Request ForceCloseHandlesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2339,7 +2339,7 @@ public static partial class File bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, fileContentLength, @@ -2377,7 +2377,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Sets the file's Content-Disposition header. /// A name-value pair to associate with a file storage object. /// The File.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long fileContentLength, @@ -2397,7 +2397,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2505,7 +2505,7 @@ internal static Azure.Request CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DownloadAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DownloadAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -2531,7 +2531,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Return file data only from the specified byte range. /// When this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. /// The File.DownloadAsync Request. - internal static Azure.Request DownloadAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -2545,7 +2545,7 @@ internal static Azure.Request DownloadAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2831,7 +2831,7 @@ internal static Azure.Request DownloadAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -2855,7 +2855,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The File.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -2868,7 +2868,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Head; @@ -3019,7 +3019,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -3041,7 +3041,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The File.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -3053,7 +3053,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -3123,7 +3123,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3159,7 +3159,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Sets the file's MD5 hash. /// Sets the file's Content-Disposition header. /// The File.SetPropertiesAsync Request. - internal static Azure.Request SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3178,7 +3178,7 @@ internal static Azure.Request SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3278,7 +3278,7 @@ internal static Azure.Request SetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3302,7 +3302,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The File.SetMetadataAsync Request. - internal static Azure.Request SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3315,7 +3315,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3412,7 +3412,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UploadRangeAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UploadRangeAsync_CreateRequest( pipeline, resourceUri, range, @@ -3444,7 +3444,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// An MD5 hash of the content. This hash is used to verify the integrity of the data during transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). /// The File.UploadRangeAsync Request. - internal static Azure.Request UploadRangeAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UploadRangeAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string range, @@ -3465,7 +3465,7 @@ internal static Azure.Request UploadRangeAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3561,7 +3561,7 @@ internal static Azure.Request UploadRangeAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetRangeListAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetRangeListAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -3587,7 +3587,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the range of bytes over which to list ranges, inclusively. /// The File.GetRangeListAsync Request. - internal static Azure.Request GetRangeListAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetRangeListAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -3601,7 +3601,7 @@ internal static Azure.Request GetRangeListAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -3694,7 +3694,7 @@ internal static Azure.Request GetRangeListAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = StartCopyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = StartCopyAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -3720,7 +3720,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The File.StartCopyAsync Request. - internal static Azure.Request StartCopyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest StartCopyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -3738,7 +3738,7 @@ internal static Azure.Request StartCopyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3831,7 +3831,7 @@ internal static Azure.Request StartCopyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = AbortCopyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = AbortCopyAsync_CreateRequest( pipeline, resourceUri, copyId, @@ -3855,7 +3855,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The File.AbortCopyAsync Request. - internal static Azure.Request AbortCopyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest AbortCopyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string copyId, @@ -3872,7 +3872,7 @@ internal static Azure.Request AbortCopyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3937,7 +3937,7 @@ internal static Azure.Response AbortCopyAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListHandlesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListHandlesAsync_CreateRequest( pipeline, resourceUri, marker, @@ -3965,7 +3965,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The File.ListHandlesAsync Request. - internal static Azure.Request ListHandlesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string marker = default, @@ -3980,7 +3980,7 @@ internal static Azure.Request ListHandlesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -4056,7 +4056,7 @@ internal static Azure.Request ListHandlesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ForceCloseHandlesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ForceCloseHandlesAsync_CreateRequest( pipeline, resourceUri, handleId, @@ -4084,7 +4084,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The File.ForceCloseHandlesAsync Request. - internal static Azure.Request ForceCloseHandlesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ForceCloseHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string handleId, @@ -4103,7 +4103,7 @@ internal static Azure.Request ForceCloseHandlesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; diff --git a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs index f9ef072a6edf1..3b7659be6406c 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs @@ -38,7 +38,7 @@ public static partial class Service bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, properties, @@ -64,7 +64,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.SetPropertiesAsync Request. - internal static Azure.Request SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Queues.Models.QueueServiceProperties properties, @@ -82,7 +82,7 @@ internal static Azure.Request SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -150,7 +150,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -174,7 +174,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -187,7 +187,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -258,7 +258,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetStatisticsAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetStatisticsAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -282,7 +282,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetStatisticsAsync Request. - internal static Azure.Request GetStatisticsAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -295,7 +295,7 @@ internal static Azure.Request GetStatisticsAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -374,7 +374,7 @@ internal static Azure.Request GetStatisticsAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ListQueuesSegmentAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ListQueuesSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -406,7 +406,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.ListQueuesSegmentAsync Request. - internal static Azure.Request ListQueuesSegmentAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ListQueuesSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -423,7 +423,7 @@ internal static Azure.Request ListQueuesSegmentAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -507,7 +507,7 @@ public static partial class Queue bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -533,7 +533,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.CreateAsync Request. - internal static Azure.Request CreateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -547,7 +547,7 @@ internal static Azure.Request CreateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -616,7 +616,7 @@ internal static Azure.Response CreateAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -640,7 +640,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -653,7 +653,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -712,7 +712,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -736,7 +736,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.GetPropertiesAsync Request. - internal static Azure.Request GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -749,7 +749,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -835,7 +835,7 @@ internal static Azure.Request GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -861,7 +861,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.SetMetadataAsync Request. - internal static Azure.Request SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -875,7 +875,7 @@ internal static Azure.Request SetMetadataAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -941,7 +941,7 @@ internal static Azure.Response SetMetadataAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = GetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = GetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -965,7 +965,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.GetAccessPolicyAsync Request. - internal static Azure.Request GetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -978,7 +978,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1054,7 +1054,7 @@ internal static Azure.Request GetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = SetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = SetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, permissions, @@ -1080,7 +1080,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.SetAccessPolicyAsync Request. - internal static Azure.Request SetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Collections.Generic.IEnumerable permissions = default, @@ -1094,7 +1094,7 @@ internal static Azure.Request SetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1180,7 +1180,7 @@ public static partial class Messages bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DequeueAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DequeueAsync_CreateRequest( pipeline, resourceUri, numberOfMessages, @@ -1208,7 +1208,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.DequeueAsync Request. - internal static Azure.Request DequeueAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DequeueAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? numberOfMessages = default, @@ -1223,7 +1223,7 @@ internal static Azure.Request DequeueAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1298,7 +1298,7 @@ internal static Azure.Request DequeueAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = ClearAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = ClearAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1322,7 +1322,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.ClearAsync Request. - internal static Azure.Request ClearAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest ClearAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1335,7 +1335,7 @@ internal static Azure.Request ClearAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -1400,7 +1400,7 @@ internal static Azure.Response ClearAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = EnqueueAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = EnqueueAsync_CreateRequest( pipeline, resourceUri, message, @@ -1430,7 +1430,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.EnqueueAsync Request. - internal static Azure.Request EnqueueAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest EnqueueAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Queues.Models.QueueMessage message, @@ -1450,7 +1450,7 @@ internal static Azure.Request EnqueueAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Post; @@ -1534,7 +1534,7 @@ internal static Azure.Request EnqueueAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = PeekAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = PeekAsync_CreateRequest( pipeline, resourceUri, numberOfMessages, @@ -1560,7 +1560,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.PeekAsync Request. - internal static Azure.Request PeekAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest PeekAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? numberOfMessages = default, @@ -1574,7 +1574,7 @@ internal static Azure.Request PeekAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1663,7 +1663,7 @@ public static partial class MessageId bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = UpdateAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = UpdateAsync_CreateRequest( pipeline, resourceUri, message, @@ -1693,7 +1693,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The MessageId.UpdateAsync Request. - internal static Azure.Request UpdateAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest UpdateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Queues.Models.QueueMessage message, @@ -1717,7 +1717,7 @@ internal static Azure.Request UpdateAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1807,7 +1807,7 @@ internal static Azure.Request UpdateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Request _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( pipeline, resourceUri, popReceipt, @@ -1833,7 +1833,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The MessageId.DeleteAsync Request. - internal static Azure.Request DeleteAsync_CreateRequest( + internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string popReceipt, @@ -1851,7 +1851,7 @@ internal static Azure.Request DeleteAsync_CreateRequest( } // Create the request - Azure.Request _request = pipeline.CreateRequest(); + Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; From 3c7c98a72334b6d91898847b697830a9b75004d8 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 8 Jul 2019 15:22:54 -0700 Subject: [PATCH 02/15] Generator --- .../swagger/Generator/src/generator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts index 0efb6b1b5c479..2bbea5d462d76 100644 --- a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts +++ b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts @@ -172,7 +172,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: w.write(')') }); w.scope('{', '}', () => { - w.write(`using (Azure.Request ${requestName} = ${methodName}_CreateRequest(`); + w.write(`using (Azure.Core.Http.HttpRequest ${requestName} = ${methodName}_CreateRequest(`); w.scope(() => { const separateParams = IndentWriter.createFenceposter(); for (const arg of operation.request.arguments) { @@ -216,7 +216,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: } } w.line(`/// The ${regionName} Request.`); - w.write(`internal static Azure.Request ${methodName}_CreateRequest(`); + w.write(`internal static Azure.Core.Http.HttpRequest ${methodName}_CreateRequest(`); w.scope(() => { const separateParams = IndentWriter.createFenceposter(); for (const arg of operation.request.arguments) { @@ -276,7 +276,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: } w.line(`// Create the request`); - w.line(`Azure.Request ${requestName} = ${pipelineName}.CreateRequest();`); + w.line(`Azure.Core.Http.HttpRequest ${requestName} = ${pipelineName}.CreateRequest();`); w.line(); w.line(`// Set the endpoint`); @@ -427,7 +427,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: // an unimplemented method on the partial class w.line(`throw ${valueName}.CreateException(${responseName});`); } else { - w.line(`throw new Azure.RequestFailedException(${responseName});`); + w.line(`throw new Azure.Core.Http.HttpRequestFailedException(${responseName});`); } }); } From 189fb9018b79fab90601045977ecb318e0884d64 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 9 Jul 2019 10:33:21 -0700 Subject: [PATCH 03/15] Back to Request --- .../src/ConfigurationClient.cs | 52 +-- .../Diagnostics/HttpPipelineEventSource.cs | 12 +- .../src/Pipeline/HttpClientTransport.cs | 4 +- .../Azure.Core/src/Pipeline/HttpPipeline.cs | 6 +- .../src/Pipeline/HttpPipelineMessage.cs | 2 +- .../src/Pipeline/HttpPipelineTransport.cs | 2 +- sdk/core/Azure.Core/src/Request.cs | 2 +- sdk/core/Azure.Core/src/RequestHeaders.cs | 4 +- sdk/core/Azure.Core/tests/EventSourceTests.cs | 6 +- .../HttpClientTransportFunctionalTests.cs | 2 +- .../tests/HttpClientTransportTests.cs | 20 +- .../tests/HttpPipelineBuilderTest.cs | 4 +- sdk/core/Azure.Core/tests/PipelineTestBase.cs | 2 +- sdk/core/Azure.Core/tests/PolicyTestBase.cs | 2 +- .../Azure.Core/tests/RetriableStreamTests.cs | 8 +- .../tests/TestFramework/MockRequest.cs | 2 +- .../Azure.Core/tests/TestFramework/Mocks.cs | 2 +- .../tests/TestFramework/PlaybackTransport.cs | 2 +- .../tests/TestFramework/RecordMatcher.cs | 2 +- .../tests/TestFramework/RecordSession.cs | 2 +- .../tests/TestFramework/RecordTransport.cs | 6 +- .../TestFramework/SyncAsyncPolicyTestBase.cs | 4 +- .../Azure.Identity/src/AadIdentityClient.cs | 20 +- .../src/ManagedIdentityClient.cs | 22 +- .../src/KeyClient_private.cs | 28 +- .../src/SecretClient.cs | 28 +- .../src/Generated/BlobRestClient.cs | 312 +++++++++--------- .../swagger/Generator/src/generator.ts | 6 +- .../src/Generated/FileRestClient.cs | 186 +++++------ .../src/Generated/QueueRestClient.cs | 96 +++--- 30 files changed, 423 insertions(+), 423 deletions(-) diff --git a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs index 892d7cda2739b..5e1a3b1895ddc 100644 --- a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs @@ -91,7 +91,7 @@ public virtual Response Add(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> AddAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateAddRequest(setting)) + using (Request request = CreateAddRequest(setting)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -113,7 +113,7 @@ public virtual async Task> AddAsync(Configuration /// A controlling the request lifetime. public virtual Response Add(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateAddRequest(setting)) + using (Request request = CreateAddRequest(setting)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -128,7 +128,7 @@ public virtual Response Add(ConfigurationSetting setting, } } - private HttpRequest CreateAddRequest(ConfigurationSetting setting) + private Request CreateAddRequest(ConfigurationSetting setting) { if (setting == null) throw new ArgumentNullException(nameof(setting)); @@ -184,7 +184,7 @@ public virtual Response Set(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> SetAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateSetRequest(setting)) + using (Request request = CreateSetRequest(setting)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -207,7 +207,7 @@ public virtual async Task> SetAsync(Configuration /// A controlling the request lifetime. public virtual Response Set(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateSetRequest(setting)) + using (Request request = CreateSetRequest(setting)) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -223,14 +223,14 @@ public virtual Response Set(ConfigurationSetting setting, } } - private HttpRequest CreateSetRequest(ConfigurationSetting setting) + private Request CreateSetRequest(ConfigurationSetting setting) { if (setting == null) throw new ArgumentNullException(nameof(setting)); if (string.IsNullOrEmpty(setting.Key)) throw new ArgumentNullException($"{nameof(setting)}.{nameof(setting.Key)}"); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); ReadOnlyMemory content = Serialize(setting); request.Method = RequestMethod.Put; @@ -283,7 +283,7 @@ public virtual Response Update(string key, string value, s /// A controlling the request lifetime. public virtual async Task> UpdateAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateUpdateRequest(setting)) + using (Request request = CreateUpdateRequest(setting)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -304,7 +304,7 @@ public virtual async Task> UpdateAsync(Configurat /// A controlling the request lifetime. public virtual Response Update(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateUpdateRequest(setting)) + using (Request request = CreateUpdateRequest(setting)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -318,14 +318,14 @@ public virtual Response Update(ConfigurationSetting settin } } - private HttpRequest CreateUpdateRequest(ConfigurationSetting setting) + private Request CreateUpdateRequest(ConfigurationSetting setting) { if (setting == null) throw new ArgumentNullException(nameof(setting)); if (string.IsNullOrEmpty(setting.Key)) throw new ArgumentNullException($"{nameof(setting)}.{nameof(setting.Key)}"); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); ReadOnlyMemory content = Serialize(setting); request.Method = RequestMethod.Put; @@ -357,7 +357,7 @@ private HttpRequest CreateUpdateRequest(ConfigurationSetting setting) /// A controlling the request lifetime. public virtual async Task DeleteAsync(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateDeleteRequest(key, label, etag)) + using (Request request = CreateDeleteRequest(key, label, etag)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -383,7 +383,7 @@ public virtual async Task DeleteAsync(string key, string label = defau /// A controlling the request lifetime. public virtual Response Delete(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateDeleteRequest(key, label, etag)) + using (Request request = CreateDeleteRequest(key, label, etag)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -398,12 +398,12 @@ public virtual Response Delete(string key, string label = default, ETag etag = d } } - private HttpRequest CreateDeleteRequest(string key, string label, ETag etag) + private Request CreateDeleteRequest(string key, string label, ETag etag) { if (string.IsNullOrEmpty(key)) throw new ArgumentNullException(nameof(key)); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Delete; BuildUriForKvRoute(request.UriBuilder, key, label); @@ -424,7 +424,7 @@ private HttpRequest CreateDeleteRequest(string key, string label, ETag etag) /// A controlling the request lifetime. public virtual async Task> GetAsync(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateGetRequest(key, label, acceptDateTime)) + using (Request request = CreateGetRequest(key, label, acceptDateTime)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -447,7 +447,7 @@ public virtual async Task> GetAsync(string key, s /// A controlling the request lifetime. public virtual Response Get(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateGetRequest(key, label, acceptDateTime)) + using (Request request = CreateGetRequest(key, label, acceptDateTime)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -481,12 +481,12 @@ public virtual IEnumerable> GetRevisions(SettingS return PageResponseEnumerator.CreateEnumerable(nextLink => GetRevisionsPage(selector, nextLink, cancellationToken)); } - private HttpRequest CreateGetRequest(string key, string label, DateTimeOffset acceptDateTime) + private Request CreateGetRequest(string key, string label, DateTimeOffset acceptDateTime) { if (string.IsNullOrEmpty(key)) throw new ArgumentNullException($"{nameof(key)}"); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; BuildUriForKvRoute(request.UriBuilder, key, label); request.Headers.Add(MediaTypeKeyValueApplicationHeader); @@ -508,7 +508,7 @@ private HttpRequest CreateGetRequest(string key, string label, DateTimeOffset ac /// A controlling the request lifetime. private async Task> GetSettingsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateBatchRequest(selector, pageLink)) + using (Request request = CreateBatchRequest(selector, pageLink)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -531,7 +531,7 @@ private async Task> GetSettingsPageAsync(Sett /// A controlling the request lifetime. private PageResponse GetSettingsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateBatchRequest(selector, pageLink)) + using (Request request = CreateBatchRequest(selector, pageLink)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -547,9 +547,9 @@ private PageResponse GetSettingsPage(SettingSelector selec } } - private HttpRequest CreateBatchRequest(SettingSelector selector, string pageLink) + private Request CreateBatchRequest(SettingSelector selector, string pageLink) { - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; BuildUriForGetBatch(request.UriBuilder, selector, pageLink); request.Headers.Add(MediaTypeKeyValueApplicationHeader); @@ -570,7 +570,7 @@ private HttpRequest CreateBatchRequest(SettingSelector selector, string pageLink /// A controlling the request lifetime. private async Task> GetRevisionsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateGetRevisionsRequest(selector, pageLink)) + using (Request request = CreateGetRevisionsRequest(selector, pageLink)) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -593,7 +593,7 @@ private async Task> GetRevisionsPageAsync(Set /// A controlling the request lifetime. private PageResponse GetRevisionsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateGetRevisionsRequest(selector, pageLink)) + using (Request request = CreateGetRevisionsRequest(selector, pageLink)) { Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) @@ -608,7 +608,7 @@ private PageResponse GetRevisionsPage(SettingSelector sele } } - private HttpRequest CreateGetRevisionsRequest(SettingSelector selector, string pageLink) + private Request CreateGetRevisionsRequest(SettingSelector selector, string pageLink) { var request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; diff --git a/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs b/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs index af28b24e73701..7fa243d1e95cd 100644 --- a/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs +++ b/sdk/core/Azure.Core/src/Diagnostics/HttpPipelineEventSource.cs @@ -47,7 +47,7 @@ private HttpPipelineEventSource() : base(EventSourceName) { } // TODO (pri 2): this logs just the URI. We need more [NonEvent] - public void Request(HttpRequest request) + public void Request(Request request) { if (IsEnabled(EventLevel.Informational, EventKeywords.None)) { @@ -56,7 +56,7 @@ public void Request(HttpRequest request) } [NonEvent] - public async Task RequestContentAsync(HttpRequest request, CancellationToken cancellationToken) + public async Task RequestContentAsync(Request request, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -65,7 +65,7 @@ public async Task RequestContentAsync(HttpRequest request, CancellationToken can } [NonEvent] - public void RequestContent(HttpRequest request, CancellationToken cancellationToken) + public void RequestContent(Request request, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -74,7 +74,7 @@ public void RequestContent(HttpRequest request, CancellationToken cancellationTo } [NonEvent] - public async Task RequestContentTextAsync(HttpRequest request, Encoding encoding, CancellationToken cancellationToken) + public async Task RequestContentTextAsync(Request request, Encoding encoding, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -83,7 +83,7 @@ public async Task RequestContentTextAsync(HttpRequest request, Encoding encoding } [NonEvent] - public void RequestContentText(HttpRequest request, Encoding encoding, CancellationToken cancellationToken) + public void RequestContentText(Request request, Encoding encoding, CancellationToken cancellationToken) { if (IsEnabled(EventLevel.Verbose, EventKeywords.None)) { @@ -206,7 +206,7 @@ public void ResponseDelay(Response response, long delayMilliseconds) } [NonEvent] - public void RequestRetrying(HttpRequest request, int retryNumber) + public void RequestRetrying(Request request, int retryNumber) { RequestRetrying(request.ClientRequestId, retryNumber); } diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs index a694111e80d40..69214fe1bdc66 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpClientTransport.cs @@ -33,7 +33,7 @@ public HttpClientTransport(HttpClient client) public static readonly HttpClientTransport Shared = new HttpClientTransport(); - public sealed override HttpRequest CreateRequest() + public sealed override Request CreateRequest() => new PipelineRequest(); public override void Process(HttpPipelineMessage message) @@ -144,7 +144,7 @@ private static string JoinHeaderValues(IEnumerable values) return string.Join(",", values); } - sealed class PipelineRequest : HttpRequest + sealed class PipelineRequest : Request { private bool _wasSent = false; private readonly HttpRequestMessage _requestMessage; diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs index cf3817bc2dd60..6e93a3fed3dd5 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs @@ -29,11 +29,11 @@ public HttpPipeline(HttpPipelineTransport transport, HttpPipelinePolicy[] polici _pipeline = all; } - public HttpRequest CreateRequest() + public Request CreateRequest() => _transport.CreateRequest(); [MethodImpl(MethodImplOptions.AggressiveInlining)] - public async Task SendRequestAsync(HttpRequest request, CancellationToken cancellationToken) + public async Task SendRequestAsync(Request request, CancellationToken cancellationToken) { var message = new HttpPipelineMessage(cancellationToken); message.Request = request; @@ -43,7 +43,7 @@ public async Task SendRequestAsync(HttpRequest request, CancellationTo } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public Response SendRequest(HttpRequest request, CancellationToken cancellationToken) + public Response SendRequest(Request request, CancellationToken cancellationToken) { var message = new HttpPipelineMessage(cancellationToken); message.Request = request; diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs index 98965bec542c0..58d3dcc0295d4 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineMessage.cs @@ -18,7 +18,7 @@ public HttpPipelineMessage(CancellationToken cancellationToken) CancellationToken = cancellationToken; } - public HttpRequest Request { get; set; } + public Request Request { get; set; } public Response Response { get; set; } diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs index ed5603d1def85..2a7e01641b735 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineTransport.cs @@ -13,6 +13,6 @@ public abstract class HttpPipelineTransport public abstract Task ProcessAsync(HttpPipelineMessage message); - public abstract HttpRequest CreateRequest(); + public abstract Request CreateRequest(); } } diff --git a/sdk/core/Azure.Core/src/Request.cs b/sdk/core/Azure.Core/src/Request.cs index af99059e45ecd..ccfc9d4c150f5 100644 --- a/sdk/core/Azure.Core/src/Request.cs +++ b/sdk/core/Azure.Core/src/Request.cs @@ -7,7 +7,7 @@ namespace Azure.Core.Http { - public abstract class HttpRequest : IDisposable + public abstract class Request : IDisposable { public virtual HttpPipelineUriBuilder UriBuilder { get; set; } = new HttpPipelineUriBuilder(); diff --git a/sdk/core/Azure.Core/src/RequestHeaders.cs b/sdk/core/Azure.Core/src/RequestHeaders.cs index 7fbf170587dc4..e9517ba554d15 100644 --- a/sdk/core/Azure.Core/src/RequestHeaders.cs +++ b/sdk/core/Azure.Core/src/RequestHeaders.cs @@ -9,9 +9,9 @@ namespace Azure.Core.Http { public readonly struct RequestHeaders: IEnumerable { - private readonly HttpRequest _request; + private readonly Request _request; - public RequestHeaders(HttpRequest request) + public RequestHeaders(Request request) { _request = request; } diff --git a/sdk/core/Azure.Core/tests/EventSourceTests.cs b/sdk/core/Azure.Core/tests/EventSourceTests.cs index 781040b2e0eea..b70f8d4341857 100644 --- a/sdk/core/Azure.Core/tests/EventSourceTests.cs +++ b/sdk/core/Azure.Core/tests/EventSourceTests.cs @@ -79,7 +79,7 @@ public async Task SendingRequestProducesEvents() var pipeline = new HttpPipeline(mockTransport, new []{ LoggingPolicy.Shared }); string requestId; - using (HttpRequest request = pipeline.CreateRequest()) + using (Request request = pipeline.CreateRequest()) { request.SetRequestLine(RequestMethod.Get, new Uri("https://contoso.a.io")); request.Headers.Add("Date", "3/26/2019"); @@ -141,7 +141,7 @@ public async Task RequestContentIsLoggedAsText() var pipeline = new HttpPipeline(mockTransport, new []{ LoggingPolicy.Shared }); string requestId; - using (HttpRequest request = pipeline.CreateRequest()) + using (Request request = pipeline.CreateRequest()) { request.SetRequestLine(RequestMethod.Get, new Uri("https://contoso.a.io")); request.Content = HttpPipelineRequestContent.Create(Encoding.UTF8.GetBytes("Hello world")); @@ -311,7 +311,7 @@ private async Task SendRequest(bool isSeekable, Action s var mockTransport = CreateMockTransport(mockResponse); var pipeline = new HttpPipeline(mockTransport, new[] { LoggingPolicy.Shared }); - using (HttpRequest request = pipeline.CreateRequest()) + using (Request request = pipeline.CreateRequest()) { request.SetRequestLine(RequestMethod.Get, new Uri("https://contoso.a.io")); diff --git a/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs b/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs index f65f931055020..38b1217c12249 100644 --- a/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs +++ b/sdk/core/Azure.Core/tests/HttpClientTransportFunctionalTests.cs @@ -27,7 +27,7 @@ public async Task ProxySettingsAreReadFromEnvironment(string envVar, string url) Environment.SetEnvironmentVariable(envVar, testServer.Address.ToString()); var transport = new HttpClientTransport(); - HttpRequest request = transport.CreateRequest(); + Request request = transport.CreateRequest(); request.UriBuilder.Uri = new Uri(url); Response response = await ExecuteRequest(request, transport); Assert.True(response.Headers.TryGetValue("Via", out var via)); diff --git a/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs b/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs index 110a04ac31af2..be80347a47883 100644 --- a/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs +++ b/sdk/core/Azure.Core/tests/HttpClientTransportTests.cs @@ -212,7 +212,7 @@ public async Task CanGetAndAddRequestHeaders(string headerName, string headerVal }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = CreateRequest(transport); + Request request = CreateRequest(transport); request.Headers.Add(headerName, headerValue); @@ -245,7 +245,7 @@ public async Task CanSetRequestHeaders(string headerName, string headerValue, bo }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = CreateRequest(transport); + Request request = CreateRequest(transport); request.Headers.Add(headerName, "Random value"); request.Headers.SetValue(headerName, headerValue); @@ -277,7 +277,7 @@ public async Task CanRemoveHeaders(string headerName, string headerValue, bool c }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = CreateRequest(transport); + Request request = CreateRequest(transport); request.Headers.Add(headerName, headerValue); Assert.True(request.Headers.Remove(headerName)); @@ -357,7 +357,7 @@ public async Task CanAddMultipleValuesToRequestHeader(string headerName, string }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = CreateRequest(transport); + Request request = CreateRequest(transport); request.Headers.Add(headerName, headerValue); request.Headers.Add(headerName, anotherHeaderValue); @@ -422,7 +422,7 @@ public async Task CanGetAndSetMultiValueResponseHeaders(string headerName, strin CollectionAssert.Contains(response.Headers, new HttpHeader(headerName, joinedHeaderValues)); } - private static HttpRequest CreateRequest(HttpClientTransport transport, byte[] bytes = null) + private static Request CreateRequest(HttpClientTransport transport, byte[] bytes = null) { var request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); @@ -474,7 +474,7 @@ public async Task ContentStreamIsReturnedSynchronously() var mockHandler = new MockHttpClientHandler(httpRequestMessage => Task.FromResult(httpResponseMessage)); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = transport.CreateRequest(); + Request request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); Response response = await ExecuteRequest(request, transport); @@ -515,7 +515,7 @@ public async Task OriginalContentStreamIsReturnedIfNotAsync() var mockHandler = new MockHttpClientHandler(httpRequestMessage => Task.FromResult(httpResponseMessage)); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = transport.CreateRequest(); + Request request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); Response response = await ExecuteRequest(request, transport); @@ -536,7 +536,7 @@ public async Task ReasonPhraseIsExposed() var mockHandler = new MockHttpClientHandler(httpRequestMessage => Task.FromResult(httpResponseMessage)); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = transport.CreateRequest(); + Request request = transport.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); Response response = await ExecuteRequest(request, transport); @@ -557,7 +557,7 @@ public async Task StreamRequestContentCanBeSentMultipleTimes() }); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - HttpRequest request = transport.CreateRequest(); + Request request = transport.CreateRequest(); request.Content = HttpPipelineRequestContent.Create(new MemoryStream(new byte[] { 1, 2, 3} )); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); @@ -582,7 +582,7 @@ public async Task RequestContentIsNotDisposedOnSend() DisposeTrackingContent disposeTrackingContent = new DisposeTrackingContent(); var transport = new HttpClientTransport(new HttpClient(mockHandler)); - using (HttpRequest request = transport.CreateRequest()) + using (Request request = transport.CreateRequest()) { request.Content = disposeTrackingContent; request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com:340")); diff --git a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs index f954957d07ad6..be52b56dcd802 100644 --- a/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs +++ b/sdk/core/Azure.Core/tests/HttpPipelineBuilderTest.cs @@ -28,7 +28,7 @@ public async Task CanAddCustomPolicy(HttpPipelinePosition position, int expected HttpPipeline pipeline = HttpPipelineBuilder.Build(options, false); - using HttpRequest request = transport.CreateRequest(); + using Request request = transport.CreateRequest(); request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); @@ -47,7 +47,7 @@ public async Task UsesAssemblyNameAndInformationalVersionForTelemetryPolicySetti HttpPipeline pipeline = HttpPipelineBuilder.Build(options, false); - using HttpRequest request = transport.CreateRequest(); + using Request request = transport.CreateRequest(); request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); diff --git a/sdk/core/Azure.Core/tests/PipelineTestBase.cs b/sdk/core/Azure.Core/tests/PipelineTestBase.cs index e9905450530ef..09ff62bca70e1 100644 --- a/sdk/core/Azure.Core/tests/PipelineTestBase.cs +++ b/sdk/core/Azure.Core/tests/PipelineTestBase.cs @@ -10,7 +10,7 @@ namespace Azure.Core.Tests { public class PipelineTestBase { - protected static async Task ExecuteRequest(HttpRequest request, HttpClientTransport transport) + protected static async Task ExecuteRequest(Request request, HttpClientTransport transport) { var message = new HttpPipelineMessage(CancellationToken.None) { Request = request }; await transport.ProcessAsync(message); diff --git a/sdk/core/Azure.Core/tests/PolicyTestBase.cs b/sdk/core/Azure.Core/tests/PolicyTestBase.cs index 7f48bf9cbf719..766caeea3416e 100644 --- a/sdk/core/Azure.Core/tests/PolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/PolicyTestBase.cs @@ -16,7 +16,7 @@ protected static Task SendGetRequest(HttpPipelineTransport transport, { Assert.IsInstanceOf(policy, "Use SyncAsyncPolicyTestBase base type for non-sync policies"); - using (HttpRequest request = transport.CreateRequest()) + using (Request request = transport.CreateRequest()) { request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); diff --git a/sdk/core/Azure.Core/tests/RetriableStreamTests.cs b/sdk/core/Azure.Core/tests/RetriableStreamTests.cs index 82ed7664c8b04..27ad9f2c97f38 100644 --- a/sdk/core/Azure.Core/tests/RetriableStreamTests.cs +++ b/sdk/core/Azure.Core/tests/RetriableStreamTests.cs @@ -241,21 +241,21 @@ private Task ReadAsync(Stream stream, byte[] buffer, int offset, int length private static Response SendTestRequest(HttpPipeline pipeline, long offset) { - using HttpRequest request = CreateRequest(pipeline, offset); + using Request request = CreateRequest(pipeline, offset); return pipeline.SendRequest(request, CancellationToken.None); } private static Task SendTestRequestAsync(HttpPipeline pipeline, long offset) { - using HttpRequest request = CreateRequest(pipeline, offset); + using Request request = CreateRequest(pipeline, offset); return pipeline.SendRequestAsync(request, CancellationToken.None); } - private static HttpRequest CreateRequest(HttpPipeline pipeline, long offset) + private static Request CreateRequest(HttpPipeline pipeline, long offset) { - HttpRequest request = pipeline.CreateRequest(); + Request request = pipeline.CreateRequest(); request.SetRequestLine(RequestMethod.Get, new Uri("http://example.com")); request.Headers.Add("Range", "bytes=" + offset); return request; diff --git a/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs b/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs index 060ddb053b890..497f83aa1fa4e 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/MockRequest.cs @@ -9,7 +9,7 @@ namespace Azure.Core.Testing { - public class MockRequest : HttpRequest + public class MockRequest : Request { public MockRequest() { diff --git a/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs b/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs index 8b0ceb16e102d..f20e6ba569ac4 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/Mocks.cs @@ -36,7 +36,7 @@ public MockTransport(Func responseFactory) _responseFactory = responseFactory; } - public override HttpRequest CreateRequest() + public override Request CreateRequest() => new MockRequest(); public override void Process(HttpPipelineMessage message) diff --git a/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs b/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs index 98301aae12397..8ba8702760e19 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/PlaybackTransport.cs @@ -61,7 +61,7 @@ public override async Task ProcessAsync(HttpPipelineMessage message) message.Response = GetResponse(_session.Lookup(message.Request, _matcher)); } - public override HttpRequest CreateRequest() + public override Request CreateRequest() { lock (_random) { diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs index 8a8438ee30f07..d108d263c6958 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs @@ -26,7 +26,7 @@ public RecordMatcher(RecordedTestSanitizer sanitizer) "User-Agent" }; - public virtual int FindMatch(HttpRequest request, IList entries, out string failureMessage) + public virtual int FindMatch(Request request, IList entries, out string failureMessage) { SortedDictionary headers = new SortedDictionary(StringComparer.OrdinalIgnoreCase); diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs index f667a720cdbce..f00b2519a265c 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordSession.cs @@ -63,7 +63,7 @@ public void Record(RecordEntry entry) } } - public RecordEntry Lookup(HttpRequest request, RecordMatcher matcher) + public RecordEntry Lookup(Request request, RecordMatcher matcher) { lock (Entries) { diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs index 8dc324cdbe79e..84aa60443143c 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordTransport.cs @@ -61,9 +61,9 @@ private void Record(HttpPipelineMessage message) } } - public override HttpRequest CreateRequest() + public override Request CreateRequest() { - HttpRequest request = _innerTransport.CreateRequest(); + Request request = _innerTransport.CreateRequest(); lock (_random) { @@ -74,7 +74,7 @@ public override HttpRequest CreateRequest() return request; } - public RecordEntry CreateEntry(HttpRequest request, Response response) + public RecordEntry CreateEntry(Request request, Response response) { var entry = new RecordEntry { diff --git a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs index 8ea0673074e77..ef74ff10fbd20 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs @@ -18,7 +18,7 @@ public SyncAsyncPolicyTestBase(bool isAsync) : base(isAsync) { } - protected Task SendRequestAsync(HttpPipeline pipeline, HttpRequest request, CancellationToken cancellationToken = default) + protected Task SendRequestAsync(HttpPipeline pipeline, Request request, CancellationToken cancellationToken = default) { return IsAsync ? pipeline.SendRequestAsync(request, cancellationToken) : Task.FromResult(pipeline.SendRequest(request, cancellationToken)); } @@ -27,7 +27,7 @@ protected async Task SendGetRequest(HttpPipelineTransport transport, H { await Task.Yield(); - using (HttpRequest request = transport.CreateRequest()) + using (Request request = transport.CreateRequest()) { request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); diff --git a/sdk/identity/Azure.Identity/src/AadIdentityClient.cs b/sdk/identity/Azure.Identity/src/AadIdentityClient.cs index 98ee36fcf83f4..5d03f11410eae 100644 --- a/sdk/identity/Azure.Identity/src/AadIdentityClient.cs +++ b/sdk/identity/Azure.Identity/src/AadIdentityClient.cs @@ -43,7 +43,7 @@ public AadIdentityClient(IdentityClientOptions options = null) public virtual async Task AuthenticateAsync(string tenantId, string clientId, string clientSecret, string[] scopes, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) + using (Request request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) { try { @@ -58,7 +58,7 @@ public virtual async Task AuthenticateAsync(string tenantId, string public virtual AccessToken Authenticate(string tenantId, string clientId, string clientSecret, string[] scopes, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) + using (Request request = CreateClientSecretAuthRequest(tenantId, clientId, clientSecret, scopes)) { try { @@ -73,7 +73,7 @@ public virtual AccessToken Authenticate(string tenantId, string clientId, string public virtual async Task AuthenticateAsync(string tenantId, string clientId, X509Certificate2 clientCertificate, string[] scopes, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) + using (Request request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) { try { @@ -88,7 +88,7 @@ public virtual async Task AuthenticateAsync(string tenantId, string public virtual AccessToken Authenticate(string tenantId, string clientId, X509Certificate2 clientCertificate, string[] scopes, CancellationToken cancellationToken = default) { - using (HttpRequest request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) + using (Request request = CreateClientCertificateAuthRequest(tenantId, clientId, clientCertificate, scopes)) { try { @@ -100,7 +100,7 @@ public virtual AccessToken Authenticate(string tenantId, string clientId, X509Ce } } } - private async Task SendAuthRequestAsync(HttpRequest request, CancellationToken cancellationToken) + private async Task SendAuthRequestAsync(Request request, CancellationToken cancellationToken) { var response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -114,7 +114,7 @@ private async Task SendAuthRequestAsync(HttpRequest request, Cancel throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } - private AccessToken SendAuthRequest(HttpRequest request, CancellationToken cancellationToken) + private AccessToken SendAuthRequest(Request request, CancellationToken cancellationToken) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -128,9 +128,9 @@ private AccessToken SendAuthRequest(HttpRequest request, CancellationToken cance throw response.CreateRequestFailedException(); } - private HttpRequest CreateClientSecretAuthRequest(string tenantId, string clientId, string clientSecret, string[] scopes) + private Request CreateClientSecretAuthRequest(string tenantId, string clientId, string clientSecret, string[] scopes) { - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Post; @@ -151,9 +151,9 @@ private HttpRequest CreateClientSecretAuthRequest(string tenantId, string client return request; } - private HttpRequest CreateClientCertificateAuthRequest(string tenantId, string clientId, X509Certificate2 clientCertficate, string[] scopes) + private Request CreateClientCertificateAuthRequest(string tenantId, string clientId, X509Certificate2 clientCertficate, string[] scopes) { - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Post; diff --git a/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs b/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs index ca0021d8f670b..a76fbc7a26f90 100644 --- a/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs +++ b/sdk/identity/Azure.Identity/src/ManagedIdentityClient.cs @@ -98,7 +98,7 @@ public virtual AccessToken Authenticate(string[] scopes, string clientId = null, private async Task SendAuthRequestAsync(MsiType msiType, string[] scopes, string clientId, CancellationToken cancellationToken) { - using (HttpRequest request = CreateAuthRequest(msiType, scopes, clientId)) + using (Request request = CreateAuthRequest(msiType, scopes, clientId)) { var response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -115,7 +115,7 @@ private async Task SendAuthRequestAsync(MsiType msiType, string[] s private AccessToken SendAuthRequest(MsiType msiType, string[] scopes, string clientId, CancellationToken cancellationToken) { - using (HttpRequest request = CreateAuthRequest(msiType, scopes, clientId)) + using (Request request = CreateAuthRequest(msiType, scopes, clientId)) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -130,7 +130,7 @@ private AccessToken SendAuthRequest(MsiType msiType, string[] scopes, string cli } } - private HttpRequest CreateAuthRequest(MsiType msiType, string[] scopes, string clientId) + private Request CreateAuthRequest(MsiType msiType, string[] scopes, string clientId) { switch (msiType) { @@ -275,7 +275,7 @@ private bool ImdsAvailable(CancellationToken cancellationToken) // send a request without the Metadata header. This will result in a failed request, // but we're just interested in if we get a response before the timeout of 500ms // if we don't get a response we assume the imds endpoint is not available - using (HttpRequest request = _pipeline.CreateRequest()) + using (Request request = _pipeline.CreateRequest()) { request.Method = RequestMethod.Get; @@ -307,7 +307,7 @@ private async Task ImdsAvailableAsync(CancellationToken cancellationToken) // send a request without the Metadata header. This will result in a failed request, // but we're just interested in if we get a response before the timeout of 500ms // if we don't get a response we assume the imds endpoint is not available - using (HttpRequest request = _pipeline.CreateRequest()) + using (Request request = _pipeline.CreateRequest()) { request.Method = RequestMethod.Get; @@ -334,12 +334,12 @@ private async Task ImdsAvailableAsync(CancellationToken cancellationToken) } } - private HttpRequest CreateImdsAuthRequest(string[] scopes, string clientId) + private Request CreateImdsAuthRequest(string[] scopes, string clientId) { // covert the scopes to a resource string string resource = ScopeUtilities.ScopesToResource(scopes); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; @@ -359,12 +359,12 @@ private HttpRequest CreateImdsAuthRequest(string[] scopes, string clientId) return request; } - private HttpRequest CreateAppServiceAuthRequest(string[] scopes, string clientId) + private Request CreateAppServiceAuthRequest(string[] scopes, string clientId) { // covert the scopes to a resource string string resource = ScopeUtilities.ScopesToResource(scopes); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Get; @@ -384,12 +384,12 @@ private HttpRequest CreateAppServiceAuthRequest(string[] scopes, string clientId return request; } - private HttpRequest CreateCloudShellAuthRequest(string[] scopes, string clientId) + private Request CreateCloudShellAuthRequest(string[] scopes, string clientId) { // covert the scopes to a resource string string resource = ScopeUtilities.ScopesToResource(scopes); - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Method = RequestMethod.Post; diff --git a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs index a8cfd4205af4b..9553d7e13f933 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient_private.cs @@ -17,7 +17,7 @@ private async Task> SendRequestAsync(Reques where TContent : Model where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -30,7 +30,7 @@ private async Task> SendRequestAsync(Reques private async Task> SendRequestAsync(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -40,13 +40,13 @@ private async Task> SendRequestAsync(RequestMethod me private async Task SendRequestAsync(RequestMethod method, CancellationToken cancellationToken, params string[] path) { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { return await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); } } - private async Task SendRequestAsync(HttpRequest request, CancellationToken cancellationToken) + private async Task SendRequestAsync(Request request, CancellationToken cancellationToken) { Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -65,7 +65,7 @@ private Response SendRequest(RequestMethod method, T where TContent : Model where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -78,7 +78,7 @@ private Response SendRequest(RequestMethod method, T private Response SendRequest(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { Response response = SendRequest(request, cancellationToken); @@ -88,13 +88,13 @@ private Response SendRequest(RequestMethod method, Func> GetPageAsync(Uri firstPageUri, string nex firstPageUri = new Uri(nextLink); } - using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -192,7 +192,7 @@ private PageResponse GetPage(Uri firstPageUri, string nextLink, Func it firstPageUri = new Uri(nextLink); } - using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = SendRequest(request, cancellationToken); diff --git a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs index 493d90d0cecfc..32f4c8f321473 100644 --- a/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs +++ b/sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs @@ -514,7 +514,7 @@ private async Task> SendRequestAsync(Reques where TContent : Model where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -528,7 +528,7 @@ private Response SendRequest(RequestMethod method, T where TContent : Model where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { request.Content = HttpPipelineRequestContent.Create(content.Serialize()); @@ -541,7 +541,7 @@ private Response SendRequest(RequestMethod method, T private async Task> SendRequestAsync(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -552,7 +552,7 @@ private async Task> SendRequestAsync(RequestMethod me private Response SendRequest(RequestMethod method, Func resultFactory, CancellationToken cancellationToken, params string[] path) where TResult : Model { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { Response response = SendRequest(request, cancellationToken); @@ -561,7 +561,7 @@ private Response SendRequest(RequestMethod method, Func SendRequestAsync(RequestMethod method, CancellationToken cancellationToken, params string[] path) { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { return await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); } @@ -569,13 +569,13 @@ private async Task SendRequestAsync(RequestMethod method, Cancellation private Response SendRequest(RequestMethod method, CancellationToken cancellationToken, params string[] path) { - using (HttpRequest request = CreateRequest(method, path)) + using (Request request = CreateRequest(method, path)) { return SendRequest(request, cancellationToken); } } - private async Task SendRequestAsync(HttpRequest request, CancellationToken cancellationToken) + private async Task SendRequestAsync(Request request, CancellationToken cancellationToken) { var response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -589,7 +589,7 @@ private async Task SendRequestAsync(HttpRequest request, CancellationT throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } - private Response SendRequest(HttpRequest request, CancellationToken cancellationToken) + private Response SendRequest(Request request, CancellationToken cancellationToken) { var response = _pipeline.SendRequest(request, cancellationToken); @@ -613,7 +613,7 @@ private async Task> GetPageAsync(Uri firstPageUri, string nex firstPageUri = new Uri(nextLink); } - using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = await SendRequestAsync(request, cancellationToken).ConfigureAwait(false); @@ -635,7 +635,7 @@ private PageResponse GetPage(Uri firstPageUri, string nextLink, Func it firstPageUri = new Uri(nextLink); } - using (HttpRequest request = CreateRequest(RequestMethod.Get, firstPageUri)) + using (Request request = CreateRequest(RequestMethod.Get, firstPageUri)) { Response response = SendRequest(request, cancellationToken); @@ -648,9 +648,9 @@ private PageResponse GetPage(Uri firstPageUri, string nextLink, Func it } } - private HttpRequest CreateRequest(RequestMethod method, Uri uri) + private Request CreateRequest(RequestMethod method, Uri uri) { - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Headers.Add(HttpHeader.Common.JsonContentType); request.Headers.Add(HttpHeader.Names.Accept, "application/json"); @@ -660,9 +660,9 @@ private HttpRequest CreateRequest(RequestMethod method, Uri uri) return request; } - private HttpRequest CreateRequest(RequestMethod method, params string[] path) + private Request CreateRequest(RequestMethod method, params string[] path) { - HttpRequest request = _pipeline.CreateRequest(); + Request request = _pipeline.CreateRequest(); request.Headers.Add(HttpHeader.Common.JsonContentType); request.Headers.Add(HttpHeader.Names.Accept, "application/json"); diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index 0808261c4516c..b46180b9da624 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -38,7 +38,7 @@ public static partial class Service bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, blobServiceProperties, @@ -64,7 +64,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.SetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.BlobServiceProperties blobServiceProperties, @@ -82,7 +82,7 @@ internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -150,7 +150,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -174,7 +174,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -187,7 +187,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -258,7 +258,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetStatisticsAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -282,7 +282,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetStatisticsAsync Request. - internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( + internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -295,7 +295,7 @@ internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -374,7 +374,7 @@ internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListContainersSegmentAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListContainersSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -406,7 +406,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.ListContainersSegmentAsync Request. - internal static Azure.Core.Http.HttpRequest ListContainersSegmentAsync_CreateRequest( + internal static Azure.Core.Http.Request ListContainersSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -423,7 +423,7 @@ internal static Azure.Core.Http.HttpRequest ListContainersSegmentAsync_CreateReq } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -499,7 +499,7 @@ internal static Azure.Core.Http.HttpRequest ListContainersSegmentAsync_CreateReq bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetUserDelegationKeyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetUserDelegationKeyAsync_CreateRequest( pipeline, resourceUri, keyInfo, @@ -525,7 +525,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetUserDelegationKeyAsync Request. - internal static Azure.Core.Http.HttpRequest GetUserDelegationKeyAsync_CreateRequest( + internal static Azure.Core.Http.Request GetUserDelegationKeyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.KeyInfo keyInfo, @@ -543,7 +543,7 @@ internal static Azure.Core.Http.HttpRequest GetUserDelegationKeyAsync_CreateRequ } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Post; @@ -617,7 +617,7 @@ internal static Azure.Core.Http.HttpRequest GetUserDelegationKeyAsync_CreateRequ bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetAccountInfoAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetAccountInfoAsync_CreateRequest( pipeline, resourceUri)) { @@ -637,7 +637,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// /// The URL of the service account, container, or blob that is the targe of the desired operation. /// The Service.GetAccountInfoAsync Request. - internal static Azure.Core.Http.HttpRequest GetAccountInfoAsync_CreateRequest( + internal static Azure.Core.Http.Request GetAccountInfoAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri) { @@ -648,7 +648,7 @@ internal static Azure.Core.Http.HttpRequest GetAccountInfoAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -739,7 +739,7 @@ public static partial class Container bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -767,7 +767,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specifies whether data in the container may be accessed publicly and the level of access /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -782,7 +782,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -871,7 +871,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -897,7 +897,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -911,7 +911,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1042,7 +1042,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1072,7 +1072,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1088,7 +1088,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -1157,7 +1157,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1187,7 +1187,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.SetMetadataAsync Request. - internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1203,7 +1203,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1294,7 +1294,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1320,7 +1320,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.GetAccessPolicyAsync Request. - internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1334,7 +1334,7 @@ internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1436,7 +1436,7 @@ internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, permissions, @@ -1470,7 +1470,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.SetAccessPolicyAsync Request. - internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Collections.Generic.IEnumerable permissions = default, @@ -1488,7 +1488,7 @@ internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1595,7 +1595,7 @@ internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = AcquireLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = AcquireLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1627,7 +1627,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.AcquireLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request AcquireLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1644,7 +1644,7 @@ internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1740,7 +1740,7 @@ internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ReleaseLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ReleaseLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -1770,7 +1770,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ReleaseLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request ReleaseLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -1790,7 +1790,7 @@ internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1881,7 +1881,7 @@ internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = RenewLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = RenewLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -1911,7 +1911,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.RenewLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request RenewLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -1931,7 +1931,7 @@ internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2026,7 +2026,7 @@ internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = BreakLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = BreakLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -2056,7 +2056,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.BreakLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request BreakLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -2072,7 +2072,7 @@ internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2181,7 +2181,7 @@ internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ChangeLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ChangeLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -2213,7 +2213,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify this header value to operate only on a blob if it has not been modified since the specified date/time. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ChangeLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request ChangeLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -2238,7 +2238,7 @@ internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2336,7 +2336,7 @@ internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListBlobsFlatSegmentAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListBlobsFlatSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -2368,7 +2368,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ListBlobsFlatSegmentAsync Request. - internal static Azure.Core.Http.HttpRequest ListBlobsFlatSegmentAsync_CreateRequest( + internal static Azure.Core.Http.Request ListBlobsFlatSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -2385,7 +2385,7 @@ internal static Azure.Core.Http.HttpRequest ListBlobsFlatSegmentAsync_CreateRequ } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2470,7 +2470,7 @@ internal static Azure.Core.Http.HttpRequest ListBlobsFlatSegmentAsync_CreateRequ bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListBlobsHierarchySegmentAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListBlobsHierarchySegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -2504,7 +2504,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Container.ListBlobsHierarchySegmentAsync Request. - internal static Azure.Core.Http.HttpRequest ListBlobsHierarchySegmentAsync_CreateRequest( + internal static Azure.Core.Http.Request ListBlobsHierarchySegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -2522,7 +2522,7 @@ internal static Azure.Core.Http.HttpRequest ListBlobsHierarchySegmentAsync_Creat } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2622,7 +2622,7 @@ public static partial class Blob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DownloadAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DownloadAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -2662,7 +2662,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.DownloadAsync Request. - internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( + internal static Azure.Core.Http.Request DownloadAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -2683,7 +2683,7 @@ internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -3050,7 +3050,7 @@ internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -3086,7 +3086,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -3105,7 +3105,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Head; @@ -3344,7 +3344,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -3382,7 +3382,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -3402,7 +3402,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -3468,7 +3468,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UndeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UndeleteAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3492,7 +3492,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.UndeleteAsync Request. - internal static Azure.Core.Http.HttpRequest UndeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request UndeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3505,7 +3505,7 @@ internal static Azure.Core.Http.HttpRequest UndeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3587,7 +3587,7 @@ internal static Azure.Response UndeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetHttpHeadersAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetHttpHeadersAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3633,7 +3633,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Optional. Sets the blob's Content-Disposition header. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.SetHttpHeadersAsync Request. - internal static Azure.Core.Http.HttpRequest SetHttpHeadersAsync_CreateRequest( + internal static Azure.Core.Http.Request SetHttpHeadersAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3657,7 +3657,7 @@ internal static Azure.Core.Http.HttpRequest SetHttpHeadersAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3786,7 +3786,7 @@ internal static Azure.Core.Http.HttpRequest SetHttpHeadersAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3822,7 +3822,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.SetMetadataAsync Request. - internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3841,7 +3841,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3960,7 +3960,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = AcquireLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = AcquireLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3996,7 +3996,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.AcquireLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request AcquireLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -4015,7 +4015,7 @@ internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4116,7 +4116,7 @@ internal static Azure.Core.Http.HttpRequest AcquireLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ReleaseLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ReleaseLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -4150,7 +4150,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.ReleaseLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request ReleaseLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -4172,7 +4172,7 @@ internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4268,7 +4268,7 @@ internal static Azure.Core.Http.HttpRequest ReleaseLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = RenewLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = RenewLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -4302,7 +4302,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.RenewLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request RenewLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -4324,7 +4324,7 @@ internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4426,7 +4426,7 @@ internal static Azure.Core.Http.HttpRequest RenewLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ChangeLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ChangeLeaseAsync_CreateRequest( pipeline, resourceUri, leaseId, @@ -4462,7 +4462,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.ChangeLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request ChangeLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string leaseId, @@ -4489,7 +4489,7 @@ internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4590,7 +4590,7 @@ internal static Azure.Core.Http.HttpRequest ChangeLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = BreakLeaseAsync_CreateRequest( + using (Azure.Core.Http.Request _request = BreakLeaseAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -4624,7 +4624,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.BreakLeaseAsync Request. - internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( + internal static Azure.Core.Http.Request BreakLeaseAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -4642,7 +4642,7 @@ internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4756,7 +4756,7 @@ internal static Azure.Core.Http.HttpRequest BreakLeaseAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateSnapshotAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateSnapshotAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -4792,7 +4792,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.CreateSnapshotAsync Request. - internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateSnapshotAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -4811,7 +4811,7 @@ internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -4928,7 +4928,7 @@ internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = StartCopyFromUriAsync_CreateRequest( + using (Azure.Core.Http.Request _request = StartCopyFromUriAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -4974,7 +4974,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.StartCopyFromUriAsync Request. - internal static Azure.Core.Http.HttpRequest StartCopyFromUriAsync_CreateRequest( + internal static Azure.Core.Http.Request StartCopyFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -5002,7 +5002,7 @@ internal static Azure.Core.Http.HttpRequest StartCopyFromUriAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5127,7 +5127,7 @@ internal static Azure.Core.Http.HttpRequest StartCopyFromUriAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CopyFromUriAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CopyFromUriAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -5173,7 +5173,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.CopyFromUriAsync Request. - internal static Azure.Core.Http.HttpRequest CopyFromUriAsync_CreateRequest( + internal static Azure.Core.Http.Request CopyFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -5201,7 +5201,7 @@ internal static Azure.Core.Http.HttpRequest CopyFromUriAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5309,7 +5309,7 @@ internal static Azure.Core.Http.HttpRequest CopyFromUriAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = AbortCopyFromUriAsync_CreateRequest( + using (Azure.Core.Http.Request _request = AbortCopyFromUriAsync_CreateRequest( pipeline, resourceUri, copyId, @@ -5337,7 +5337,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Blob.AbortCopyFromUriAsync Request. - internal static Azure.Core.Http.HttpRequest AbortCopyFromUriAsync_CreateRequest( + internal static Azure.Core.Http.Request AbortCopyFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string copyId, @@ -5356,7 +5356,7 @@ internal static Azure.Core.Http.HttpRequest AbortCopyFromUriAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5423,7 +5423,7 @@ internal static Azure.Response AbortCopyFromUriAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetTierAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetTierAsync_CreateRequest( pipeline, resourceUri, tier, @@ -5451,7 +5451,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// The Blob.SetTierAsync Request. - internal static Azure.Core.Http.HttpRequest SetTierAsync_CreateRequest( + internal static Azure.Core.Http.Request SetTierAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.AccessTier tier, @@ -5470,7 +5470,7 @@ internal static Azure.Core.Http.HttpRequest SetTierAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5574,7 +5574,7 @@ public static partial class PageBlob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, contentLength, @@ -5628,7 +5628,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long contentLength, @@ -5656,7 +5656,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5798,7 +5798,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UploadPagesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UploadPagesAsync_CreateRequest( pipeline, resourceUri, body, @@ -5846,7 +5846,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.UploadPagesAsync Request. - internal static Azure.Core.Http.HttpRequest UploadPagesAsync_CreateRequest( + internal static Azure.Core.Http.Request UploadPagesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.IO.Stream body, @@ -5875,7 +5875,7 @@ internal static Azure.Core.Http.HttpRequest UploadPagesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -5998,7 +5998,7 @@ internal static Azure.Core.Http.HttpRequest UploadPagesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ClearPagesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ClearPagesAsync_CreateRequest( pipeline, resourceUri, contentLength, @@ -6042,7 +6042,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.ClearPagesAsync Request. - internal static Azure.Core.Http.HttpRequest ClearPagesAsync_CreateRequest( + internal static Azure.Core.Http.Request ClearPagesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long contentLength, @@ -6065,7 +6065,7 @@ internal static Azure.Core.Http.HttpRequest ClearPagesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -6198,7 +6198,7 @@ internal static Azure.Core.Http.HttpRequest ClearPagesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UploadPagesFromUriAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UploadPagesFromUriAsync_CreateRequest( pipeline, resourceUri, sourceUri, @@ -6256,7 +6256,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.UploadPagesFromUriAsync Request. - internal static Azure.Core.Http.HttpRequest UploadPagesFromUriAsync_CreateRequest( + internal static Azure.Core.Http.Request UploadPagesFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri sourceUri, @@ -6298,7 +6298,7 @@ internal static Azure.Core.Http.HttpRequest UploadPagesFromUriAsync_CreateReques } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -6432,7 +6432,7 @@ internal static Azure.Core.Http.HttpRequest UploadPagesFromUriAsync_CreateReques bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPageRangesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPageRangesAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -6470,7 +6470,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.GetPageRangesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPageRangesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPageRangesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -6490,7 +6490,7 @@ internal static Azure.Core.Http.HttpRequest GetPageRangesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -6613,7 +6613,7 @@ internal static Azure.Core.Http.HttpRequest GetPageRangesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPageRangesDiffAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPageRangesDiffAsync_CreateRequest( pipeline, resourceUri, snapshot, @@ -6653,7 +6653,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.GetPageRangesDiffAsync Request. - internal static Azure.Core.Http.HttpRequest GetPageRangesDiffAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPageRangesDiffAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string snapshot = default, @@ -6674,7 +6674,7 @@ internal static Azure.Core.Http.HttpRequest GetPageRangesDiffAsync_CreateRequest } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -6794,7 +6794,7 @@ internal static Azure.Core.Http.HttpRequest GetPageRangesDiffAsync_CreateRequest bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ResizeAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ResizeAsync_CreateRequest( pipeline, resourceUri, blobContentLength, @@ -6830,7 +6830,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.ResizeAsync Request. - internal static Azure.Core.Http.HttpRequest ResizeAsync_CreateRequest( + internal static Azure.Core.Http.Request ResizeAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long blobContentLength, @@ -6849,7 +6849,7 @@ internal static Azure.Core.Http.HttpRequest ResizeAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -6953,7 +6953,7 @@ internal static Azure.Core.Http.HttpRequest ResizeAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UpdateSequenceNumberAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UpdateSequenceNumberAsync_CreateRequest( pipeline, resourceUri, sequenceNumberAction, @@ -6991,7 +6991,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Set for page blobs only. The sequence number is a user-controlled value that you can use to track requests. The value of the sequence number must be between 0 and 2^63 - 1. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.UpdateSequenceNumberAsync Request. - internal static Azure.Core.Http.HttpRequest UpdateSequenceNumberAsync_CreateRequest( + internal static Azure.Core.Http.Request UpdateSequenceNumberAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.SequenceNumberAction sequenceNumberAction, @@ -7011,7 +7011,7 @@ internal static Azure.Core.Http.HttpRequest UpdateSequenceNumberAsync_CreateRequ } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7112,7 +7112,7 @@ internal static Azure.Core.Http.HttpRequest UpdateSequenceNumberAsync_CreateRequ bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CopyIncrementalAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CopyIncrementalAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -7146,7 +7146,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The PageBlob.CopyIncrementalAsync Request. - internal static Azure.Core.Http.HttpRequest CopyIncrementalAsync_CreateRequest( + internal static Azure.Core.Http.Request CopyIncrementalAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -7168,7 +7168,7 @@ internal static Azure.Core.Http.HttpRequest CopyIncrementalAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7295,7 +7295,7 @@ public static partial class AppendBlob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, contentLength, @@ -7345,7 +7345,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The AppendBlob.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long contentLength, @@ -7371,7 +7371,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7507,7 +7507,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = AppendBlockAsync_CreateRequest( + using (Azure.Core.Http.Request _request = AppendBlockAsync_CreateRequest( pipeline, resourceUri, body, @@ -7551,7 +7551,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The AppendBlob.AppendBlockAsync Request. - internal static Azure.Core.Http.HttpRequest AppendBlockAsync_CreateRequest( + internal static Azure.Core.Http.Request AppendBlockAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.IO.Stream body, @@ -7578,7 +7578,7 @@ internal static Azure.Core.Http.HttpRequest AppendBlockAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7716,7 +7716,7 @@ internal static Azure.Core.Http.HttpRequest AppendBlockAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = AppendBlockFromUriAsync_CreateRequest( + using (Azure.Core.Http.Request _request = AppendBlockFromUriAsync_CreateRequest( pipeline, resourceUri, sourceUri, @@ -7770,7 +7770,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The AppendBlob.AppendBlockFromUriAsync Request. - internal static Azure.Core.Http.HttpRequest AppendBlockFromUriAsync_CreateRequest( + internal static Azure.Core.Http.Request AppendBlockFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri sourceUri, @@ -7802,7 +7802,7 @@ internal static Azure.Core.Http.HttpRequest AppendBlockFromUriAsync_CreateReques } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -7963,7 +7963,7 @@ public static partial class BlockBlob bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UploadAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UploadAsync_CreateRequest( pipeline, resourceUri, body, @@ -8015,7 +8015,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.UploadAsync Request. - internal static Azure.Core.Http.HttpRequest UploadAsync_CreateRequest( + internal static Azure.Core.Http.Request UploadAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.IO.Stream body, @@ -8046,7 +8046,7 @@ internal static Azure.Core.Http.HttpRequest UploadAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8175,7 +8175,7 @@ internal static Azure.Core.Http.HttpRequest UploadAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = StageBlockAsync_CreateRequest( + using (Azure.Core.Http.Request _request = StageBlockAsync_CreateRequest( pipeline, resourceUri, blockId, @@ -8209,7 +8209,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.StageBlockAsync Request. - internal static Azure.Core.Http.HttpRequest StageBlockAsync_CreateRequest( + internal static Azure.Core.Http.Request StageBlockAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string blockId, @@ -8235,7 +8235,7 @@ internal static Azure.Core.Http.HttpRequest StageBlockAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8338,7 +8338,7 @@ internal static Azure.Core.Http.HttpRequest StageBlockAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = StageBlockFromUriAsync_CreateRequest( + using (Azure.Core.Http.Request _request = StageBlockFromUriAsync_CreateRequest( pipeline, resourceUri, blockId, @@ -8382,7 +8382,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.StageBlockFromUriAsync Request. - internal static Azure.Core.Http.HttpRequest StageBlockFromUriAsync_CreateRequest( + internal static Azure.Core.Http.Request StageBlockFromUriAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string blockId, @@ -8413,7 +8413,7 @@ internal static Azure.Core.Http.HttpRequest StageBlockFromUriAsync_CreateRequest } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8538,7 +8538,7 @@ internal static Azure.Core.Http.HttpRequest StageBlockFromUriAsync_CreateRequest bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CommitBlockListAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CommitBlockListAsync_CreateRequest( pipeline, resourceUri, blocks, @@ -8587,7 +8587,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specify an ETag value to operate only on blobs without a matching value. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.CommitBlockListAsync Request. - internal static Azure.Core.Http.HttpRequest CommitBlockListAsync_CreateRequest( + internal static Azure.Core.Http.Request CommitBlockListAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.BlockLookupList blocks, @@ -8617,7 +8617,7 @@ internal static Azure.Core.Http.HttpRequest CommitBlockListAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -8745,7 +8745,7 @@ internal static Azure.Core.Http.HttpRequest CommitBlockListAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetBlockListAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetBlockListAsync_CreateRequest( pipeline, resourceUri, listType, @@ -8775,7 +8775,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// If specified, the operation only succeeds if the resource's lease is active and matches this ID. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The BlockBlob.GetBlockListAsync Request. - internal static Azure.Core.Http.HttpRequest GetBlockListAsync_CreateRequest( + internal static Azure.Core.Http.Request GetBlockListAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Blobs.Models.BlockListType listType, @@ -8791,7 +8791,7 @@ internal static Azure.Core.Http.HttpRequest GetBlockListAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; diff --git a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts index 2bbea5d462d76..c7ad1bcfbbfc8 100644 --- a/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts +++ b/sdk/storage/Azure.Storage.Common/swagger/Generator/src/generator.ts @@ -172,7 +172,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: w.write(')') }); w.scope('{', '}', () => { - w.write(`using (Azure.Core.Http.HttpRequest ${requestName} = ${methodName}_CreateRequest(`); + w.write(`using (Azure.Core.Http.Request ${requestName} = ${methodName}_CreateRequest(`); w.scope(() => { const separateParams = IndentWriter.createFenceposter(); for (const arg of operation.request.arguments) { @@ -216,7 +216,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: } } w.line(`/// The ${regionName} Request.`); - w.write(`internal static Azure.Core.Http.HttpRequest ${methodName}_CreateRequest(`); + w.write(`internal static Azure.Core.Http.Request ${methodName}_CreateRequest(`); w.scope(() => { const separateParams = IndentWriter.createFenceposter(); for (const arg of operation.request.arguments) { @@ -427,7 +427,7 @@ function generateOperation(w: IndentWriter, serviceModel: IServiceModel, group: // an unimplemented method on the partial class w.line(`throw ${valueName}.CreateException(${responseName});`); } else { - w.line(`throw new Azure.Core.Http.HttpRequestFailedException(${responseName});`); + w.line(`throw new Azure.RequestFailedException(${responseName});`); } }); } diff --git a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs index 8a57e038a38c9..24099d83b252e 100644 --- a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs @@ -36,7 +36,7 @@ public static partial class Service bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, properties, @@ -60,7 +60,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The StorageService properties. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Service.SetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Files.Models.FileServiceProperties properties, @@ -77,7 +77,7 @@ internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -142,7 +142,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -164,7 +164,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Service.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -176,7 +176,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -252,7 +252,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListSharesSegmentAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListSharesSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -282,7 +282,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Include this parameter to specify one or more datasets to include in the response. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Service.ListSharesSegmentAsync Request. - internal static Azure.Core.Http.HttpRequest ListSharesSegmentAsync_CreateRequest( + internal static Azure.Core.Http.Request ListSharesSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -298,7 +298,7 @@ internal static Azure.Core.Http.HttpRequest ListSharesSegmentAsync_CreateRequest } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -381,7 +381,7 @@ public static partial class Share bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -407,7 +407,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// A name-value pair to associate with a file storage object. /// Specifies the maximum size of the share, in gigabytes. /// The Share.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -421,7 +421,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -507,7 +507,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -531,7 +531,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -544,7 +544,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -638,7 +638,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -664,7 +664,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the option include to delete the base share and all of its snapshots. /// The Share.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -678,7 +678,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -739,7 +739,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateSnapshotAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateSnapshotAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -763,7 +763,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Share.CreateSnapshotAsync Request. - internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateSnapshotAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -776,7 +776,7 @@ internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -866,7 +866,7 @@ internal static Azure.Core.Http.HttpRequest CreateSnapshotAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetQuotaAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetQuotaAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -890,7 +890,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the maximum size of the share, in gigabytes. /// The Share.SetQuotaAsync Request. - internal static Azure.Core.Http.HttpRequest SetQuotaAsync_CreateRequest( + internal static Azure.Core.Http.Request SetQuotaAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -903,7 +903,7 @@ internal static Azure.Core.Http.HttpRequest SetQuotaAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -984,7 +984,7 @@ internal static Azure.Core.Http.HttpRequest SetQuotaAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1008,7 +1008,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Share.SetMetadataAsync Request. - internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1021,7 +1021,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1105,7 +1105,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -1127,7 +1127,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.GetAccessPolicyAsync Request. - internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -1139,7 +1139,7 @@ internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1213,7 +1213,7 @@ internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, permissions, @@ -1237,7 +1237,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The ACL for the share. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.SetAccessPolicyAsync Request. - internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Collections.Generic.IEnumerable permissions = default, @@ -1250,7 +1250,7 @@ internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1342,7 +1342,7 @@ internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetStatisticsAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -1364,7 +1364,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Share.GetStatisticsAsync Request. - internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( + internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -1376,7 +1376,7 @@ internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1454,7 +1454,7 @@ public static partial class Directory bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1478,7 +1478,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Directory.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1491,7 +1491,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1576,7 +1576,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -1600,7 +1600,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Directory.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -1613,7 +1613,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1703,7 +1703,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -1725,7 +1725,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Directory.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -1737,7 +1737,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -1796,7 +1796,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1820,7 +1820,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The Directory.SetMetadataAsync Request. - internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1833,7 +1833,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1925,7 +1925,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListFilesAndDirectoriesSegmentAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListFilesAndDirectoriesSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -1955,7 +1955,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Specifies the maximum number of entries to return. If the request does not specify maxresults, or specifies a value greater than 5,000, the server will return up to 5,000 items. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The Directory.ListFilesAndDirectoriesSegmentAsync Request. - internal static Azure.Core.Http.HttpRequest ListFilesAndDirectoriesSegmentAsync_CreateRequest( + internal static Azure.Core.Http.Request ListFilesAndDirectoriesSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -1971,7 +1971,7 @@ internal static Azure.Core.Http.HttpRequest ListFilesAndDirectoriesSegmentAsync_ } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2051,7 +2051,7 @@ internal static Azure.Core.Http.HttpRequest ListFilesAndDirectoriesSegmentAsync_ bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListHandlesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListHandlesAsync_CreateRequest( pipeline, resourceUri, marker, @@ -2081,7 +2081,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. /// The Directory.ListHandlesAsync Request. - internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( + internal static Azure.Core.Http.Request ListHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string marker = default, @@ -2097,7 +2097,7 @@ internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2180,7 +2180,7 @@ internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ForceCloseHandlesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ForceCloseHandlesAsync_CreateRequest( pipeline, resourceUri, handleId, @@ -2210,7 +2210,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// Specifies operation should apply to the directory specified in the URI, its files, its subdirectories and their files. /// The Directory.ForceCloseHandlesAsync Request. - internal static Azure.Core.Http.HttpRequest ForceCloseHandlesAsync_CreateRequest( + internal static Azure.Core.Http.Request ForceCloseHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string handleId, @@ -2230,7 +2230,7 @@ internal static Azure.Core.Http.HttpRequest ForceCloseHandlesAsync_CreateRequest } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2339,7 +2339,7 @@ public static partial class File bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, fileContentLength, @@ -2377,7 +2377,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Sets the file's Content-Disposition header. /// A name-value pair to associate with a file storage object. /// The File.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, long fileContentLength, @@ -2397,7 +2397,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -2505,7 +2505,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DownloadAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DownloadAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -2531,7 +2531,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Return file data only from the specified byte range. /// When this header is set to true and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4 MB in size. /// The File.DownloadAsync Request. - internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( + internal static Azure.Core.Http.Request DownloadAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -2545,7 +2545,7 @@ internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -2831,7 +2831,7 @@ internal static Azure.Core.Http.HttpRequest DownloadAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -2855,7 +2855,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The File.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -2868,7 +2868,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Head; @@ -3019,7 +3019,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout)) @@ -3041,7 +3041,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The URL of the service account, share, directory or file that is the target of the desired operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The File.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default) @@ -3053,7 +3053,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -3123,7 +3123,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3159,7 +3159,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Sets the file's MD5 hash. /// Sets the file's Content-Disposition header. /// The File.SetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3178,7 +3178,7 @@ internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3278,7 +3278,7 @@ internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -3302,7 +3302,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The File.SetMetadataAsync Request. - internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -3315,7 +3315,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3412,7 +3412,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UploadRangeAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UploadRangeAsync_CreateRequest( pipeline, resourceUri, range, @@ -3444,7 +3444,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// An MD5 hash of the content. This hash is used to verify the integrity of the data during transport. When the Content-MD5 header is specified, the File service compares the hash of the content that has arrived with the header value that was sent. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). /// The File.UploadRangeAsync Request. - internal static Azure.Core.Http.HttpRequest UploadRangeAsync_CreateRequest( + internal static Azure.Core.Http.Request UploadRangeAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string range, @@ -3465,7 +3465,7 @@ internal static Azure.Core.Http.HttpRequest UploadRangeAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3561,7 +3561,7 @@ internal static Azure.Core.Http.HttpRequest UploadRangeAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetRangeListAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetRangeListAsync_CreateRequest( pipeline, resourceUri, sharesnapshot, @@ -3587,7 +3587,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// Specifies the range of bytes over which to list ranges, inclusively. /// The File.GetRangeListAsync Request. - internal static Azure.Core.Http.HttpRequest GetRangeListAsync_CreateRequest( + internal static Azure.Core.Http.Request GetRangeListAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string sharesnapshot = default, @@ -3601,7 +3601,7 @@ internal static Azure.Core.Http.HttpRequest GetRangeListAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -3694,7 +3694,7 @@ internal static Azure.Core.Http.HttpRequest GetRangeListAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = StartCopyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = StartCopyAsync_CreateRequest( pipeline, resourceUri, copySource, @@ -3720,7 +3720,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// A name-value pair to associate with a file storage object. /// The File.StartCopyAsync Request. - internal static Azure.Core.Http.HttpRequest StartCopyAsync_CreateRequest( + internal static Azure.Core.Http.Request StartCopyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Uri copySource, @@ -3738,7 +3738,7 @@ internal static Azure.Core.Http.HttpRequest StartCopyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3831,7 +3831,7 @@ internal static Azure.Core.Http.HttpRequest StartCopyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = AbortCopyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = AbortCopyAsync_CreateRequest( pipeline, resourceUri, copyId, @@ -3855,7 +3855,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The copy identifier provided in the x-ms-copy-id header of the original Copy File operation. /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The File.AbortCopyAsync Request. - internal static Azure.Core.Http.HttpRequest AbortCopyAsync_CreateRequest( + internal static Azure.Core.Http.Request AbortCopyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string copyId, @@ -3872,7 +3872,7 @@ internal static Azure.Core.Http.HttpRequest AbortCopyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -3937,7 +3937,7 @@ internal static Azure.Response AbortCopyAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListHandlesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListHandlesAsync_CreateRequest( pipeline, resourceUri, marker, @@ -3965,7 +3965,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for File Service Operations. /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The File.ListHandlesAsync Request. - internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( + internal static Azure.Core.Http.Request ListHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string marker = default, @@ -3980,7 +3980,7 @@ internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -4056,7 +4056,7 @@ internal static Azure.Core.Http.HttpRequest ListHandlesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ForceCloseHandlesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ForceCloseHandlesAsync_CreateRequest( pipeline, resourceUri, handleId, @@ -4084,7 +4084,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// A string value that identifies the portion of the list to be returned with the next list operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items. The marker value is opaque to the client. /// The snapshot parameter is an opaque DateTime value that, when present, specifies the share snapshot to query. /// The File.ForceCloseHandlesAsync Request. - internal static Azure.Core.Http.HttpRequest ForceCloseHandlesAsync_CreateRequest( + internal static Azure.Core.Http.Request ForceCloseHandlesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string handleId, @@ -4103,7 +4103,7 @@ internal static Azure.Core.Http.HttpRequest ForceCloseHandlesAsync_CreateRequest } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; diff --git a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs index 3b7659be6406c..24230ebdee057 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs @@ -38,7 +38,7 @@ public static partial class Service bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetPropertiesAsync_CreateRequest( pipeline, resourceUri, properties, @@ -64,7 +64,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.SetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request SetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Queues.Models.QueueServiceProperties properties, @@ -82,7 +82,7 @@ internal static Azure.Core.Http.HttpRequest SetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -150,7 +150,7 @@ internal static Azure.Response SetPropertiesAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -174,7 +174,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -187,7 +187,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -258,7 +258,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetStatisticsAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetStatisticsAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -282,7 +282,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.GetStatisticsAsync Request. - internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( + internal static Azure.Core.Http.Request GetStatisticsAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -295,7 +295,7 @@ internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -374,7 +374,7 @@ internal static Azure.Core.Http.HttpRequest GetStatisticsAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ListQueuesSegmentAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ListQueuesSegmentAsync_CreateRequest( pipeline, resourceUri, prefix, @@ -406,7 +406,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Service.ListQueuesSegmentAsync Request. - internal static Azure.Core.Http.HttpRequest ListQueuesSegmentAsync_CreateRequest( + internal static Azure.Core.Http.Request ListQueuesSegmentAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string prefix = default, @@ -423,7 +423,7 @@ internal static Azure.Core.Http.HttpRequest ListQueuesSegmentAsync_CreateRequest } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -507,7 +507,7 @@ public static partial class Queue bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = CreateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = CreateAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -533,7 +533,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.CreateAsync Request. - internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( + internal static Azure.Core.Http.Request CreateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -547,7 +547,7 @@ internal static Azure.Core.Http.HttpRequest CreateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -616,7 +616,7 @@ internal static Azure.Response CreateAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -640,7 +640,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -653,7 +653,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -712,7 +712,7 @@ internal static Azure.Response DeleteAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetPropertiesAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetPropertiesAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -736,7 +736,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.GetPropertiesAsync Request. - internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( + internal static Azure.Core.Http.Request GetPropertiesAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -749,7 +749,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -835,7 +835,7 @@ internal static Azure.Core.Http.HttpRequest GetPropertiesAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetMetadataAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetMetadataAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -861,7 +861,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// Optional. Include this parameter to specify that the queue's metadata be returned as part of the response body. Note that metadata requested with this parameter must be stored in accordance with the naming restrictions imposed by the 2009-09-19 version of the Queue service. Beginning with this version, all metadata names must adhere to the naming conventions for C# identifiers. /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.SetMetadataAsync Request. - internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( + internal static Azure.Core.Http.Request SetMetadataAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -875,7 +875,7 @@ internal static Azure.Core.Http.HttpRequest SetMetadataAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -941,7 +941,7 @@ internal static Azure.Response SetMetadataAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = GetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = GetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -965,7 +965,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.GetAccessPolicyAsync Request. - internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.Request GetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -978,7 +978,7 @@ internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1054,7 +1054,7 @@ internal static Azure.Core.Http.HttpRequest GetAccessPolicyAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = SetAccessPolicyAsync_CreateRequest( + using (Azure.Core.Http.Request _request = SetAccessPolicyAsync_CreateRequest( pipeline, resourceUri, permissions, @@ -1080,7 +1080,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Queue.SetAccessPolicyAsync Request. - internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( + internal static Azure.Core.Http.Request SetAccessPolicyAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, System.Collections.Generic.IEnumerable permissions = default, @@ -1094,7 +1094,7 @@ internal static Azure.Core.Http.HttpRequest SetAccessPolicyAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1180,7 +1180,7 @@ public static partial class Messages bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DequeueAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DequeueAsync_CreateRequest( pipeline, resourceUri, numberOfMessages, @@ -1208,7 +1208,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.DequeueAsync Request. - internal static Azure.Core.Http.HttpRequest DequeueAsync_CreateRequest( + internal static Azure.Core.Http.Request DequeueAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? numberOfMessages = default, @@ -1223,7 +1223,7 @@ internal static Azure.Core.Http.HttpRequest DequeueAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1298,7 +1298,7 @@ internal static Azure.Core.Http.HttpRequest DequeueAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = ClearAsync_CreateRequest( + using (Azure.Core.Http.Request _request = ClearAsync_CreateRequest( pipeline, resourceUri, timeout, @@ -1322,7 +1322,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.ClearAsync Request. - internal static Azure.Core.Http.HttpRequest ClearAsync_CreateRequest( + internal static Azure.Core.Http.Request ClearAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? timeout = default, @@ -1335,7 +1335,7 @@ internal static Azure.Core.Http.HttpRequest ClearAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; @@ -1400,7 +1400,7 @@ internal static Azure.Response ClearAsync_CreateResponse( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = EnqueueAsync_CreateRequest( + using (Azure.Core.Http.Request _request = EnqueueAsync_CreateRequest( pipeline, resourceUri, message, @@ -1430,7 +1430,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.EnqueueAsync Request. - internal static Azure.Core.Http.HttpRequest EnqueueAsync_CreateRequest( + internal static Azure.Core.Http.Request EnqueueAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Queues.Models.QueueMessage message, @@ -1450,7 +1450,7 @@ internal static Azure.Core.Http.HttpRequest EnqueueAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Post; @@ -1534,7 +1534,7 @@ internal static Azure.Core.Http.HttpRequest EnqueueAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = PeekAsync_CreateRequest( + using (Azure.Core.Http.Request _request = PeekAsync_CreateRequest( pipeline, resourceUri, numberOfMessages, @@ -1560,7 +1560,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The Messages.PeekAsync Request. - internal static Azure.Core.Http.HttpRequest PeekAsync_CreateRequest( + internal static Azure.Core.Http.Request PeekAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, int? numberOfMessages = default, @@ -1574,7 +1574,7 @@ internal static Azure.Core.Http.HttpRequest PeekAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Get; @@ -1663,7 +1663,7 @@ public static partial class MessageId bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = UpdateAsync_CreateRequest( + using (Azure.Core.Http.Request _request = UpdateAsync_CreateRequest( pipeline, resourceUri, message, @@ -1693,7 +1693,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The MessageId.UpdateAsync Request. - internal static Azure.Core.Http.HttpRequest UpdateAsync_CreateRequest( + internal static Azure.Core.Http.Request UpdateAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, Azure.Storage.Queues.Models.QueueMessage message, @@ -1717,7 +1717,7 @@ internal static Azure.Core.Http.HttpRequest UpdateAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Put; @@ -1807,7 +1807,7 @@ internal static Azure.Core.Http.HttpRequest UpdateAsync_CreateRequest( bool async = true, System.Threading.CancellationToken cancellationToken = default) { - using (Azure.Core.Http.HttpRequest _request = DeleteAsync_CreateRequest( + using (Azure.Core.Http.Request _request = DeleteAsync_CreateRequest( pipeline, resourceUri, popReceipt, @@ -1833,7 +1833,7 @@ await pipeline.SendRequestAsync(_request, cancellationToken).ConfigureAwait(fals /// The The timeout parameter is expressed in seconds. For more information, see Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. /// The MessageId.DeleteAsync Request. - internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( + internal static Azure.Core.Http.Request DeleteAsync_CreateRequest( Azure.Core.Pipeline.HttpPipeline pipeline, System.Uri resourceUri, string popReceipt, @@ -1851,7 +1851,7 @@ internal static Azure.Core.Http.HttpRequest DeleteAsync_CreateRequest( } // Create the request - Azure.Core.Http.HttpRequest _request = pipeline.CreateRequest(); + Azure.Core.Http.Request _request = pipeline.CreateRequest(); // Set the endpoint _request.Method = Azure.Core.Pipeline.RequestMethod.Delete; From ea3015c9a89849122be6e6438aad82dd019cb237 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 9 Jul 2019 11:56:40 -0700 Subject: [PATCH 04/15] Fix merge --- sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs index 98dc88e9f286f..7de97fbd9b800 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/RecordMatcher.cs @@ -6,6 +6,8 @@ using System.Diagnostics; using System.Linq; using System.Text; +using Azure.Core.Http; +using Azure.Core.Pipeline; namespace Azure.Core.Testing { From 254cfd302eec8ef127e3b96cd94208dafbc4c7de Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 12 Jul 2019 13:41:10 -0700 Subject: [PATCH 05/15] Add initial common infrastructure for wiring up distributed tracing --- .../src/ConfigurationClient.cs | 171 ++++++++++++++++-- sdk/core/Azure.Core/src/Azure.Core.csproj | 1 + .../src/Pipeline/AzureOperationScope.cs | 73 ++++++++ .../Azure.Core/src/Pipeline/HttpPipeline.cs | 6 +- .../src/Pipeline/HttpPipelineBuilder.cs | 4 +- .../src/Pipeline/HttpPipelineDiagnostics.cs | 28 +++ .../Policies/RequestActivityPolicy.cs | 77 ++++++++ .../tests/ClientDiagnosticsTests.cs | 89 +++++++++ .../tests/RequestActivityPolicyTests.cs | 50 +++++ .../tests/TestDiagnosticListener.cs | 53 ++++++ .../tests/TestFramework/SyncAsyncTestBase.cs | 9 + 11 files changed, 540 insertions(+), 21 deletions(-) create mode 100644 sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs create mode 100644 sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs create mode 100644 sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs create mode 100644 sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs create mode 100644 sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs create mode 100644 sdk/core/Azure.Core/tests/TestDiagnosticListener.cs diff --git a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs index 5e1a3b1895ddc..256e898b32d0c 100644 --- a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs @@ -10,7 +10,6 @@ using Azure.Core; using Azure.Core.Http; using Azure.Core.Pipeline; -using Azure.Core.Pipeline.Policies; namespace Azure.ApplicationModel.Configuration { @@ -67,7 +66,8 @@ public ConfigurationClient(string connectionString, ConfigurationClientOptions o /// A controlling the request lifetime. public virtual async Task> AddAsync(string key, string value, string label = default, CancellationToken cancellationToken = default) { - if (string.IsNullOrEmpty(key)) throw new ArgumentNullException($"{nameof(key)}"); + if (string.IsNullOrEmpty(key)) + throw new ArgumentNullException($"{nameof(key)}"); return await AddAsync(new ConfigurationSetting(key, value, label), cancellationToken).ConfigureAwait(false); } @@ -80,7 +80,8 @@ public virtual async Task> AddAsync(string key, s /// A controlling the request lifetime. public virtual Response Add(string key, string value, string label = default, CancellationToken cancellationToken = default) { - if (string.IsNullOrEmpty(key)) throw new ArgumentNullException($"{nameof(key)}"); + if (string.IsNullOrEmpty(key)) + throw new ArgumentNullException($"{nameof(key)}"); return Add(new ConfigurationSetting(key, value, label), cancellationToken); } @@ -91,8 +92,12 @@ public virtual Response Add(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> AddAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateAddRequest(setting)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); + scope.Start(); + + try { + using Request request = CreateAddRequest(setting); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -104,6 +109,11 @@ public virtual async Task> AddAsync(Configuration throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -113,8 +123,13 @@ public virtual async Task> AddAsync(Configuration /// A controlling the request lifetime. public virtual Response Add(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateAddRequest(setting)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); + scope.AddAttribute("key", setting.Key); + scope.Start(); + + try { + using Request request = CreateAddRequest(setting); Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) @@ -126,6 +141,11 @@ public virtual Response Add(ConfigurationSetting setting, throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } private Request CreateAddRequest(ConfigurationSetting setting) @@ -160,7 +180,8 @@ private Request CreateAddRequest(ConfigurationSetting setting) /// A controlling the request lifetime. public virtual async Task> SetAsync(string key, string value, string label = default, CancellationToken cancellationToken = default) { - if (string.IsNullOrEmpty(key)) throw new ArgumentNullException($"{nameof(key)}"); + if (string.IsNullOrEmpty(key)) + throw new ArgumentNullException($"{nameof(key)}"); return await SetAsync(new ConfigurationSetting(key, value, label), cancellationToken).ConfigureAwait(false); } @@ -173,7 +194,8 @@ public virtual async Task> SetAsync(string key, s /// A controlling the request lifetime. public virtual Response Set(string key, string value, string label = default, CancellationToken cancellationToken = default) { - if (string.IsNullOrEmpty(key)) throw new ArgumentNullException($"{nameof(key)}"); + if (string.IsNullOrEmpty(key)) + throw new ArgumentNullException($"{nameof(key)}"); return Set(new ConfigurationSetting(key, value, label), cancellationToken); } @@ -184,8 +206,13 @@ public virtual Response Set(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> SetAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateSetRequest(setting)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.AddAttribute("key", setting.Key); + scope.Start(); + + try { + using Request request = CreateSetRequest(setting); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -198,6 +225,11 @@ public virtual async Task> SetAsync(Configuration throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -207,9 +239,15 @@ public virtual async Task> SetAsync(Configuration /// A controlling the request lifetime. public virtual Response Set(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateSetRequest(setting)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.AddAttribute("key", setting.Key); + scope.Start(); + + try { - var response = _pipeline.SendRequest(request, cancellationToken); + using Request request = CreateSetRequest(setting); + + Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) { @@ -221,6 +259,11 @@ public virtual Response Set(ConfigurationSetting setting, throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } private Request CreateSetRequest(ConfigurationSetting setting) @@ -283,8 +326,13 @@ public virtual Response Update(string key, string value, s /// A controlling the request lifetime. public virtual async Task> UpdateAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateUpdateRequest(setting)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); + scope.AddAttribute("key", setting.Key); + scope.Start(); + + try { + using Request request = CreateUpdateRequest(setting); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -295,6 +343,11 @@ public virtual async Task> UpdateAsync(Configurat throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -304,8 +357,13 @@ public virtual async Task> UpdateAsync(Configurat /// A controlling the request lifetime. public virtual Response Update(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using (Request request = CreateUpdateRequest(setting)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); + scope.AddAttribute("key", setting.Key); + scope.Start(); + + try { + using Request request = CreateUpdateRequest(setting); Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) @@ -316,6 +374,11 @@ public virtual Response Update(ConfigurationSetting settin throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } private Request CreateUpdateRequest(ConfigurationSetting setting) @@ -357,8 +420,13 @@ private Request CreateUpdateRequest(ConfigurationSetting setting) /// A controlling the request lifetime. public virtual async Task DeleteAsync(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using (Request request = CreateDeleteRequest(key, label, etag)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Delete"); + scope.AddAttribute("key", key); + scope.Start(); + + try { + using Request request = CreateDeleteRequest(key, label, etag); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -370,6 +438,11 @@ public virtual async Task DeleteAsync(string key, string label = defau throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -383,8 +456,13 @@ public virtual async Task DeleteAsync(string key, string label = defau /// A controlling the request lifetime. public virtual Response Delete(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using (Request request = CreateDeleteRequest(key, label, etag)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.AddAttribute("key", key); + scope.Start(); + + try { + using Request request = CreateDeleteRequest(key, label, etag); Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) @@ -396,6 +474,11 @@ public virtual Response Delete(string key, string label = default, ETag etag = d throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } private Request CreateDeleteRequest(string key, string label, ETag etag) @@ -424,8 +507,13 @@ private Request CreateDeleteRequest(string key, string label, ETag etag) /// A controlling the request lifetime. public virtual async Task> GetAsync(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRequest(key, label, acceptDateTime)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); + scope.AddAttribute("key", key); + scope.Start(); + + try { + using Request request = CreateGetRequest(key, label, acceptDateTime); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -436,6 +524,11 @@ public virtual async Task> GetAsync(string key, s throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -447,6 +540,10 @@ public virtual async Task> GetAsync(string key, s /// A controlling the request lifetime. public virtual Response Get(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); + scope.AddAttribute(nameof(key), key); + scope.Start(); + using (Request request = CreateGetRequest(key, label, acceptDateTime)) { Response response = _pipeline.SendRequest(request, cancellationToken); @@ -508,8 +605,12 @@ private Request CreateGetRequest(string key, string label, DateTimeOffset accept /// A controlling the request lifetime. private async Task> GetSettingsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateBatchRequest(selector, pageLink)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); + scope.Start(); + + try { + using Request request = CreateBatchRequest(selector, pageLink); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) @@ -522,6 +623,11 @@ private async Task> GetSettingsPageAsync(Sett throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -531,8 +637,12 @@ private async Task> GetSettingsPageAsync(Sett /// A controlling the request lifetime. private PageResponse GetSettingsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateBatchRequest(selector, pageLink)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); + scope.Start(); + + try { + using Request request = CreateBatchRequest(selector, pageLink); Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) @@ -545,6 +655,11 @@ private PageResponse GetSettingsPage(SettingSelector selec throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } private Request CreateBatchRequest(SettingSelector selector, string pageLink) @@ -570,8 +685,12 @@ private Request CreateBatchRequest(SettingSelector selector, string pageLink) /// A controlling the request lifetime. private async Task> GetRevisionsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRevisionsRequest(selector, pageLink)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.Start(); + + try { + using Request request = CreateGetRevisionsRequest(selector, pageLink); Response response = await _pipeline.SendRequestAsync(request, cancellationToken).ConfigureAwait(false); switch (response.Status) { @@ -583,6 +702,11 @@ private async Task> GetRevisionsPageAsync(Set throw await response.CreateRequestFailedExceptionAsync().ConfigureAwait(false); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// @@ -593,8 +717,12 @@ private async Task> GetRevisionsPageAsync(Set /// A controlling the request lifetime. private PageResponse GetRevisionsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using (Request request = CreateGetRevisionsRequest(selector, pageLink)) + using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.Start(); + + try { + using Request request = CreateGetRevisionsRequest(selector, pageLink); Response response = _pipeline.SendRequest(request, cancellationToken); switch (response.Status) { @@ -606,6 +734,11 @@ private PageResponse GetRevisionsPage(SettingSelector sele throw response.CreateRequestFailedException(); } } + catch (Exception e) + { + scope.Failed(e); + throw; + } } private Request CreateGetRevisionsRequest(SettingSelector selector, string pageLink) diff --git a/sdk/core/Azure.Core/src/Azure.Core.csproj b/sdk/core/Azure.Core/src/Azure.Core.csproj index 850b4d16fcf03..319df1c858e3f 100644 --- a/sdk/core/Azure.Core/src/Azure.Core.csproj +++ b/sdk/core/Azure.Core/src/Azure.Core.csproj @@ -17,6 +17,7 @@ + diff --git a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs new file mode 100644 index 0000000000000..f2acf7185a373 --- /dev/null +++ b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics; + +namespace Azure.Core.Pipeline +{ + public struct ClientDiagnosticScope: IDisposable + { + private Activity _activity; + + private readonly string _name; + + private readonly DiagnosticListener _source; + + internal ClientDiagnosticScope(string name, DiagnosticListener source) + { + _name = name; + _source = source; + _activity = _source.IsEnabled() ? new Activity(_name) : null; + } + + public bool IsEnabled => _activity != null; + + public void AddAttribute(string name, string value) + { + _activity?.AddTag(name, value); + } + + public void AddAttribute(string name, T value, Func format) + { + if (_activity != null) + { + AddAttribute(name, format(value)); + } + } + + public void Start() + { + if (_activity != null && _source.IsEnabled(_name)) + { + _source.StartActivity(_activity, null); + } + } + + public void Dispose() + { + if (_activity == null) + { + return; + } + + if (_source != null) + { + _source.StopActivity(_activity, null); + } + else + { + _activity?.Stop(); + } + } + + public void Failed(Exception e) + { + _source?.Write(_activity.OperationName + ".Exception", e); + _activity?.Stop(); + + _activity = null; + + } + } +} diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs index 6e93a3fed3dd5..5e3433aadcbfc 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipeline.cs @@ -15,11 +15,13 @@ public class HttpPipeline private readonly ResponseClassifier _responseClassifier; private readonly ReadOnlyMemory _pipeline; - public HttpPipeline(HttpPipelineTransport transport, HttpPipelinePolicy[] policies = null, ResponseClassifier responseClassifier = null) + public HttpPipeline(HttpPipelineTransport transport, HttpPipelinePolicy[] policies = null, ResponseClassifier responseClassifier = null, ClientDiagnostics clientDiagnostics = null) { _transport = transport ?? throw new ArgumentNullException(nameof(transport)); _responseClassifier = responseClassifier ?? new ResponseClassifier(); + Diagnostics = clientDiagnostics ?? new ClientDiagnostics(true); + policies = policies ?? Array.Empty(); var all = new HttpPipelinePolicy[policies.Length + 1]; @@ -32,6 +34,8 @@ public HttpPipeline(HttpPipelineTransport transport, HttpPipelinePolicy[] polici public Request CreateRequest() => _transport.CreateRequest(); + public ClientDiagnostics Diagnostics { get; } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public async Task SendRequestAsync(Request request, CancellationToken cancellationToken) { diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineBuilder.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineBuilder.cs index e4f134f31f5f7..54e13b95d0cfd 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineBuilder.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineBuilder.cs @@ -40,9 +40,11 @@ public static HttpPipeline Build(ClientOptions options, bool bufferResponse = tr policies.Add(BufferResponsePolicy.Shared); } + policies.Add(new RequestActivityPolicy()); + policies.RemoveAll(policy => policy == null); - return new HttpPipeline(options.Transport, policies.ToArray(), options.ResponseClassifier); + return new HttpPipeline(options.Transport, policies.ToArray(), options.ResponseClassifier, new ClientDiagnostics(options.Diagnostics.IsLoggingEnabled)); } // internal for testing diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs new file mode 100644 index 0000000000000..22ec2ac9523fd --- /dev/null +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Diagnostics; + +namespace Azure.Core.Pipeline +{ + public sealed class ClientDiagnostics + { + private readonly bool _isActivityEnabled; + + public ClientDiagnostics(bool isActivityEnabled) + { + _isActivityEnabled = isActivityEnabled; + } + + private static readonly DiagnosticListener s_source = new DiagnosticListener("Azure"); + + public ClientDiagnosticScope CreateScope(string name) + { + if (!_isActivityEnabled) + { + return default; + } + return new ClientDiagnosticScope(name, s_source); + } + } +} diff --git a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs new file mode 100644 index 0000000000000..de8cace04abe8 --- /dev/null +++ b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Threading.Tasks; + +namespace Azure.Core.Pipeline.Policies +{ + internal class RequestActivityPolicy : HttpPipelinePolicy + { + public static RequestActivityPolicy Shared { get; } = new RequestActivityPolicy(); + + private static readonly DiagnosticListener s_diagnosticSource = new DiagnosticListener("Azure.Pipeline"); + + public override Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemory pipeline) + { + return ProcessAsync(message, pipeline, true); + } + + public override void Process(HttpPipelineMessage message, ReadOnlyMemory pipeline) + { + ProcessAsync(message, pipeline, false).EnsureCompleted(); + } + + private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemory pipeline, bool isAsync) + { + if (!s_diagnosticSource.IsEnabled()) + { + if (isAsync) + { + await ProcessNextAsync(message, pipeline).ConfigureAwait(false); + } + else + { + ProcessNext(message, pipeline); + } + } + + var activity = new Activity("Azure.Core.Http.Request"); + activity.AddTag("method", message.Request.Method.Method); + activity.AddTag("uri", message.Request.UriBuilder.ToString()); + + var diagnosticSourceActivityEnabled = s_diagnosticSource.IsEnabled(activity.OperationName); + + if (diagnosticSourceActivityEnabled) + { + s_diagnosticSource.StartActivity(activity, null); + } + else + { + activity.Start(); + } + + if (isAsync) + { + await ProcessNextAsync(message, pipeline).ConfigureAwait(false); + } + else + { + ProcessNext(message, pipeline); + } + + activity.AddTag("status", message.Response.Status.ToString(CultureInfo.InvariantCulture)); + + if (diagnosticSourceActivityEnabled) + { + s_diagnosticSource.StopActivity(activity, null); + } + else + { + activity.Stop(); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs new file mode 100644 index 0000000000000..2246703d1d508 --- /dev/null +++ b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using Azure.Core.Pipeline; +using NUnit.Framework; + +namespace Azure.Core.Tests +{ + public class ClientDiagnosticsTests + { + [Test] + public void CreatesActivityWithNameAndTags() + { + + using var testListener = new TestDiagnosticListener("Azure"); + ClientDiagnostics clientDiagnostics = new ClientDiagnostics(true); + + ClientDiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); + + scope.AddAttribute("Attribute1", "Value1"); + scope.AddAttribute("Attribute2", 2, i => i.ToString()); + + scope.Start(); + + KeyValuePair startEvent = testListener.Events.Dequeue(); + + Activity activity = Activity.Current; + + scope.Dispose(); + + KeyValuePair stopEvent = testListener.Events.Dequeue(); + + Assert.Null(Activity.Current); + Assert.AreEqual("ActivityName.Start", startEvent.Key); + Assert.AreEqual("ActivityName.Stop", stopEvent.Key); + + CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute1", "Value1")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute2", "2")); + } + + [Test] + public void FailedStopsActivityAndWritesExceptionEvent() + { + using var testListener = new TestDiagnosticListener("Azure"); + ClientDiagnostics clientDiagnostics = new ClientDiagnostics(true); + + ClientDiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); + + scope.AddAttribute("Attribute1", "Value1"); + scope.AddAttribute("Attribute2", 2, i => i.ToString()); + + scope.Start(); + + KeyValuePair startEvent = testListener.Events.Dequeue(); + + Activity activity = Activity.Current; + + var exception = new Exception(); + scope.Failed(exception); + scope.Dispose(); + + KeyValuePair stopEvent = testListener.Events.Dequeue(); + + Assert.Null(Activity.Current); + Assert.AreEqual("ActivityName.Start", startEvent.Key); + Assert.AreEqual("ActivityName.Exception", stopEvent.Key); + Assert.AreEqual(exception, stopEvent.Value); + Assert.AreEqual(0, testListener.Events.Count); + + CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute1", "Value1")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute2", "2")); + } + + [Test] + public void NoopsWhenDisabled() + { + ClientDiagnostics clientDiagnostics = new ClientDiagnostics(false); + ClientDiagnosticScope scope = clientDiagnostics.CreateScope(""); + + scope.AddAttribute("Attribute1", "Value1"); + scope.AddAttribute("Attribute2", 2, i => i.ToString()); + scope.Failed(new Exception()); + scope.Dispose(); + } + } +} diff --git a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs new file mode 100644 index 0000000000000..fe3b59508c80b --- /dev/null +++ b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Diagnostics; +using System.Threading.Tasks; +using Azure.Core.Pipeline.Policies; +using Azure.Core.Testing; +using NUnit.Framework; + +namespace Azure.Core.Tests +{ + public class RequestActivityPolicyTests : SyncAsyncPolicyTestBase + { + public RequestActivityPolicyTests(bool isAsync) : base(isAsync) + { + } + + [Test] + [NonParallelizable] + public async Task ActivityIsCreatedForRequest() + { + Activity activity = null; + KeyValuePair startEvent = default; + using var testListener = new TestDiagnosticListener("Azure.Pipeline"); + + MockTransport mockTransport = CreateMockTransport(request => + { + activity = Activity.Current; + startEvent = testListener.Events.Dequeue(); + return new MockResponse(201); + }); + + Task requestTask = SendGetRequest(mockTransport, RequestActivityPolicy.Shared); + + await requestTask; + + KeyValuePair stopEvent = testListener.Events.Dequeue(); + + Assert.AreEqual("Azure.Core.Http.Request.Start", startEvent.Key); + Assert.AreEqual("Azure.Core.Http.Request.Stop", stopEvent.Key); + + Assert.AreEqual("Azure.Core.Http.Request", activity.OperationName); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("status", "201")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("uri", "http://example.com/")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("method", "GET")); + } + + } +} diff --git a/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs b/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs new file mode 100644 index 0000000000000..49115c8114c06 --- /dev/null +++ b/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Azure.Core.Tests +{ + public class TestDiagnosticListener : IObserver, IObserver>, IDisposable + { + private readonly string _diagnosticSourceName; + + private readonly List _subscriptions = new List(); + + public Queue> Events { get; } = new Queue>(); + + public TestDiagnosticListener(string diagnosticSourceName) + { + _diagnosticSourceName = diagnosticSourceName; + DiagnosticListener.AllListeners.Subscribe(this); + } + + public void OnCompleted() + { + } + + public void OnError(Exception error) + { + } + + public void OnNext(KeyValuePair value) + { + Events.Enqueue(value); + } + + public void OnNext(DiagnosticListener value) + { + if (value.Name == _diagnosticSourceName) + { + _subscriptions.Add(value.Subscribe(this)); + } + } + + public void Dispose() + { + foreach (IDisposable subscription in _subscriptions) + { + subscription.Dispose(); + } + } + } +} diff --git a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncTestBase.cs index 0ac57e84ed013..b52a8db6e8c64 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncTestBase.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.IO; namespace Azure.Core.Testing @@ -22,6 +23,14 @@ protected MockTransport CreateMockTransport() }; } + protected MockTransport CreateMockTransport(Func responseFactory) + { + return new MockTransport(responseFactory) + { + ExpectSyncPipeline = !IsAsync + }; + } + protected MockTransport CreateMockTransport(params MockResponse[] responses) { return new MockTransport(responses) From 5b1f9cf5860a3551966d58f6495d2b7e3b31737c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 12 Jul 2019 14:13:52 -0700 Subject: [PATCH 06/15] Nullref --- sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs index f2acf7185a373..3a169c10d0365 100644 --- a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs +++ b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs @@ -63,6 +63,11 @@ public void Dispose() public void Failed(Exception e) { + if (_activity == null) + { + return; + } + _source?.Write(_activity.OperationName + ".Exception", e); _activity?.Stop(); From 8e289c9b1a38078d188f0ab555fc3a5606646297 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 12 Jul 2019 14:43:35 -0700 Subject: [PATCH 07/15] Don't run-em twice --- .../Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs index de8cace04abe8..473d30365f7c5 100644 --- a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs @@ -36,6 +36,8 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo { ProcessNext(message, pipeline); } + + return; } var activity = new Activity("Azure.Core.Http.Request"); From 5ae73d734a9693e9d55b63f97dcadf0bc40c3c4c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 12 Jul 2019 15:33:12 -0700 Subject: [PATCH 08/15] PR comments --- .../src/ConfigurationClient.cs | 38 +++++++++---------- .../src/Pipeline/AzureOperationScope.cs | 4 +- .../src/Pipeline/HttpPipelineDiagnostics.cs | 4 +- .../tests/ClientDiagnosticsTests.cs | 6 +-- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs index 35a4d1f32e67c..2b101ca868623 100644 --- a/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs +++ b/sdk/appconfiguration/Azure.ApplicationModel.Configuration/src/ConfigurationClient.cs @@ -92,7 +92,7 @@ public virtual Response Add(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> AddAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); scope.Start(); try @@ -123,8 +123,8 @@ public virtual async Task> AddAsync(Configuration /// A controlling the request lifetime. public virtual Response Add(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); - scope.AddAttribute("key", setting.Key); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Add"); + scope.AddAttribute("key", setting?.Key); scope.Start(); try @@ -206,8 +206,8 @@ public virtual Response Set(string key, string value, stri /// A controlling the request lifetime. public virtual async Task> SetAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); - scope.AddAttribute("key", setting.Key); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.AddAttribute("key", setting?.Key); scope.Start(); try @@ -239,8 +239,8 @@ public virtual async Task> SetAsync(Configuration /// A controlling the request lifetime. public virtual Response Set(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); - scope.AddAttribute("key", setting.Key); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + scope.AddAttribute("key", setting?.Key); scope.Start(); try @@ -326,8 +326,8 @@ public virtual Response Update(string key, string value, s /// A controlling the request lifetime. public virtual async Task> UpdateAsync(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); - scope.AddAttribute("key", setting.Key); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); + scope.AddAttribute("key", setting?.Key); scope.Start(); try @@ -357,8 +357,8 @@ public virtual async Task> UpdateAsync(Configurat /// A controlling the request lifetime. public virtual Response Update(ConfigurationSetting setting, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); - scope.AddAttribute("key", setting.Key); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Update"); + scope.AddAttribute("key", setting?.Key); scope.Start(); try @@ -420,7 +420,7 @@ private Request CreateUpdateRequest(ConfigurationSetting setting) /// A controlling the request lifetime. public virtual async Task DeleteAsync(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Delete"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Delete"); scope.AddAttribute("key", key); scope.Start(); @@ -456,7 +456,7 @@ public virtual async Task DeleteAsync(string key, string label = defau /// A controlling the request lifetime. public virtual Response Delete(string key, string label = default, ETag etag = default, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); scope.AddAttribute("key", key); scope.Start(); @@ -507,7 +507,7 @@ private Request CreateDeleteRequest(string key, string label, ETag etag) /// A controlling the request lifetime. public virtual async Task> GetAsync(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); scope.AddAttribute("key", key); scope.Start(); @@ -540,7 +540,7 @@ public virtual async Task> GetAsync(string key, s /// A controlling the request lifetime. public virtual Response Get(string key, string label = default, DateTimeOffset acceptDateTime = default, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Get"); scope.AddAttribute(nameof(key), key); scope.Start(); @@ -626,7 +626,7 @@ private Request CreateGetRequest(string key, string label, DateTimeOffset accept /// A controlling the request lifetime. private async Task> GetSettingsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); scope.Start(); try @@ -659,7 +659,7 @@ private async Task> GetSettingsPageAsync(Sett /// A controlling the request lifetime. private PageResponse GetSettingsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.GetSettingsPage"); scope.Start(); try @@ -708,7 +708,7 @@ private Request CreateBatchRequest(SettingSelector selector, string pageLink) /// A controlling the request lifetime. private async Task> GetRevisionsPageAsync(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); scope.Start(); try @@ -741,7 +741,7 @@ private async Task> GetRevisionsPageAsync(Set /// A controlling the request lifetime. private PageResponse GetRevisionsPage(SettingSelector selector, string pageLink, CancellationToken cancellationToken = default) { - using ClientDiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); + using DiagnosticScope scope = _pipeline.Diagnostics.CreateScope("ConfigurationClient.Set"); scope.Start(); try diff --git a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs index 3a169c10d0365..d5deccd6259f6 100644 --- a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs +++ b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs @@ -6,7 +6,7 @@ namespace Azure.Core.Pipeline { - public struct ClientDiagnosticScope: IDisposable + public struct DiagnosticScope: IDisposable { private Activity _activity; @@ -14,7 +14,7 @@ public struct ClientDiagnosticScope: IDisposable private readonly DiagnosticListener _source; - internal ClientDiagnosticScope(string name, DiagnosticListener source) + internal DiagnosticScope(string name, DiagnosticListener source) { _name = name; _source = source; diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs index 22ec2ac9523fd..ee31da205d8a7 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs @@ -16,13 +16,13 @@ public ClientDiagnostics(bool isActivityEnabled) private static readonly DiagnosticListener s_source = new DiagnosticListener("Azure"); - public ClientDiagnosticScope CreateScope(string name) + public DiagnosticScope CreateScope(string name) { if (!_isActivityEnabled) { return default; } - return new ClientDiagnosticScope(name, s_source); + return new DiagnosticScope(name, s_source); } } } diff --git a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs index 2246703d1d508..0118d5c215cd9 100644 --- a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs +++ b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs @@ -18,7 +18,7 @@ public void CreatesActivityWithNameAndTags() using var testListener = new TestDiagnosticListener("Azure"); ClientDiagnostics clientDiagnostics = new ClientDiagnostics(true); - ClientDiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); + DiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); scope.AddAttribute("Attribute1", "Value1"); scope.AddAttribute("Attribute2", 2, i => i.ToString()); @@ -47,7 +47,7 @@ public void FailedStopsActivityAndWritesExceptionEvent() using var testListener = new TestDiagnosticListener("Azure"); ClientDiagnostics clientDiagnostics = new ClientDiagnostics(true); - ClientDiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); + DiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); scope.AddAttribute("Attribute1", "Value1"); scope.AddAttribute("Attribute2", 2, i => i.ToString()); @@ -78,7 +78,7 @@ public void FailedStopsActivityAndWritesExceptionEvent() public void NoopsWhenDisabled() { ClientDiagnostics clientDiagnostics = new ClientDiagnostics(false); - ClientDiagnosticScope scope = clientDiagnostics.CreateScope(""); + DiagnosticScope scope = clientDiagnostics.CreateScope(""); scope.AddAttribute("Attribute1", "Value1"); scope.AddAttribute("Attribute2", 2, i => i.ToString()); From 8bbb2cf421e41542703387fd9216748c752683f6 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 12 Jul 2019 15:44:32 -0700 Subject: [PATCH 09/15] Nice overload --- sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs | 8 ++++++++ sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs | 2 ++ 2 files changed, 10 insertions(+) diff --git a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs index d5deccd6259f6..187044fc7b4c2 100644 --- a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs +++ b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs @@ -28,6 +28,14 @@ public void AddAttribute(string name, string value) _activity?.AddTag(name, value); } + public void AddAttribute(string name, T value) + { + if (_activity != null) + { + AddAttribute(name, value, t => t.ToString()); + } + } + public void AddAttribute(string name, T value, Func format) { if (_activity != null) diff --git a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs index 0118d5c215cd9..f741c4767d4c5 100644 --- a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs +++ b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs @@ -22,6 +22,7 @@ public void CreatesActivityWithNameAndTags() scope.AddAttribute("Attribute1", "Value1"); scope.AddAttribute("Attribute2", 2, i => i.ToString()); + scope.AddAttribute("Attribute3", 3); scope.Start(); @@ -39,6 +40,7 @@ public void CreatesActivityWithNameAndTags() CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute1", "Value1")); CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute2", "2")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("Attribute3", "3")); } [Test] From 0bc381ed0b3e4a1f67ea1a35ea18e02340481d2e Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 12 Jul 2019 15:54:41 -0700 Subject: [PATCH 10/15] Ted is right --- sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs index 187044fc7b4c2..bf6c61b3d1b4f 100644 --- a/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs +++ b/sdk/core/Azure.Core/src/Pipeline/AzureOperationScope.cs @@ -32,7 +32,7 @@ public void AddAttribute(string name, T value) { if (_activity != null) { - AddAttribute(name, value, t => t.ToString()); + AddAttribute(name, value.ToString()); } } From 09a62cb54d9fdade500dbd70223fa1d53211b505 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 15 Jul 2019 11:21:30 -0700 Subject: [PATCH 11/15] New Http fields --- .../Policies/RequestActivityPolicy.cs | 10 +++++++--- .../tests/RequestActivityPolicyTests.cs | 20 +++++++++++++------ .../TestFramework/SyncAsyncPolicyTestBase.cs | 19 +++++++++++------- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs index 473d30365f7c5..98f9c58c31d63 100644 --- a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs @@ -41,8 +41,12 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo } var activity = new Activity("Azure.Core.Http.Request"); - activity.AddTag("method", message.Request.Method.Method); - activity.AddTag("uri", message.Request.UriBuilder.ToString()); + activity.AddTag("http.method", message.Request.Method.Method); + activity.AddTag("http.url", message.Request.UriBuilder.ToString()); + if (message.Request.Headers.TryGetValue("User-Agent", out string userAgent)) + { + activity.AddTag("http.user_agent", userAgent); + } var diagnosticSourceActivityEnabled = s_diagnosticSource.IsEnabled(activity.OperationName); @@ -64,7 +68,7 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo ProcessNext(message, pipeline); } - activity.AddTag("status", message.Response.Status.ToString(CultureInfo.InvariantCulture)); + activity.AddTag("http.status_code", message.Response.Status.ToString(CultureInfo.InvariantCulture)); if (diagnosticSourceActivityEnabled) { diff --git a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs index fe3b59508c80b..d7d0b7f95c5e1 100644 --- a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs +++ b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading.Tasks; +using Azure.Core.Http; +using Azure.Core.Pipeline; using Azure.Core.Pipeline.Policies; using Azure.Core.Testing; using NUnit.Framework; @@ -24,14 +27,19 @@ public async Task ActivityIsCreatedForRequest() KeyValuePair startEvent = default; using var testListener = new TestDiagnosticListener("Azure.Pipeline"); - MockTransport mockTransport = CreateMockTransport(request => + MockTransport mockTransport = CreateMockTransport(_ => { activity = Activity.Current; startEvent = testListener.Events.Dequeue(); return new MockResponse(201); }); - Task requestTask = SendGetRequest(mockTransport, RequestActivityPolicy.Shared); + using Request request = mockTransport.CreateRequest(); + request.Method = RequestMethod.Get; + request.UriBuilder.Uri = new Uri("http://example.com"); + request.Headers.Add("User-Agent", "agent"); + + Task requestTask = SendRequestAsync(mockTransport, request, RequestActivityPolicy.Shared); await requestTask; @@ -41,10 +49,10 @@ public async Task ActivityIsCreatedForRequest() Assert.AreEqual("Azure.Core.Http.Request.Stop", stopEvent.Key); Assert.AreEqual("Azure.Core.Http.Request", activity.OperationName); - CollectionAssert.Contains(activity.Tags, new KeyValuePair("status", "201")); - CollectionAssert.Contains(activity.Tags, new KeyValuePair("uri", "http://example.com/")); - CollectionAssert.Contains(activity.Tags, new KeyValuePair("method", "GET")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.status_code", "201")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.url", "http://example.com/")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.method", "GET")); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.user_agent", "agent")); } - } } diff --git a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs index ef74ff10fbd20..7833d10c2f6ba 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs @@ -23,17 +23,22 @@ protected Task SendRequestAsync(HttpPipeline pipeline, Request request return IsAsync ? pipeline.SendRequestAsync(request, cancellationToken) : Task.FromResult(pipeline.SendRequest(request, cancellationToken)); } + protected async Task SendRequestAsync(HttpPipelineTransport transport, Request request, HttpPipelinePolicy policy, ResponseClassifier responseClassifier = null) + { + await Task.Yield(); + + var pipeline = new HttpPipeline(transport, new [] { policy }); + return await SendRequestAsync(pipeline, request, CancellationToken.None); + } + protected async Task SendGetRequest(HttpPipelineTransport transport, HttpPipelinePolicy policy, ResponseClassifier responseClassifier = null) { await Task.Yield(); - using (Request request = transport.CreateRequest()) - { - request.Method = RequestMethod.Get; - request.UriBuilder.Uri = new Uri("http://example.com"); - var pipeline = new HttpPipeline(transport, new [] { policy }, responseClassifier); - return await SendRequestAsync(pipeline, request, CancellationToken.None); - } + using Request request = transport.CreateRequest(); + request.Method = RequestMethod.Get; + request.UriBuilder.Uri = new Uri("http://example.com"); + return await SendRequestAsync(transport, request, policy, responseClassifier); } } } From ecd1c1ae7b272ea030ac24455459b92b4c59674d Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 15 Jul 2019 11:47:27 -0700 Subject: [PATCH 12/15] Remove extra yield --- .../Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs index 7833d10c2f6ba..3352abc372b3f 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs @@ -33,8 +33,6 @@ protected async Task SendRequestAsync(HttpPipelineTransport transport, protected async Task SendGetRequest(HttpPipelineTransport transport, HttpPipelinePolicy policy, ResponseClassifier responseClassifier = null) { - await Task.Yield(); - using Request request = transport.CreateRequest(); request.Method = RequestMethod.Get; request.UriBuilder.Uri = new Uri("http://example.com"); From c48c7d4f9731d55fb5ce6346d159cd7dc4fb8d18 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 15 Jul 2019 12:16:10 -0700 Subject: [PATCH 13/15] Real fix --- .../Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs index 3352abc372b3f..eb88f7f029170 100644 --- a/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs +++ b/sdk/core/Azure.Core/tests/TestFramework/SyncAsyncPolicyTestBase.cs @@ -27,7 +27,7 @@ protected async Task SendRequestAsync(HttpPipelineTransport transport, { await Task.Yield(); - var pipeline = new HttpPipeline(transport, new [] { policy }); + var pipeline = new HttpPipeline(transport, new [] { policy }, responseClassifier); return await SendRequestAsync(pipeline, request, CancellationToken.None); } From c63ec21c86340b46d605cc31e5afc55c18d9d7d7 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 15 Jul 2019 14:15:59 -0700 Subject: [PATCH 14/15] Some PR Comments --- eng/Packages.Data.props | 11 ++-- .../src/Pipeline/HttpPipelineDiagnostics.cs | 2 +- .../Policies/RequestActivityPolicy.cs | 52 +++++++++++++++---- .../tests/ClientDiagnosticsTests.cs | 4 +- .../tests/RequestActivityPolicyTests.cs | 50 ++++++++++++++++++ .../tests/TestDiagnosticListener.cs | 10 +++- 6 files changed, 113 insertions(+), 16 deletions(-) diff --git a/eng/Packages.Data.props b/eng/Packages.Data.props index bbe48c3f04a9e..2d56ef86f70f9 100755 --- a/eng/Packages.Data.props +++ b/eng/Packages.Data.props @@ -31,7 +31,6 @@ - @@ -81,7 +80,6 @@ - @@ -95,7 +93,6 @@ - @@ -103,4 +100,12 @@ + + + + + + + + \ No newline at end of file diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs index ee31da205d8a7..a3370a3eba238 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelineDiagnostics.cs @@ -14,7 +14,7 @@ public ClientDiagnostics(bool isActivityEnabled) _isActivityEnabled = isActivityEnabled; } - private static readonly DiagnosticListener s_source = new DiagnosticListener("Azure"); + private static readonly DiagnosticListener s_source = new DiagnosticListener("Azure.Clients"); public DiagnosticScope CreateScope(string name) { diff --git a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs index 98f9c58c31d63..33ef3aec80650 100644 --- a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs @@ -10,6 +10,10 @@ namespace Azure.Core.Pipeline.Policies { internal class RequestActivityPolicy : HttpPipelinePolicy { + private const string TraceParentHeaderName = "traceparent"; + private const string TraceStateHeaderName = "tracestate"; + private const string RequestIdHeaderName = "Request-Id"; + public static RequestActivityPolicy Shared { get; } = new RequestActivityPolicy(); private static readonly DiagnosticListener s_diagnosticSource = new DiagnosticListener("Azure.Pipeline"); @@ -28,14 +32,7 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo { if (!s_diagnosticSource.IsEnabled()) { - if (isAsync) - { - await ProcessNextAsync(message, pipeline).ConfigureAwait(false); - } - else - { - ProcessNext(message, pipeline); - } + await ProcessNextAsync(message, pipeline, isAsync).ConfigureAwait(false); return; } @@ -48,7 +45,7 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo activity.AddTag("http.user_agent", userAgent); } - var diagnosticSourceActivityEnabled = s_diagnosticSource.IsEnabled(activity.OperationName); + var diagnosticSourceActivityEnabled = s_diagnosticSource.IsEnabled(activity.OperationName, message.Request); if (diagnosticSourceActivityEnabled) { @@ -59,6 +56,7 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo activity.Start(); } + if (isAsync) { await ProcessNextAsync(message, pipeline).ConfigureAwait(false); @@ -79,5 +77,41 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo activity.Stop(); } } + + private static async Task ProcessNextAsync(HttpPipelineMessage message, ReadOnlyMemory pipeline, bool isAsync) + { + var currentActivity = Activity.Current; + + if (currentActivity != null) + { + if (currentActivity.IdFormat == ActivityIdFormat.W3C) + { + if (!message.Request.Headers.Contains(TraceParentHeaderName)) + { + message.Request.Headers.Add(TraceParentHeaderName, currentActivity.Id); + if (currentActivity.TraceStateString != null) + { + message.Request.Headers.Add(TraceStateHeaderName, currentActivity.TraceStateString); + } + } + } + else + { + if (!message.Request.Headers.Contains(RequestIdHeaderName)) + { + message.Request.Headers.Add(RequestIdHeaderName, currentActivity.Id); + } + } + } + + if (isAsync) + { + await ProcessNextAsync(message, pipeline).ConfigureAwait(false); + } + else + { + ProcessNext(message, pipeline); + } + } } } diff --git a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs index f741c4767d4c5..2bfeb7a8828b8 100644 --- a/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs +++ b/sdk/core/Azure.Core/tests/ClientDiagnosticsTests.cs @@ -15,7 +15,7 @@ public class ClientDiagnosticsTests public void CreatesActivityWithNameAndTags() { - using var testListener = new TestDiagnosticListener("Azure"); + using var testListener = new TestDiagnosticListener("Azure.Clients"); ClientDiagnostics clientDiagnostics = new ClientDiagnostics(true); DiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); @@ -46,7 +46,7 @@ public void CreatesActivityWithNameAndTags() [Test] public void FailedStopsActivityAndWritesExceptionEvent() { - using var testListener = new TestDiagnosticListener("Azure"); + using var testListener = new TestDiagnosticListener("Azure.Clients"); ClientDiagnostics clientDiagnostics = new ClientDiagnostics(true); DiagnosticScope scope = clientDiagnostics.CreateScope("ActivityName"); diff --git a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs index d7d0b7f95c5e1..49b23730c5b70 100644 --- a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs +++ b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs @@ -49,10 +49,60 @@ public async Task ActivityIsCreatedForRequest() Assert.AreEqual("Azure.Core.Http.Request.Stop", stopEvent.Key); Assert.AreEqual("Azure.Core.Http.Request", activity.OperationName); + CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.status_code", "201")); CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.url", "http://example.com/")); CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.method", "GET")); CollectionAssert.Contains(activity.Tags, new KeyValuePair("http.user_agent", "agent")); } + + [Test] + [NonParallelizable] + public async Task CurrentActivityIsInjectedIntoRequest() + { + var transport = new MockTransport(new MockResponse(200)); + + var activity = new Activity("Dummy"); + + activity.Start(); + + await SendGetRequest(transport, RequestActivityPolicy.Shared); + + activity.Stop(); + + Assert.True(transport.SingleRequest.TryGetHeader("Request-Id", out string requestId)); + Assert.AreEqual(activity.Id, requestId); + } + + [Test] + [NonParallelizable] + public async Task CurrentActivityIsInjectedIntoRequestW3C() + { + var previousFormat = Activity.DefaultIdFormat; + Activity.DefaultIdFormat = ActivityIdFormat.W3C; + try + { + var transport = new MockTransport(new MockResponse(200)); + + var activity = new Activity("Dummy"); + + activity.Start(); + activity.TraceStateString = "trace"; + + await SendGetRequest(transport, RequestActivityPolicy.Shared); + + activity.Stop(); + + Assert.True(transport.SingleRequest.TryGetHeader("traceparent", out string requestId)); + Assert.AreEqual(activity.Id, requestId); + + Assert.True(transport.SingleRequest.TryGetHeader("tracestate", out string traceState)); + Assert.AreEqual("trace", traceState); + } + finally + { + Activity.DefaultIdFormat = previousFormat; + } + } } } diff --git a/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs b/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs index 49115c8114c06..1c42a40913db4 100644 --- a/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs +++ b/sdk/core/Azure.Core/tests/TestDiagnosticListener.cs @@ -15,6 +15,8 @@ public class TestDiagnosticListener : IObserver, IObserver> Events { get; } = new Queue>(); + public Queue<(string, object, object)> IsEnabledCalls { get; } = new Queue<(string, object, object)>(); + public TestDiagnosticListener(string diagnosticSourceName) { _diagnosticSourceName = diagnosticSourceName; @@ -38,10 +40,16 @@ public void OnNext(DiagnosticListener value) { if (value.Name == _diagnosticSourceName) { - _subscriptions.Add(value.Subscribe(this)); + _subscriptions.Add(value.Subscribe(this, IsEnabled)); } } + private bool IsEnabled(string arg1, object arg2, object arg3) + { + IsEnabledCalls.Enqueue((arg1, arg2, arg3)); + return true; + } + public void Dispose() { foreach (IDisposable subscription in _subscriptions) From 5ed43bb25056b9b0e778b872c973d8aeb54dbe6c Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 15 Jul 2019 14:34:16 -0700 Subject: [PATCH 15/15] Pass the message in --- .../Policies/RequestActivityPolicy.cs | 6 ++--- .../tests/RequestActivityPolicyTests.cs | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs index 33ef3aec80650..958483f2e9067 100644 --- a/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/Policies/RequestActivityPolicy.cs @@ -45,11 +45,11 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo activity.AddTag("http.user_agent", userAgent); } - var diagnosticSourceActivityEnabled = s_diagnosticSource.IsEnabled(activity.OperationName, message.Request); + var diagnosticSourceActivityEnabled = s_diagnosticSource.IsEnabled(activity.OperationName, message); if (diagnosticSourceActivityEnabled) { - s_diagnosticSource.StartActivity(activity, null); + s_diagnosticSource.StartActivity(activity, message); } else { @@ -70,7 +70,7 @@ private static async Task ProcessAsync(HttpPipelineMessage message, ReadOnlyMemo if (diagnosticSourceActivityEnabled) { - s_diagnosticSource.StopActivity(activity, null); + s_diagnosticSource.StopActivity(activity, message); } else { diff --git a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs index 49b23730c5b70..7de97844d65d3 100644 --- a/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs +++ b/sdk/core/Azure.Core/tests/RequestActivityPolicyTests.cs @@ -104,5 +104,30 @@ public async Task CurrentActivityIsInjectedIntoRequestW3C() Activity.DefaultIdFormat = previousFormat; } } + + [Test] + [NonParallelizable] + public async Task PassesMessageIntoIsEnabledStartAndStopEvents() + { + using var testListener = new TestDiagnosticListener("Azure.Pipeline"); + + var transport = new MockTransport(new MockResponse(200)); + + await SendGetRequest(transport, RequestActivityPolicy.Shared); + + KeyValuePair startEvent = testListener.Events.Dequeue(); + KeyValuePair stopEvent = testListener.Events.Dequeue(); + var isEnabledCall = testListener.IsEnabledCalls.Dequeue(); + + Assert.AreEqual("Azure.Core.Http.Request.Start", startEvent.Key); + Assert.IsInstanceOf(startEvent.Value); + + Assert.AreEqual("Azure.Core.Http.Request.Stop", stopEvent.Key); + Assert.IsInstanceOf(stopEvent.Value); + + Assert.AreEqual("Azure.Core.Http.Request", isEnabledCall.Item1); + Assert.IsInstanceOf(isEnabledCall.Item2); + } + } }