< Summary

Class:Azure.Storage.Blobs.BatchRestClient
Assembly:Azure.Storage.Blobs.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.Batch\src\Generated\BatchRestClient.cs
Covered lines:74
Uncovered lines:88
Coverable lines:162
Total lines:668
Line coverage:45.6% (74 of 162)
Covered branches:34
Total branches:72
Branch coverage:47.2% (34 of 72)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
SubmitBatchAsync()-100%100%
SubmitBatchAsync_CreateMessage(...)-70%50%
SubmitBatchAsync_CreateResponse(...)-100%100%
SetAccessTierAsync()-0%0%
SetAccessTierAsync_CreateMessage(...)-62.5%50%
SetAccessTierAsync_CreateResponse(...)-83.33%75%
DeleteAsync()-0%0%
DeleteAsync_CreateMessage(...)-42.11%50%
DeleteAsync_CreateResponse(...)-100%100%
ToString(...)-0%0%
ParseDeleteSnapshotsOption(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Blobs.Batch\src\Generated\BatchRestClient.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// This file was automatically generated.  Do not edit.
 5
 6#pragma warning disable IDE0016 // Null check can be simplified
 7#pragma warning disable IDE0017 // Variable declaration can be inlined
 8#pragma warning disable IDE0018 // Object initialization can be simplified
 9#pragma warning disable SA1402  // File may only contain a single type
 10
 11#region Service
 12namespace Azure.Storage.Blobs
 13{
 14    /// <summary>
 15    /// Azure Blob Storage
 16    /// </summary>
 17    internal static partial class BatchRestClient
 18    {
 19        #region Service operations
 20        /// <summary>
 21        /// Service operations for Azure Blob Storage
 22        /// </summary>
 23        public static partial class Service
 24        {
 25            #region Service.SubmitBatchAsync
 26            /// <summary>
 27            /// The Batch operation allows multiple API calls to be embedded into a single HTTP request.
 28            /// </summary>
 29            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 30            /// <param name="pipeline">The pipeline used for sending requests.</param>
 31            /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de
 32            /// <param name="body">Initial data</param>
 33            /// <param name="contentLength">The length of the request.</param>
 34            /// <param name="multipartContentType">Required. The value of this header must be multipart/mixed with a bat
 35            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 36            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 37            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 38            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 39            /// <param name="operationName">Operation name.</param>
 40            /// <param name="cancellationToken">Cancellation token.</param>
 41            /// <returns>Azure.Response{Azure.Storage.Blobs.Models.BlobBatchResult}</returns>
 42            public static async System.Threading.Tasks.ValueTask<Azure.Response<Azure.Storage.Blobs.Models.BlobBatchResu
 43                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 44                Azure.Core.Pipeline.HttpPipeline pipeline,
 45                System.Uri resourceUri,
 46                System.IO.Stream body,
 47                long contentLength,
 48                string multipartContentType,
 49                string version,
 50                int? timeout = default,
 51                string requestId = default,
 52                bool async = true,
 53                string operationName = "ServiceClient.SubmitBatch",
 54                System.Threading.CancellationToken cancellationToken = default)
 55            {
 9256                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 57                try
 58                {
 9259                    _scope.AddAttribute("url", resourceUri);
 9260                    _scope.Start();
 9261                    using (Azure.Core.HttpMessage _message = SubmitBatchAsync_CreateMessage(
 9262                        pipeline,
 9263                        resourceUri,
 9264                        body,
 9265                        contentLength,
 9266                        multipartContentType,
 9267                        version,
 9268                        timeout,
 9269                        requestId))
 70                    {
 9271                        if (async)
 72                        {
 73                            // Send the request asynchronously if we're being called via an async path
 4674                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 75                        }
 76                        else
 77                        {
 78                            // Send the request synchronously through the API that blocks if we're being called via a sy
 79                            // (this is safe because the Task will complete before the user can call Wait)
 4680                            pipeline.Send(_message, cancellationToken);
 81                        }
 9282                        Azure.Response _response = _message.Response;
 9283                        cancellationToken.ThrowIfCancellationRequested();
 9284                        return SubmitBatchAsync_CreateResponse(clientDiagnostics, _response);
 85                    }
 86                }
 487                catch (System.Exception ex)
 88                {
 489                    _scope.Failed(ex);
 490                    throw;
 91                }
 92                finally
 93                {
 9294                    _scope.Dispose();
 95                }
 8896            }
 97
 98            /// <summary>
 99            /// Create the Service.SubmitBatchAsync request.
 100            /// </summary>
 101            /// <param name="pipeline">The pipeline used for sending requests.</param>
 102            /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de
 103            /// <param name="body">Initial data</param>
 104            /// <param name="contentLength">The length of the request.</param>
 105            /// <param name="multipartContentType">Required. The value of this header must be multipart/mixed with a bat
 106            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 107            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 108            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 109            /// <returns>The Service.SubmitBatchAsync Message.</returns>
 110            internal static Azure.Core.HttpMessage SubmitBatchAsync_CreateMessage(
 111                Azure.Core.Pipeline.HttpPipeline pipeline,
 112                System.Uri resourceUri,
 113                System.IO.Stream body,
 114                long contentLength,
 115                string multipartContentType,
 116                string version,
 117                int? timeout = default,
 118                string requestId = default)
 119            {
 120                // Validation
 92121                if (resourceUri == null)
 122                {
 0123                    throw new System.ArgumentNullException(nameof(resourceUri));
 124                }
 92125                if (body == null)
 126                {
 0127                    throw new System.ArgumentNullException(nameof(body));
 128                }
 92129                if (multipartContentType == null)
 130                {
 0131                    throw new System.ArgumentNullException(nameof(multipartContentType));
 132                }
 92133                if (version == null)
 134                {
 0135                    throw new System.ArgumentNullException(nameof(version));
 136                }
 137
 138                // Create the request
 92139                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 92140                Azure.Core.Request _request = _message.Request;
 141
 142                // Set the endpoint
 92143                _request.Method = Azure.Core.RequestMethod.Post;
 92144                _request.Uri.Reset(resourceUri);
 92145                _request.Uri.AppendQuery("comp", "batch", escapeValue: false);
 0146                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 147
 148                // Add request headers
 92149                _request.Headers.SetValue("Content-Length", contentLength.ToString(System.Globalization.CultureInfo.Inva
 92150                _request.Headers.SetValue("Content-Type", multipartContentType);
 92151                _request.Headers.SetValue("x-ms-version", version);
 0152                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 153
 154                // Create the body
 92155                _request.Content = Azure.Core.RequestContent.Create(body);
 156
 92157                return _message;
 158            }
 159
 160            /// <summary>
 161            /// Create the Service.SubmitBatchAsync response or throw a failure exception.
 162            /// </summary>
 163            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 164            /// <param name="response">The raw Response.</param>
 165            /// <returns>The Service.SubmitBatchAsync Azure.Response{Azure.Storage.Blobs.Models.BlobBatchResult}.</retur
 166            internal static Azure.Response<Azure.Storage.Blobs.Models.BlobBatchResult> SubmitBatchAsync_CreateResponse(
 167                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 168                Azure.Response response)
 169            {
 170                // Process the response
 96171                switch (response.Status)
 172                {
 173                    case 202:
 174                    {
 175                        // Create the result
 88176                        Azure.Storage.Blobs.Models.BlobBatchResult _value = new Azure.Storage.Blobs.Models.BlobBatchResu
 88177                        _value.Content = response.ContentStream; // You should manually wrap with RetriableStream!
 178
 179                        // Get response headers
 180                        string _header;
 88181                        if (response.Headers.TryGetValue("Content-Type", out _header))
 182                        {
 88183                            _value.ContentType = _header;
 184                        }
 185
 186                        // Create the response
 88187                        return Response.FromValue(_value, response);
 188                    }
 189                    default:
 190                    {
 191                        // Create the result
 8192                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 8193                        Azure.Storage.Blobs.Models.StorageError _value = Azure.Storage.Blobs.Models.StorageError.FromXml
 194
 8195                        throw _value.CreateException(clientDiagnostics, response);
 196                    }
 197                }
 198            }
 199            #endregion Service.SubmitBatchAsync
 200        }
 201        #endregion Service operations
 202
 203        #region Blob operations
 204        /// <summary>
 205        /// Blob operations for Azure Blob Storage
 206        /// </summary>
 207        public static partial class Blob
 208        {
 209            #region Blob.SetAccessTierAsync
 210            /// <summary>
 211            /// The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium sto
 212            /// </summary>
 213            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 214            /// <param name="pipeline">The pipeline used for sending requests.</param>
 215            /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de
 216            /// <param name="tier">Indicates the tier to be set on the blob.</param>
 217            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 218            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 219            /// <param name="rehydratePriority">Optional: Indicates the priority with which to rehydrate an archived blo
 220            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 221            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 222            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 223            /// <param name="operationName">Operation name.</param>
 224            /// <param name="cancellationToken">Cancellation token.</param>
 225            /// <returns>Azure.Response</returns>
 226            public static async System.Threading.Tasks.ValueTask<Azure.Response> SetAccessTierAsync(
 227                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 228                Azure.Core.Pipeline.HttpPipeline pipeline,
 229                System.Uri resourceUri,
 230                Azure.Storage.Blobs.Models.AccessTier tier,
 231                string version,
 232                int? timeout = default,
 233                Azure.Storage.Blobs.Models.RehydratePriority? rehydratePriority = default,
 234                string requestId = default,
 235                string leaseId = default,
 236                bool async = true,
 237                string operationName = "BlobClient.SetAccessTier",
 238                System.Threading.CancellationToken cancellationToken = default)
 239            {
 0240                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 241                try
 242                {
 0243                    _scope.AddAttribute("url", resourceUri);
 0244                    _scope.Start();
 0245                    using (Azure.Core.HttpMessage _message = SetAccessTierAsync_CreateMessage(
 0246                        pipeline,
 0247                        resourceUri,
 0248                        tier,
 0249                        version,
 0250                        timeout,
 0251                        rehydratePriority,
 0252                        requestId,
 0253                        leaseId))
 254                    {
 0255                        if (async)
 256                        {
 257                            // Send the request asynchronously if we're being called via an async path
 0258                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 259                        }
 260                        else
 261                        {
 262                            // Send the request synchronously through the API that blocks if we're being called via a sy
 263                            // (this is safe because the Task will complete before the user can call Wait)
 0264                            pipeline.Send(_message, cancellationToken);
 265                        }
 0266                        Azure.Response _response = _message.Response;
 0267                        cancellationToken.ThrowIfCancellationRequested();
 0268                        return SetAccessTierAsync_CreateResponse(clientDiagnostics, _response);
 269                    }
 270                }
 0271                catch (System.Exception ex)
 272                {
 0273                    _scope.Failed(ex);
 0274                    throw;
 275                }
 276                finally
 277                {
 0278                    _scope.Dispose();
 279                }
 0280            }
 281
 282            /// <summary>
 283            /// Create the Blob.SetAccessTierAsync request.
 284            /// </summary>
 285            /// <param name="pipeline">The pipeline used for sending requests.</param>
 286            /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de
 287            /// <param name="tier">Indicates the tier to be set on the blob.</param>
 288            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 289            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 290            /// <param name="rehydratePriority">Optional: Indicates the priority with which to rehydrate an archived blo
 291            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 292            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 293            /// <returns>The Blob.SetAccessTierAsync Message.</returns>
 294            internal static Azure.Core.HttpMessage SetAccessTierAsync_CreateMessage(
 295                Azure.Core.Pipeline.HttpPipeline pipeline,
 296                System.Uri resourceUri,
 297                Azure.Storage.Blobs.Models.AccessTier tier,
 298                string version,
 299                int? timeout = default,
 300                Azure.Storage.Blobs.Models.RehydratePriority? rehydratePriority = default,
 301                string requestId = default,
 302                string leaseId = default)
 303            {
 304                // Validation
 100305                if (resourceUri == null)
 306                {
 0307                    throw new System.ArgumentNullException(nameof(resourceUri));
 308                }
 100309                if (version == null)
 310                {
 0311                    throw new System.ArgumentNullException(nameof(version));
 312                }
 313
 314                // Create the request
 100315                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 100316                Azure.Core.Request _request = _message.Request;
 317
 318                // Set the endpoint
 100319                _request.Method = Azure.Core.RequestMethod.Put;
 100320                _request.Uri.Reset(resourceUri);
 100321                _request.Uri.AppendQuery("comp", "tier", escapeValue: false);
 0322                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 323
 324                // Add request headers
 100325                _request.Headers.SetValue("x-ms-access-tier", tier.ToString());
 100326                _request.Headers.SetValue("x-ms-version", version);
 0327                if (rehydratePriority != null) { _request.Headers.SetValue("x-ms-rehydrate-priority", rehydratePriority.
 0328                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 0329                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 330
 100331                return _message;
 332            }
 333
 334            /// <summary>
 335            /// Create the Blob.SetAccessTierAsync response or throw a failure exception.
 336            /// </summary>
 337            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 338            /// <param name="response">The raw Response.</param>
 339            /// <returns>The Blob.SetAccessTierAsync Azure.Response.</returns>
 340            internal static Azure.Response SetAccessTierAsync_CreateResponse(
 341                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 342                Azure.Response response)
 343            {
 344                // Process the response
 60345                switch (response.Status)
 346                {
 347                    case 200:
 348                    {
 36349                        return response;
 350                    }
 351                    case 202:
 352                    {
 0353                        return response;
 354                    }
 355                    default:
 356                    {
 357                        // Create the result
 24358                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 24359                        Azure.Storage.Blobs.Models.StorageError _value = Azure.Storage.Blobs.Models.StorageError.FromXml
 360
 24361                        throw _value.CreateException(clientDiagnostics, response);
 362                    }
 363                }
 364            }
 365            #endregion Blob.SetAccessTierAsync
 366
 367            #region Blob.DeleteAsync
 368            /// <summary>
 369            /// If the storage account's soft delete feature is disabled then, when a blob is deleted, it is permanently
 370            /// </summary>
 371            /// <param name="clientDiagnostics">The ClientDiagnostics instance used for operation reporting.</param>
 372            /// <param name="pipeline">The pipeline used for sending requests.</param>
 373            /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de
 374            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 375            /// <param name="snapshot">The snapshot parameter is an opaque DateTime value that, when present, specifies 
 376            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 377            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 378            /// <param name="deleteSnapshots">Required if the blob has associated snapshots. Specify one of the followin
 379            /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie
 380            /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m
 381            /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param>
 382            /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para
 383            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 384            /// <param name="async">Whether to invoke the operation asynchronously.  The default value is true.</param>
 385            /// <param name="operationName">Operation name.</param>
 386            /// <param name="cancellationToken">Cancellation token.</param>
 387            /// <returns>Azure.Response</returns>
 388            public static async System.Threading.Tasks.ValueTask<Azure.Response> DeleteAsync(
 389                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 390                Azure.Core.Pipeline.HttpPipeline pipeline,
 391                System.Uri resourceUri,
 392                string version,
 393                string snapshot = default,
 394                int? timeout = default,
 395                string leaseId = default,
 396                Azure.Storage.Blobs.Models.DeleteSnapshotsOption? deleteSnapshots = default,
 397                System.DateTimeOffset? ifModifiedSince = default,
 398                System.DateTimeOffset? ifUnmodifiedSince = default,
 399                Azure.ETag? ifMatch = default,
 400                Azure.ETag? ifNoneMatch = default,
 401                string requestId = default,
 402                bool async = true,
 403                string operationName = "BlobClient.Delete",
 404                System.Threading.CancellationToken cancellationToken = default)
 405            {
 0406                Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName);
 407                try
 408                {
 0409                    _scope.AddAttribute("url", resourceUri);
 0410                    _scope.Start();
 0411                    using (Azure.Core.HttpMessage _message = DeleteAsync_CreateMessage(
 0412                        pipeline,
 0413                        resourceUri,
 0414                        version,
 0415                        snapshot,
 0416                        timeout,
 0417                        leaseId,
 0418                        deleteSnapshots,
 0419                        ifModifiedSince,
 0420                        ifUnmodifiedSince,
 0421                        ifMatch,
 0422                        ifNoneMatch,
 0423                        requestId))
 424                    {
 0425                        if (async)
 426                        {
 427                            // Send the request asynchronously if we're being called via an async path
 0428                            await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false);
 429                        }
 430                        else
 431                        {
 432                            // Send the request synchronously through the API that blocks if we're being called via a sy
 433                            // (this is safe because the Task will complete before the user can call Wait)
 0434                            pipeline.Send(_message, cancellationToken);
 435                        }
 0436                        Azure.Response _response = _message.Response;
 0437                        cancellationToken.ThrowIfCancellationRequested();
 0438                        return DeleteAsync_CreateResponse(clientDiagnostics, _response);
 439                    }
 440                }
 0441                catch (System.Exception ex)
 442                {
 0443                    _scope.Failed(ex);
 0444                    throw;
 445                }
 446                finally
 447                {
 0448                    _scope.Dispose();
 449                }
 0450            }
 451
 452            /// <summary>
 453            /// Create the Blob.DeleteAsync request.
 454            /// </summary>
 455            /// <param name="pipeline">The pipeline used for sending requests.</param>
 456            /// <param name="resourceUri">The URL of the service account, container, or blob that is the targe of the de
 457            /// <param name="version">Specifies the version of the operation to use for this request.</param>
 458            /// <param name="snapshot">The snapshot parameter is an opaque DateTime value that, when present, specifies 
 459            /// <param name="timeout">The timeout parameter is expressed in seconds. For more information, see <a href="
 460            /// <param name="leaseId">If specified, the operation only succeeds if the resource's lease is active and ma
 461            /// <param name="deleteSnapshots">Required if the blob has associated snapshots. Specify one of the followin
 462            /// <param name="ifModifiedSince">Specify this header value to operate only on a blob if it has been modifie
 463            /// <param name="ifUnmodifiedSince">Specify this header value to operate only on a blob if it has not been m
 464            /// <param name="ifMatch">Specify an ETag value to operate only on blobs with a matching value.</param>
 465            /// <param name="ifNoneMatch">Specify an ETag value to operate only on blobs without a matching value.</para
 466            /// <param name="requestId">Provides a client-generated, opaque value with a 1 KB character limit that is re
 467            /// <returns>The Blob.DeleteAsync Message.</returns>
 468            internal static Azure.Core.HttpMessage DeleteAsync_CreateMessage(
 469                Azure.Core.Pipeline.HttpPipeline pipeline,
 470                System.Uri resourceUri,
 471                string version,
 472                string snapshot = default,
 473                int? timeout = default,
 474                string leaseId = default,
 475                Azure.Storage.Blobs.Models.DeleteSnapshotsOption? deleteSnapshots = default,
 476                System.DateTimeOffset? ifModifiedSince = default,
 477                System.DateTimeOffset? ifUnmodifiedSince = default,
 478                Azure.ETag? ifMatch = default,
 479                Azure.ETag? ifNoneMatch = default,
 480                string requestId = default)
 481            {
 482                // Validation
 2224483                if (resourceUri == null)
 484                {
 0485                    throw new System.ArgumentNullException(nameof(resourceUri));
 486                }
 2224487                if (version == null)
 488                {
 0489                    throw new System.ArgumentNullException(nameof(version));
 490                }
 491
 492                // Create the request
 2224493                Azure.Core.HttpMessage _message = pipeline.CreateMessage();
 2224494                Azure.Core.Request _request = _message.Request;
 495
 496                // Set the endpoint
 2224497                _request.Method = Azure.Core.RequestMethod.Delete;
 2224498                _request.Uri.Reset(resourceUri);
 0499                if (snapshot != null) { _request.Uri.AppendQuery("snapshot", snapshot); }
 0500                if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.C
 501
 502                // Add request headers
 2224503                _request.Headers.SetValue("x-ms-version", version);
 0504                if (leaseId != null) { _request.Headers.SetValue("x-ms-lease-id", leaseId); }
 0505                if (deleteSnapshots != null) { _request.Headers.SetValue("x-ms-delete-snapshots", Azure.Storage.Blobs.Ba
 0506                if (ifModifiedSince != null) { _request.Headers.SetValue("If-Modified-Since", ifModifiedSince.Value.ToSt
 0507                if (ifUnmodifiedSince != null) { _request.Headers.SetValue("If-Unmodified-Since", ifUnmodifiedSince.Valu
 0508                if (ifMatch != null) { _request.Headers.SetValue("If-Match", ifMatch.Value.ToString()); }
 0509                if (ifNoneMatch != null) { _request.Headers.SetValue("If-None-Match", ifNoneMatch.Value.ToString()); }
 0510                if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); }
 511
 2224512                return _message;
 513            }
 514
 515            /// <summary>
 516            /// Create the Blob.DeleteAsync response or throw a failure exception.
 517            /// </summary>
 518            /// <param name="clientDiagnostics">The ClientDiagnostics instance to use.</param>
 519            /// <param name="response">The raw Response.</param>
 520            /// <returns>The Blob.DeleteAsync Azure.Response.</returns>
 521            internal static Azure.Response DeleteAsync_CreateResponse(
 522                Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics,
 523                Azure.Response response)
 524            {
 525                // Process the response
 1104526                switch (response.Status)
 527                {
 528                    case 202:
 529                    {
 1080530                        return response;
 531                    }
 532                    default:
 533                    {
 534                        // Create the result
 24535                        System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.X
 24536                        Azure.Storage.Blobs.Models.StorageError _value = Azure.Storage.Blobs.Models.StorageError.FromXml
 537
 24538                        throw _value.CreateException(clientDiagnostics, response);
 539                    }
 540                }
 541            }
 542            #endregion Blob.DeleteAsync
 543        }
 544        #endregion Blob operations
 545    }
 546}
 547#endregion Service
 548
 549#region Models
 550
 551#region class BlobBatchResult
 552namespace Azure.Storage.Blobs.Models
 553{
 554    /// <summary>
 555    /// BlobBatchResult
 556    /// </summary>
 557    internal partial class BlobBatchResult
 558    {
 559        /// <summary>
 560        /// The media type of the body of the response. For batch requests, this is multipart/mixed; boundary=batchrespo
 561        /// </summary>
 562        public string ContentType { get; internal set; }
 563
 564        /// <summary>
 565        /// Content
 566        /// </summary>
 567        public System.IO.Stream Content { get; internal set; }
 568
 569        /// <summary>
 570        /// Prevent direct instantiation of BlobBatchResult instances.
 571        /// You can use BlobsModelFactory.BlobBatchResult instead.
 572        /// </summary>
 573        internal BlobBatchResult() { }
 574    }
 575}
 576#endregion class BlobBatchResult
 577
 578#region enum DeleteSnapshotsOption
 579
 580namespace Azure.Storage.Blobs
 581{
 582    internal static partial class BatchRestClient
 583    {
 584        public static partial class Serialization
 585        {
 586            public static string ToString(Azure.Storage.Blobs.Models.DeleteSnapshotsOption value)
 587            {
 0588                return value switch
 0589                {
 0590                    Azure.Storage.Blobs.Models.DeleteSnapshotsOption.None => null,
 0591                    Azure.Storage.Blobs.Models.DeleteSnapshotsOption.IncludeSnapshots => "include",
 0592                    Azure.Storage.Blobs.Models.DeleteSnapshotsOption.OnlySnapshots => "only",
 0593                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Blobs
 0594                };
 595            }
 596
 597            public static Azure.Storage.Blobs.Models.DeleteSnapshotsOption ParseDeleteSnapshotsOption(string value)
 598            {
 0599                return value switch
 0600                {
 0601                    null => Azure.Storage.Blobs.Models.DeleteSnapshotsOption.None,
 0602                    "include" => Azure.Storage.Blobs.Models.DeleteSnapshotsOption.IncludeSnapshots,
 0603                    "only" => Azure.Storage.Blobs.Models.DeleteSnapshotsOption.OnlySnapshots,
 0604                    _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Blobs
 0605                };
 606            }
 607        }
 608    }
 609}
 610#endregion enum DeleteSnapshotsOption
 611
 612#region enum RehydratePriority
 613#endregion enum RehydratePriority
 614
 615#region class StorageError
 616namespace Azure.Storage.Blobs.Models
 617{
 618    /// <summary>
 619    /// StorageError
 620    /// </summary>
 621    internal partial class StorageError
 622    {
 623        /// <summary>
 624        /// Message
 625        /// </summary>
 626        public string Message { get; internal set; }
 627
 628        /// <summary>
 629        /// Code
 630        /// </summary>
 631        public string Code { get; internal set; }
 632
 633        /// <summary>
 634        /// Prevent direct instantiation of StorageError instances.
 635        /// You can use BlobsModelFactory.StorageError instead.
 636        /// </summary>
 637        internal StorageError() { }
 638
 639        /// <summary>
 640        /// Deserializes XML into a new StorageError instance.
 641        /// </summary>
 642        /// <param name="element">The XML element to deserialize.</param>
 643        /// <returns>A deserialized StorageError instance.</returns>
 644        internal static Azure.Storage.Blobs.Models.StorageError FromXml(System.Xml.Linq.XElement element)
 645        {
 646            System.Diagnostics.Debug.Assert(element != null);
 647            System.Xml.Linq.XElement _child;
 648            Azure.Storage.Blobs.Models.StorageError _value = new Azure.Storage.Blobs.Models.StorageError();
 649            _child = element.Element(System.Xml.Linq.XName.Get("Message", ""));
 650            if (_child != null)
 651            {
 652                _value.Message = _child.Value;
 653            }
 654            _child = element.Element(System.Xml.Linq.XName.Get("Code", ""));
 655            if (_child != null)
 656            {
 657                _value.Code = _child.Value;
 658            }
 659            CustomizeFromXml(element, _value);
 660            return _value;
 661        }
 662
 663        static partial void CustomizeFromXml(System.Xml.Linq.XElement element, Azure.Storage.Blobs.Models.StorageError v
 664    }
 665}
 666#endregion class StorageError
 667#endregion Models
 668