<PackageReference Include="Azure.Storage.Blobs" Version="12.24.1" />

BlockBlobRestClient

using Azure.Core; using Azure.Core.Pipeline; using Azure.Storage.Blobs.Models; using System; using System.Collections.Generic; using System.IO; using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using System.Xml.Linq; namespace Azure.Storage.Blobs { internal class BlockBlobRestClient { private readonly HttpPipeline _pipeline; private readonly string _url; private readonly string _version; internal ClientDiagnostics ClientDiagnostics { get; } public BlockBlobRestClient(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string url, string version) { if (clientDiagnostics == null) throw new ArgumentNullException("clientDiagnostics"); ClientDiagnostics = clientDiagnostics; if (pipeline == null) throw new ArgumentNullException("pipeline"); _pipeline = pipeline; if (url == null) throw new ArgumentNullException("url"); _url = url; if (version == null) throw new ArgumentNullException("version"); _version = version; } internal HttpMessage CreateUploadRequest(long contentLength, Stream body, int? timeout, byte[] transactionalContentMD5, string blobContentType, string blobContentEncoding, string blobContentLanguage, byte[] blobContentMD5, string blobCacheControl, IDictionary<string, string> metadata, string leaseId, string blobContentDisposition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, AccessTier? tier, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string blobTagsString, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode, bool? legalHold, byte[] transactionalContentCrc64, string structuredBodyType, long? structuredContentLength) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-blob-type", "BlockBlob"); if (blobContentType != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-type", blobContentType); } if (blobContentEncoding != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-encoding", blobContentEncoding); } if (blobContentLanguage != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-language", blobContentLanguage); } if (blobContentMD5 != null) val2.get_Headers().Add("x-ms-blob-content-md5", blobContentMD5, "D"); if (blobCacheControl != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-cache-control", blobCacheControl); } if (metadata != null) val2.get_Headers().Add("x-ms-meta-", metadata); if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (blobContentDisposition != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-disposition", blobContentDisposition); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (tier.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-access-tier", tier.Value.ToString()); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (blobTagsString != null) { headers = val2.get_Headers(); headers.Add("x-ms-tags", blobTagsString); } if (immutabilityPolicyExpiry.HasValue) val2.get_Headers().Add("x-ms-immutability-policy-until-date", immutabilityPolicyExpiry.Value, "R"); if (immutabilityPolicyMode.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-immutability-policy-mode", immutabilityPolicyMode.Value.ToSerialString()); } if (legalHold.HasValue) val2.get_Headers().Add("x-ms-legal-hold", legalHold.Value); if (transactionalContentCrc64 != null) val2.get_Headers().Add("x-ms-content-crc64", transactionalContentCrc64, "D"); if (structuredBodyType != null) { headers = val2.get_Headers(); headers.Add("x-ms-structured-body", structuredBodyType); } if (structuredContentLength.HasValue) val2.get_Headers().Add("x-ms-structured-content-length", structuredContentLength.Value); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); if (transactionalContentMD5 != null) val2.get_Headers().Add("Content-MD5", transactionalContentMD5, "D"); val2.get_Headers().Add("Content-Length", contentLength); headers = val2.get_Headers(); headers.Add("Content-Type", "application/octet-stream"); val2.set_Content(RequestContent.Create(body)); return val; } [AsyncStateMachine(typeof(<UploadAsync>d__8))] public Task<ResponseWithHeaders<BlockBlobUploadHeaders>> UploadAsync(long contentLength, Stream body, int? timeout = default(int?), byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, AccessTier? tier = default(AccessTier?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = default(DateTimeOffset?), BlobImmutabilityPolicyMode? immutabilityPolicyMode = default(BlobImmutabilityPolicyMode?), bool? legalHold = default(bool?), byte[] transactionalContentCrc64 = null, string structuredBodyType = null, long? structuredContentLength = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { <UploadAsync>d__8 stateMachine = default(<UploadAsync>d__8); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<BlockBlobUploadHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.contentLength = contentLength; stateMachine.body = body; stateMachine.timeout = timeout; stateMachine.transactionalContentMD5 = transactionalContentMD5; stateMachine.blobContentType = blobContentType; stateMachine.blobContentEncoding = blobContentEncoding; stateMachine.blobContentLanguage = blobContentLanguage; stateMachine.blobContentMD5 = blobContentMD5; stateMachine.blobCacheControl = blobCacheControl; stateMachine.metadata = metadata; stateMachine.leaseId = leaseId; stateMachine.blobContentDisposition = blobContentDisposition; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.tier = tier; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.blobTagsString = blobTagsString; stateMachine.immutabilityPolicyExpiry = immutabilityPolicyExpiry; stateMachine.immutabilityPolicyMode = immutabilityPolicyMode; stateMachine.legalHold = legalHold; stateMachine.transactionalContentCrc64 = transactionalContentCrc64; stateMachine.structuredBodyType = structuredBodyType; stateMachine.structuredContentLength = structuredContentLength; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<BlockBlobUploadHeaders> Upload(long contentLength, Stream body, int? timeout = default(int?), byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, AccessTier? tier = default(AccessTier?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = default(DateTimeOffset?), BlobImmutabilityPolicyMode? immutabilityPolicyMode = default(BlobImmutabilityPolicyMode?), bool? legalHold = default(bool?), byte[] transactionalContentCrc64 = null, string structuredBodyType = null, long? structuredContentLength = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { if (body != null) { HttpMessage val = CreateUploadRequest(contentLength, body, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold, transactionalContentCrc64, structuredBodyType, structuredContentLength); try { _pipeline.Send(val, cancellationToken); BlockBlobUploadHeaders headers = new BlockBlobUploadHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("body"); } internal HttpMessage CreatePutBlobFromUrlRequest(long contentLength, string copySource, int? timeout, byte[] transactionalContentMD5, string blobContentType, string blobContentEncoding, string blobContentLanguage, byte[] blobContentMD5, string blobCacheControl, IDictionary<string, string> metadata, string leaseId, string blobContentDisposition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, AccessTier? tier, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, DateTimeOffset? sourceIfModifiedSince, DateTimeOffset? sourceIfUnmodifiedSince, string sourceIfMatch, string sourceIfNoneMatch, string sourceIfTags, byte[] sourceContentMD5, string blobTagsString, bool? copySourceBlobProperties, string copySourceAuthorization, BlobCopySourceTagsMode? copySourceTags) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-blob-type", "BlockBlob"); if (blobContentType != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-type", blobContentType); } if (blobContentEncoding != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-encoding", blobContentEncoding); } if (blobContentLanguage != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-language", blobContentLanguage); } if (blobContentMD5 != null) val2.get_Headers().Add("x-ms-blob-content-md5", blobContentMD5, "D"); if (blobCacheControl != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-cache-control", blobCacheControl); } if (metadata != null) val2.get_Headers().Add("x-ms-meta-", metadata); if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (blobContentDisposition != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-disposition", blobContentDisposition); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (tier.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-access-tier", tier.Value.ToString()); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } if (sourceIfModifiedSince.HasValue) val2.get_Headers().Add("x-ms-source-if-modified-since", sourceIfModifiedSince.Value, "R"); if (sourceIfUnmodifiedSince.HasValue) val2.get_Headers().Add("x-ms-source-if-unmodified-since", sourceIfUnmodifiedSince.Value, "R"); if (sourceIfMatch != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-match", sourceIfMatch); } if (sourceIfNoneMatch != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-none-match", sourceIfNoneMatch); } if (sourceIfTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-tags", sourceIfTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (sourceContentMD5 != null) val2.get_Headers().Add("x-ms-source-content-md5", sourceContentMD5, "D"); if (blobTagsString != null) { headers = val2.get_Headers(); headers.Add("x-ms-tags", blobTagsString); } headers = val2.get_Headers(); headers.Add("x-ms-copy-source", copySource); if (copySourceBlobProperties.HasValue) val2.get_Headers().Add("x-ms-copy-source-blob-properties", copySourceBlobProperties.Value); if (copySourceAuthorization != null) { headers = val2.get_Headers(); headers.Add("x-ms-copy-source-authorization", copySourceAuthorization); } if (copySourceTags.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-copy-source-tag-option", copySourceTags.Value.ToSerialString()); } headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<PutBlobFromUrlAsync>d__11))] public Task<ResponseWithHeaders<BlockBlobPutBlobFromUrlHeaders>> PutBlobFromUrlAsync(long contentLength, string copySource, int? timeout = default(int?), byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, AccessTier? tier = default(AccessTier?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, DateTimeOffset? sourceIfModifiedSince = default(DateTimeOffset?), DateTimeOffset? sourceIfUnmodifiedSince = default(DateTimeOffset?), string sourceIfMatch = null, string sourceIfNoneMatch = null, string sourceIfTags = null, byte[] sourceContentMD5 = null, string blobTagsString = null, bool? copySourceBlobProperties = default(bool?), string copySourceAuthorization = null, BlobCopySourceTagsMode? copySourceTags = default(BlobCopySourceTagsMode?), CancellationToken cancellationToken = default(CancellationToken)) { <PutBlobFromUrlAsync>d__11 stateMachine = default(<PutBlobFromUrlAsync>d__11); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<BlockBlobPutBlobFromUrlHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.contentLength = contentLength; stateMachine.copySource = copySource; stateMachine.timeout = timeout; stateMachine.transactionalContentMD5 = transactionalContentMD5; stateMachine.blobContentType = blobContentType; stateMachine.blobContentEncoding = blobContentEncoding; stateMachine.blobContentLanguage = blobContentLanguage; stateMachine.blobContentMD5 = blobContentMD5; stateMachine.blobCacheControl = blobCacheControl; stateMachine.metadata = metadata; stateMachine.leaseId = leaseId; stateMachine.blobContentDisposition = blobContentDisposition; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.tier = tier; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.sourceIfModifiedSince = sourceIfModifiedSince; stateMachine.sourceIfUnmodifiedSince = sourceIfUnmodifiedSince; stateMachine.sourceIfMatch = sourceIfMatch; stateMachine.sourceIfNoneMatch = sourceIfNoneMatch; stateMachine.sourceIfTags = sourceIfTags; stateMachine.sourceContentMD5 = sourceContentMD5; stateMachine.blobTagsString = blobTagsString; stateMachine.copySourceBlobProperties = copySourceBlobProperties; stateMachine.copySourceAuthorization = copySourceAuthorization; stateMachine.copySourceTags = copySourceTags; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<BlockBlobPutBlobFromUrlHeaders> PutBlobFromUrl(long contentLength, string copySource, int? timeout = default(int?), byte[] transactionalContentMD5 = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, string blobCacheControl = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, AccessTier? tier = default(AccessTier?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, DateTimeOffset? sourceIfModifiedSince = default(DateTimeOffset?), DateTimeOffset? sourceIfUnmodifiedSince = default(DateTimeOffset?), string sourceIfMatch = null, string sourceIfNoneMatch = null, string sourceIfTags = null, byte[] sourceContentMD5 = null, string blobTagsString = null, bool? copySourceBlobProperties = default(bool?), string copySourceAuthorization = null, BlobCopySourceTagsMode? copySourceTags = default(BlobCopySourceTagsMode?), CancellationToken cancellationToken = default(CancellationToken)) { if (copySource != null) { HttpMessage val = CreatePutBlobFromUrlRequest(contentLength, copySource, timeout, transactionalContentMD5, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, blobCacheControl, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, sourceContentMD5, blobTagsString, copySourceBlobProperties, copySourceAuthorization, copySourceTags); try { _pipeline.Send(val, cancellationToken); BlockBlobPutBlobFromUrlHeaders headers = new BlockBlobPutBlobFromUrlHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("copySource"); } internal HttpMessage CreateStageBlockRequest(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, int? timeout, string leaseId, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, string structuredBodyType, long? structuredContentLength) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "block", true); rawRequestUriBuilder.AppendQuery("blockid", blockId, true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); if (transactionalContentCrc64 != null) val2.get_Headers().Add("x-ms-content-crc64", transactionalContentCrc64, "D"); RequestHeaders headers; if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (structuredBodyType != null) { headers = val2.get_Headers(); headers.Add("x-ms-structured-body", structuredBodyType); } if (structuredContentLength.HasValue) val2.get_Headers().Add("x-ms-structured-content-length", structuredContentLength.Value); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); val2.get_Headers().Add("Content-Length", contentLength); if (transactionalContentMD5 != null) val2.get_Headers().Add("Content-MD5", transactionalContentMD5, "D"); headers = val2.get_Headers(); headers.Add("Content-Type", "application/octet-stream"); val2.set_Content(RequestContent.Create(body)); return val; } [AsyncStateMachine(typeof(<StageBlockAsync>d__14))] public Task<ResponseWithHeaders<BlockBlobStageBlockHeaders>> StageBlockAsync(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = default(int?), string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, string structuredBodyType = null, long? structuredContentLength = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { <StageBlockAsync>d__14 stateMachine = default(<StageBlockAsync>d__14); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<BlockBlobStageBlockHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.blockId = blockId; stateMachine.contentLength = contentLength; stateMachine.body = body; stateMachine.transactionalContentMD5 = transactionalContentMD5; stateMachine.transactionalContentCrc64 = transactionalContentCrc64; stateMachine.timeout = timeout; stateMachine.leaseId = leaseId; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.structuredBodyType = structuredBodyType; stateMachine.structuredContentLength = structuredContentLength; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<BlockBlobStageBlockHeaders> StageBlock(string blockId, long contentLength, Stream body, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, int? timeout = default(int?), string leaseId = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, string structuredBodyType = null, long? structuredContentLength = default(long?), CancellationToken cancellationToken = default(CancellationToken)) { if (blockId == null) throw new ArgumentNullException("blockId"); if (body != null) { HttpMessage val = CreateStageBlockRequest(blockId, contentLength, body, transactionalContentMD5, transactionalContentCrc64, timeout, leaseId, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, structuredBodyType, structuredContentLength); try { _pipeline.Send(val, cancellationToken); BlockBlobStageBlockHeaders headers = new BlockBlobStageBlockHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("body"); } internal HttpMessage CreateStageBlockFromURLRequest(string blockId, long contentLength, string sourceUrl, string sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, int? timeout, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, string leaseId, DateTimeOffset? sourceIfModifiedSince, DateTimeOffset? sourceIfUnmodifiedSince, string sourceIfMatch, string sourceIfNoneMatch, string copySourceAuthorization) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "block", true); rawRequestUriBuilder.AppendQuery("blockid", blockId, true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers = val2.get_Headers(); headers.Add("x-ms-copy-source", sourceUrl); if (sourceRange != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-range", sourceRange); } if (sourceContentMD5 != null) val2.get_Headers().Add("x-ms-source-content-md5", sourceContentMD5, "D"); if (sourceContentcrc64 != null) val2.get_Headers().Add("x-ms-source-content-crc64", sourceContentcrc64, "D"); if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (sourceIfModifiedSince.HasValue) val2.get_Headers().Add("x-ms-source-if-modified-since", sourceIfModifiedSince.Value, "R"); if (sourceIfUnmodifiedSince.HasValue) val2.get_Headers().Add("x-ms-source-if-unmodified-since", sourceIfUnmodifiedSince.Value, "R"); if (sourceIfMatch != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-match", sourceIfMatch); } if (sourceIfNoneMatch != null) { headers = val2.get_Headers(); headers.Add("x-ms-source-if-none-match", sourceIfNoneMatch); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (copySourceAuthorization != null) { headers = val2.get_Headers(); headers.Add("x-ms-copy-source-authorization", copySourceAuthorization); } headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<StageBlockFromURLAsync>d__17))] public Task<ResponseWithHeaders<BlockBlobStageBlockFromURLHeaders>> StageBlockFromURLAsync(string blockId, long contentLength, string sourceUrl, string sourceRange = null, byte[] sourceContentMD5 = null, byte[] sourceContentcrc64 = null, int? timeout = default(int?), string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, string leaseId = null, DateTimeOffset? sourceIfModifiedSince = default(DateTimeOffset?), DateTimeOffset? sourceIfUnmodifiedSince = default(DateTimeOffset?), string sourceIfMatch = null, string sourceIfNoneMatch = null, string copySourceAuthorization = null, CancellationToken cancellationToken = default(CancellationToken)) { <StageBlockFromURLAsync>d__17 stateMachine = default(<StageBlockFromURLAsync>d__17); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<BlockBlobStageBlockFromURLHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.blockId = blockId; stateMachine.contentLength = contentLength; stateMachine.sourceUrl = sourceUrl; stateMachine.sourceRange = sourceRange; stateMachine.sourceContentMD5 = sourceContentMD5; stateMachine.sourceContentcrc64 = sourceContentcrc64; stateMachine.timeout = timeout; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.leaseId = leaseId; stateMachine.sourceIfModifiedSince = sourceIfModifiedSince; stateMachine.sourceIfUnmodifiedSince = sourceIfUnmodifiedSince; stateMachine.sourceIfMatch = sourceIfMatch; stateMachine.sourceIfNoneMatch = sourceIfNoneMatch; stateMachine.copySourceAuthorization = copySourceAuthorization; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<BlockBlobStageBlockFromURLHeaders> StageBlockFromURL(string blockId, long contentLength, string sourceUrl, string sourceRange = null, byte[] sourceContentMD5 = null, byte[] sourceContentcrc64 = null, int? timeout = default(int?), string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, string leaseId = null, DateTimeOffset? sourceIfModifiedSince = default(DateTimeOffset?), DateTimeOffset? sourceIfUnmodifiedSince = default(DateTimeOffset?), string sourceIfMatch = null, string sourceIfNoneMatch = null, string copySourceAuthorization = null, CancellationToken cancellationToken = default(CancellationToken)) { if (blockId == null) throw new ArgumentNullException("blockId"); if (sourceUrl != null) { HttpMessage val = CreateStageBlockFromURLRequest(blockId, contentLength, sourceUrl, sourceRange, sourceContentMD5, sourceContentcrc64, timeout, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, leaseId, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, copySourceAuthorization); try { _pipeline.Send(val, cancellationToken); BlockBlobStageBlockFromURLHeaders headers = new BlockBlobStageBlockFromURLHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("sourceUrl"); } internal HttpMessage CreateCommitBlockListRequest(BlockLookupList blocks, int? timeout, string blobCacheControl, string blobContentType, string blobContentEncoding, string blobContentLanguage, byte[] blobContentMD5, byte[] transactionalContentMD5, byte[] transactionalContentCrc64, IDictionary<string, string> metadata, string leaseId, string blobContentDisposition, string encryptionKey, string encryptionKeySha256, EncryptionAlgorithmTypeInternal? encryptionAlgorithm, string encryptionScope, AccessTier? tier, DateTimeOffset? ifModifiedSince, DateTimeOffset? ifUnmodifiedSince, string ifMatch, string ifNoneMatch, string ifTags, string blobTagsString, DateTimeOffset? immutabilityPolicyExpiry, BlobImmutabilityPolicyMode? immutabilityPolicyMode, bool? legalHold) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Put()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "blocklist", true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (blobCacheControl != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-cache-control", blobCacheControl); } if (blobContentType != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-type", blobContentType); } if (blobContentEncoding != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-encoding", blobContentEncoding); } if (blobContentLanguage != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-language", blobContentLanguage); } if (blobContentMD5 != null) val2.get_Headers().Add("x-ms-blob-content-md5", blobContentMD5, "D"); if (transactionalContentCrc64 != null) val2.get_Headers().Add("x-ms-content-crc64", transactionalContentCrc64, "D"); if (metadata != null) val2.get_Headers().Add("x-ms-meta-", metadata); if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (blobContentDisposition != null) { headers = val2.get_Headers(); headers.Add("x-ms-blob-content-disposition", blobContentDisposition); } if (encryptionKey != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key", encryptionKey); } if (encryptionKeySha256 != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-key-sha256", encryptionKeySha256); } if (encryptionAlgorithm.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-algorithm", encryptionAlgorithm.Value.ToSerialString()); } if (encryptionScope != null) { headers = val2.get_Headers(); headers.Add("x-ms-encryption-scope", encryptionScope); } if (tier.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-access-tier", tier.Value.ToString()); } if (ifModifiedSince.HasValue) val2.get_Headers().Add("If-Modified-Since", ifModifiedSince.Value, "R"); if (ifUnmodifiedSince.HasValue) val2.get_Headers().Add("If-Unmodified-Since", ifUnmodifiedSince.Value, "R"); if (ifMatch != null) { headers = val2.get_Headers(); headers.Add("If-Match", ifMatch); } if (ifNoneMatch != null) { headers = val2.get_Headers(); headers.Add("If-None-Match", ifNoneMatch); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); if (blobTagsString != null) { headers = val2.get_Headers(); headers.Add("x-ms-tags", blobTagsString); } if (immutabilityPolicyExpiry.HasValue) val2.get_Headers().Add("x-ms-immutability-policy-until-date", immutabilityPolicyExpiry.Value, "R"); if (immutabilityPolicyMode.HasValue) { headers = val2.get_Headers(); headers.Add("x-ms-immutability-policy-mode", immutabilityPolicyMode.Value.ToSerialString()); } if (legalHold.HasValue) val2.get_Headers().Add("x-ms-legal-hold", legalHold.Value); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); if (transactionalContentMD5 != null) val2.get_Headers().Add("Content-MD5", transactionalContentMD5, "D"); headers = val2.get_Headers(); headers.Add("Content-Type", "application/xml"); XmlWriterContent xmlWriterContent = new XmlWriterContent(); xmlWriterContent.XmlWriter.WriteObjectValue(blocks, "BlockList"); val2.set_Content(xmlWriterContent); return val; } [AsyncStateMachine(typeof(<CommitBlockListAsync>d__20))] public Task<ResponseWithHeaders<BlockBlobCommitBlockListHeaders>> CommitBlockListAsync(BlockLookupList blocks, int? timeout = default(int?), string blobCacheControl = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, AccessTier? tier = default(AccessTier?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = default(DateTimeOffset?), BlobImmutabilityPolicyMode? immutabilityPolicyMode = default(BlobImmutabilityPolicyMode?), bool? legalHold = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { <CommitBlockListAsync>d__20 stateMachine = default(<CommitBlockListAsync>d__20); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<BlockBlobCommitBlockListHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.blocks = blocks; stateMachine.timeout = timeout; stateMachine.blobCacheControl = blobCacheControl; stateMachine.blobContentType = blobContentType; stateMachine.blobContentEncoding = blobContentEncoding; stateMachine.blobContentLanguage = blobContentLanguage; stateMachine.blobContentMD5 = blobContentMD5; stateMachine.transactionalContentMD5 = transactionalContentMD5; stateMachine.transactionalContentCrc64 = transactionalContentCrc64; stateMachine.metadata = metadata; stateMachine.leaseId = leaseId; stateMachine.blobContentDisposition = blobContentDisposition; stateMachine.encryptionKey = encryptionKey; stateMachine.encryptionKeySha256 = encryptionKeySha256; stateMachine.encryptionAlgorithm = encryptionAlgorithm; stateMachine.encryptionScope = encryptionScope; stateMachine.tier = tier; stateMachine.ifModifiedSince = ifModifiedSince; stateMachine.ifUnmodifiedSince = ifUnmodifiedSince; stateMachine.ifMatch = ifMatch; stateMachine.ifNoneMatch = ifNoneMatch; stateMachine.ifTags = ifTags; stateMachine.blobTagsString = blobTagsString; stateMachine.immutabilityPolicyExpiry = immutabilityPolicyExpiry; stateMachine.immutabilityPolicyMode = immutabilityPolicyMode; stateMachine.legalHold = legalHold; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<BlockBlobCommitBlockListHeaders> CommitBlockList(BlockLookupList blocks, int? timeout = default(int?), string blobCacheControl = null, string blobContentType = null, string blobContentEncoding = null, string blobContentLanguage = null, byte[] blobContentMD5 = null, byte[] transactionalContentMD5 = null, byte[] transactionalContentCrc64 = null, IDictionary<string, string> metadata = null, string leaseId = null, string blobContentDisposition = null, string encryptionKey = null, string encryptionKeySha256 = null, EncryptionAlgorithmTypeInternal? encryptionAlgorithm = default(EncryptionAlgorithmTypeInternal?), string encryptionScope = null, AccessTier? tier = default(AccessTier?), DateTimeOffset? ifModifiedSince = default(DateTimeOffset?), DateTimeOffset? ifUnmodifiedSince = default(DateTimeOffset?), string ifMatch = null, string ifNoneMatch = null, string ifTags = null, string blobTagsString = null, DateTimeOffset? immutabilityPolicyExpiry = default(DateTimeOffset?), BlobImmutabilityPolicyMode? immutabilityPolicyMode = default(BlobImmutabilityPolicyMode?), bool? legalHold = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { if (blocks != null) { HttpMessage val = CreateCommitBlockListRequest(blocks, timeout, blobCacheControl, blobContentType, blobContentEncoding, blobContentLanguage, blobContentMD5, transactionalContentMD5, transactionalContentCrc64, metadata, leaseId, blobContentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, tier, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, blobTagsString, immutabilityPolicyExpiry, immutabilityPolicyMode, legalHold); try { _pipeline.Send(val, cancellationToken); BlockBlobCommitBlockListHeaders headers = new BlockBlobCommitBlockListHeaders(val.get_Response()); if (val.get_Response().get_Status() != 201) throw new RequestFailedException(val.get_Response()); return ResponseWithHeaders.FromValue(headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } throw new ArgumentNullException("blocks"); } internal HttpMessage CreateGetBlockListRequest(BlockListType listType, string snapshot, int? timeout, string leaseId, string ifTags) { HttpMessage val = _pipeline.CreateMessage(); Request val2 = val.get_Request(); val2.set_Method(RequestMethod.get_Get()); RawRequestUriBuilder rawRequestUriBuilder = new RawRequestUriBuilder(); rawRequestUriBuilder.AppendRaw(_url, false); rawRequestUriBuilder.AppendQuery("comp", "blocklist", true); if (snapshot != null) rawRequestUriBuilder.AppendQuery("snapshot", snapshot, true); rawRequestUriBuilder.AppendQuery("blocklisttype", listType.ToSerialString(), true); if (timeout.HasValue) rawRequestUriBuilder.AppendQuery("timeout", timeout.Value, true); val2.set_Uri(rawRequestUriBuilder); RequestHeaders headers; if (leaseId != null) { headers = val2.get_Headers(); headers.Add("x-ms-lease-id", leaseId); } if (ifTags != null) { headers = val2.get_Headers(); headers.Add("x-ms-if-tags", ifTags); } headers = val2.get_Headers(); headers.Add("x-ms-version", _version); headers = val2.get_Headers(); headers.Add("Accept", "application/xml"); return val; } [AsyncStateMachine(typeof(<GetBlockListAsync>d__23))] public Task<ResponseWithHeaders<BlockList, BlockBlobGetBlockListHeaders>> GetBlockListAsync(BlockListType listType, string snapshot = null, int? timeout = default(int?), string leaseId = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { <GetBlockListAsync>d__23 stateMachine = default(<GetBlockListAsync>d__23); stateMachine.<>t__builder = AsyncTaskMethodBuilder<ResponseWithHeaders<BlockList, BlockBlobGetBlockListHeaders>>.Create(); stateMachine.<>4__this = this; stateMachine.listType = listType; stateMachine.snapshot = snapshot; stateMachine.timeout = timeout; stateMachine.leaseId = leaseId; stateMachine.ifTags = ifTags; stateMachine.cancellationToken = cancellationToken; stateMachine.<>1__state = -1; stateMachine.<>t__builder.Start(ref stateMachine); return stateMachine.<>t__builder.Task; } public ResponseWithHeaders<BlockList, BlockBlobGetBlockListHeaders> GetBlockList(BlockListType listType, string snapshot = null, int? timeout = default(int?), string leaseId = null, string ifTags = null, CancellationToken cancellationToken = default(CancellationToken)) { HttpMessage val = CreateGetBlockListRequest(listType, snapshot, timeout, leaseId, ifTags); try { _pipeline.Send(val, cancellationToken); BlockBlobGetBlockListHeaders headers = new BlockBlobGetBlockListHeaders(val.get_Response()); if (val.get_Response().get_Status() != 200) throw new RequestFailedException(val.get_Response()); BlockList value = null; XElement xElement = XDocument.Load(val.get_Response().get_ContentStream(), LoadOptions.PreserveWhitespace).Element("BlockList"); if (xElement != null) value = BlockList.DeserializeBlockList(xElement); return ResponseWithHeaders.FromValue(value, headers, val.get_Response()); } finally { ((IDisposable)val)?.Dispose(); } } } }