Merge pull request #507 from pakrym/pakrym/filter-standard-headers
Filter well known headers
This commit is contained in:
Коммит
60f66f4b30
|
@ -18,7 +18,6 @@ namespace AppConfiguration
|
|||
_response = response;
|
||||
}
|
||||
public string SyncToken => _response.Headers.TryGetValue("Sync-Token", out string value) ? value : null;
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
public string LastModified => _response.Headers.TryGetValue("Last-Modified", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,5 @@ namespace AppConfiguration
|
|||
_response = response;
|
||||
}
|
||||
public string SyncToken => _response.Headers.TryGetValue("Sync-Token", out string value) ? value : null;
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,5 @@ namespace AppConfiguration
|
|||
_response = response;
|
||||
}
|
||||
public string SyncToken => _response.Headers.TryGetValue("Sync-Token", out string value) ? value : null;
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,6 @@ namespace AppConfiguration
|
|||
_response = response;
|
||||
}
|
||||
public string SyncToken => _response.Headers.TryGetValue("Sync-Token", out string value) ? value : null;
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
public string LastModified => _response.Headers.TryGetValue("Last-Modified", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,5 @@ namespace AppConfiguration
|
|||
_response = response;
|
||||
}
|
||||
public string SyncToken => _response.Headers.TryGetValue("Sync-Token", out string value) ? value : null;
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,5 @@ namespace AppConfiguration
|
|||
_response = response;
|
||||
}
|
||||
public string SyncToken => _response.Headers.TryGetValue("Sync-Token", out string value) ? value : null;
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -881,7 +881,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob container. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public async ValueTask<ResponseWithHeaders<ImmutabilityPolicy, CreateOrUpdateImmutabilityPolicyHeaders>> CreateOrUpdateImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
public async ValueTask<Response<ImmutabilityPolicy>> CreateOrUpdateImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -908,8 +908,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new CreateOrUpdateImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw await clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
|
||||
|
@ -928,7 +927,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob container. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public ResponseWithHeaders<ImmutabilityPolicy, CreateOrUpdateImmutabilityPolicyHeaders> CreateOrUpdateImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
public Response<ImmutabilityPolicy> CreateOrUpdateImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -955,8 +954,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = JsonDocument.Parse(message.Response.ContentStream);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new CreateOrUpdateImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw clientDiagnostics.CreateRequestFailedException(message.Response);
|
||||
|
@ -999,7 +997,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="containerName"> The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
|
||||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public async ValueTask<ResponseWithHeaders<ImmutabilityPolicy, GetImmutabilityPolicyHeaders>> GetImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
public async ValueTask<Response<ImmutabilityPolicy>> GetImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1026,8 +1024,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new GetImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw await clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
|
||||
|
@ -1045,7 +1042,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="containerName"> The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
|
||||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public ResponseWithHeaders<ImmutabilityPolicy, GetImmutabilityPolicyHeaders> GetImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
public Response<ImmutabilityPolicy> GetImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1072,8 +1069,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = JsonDocument.Parse(message.Response.ContentStream);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new GetImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw clientDiagnostics.CreateRequestFailedException(message.Response);
|
||||
|
@ -1113,7 +1109,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="containerName"> The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
|
||||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public async ValueTask<ResponseWithHeaders<ImmutabilityPolicy, DeleteImmutabilityPolicyHeaders>> DeleteImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
public async ValueTask<Response<ImmutabilityPolicy>> DeleteImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1144,8 +1140,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new DeleteImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw await clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
|
||||
|
@ -1163,7 +1158,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="containerName"> The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
|
||||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public ResponseWithHeaders<ImmutabilityPolicy, DeleteImmutabilityPolicyHeaders> DeleteImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
public Response<ImmutabilityPolicy> DeleteImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1194,8 +1189,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = JsonDocument.Parse(message.Response.ContentStream);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new DeleteImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw clientDiagnostics.CreateRequestFailedException(message.Response);
|
||||
|
@ -1234,7 +1228,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="containerName"> The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
|
||||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public async ValueTask<ResponseWithHeaders<ImmutabilityPolicy, LockImmutabilityPolicyHeaders>> LockImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
public async ValueTask<Response<ImmutabilityPolicy>> LockImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1265,8 +1259,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new LockImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw await clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
|
||||
|
@ -1284,7 +1277,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="containerName"> The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. </param>
|
||||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public ResponseWithHeaders<ImmutabilityPolicy, LockImmutabilityPolicyHeaders> LockImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
public Response<ImmutabilityPolicy> LockImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1315,8 +1308,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = JsonDocument.Parse(message.Response.ContentStream);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new LockImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw clientDiagnostics.CreateRequestFailedException(message.Response);
|
||||
|
@ -1360,7 +1352,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob container. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public async ValueTask<ResponseWithHeaders<ImmutabilityPolicy, ExtendImmutabilityPolicyHeaders>> ExtendImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
public async ValueTask<Response<ImmutabilityPolicy>> ExtendImmutabilityPolicyAsync(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1391,8 +1383,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new ExtendImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw await clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false);
|
||||
|
@ -1411,7 +1402,7 @@ namespace Azure.Storage.Management
|
|||
/// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. </param>
|
||||
/// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob container. </param>
|
||||
/// <param name="cancellationToken"> The cancellation token to use. </param>
|
||||
public ResponseWithHeaders<ImmutabilityPolicy, ExtendImmutabilityPolicyHeaders> ExtendImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
public Response<ImmutabilityPolicy> ExtendImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string ifMatch, ImmutabilityPolicy parameters, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (resourceGroupName == null)
|
||||
{
|
||||
|
@ -1442,8 +1433,7 @@ namespace Azure.Storage.Management
|
|||
{
|
||||
using var document = JsonDocument.Parse(message.Response.ContentStream);
|
||||
var value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
|
||||
var headers = new ExtendImmutabilityPolicyHeaders(message.Response);
|
||||
return ResponseWithHeaders.FromValue(value, headers, message.Response);
|
||||
return Response.FromValue(value, message.Response);
|
||||
}
|
||||
default:
|
||||
throw clientDiagnostics.CreateRequestFailedException(message.Response);
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
namespace Azure.Storage.Management
|
||||
{
|
||||
internal class CreateOrUpdateImmutabilityPolicyHeaders
|
||||
{
|
||||
private readonly Response _response;
|
||||
public CreateOrUpdateImmutabilityPolicyHeaders(Response response)
|
||||
{
|
||||
_response = response;
|
||||
}
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
namespace Azure.Storage.Management
|
||||
{
|
||||
internal class DeleteImmutabilityPolicyHeaders
|
||||
{
|
||||
private readonly Response _response;
|
||||
public DeleteImmutabilityPolicyHeaders(Response response)
|
||||
{
|
||||
_response = response;
|
||||
}
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
namespace Azure.Storage.Management
|
||||
{
|
||||
internal class ExtendImmutabilityPolicyHeaders
|
||||
{
|
||||
private readonly Response _response;
|
||||
public ExtendImmutabilityPolicyHeaders(Response response)
|
||||
{
|
||||
_response = response;
|
||||
}
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
namespace Azure.Storage.Management
|
||||
{
|
||||
internal class GetImmutabilityPolicyHeaders
|
||||
{
|
||||
private readonly Response _response;
|
||||
public GetImmutabilityPolicyHeaders(Response response)
|
||||
{
|
||||
_response = response;
|
||||
}
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
// <auto-generated/>
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
namespace Azure.Storage.Management
|
||||
{
|
||||
internal class LockImmutabilityPolicyHeaders
|
||||
{
|
||||
private readonly Response _response;
|
||||
public LockImmutabilityPolicyHeaders(Response response)
|
||||
{
|
||||
_response = response;
|
||||
}
|
||||
public string ETag => _response.Headers.TryGetValue("ETag", out string value) ? value : null;
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,10 +17,7 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
public string XMsContinuationNextTableName => _response.Headers.TryGetValue("x-ms-continuation-NextTableName", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,10 +17,7 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
public string XMsContinuationNextTableName => _response.Headers.TryGetValue("x-ms-continuation-NextTableName", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,10 +17,7 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
public string XMsContinuationNextTableName => _response.Headers.TryGetValue("x-ms-continuation-NextTableName", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using Azure;
|
||||
using Azure.Core;
|
||||
|
||||
|
@ -18,9 +17,6 @@ namespace Azure.Storage.Tables
|
|||
{
|
||||
_response = response;
|
||||
}
|
||||
public string XMsClientRequestId => _response.Headers.TryGetValue("x-ms-client-request-id", out string value) ? value : null;
|
||||
public string XMsRequestId => _response.Headers.TryGetValue("x-ms-request-id", out string value) ? value : null;
|
||||
public string XMsVersion => _response.Headers.TryGetValue("x-ms-version", out string value) ? value : null;
|
||||
public DateTimeOffset? Date => _response.Headers.TryGetValue("Date", out DateTimeOffset? value) ? value : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,13 @@ namespace AutoRest.CSharp.V3.Output.Builders
|
|||
{
|
||||
internal class ClientBuilder
|
||||
{
|
||||
private static string[] _knownResponseHeaders = new[]
|
||||
{
|
||||
"Date",
|
||||
"ETag",
|
||||
"x-ms-client-request-id",
|
||||
"x-ms-request-id"
|
||||
};
|
||||
private readonly BuildContext _context;
|
||||
private readonly SerializationBuilder _serializationBuilder;
|
||||
private readonly TypeFactory _typeFactory;
|
||||
|
@ -408,7 +415,15 @@ namespace AutoRest.CSharp.V3.Output.Builders
|
|||
|
||||
private ResponseHeaderGroupType? BuildResponseHeaderModel(Operation operation, HttpResponse? httpResponse)
|
||||
{
|
||||
if (httpResponse == null || !httpResponse.Headers.Any())
|
||||
if (httpResponse == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var httpResponseHeaders = httpResponse.Headers
|
||||
.Where(h => !_knownResponseHeaders.Contains(h.Header, StringComparer.InvariantCultureIgnoreCase))
|
||||
.ToArray();
|
||||
|
||||
if (!httpResponseHeaders.Any())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -421,7 +436,7 @@ namespace AutoRest.CSharp.V3.Output.Builders
|
|||
return new ResponseHeaderGroupType(
|
||||
BuilderHelpers.CreateTypeAttributes(operationName + "Headers", _context.DefaultNamespace, "internal"),
|
||||
$"Header model for {operationName}",
|
||||
httpResponse.Headers.Select(CreateResponseHeader).ToArray()
|
||||
httpResponseHeaders.Select(CreateResponseHeader).ToArray()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче