< Summary

Class:Azure.ResourceManager.Storage.BlobContainersRestOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\BlobContainersRestOperations.cs
Covered lines:571
Uncovered lines:200
Coverable lines:771
Total lines:1654
Line coverage:74% (571 of 771)
Covered branches:155
Total branches:324
Branch coverage:47.8% (155 of 324)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-83.33%50%
CreateListRequest(...)-95%75%
ListAsync()-73.33%50%
List(...)-73.33%50%
CreateCreateRequest(...)-100%100%
CreateAsync()-68.42%50%
Create(...)-68.42%50%
CreateUpdateRequest(...)-100%100%
UpdateAsync()-68.42%50%
Update(...)-68.42%50%
CreateGetRequest(...)-100%100%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-66.67%50%
Delete(...)-66.67%50%
CreateSetLegalHoldRequest(...)-100%100%
SetLegalHoldAsync()-68.42%50%
SetLegalHold(...)-68.42%50%
CreateClearLegalHoldRequest(...)-100%100%
ClearLegalHoldAsync()-68.42%50%
ClearLegalHold(...)-68.42%50%
CreateCreateOrUpdateImmutabilityPolicyRequest(...)-100%100%
CreateOrUpdateImmutabilityPolicyAsync()-70.59%50%
CreateOrUpdateImmutabilityPolicy(...)-70.59%50%
CreateGetImmutabilityPolicyRequest(...)-95%50%
GetImmutabilityPolicyAsync()-70.59%50%
GetImmutabilityPolicy(...)-70.59%50%
CreateDeleteImmutabilityPolicyRequest(...)-100%100%
DeleteImmutabilityPolicyAsync()-68.42%50%
DeleteImmutabilityPolicy(...)-68.42%50%
CreateLockImmutabilityPolicyRequest(...)-100%100%
LockImmutabilityPolicyAsync()-68.42%50%
LockImmutabilityPolicy(...)-68.42%50%
CreateExtendImmutabilityPolicyRequest(...)-100%100%
ExtendImmutabilityPolicyAsync()-68.42%50%
ExtendImmutabilityPolicy(...)-68.42%50%
CreateLeaseRequest(...)-0%0%
LeaseAsync()-0%0%
Lease(...)-0%0%
CreateListNextPageRequest(...)-100%100%
ListNextPageAsync()-70.59%50%
ListNextPage(...)-70.59%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\BlobContainersRestOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Text.Json;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core;
 14using Azure.Core.Pipeline;
 15using Azure.ResourceManager.Storage.Models;
 16
 17namespace Azure.ResourceManager.Storage
 18{
 19    internal partial class BlobContainersRestOperations
 20    {
 21        private string subscriptionId;
 22        private Uri endpoint;
 23        private string apiVersion;
 24        private ClientDiagnostics _clientDiagnostics;
 25        private HttpPipeline _pipeline;
 26
 27        /// <summary> Initializes a new instance of BlobContainersRestOperations. </summary>
 28        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 29        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 30        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 31        /// <param name="endpoint"> server parameter. </param>
 32        /// <param name="apiVersion"> Api Version. </param>
 33        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 24034        public BlobContainersRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscript
 35        {
 24036            if (subscriptionId == null)
 37            {
 038                throw new ArgumentNullException(nameof(subscriptionId));
 39            }
 24040            endpoint ??= new Uri("https://management.azure.com");
 24041            if (apiVersion == null)
 42            {
 043                throw new ArgumentNullException(nameof(apiVersion));
 44            }
 45
 24046            this.subscriptionId = subscriptionId;
 24047            this.endpoint = endpoint;
 24048            this.apiVersion = apiVersion;
 24049            _clientDiagnostics = clientDiagnostics;
 24050            _pipeline = pipeline;
 24051        }
 52
 53        internal HttpMessage CreateListRequest(string resourceGroupName, string accountName, string maxpagesize, string 
 54        {
 1255            var message = _pipeline.CreateMessage();
 1256            var request = message.Request;
 1257            request.Method = RequestMethod.Get;
 1258            var uri = new RawRequestUriBuilder();
 1259            uri.Reset(endpoint);
 1260            uri.AppendPath("/subscriptions/", false);
 1261            uri.AppendPath(subscriptionId, true);
 1262            uri.AppendPath("/resourceGroups/", false);
 1263            uri.AppendPath(resourceGroupName, true);
 1264            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 1265            uri.AppendPath(accountName, true);
 1266            uri.AppendPath("/blobServices/default/containers", false);
 1267            uri.AppendQuery("api-version", apiVersion, true);
 1268            if (maxpagesize != null)
 69            {
 470                uri.AppendQuery("$maxpagesize", maxpagesize, true);
 71            }
 1272            if (filter != null)
 73            {
 074                uri.AppendQuery("$filter", filter, true);
 75            }
 1276            uri.AppendQuery("$include", "deleted", true);
 1277            request.Uri = uri;
 1278            return message;
 79        }
 80
 81        /// <summary> Lists all containers and does not support a prefix like data plane. Also SRP today does not return
 82        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 83        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 84        /// <param name="maxpagesize"> Optional. Specified maximum number of containers that can be included in the list
 85        /// <param name="filter"> Optional. When specified, only container names starting with the filter will be listed
 86        /// <param name="cancellationToken"> The cancellation token to use. </param>
 87        public async Task<Response<ListContainerItems>> ListAsync(string resourceGroupName, string accountName, string m
 88        {
 689            if (resourceGroupName == null)
 90            {
 091                throw new ArgumentNullException(nameof(resourceGroupName));
 92            }
 693            if (accountName == null)
 94            {
 095                throw new ArgumentNullException(nameof(accountName));
 96            }
 97
 698            using var message = CreateListRequest(resourceGroupName, accountName, maxpagesize, filter);
 699            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6100            switch (message.Response.Status)
 101            {
 102                case 200:
 103                    {
 6104                        ListContainerItems value = default;
 6105                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6106                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 107                        {
 0108                            value = null;
 109                        }
 110                        else
 111                        {
 6112                            value = ListContainerItems.DeserializeListContainerItems(document.RootElement);
 113                        }
 6114                        return Response.FromValue(value, message.Response);
 115                    }
 116                default:
 0117                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 118            }
 6119        }
 120
 121        /// <summary> Lists all containers and does not support a prefix like data plane. Also SRP today does not return
 122        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 123        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 124        /// <param name="maxpagesize"> Optional. Specified maximum number of containers that can be included in the list
 125        /// <param name="filter"> Optional. When specified, only container names starting with the filter will be listed
 126        /// <param name="cancellationToken"> The cancellation token to use. </param>
 127        public Response<ListContainerItems> List(string resourceGroupName, string accountName, string maxpagesize = null
 128        {
 6129            if (resourceGroupName == null)
 130            {
 0131                throw new ArgumentNullException(nameof(resourceGroupName));
 132            }
 6133            if (accountName == null)
 134            {
 0135                throw new ArgumentNullException(nameof(accountName));
 136            }
 137
 6138            using var message = CreateListRequest(resourceGroupName, accountName, maxpagesize, filter);
 6139            _pipeline.Send(message, cancellationToken);
 6140            switch (message.Response.Status)
 141            {
 142                case 200:
 143                    {
 6144                        ListContainerItems value = default;
 6145                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6146                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 147                        {
 0148                            value = null;
 149                        }
 150                        else
 151                        {
 6152                            value = ListContainerItems.DeserializeListContainerItems(document.RootElement);
 153                        }
 6154                        return Response.FromValue(value, message.Response);
 155                    }
 156                default:
 0157                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 158            }
 6159        }
 160
 161        internal HttpMessage CreateCreateRequest(string resourceGroupName, string accountName, string containerName, Blo
 162        {
 68163            var message = _pipeline.CreateMessage();
 68164            var request = message.Request;
 68165            request.Method = RequestMethod.Put;
 68166            var uri = new RawRequestUriBuilder();
 68167            uri.Reset(endpoint);
 68168            uri.AppendPath("/subscriptions/", false);
 68169            uri.AppendPath(subscriptionId, true);
 68170            uri.AppendPath("/resourceGroups/", false);
 68171            uri.AppendPath(resourceGroupName, true);
 68172            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 68173            uri.AppendPath(accountName, true);
 68174            uri.AppendPath("/blobServices/default/containers/", false);
 68175            uri.AppendPath(containerName, true);
 68176            uri.AppendQuery("api-version", apiVersion, true);
 68177            request.Uri = uri;
 68178            request.Headers.Add("Content-Type", "application/json");
 68179            var content = new Utf8JsonRequestContent();
 68180            content.JsonWriter.WriteObjectValue(blobContainer);
 68181            request.Content = content;
 68182            return message;
 183        }
 184
 185        /// <summary> Creates a new container under the specified account as described by request body. The container re
 186        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 187        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 188        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 189        /// <param name="blobContainer"> Properties of the blob container to create. </param>
 190        /// <param name="cancellationToken"> The cancellation token to use. </param>
 191        public async Task<Response<BlobContainer>> CreateAsync(string resourceGroupName, string accountName, string cont
 192        {
 34193            if (resourceGroupName == null)
 194            {
 0195                throw new ArgumentNullException(nameof(resourceGroupName));
 196            }
 34197            if (accountName == null)
 198            {
 0199                throw new ArgumentNullException(nameof(accountName));
 200            }
 34201            if (containerName == null)
 202            {
 0203                throw new ArgumentNullException(nameof(containerName));
 204            }
 34205            if (blobContainer == null)
 206            {
 0207                throw new ArgumentNullException(nameof(blobContainer));
 208            }
 209
 34210            using var message = CreateCreateRequest(resourceGroupName, accountName, containerName, blobContainer);
 34211            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 34212            switch (message.Response.Status)
 213            {
 214                case 200:
 215                case 201:
 216                    {
 34217                        BlobContainer value = default;
 34218                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 34219                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 220                        {
 0221                            value = null;
 222                        }
 223                        else
 224                        {
 34225                            value = BlobContainer.DeserializeBlobContainer(document.RootElement);
 226                        }
 34227                        return Response.FromValue(value, message.Response);
 228                    }
 229                default:
 0230                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 231            }
 34232        }
 233
 234        /// <summary> Creates a new container under the specified account as described by request body. The container re
 235        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 236        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 237        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 238        /// <param name="blobContainer"> Properties of the blob container to create. </param>
 239        /// <param name="cancellationToken"> The cancellation token to use. </param>
 240        public Response<BlobContainer> Create(string resourceGroupName, string accountName, string containerName, BlobCo
 241        {
 34242            if (resourceGroupName == null)
 243            {
 0244                throw new ArgumentNullException(nameof(resourceGroupName));
 245            }
 34246            if (accountName == null)
 247            {
 0248                throw new ArgumentNullException(nameof(accountName));
 249            }
 34250            if (containerName == null)
 251            {
 0252                throw new ArgumentNullException(nameof(containerName));
 253            }
 34254            if (blobContainer == null)
 255            {
 0256                throw new ArgumentNullException(nameof(blobContainer));
 257            }
 258
 34259            using var message = CreateCreateRequest(resourceGroupName, accountName, containerName, blobContainer);
 34260            _pipeline.Send(message, cancellationToken);
 34261            switch (message.Response.Status)
 262            {
 263                case 200:
 264                case 201:
 265                    {
 34266                        BlobContainer value = default;
 34267                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 34268                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 269                        {
 0270                            value = null;
 271                        }
 272                        else
 273                        {
 34274                            value = BlobContainer.DeserializeBlobContainer(document.RootElement);
 275                        }
 34276                        return Response.FromValue(value, message.Response);
 277                    }
 278                default:
 0279                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 280            }
 34281        }
 282
 283        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string accountName, string containerName, Blo
 284        {
 12285            var message = _pipeline.CreateMessage();
 12286            var request = message.Request;
 12287            request.Method = RequestMethod.Patch;
 12288            var uri = new RawRequestUriBuilder();
 12289            uri.Reset(endpoint);
 12290            uri.AppendPath("/subscriptions/", false);
 12291            uri.AppendPath(subscriptionId, true);
 12292            uri.AppendPath("/resourceGroups/", false);
 12293            uri.AppendPath(resourceGroupName, true);
 12294            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 12295            uri.AppendPath(accountName, true);
 12296            uri.AppendPath("/blobServices/default/containers/", false);
 12297            uri.AppendPath(containerName, true);
 12298            uri.AppendQuery("api-version", apiVersion, true);
 12299            request.Uri = uri;
 12300            request.Headers.Add("Content-Type", "application/json");
 12301            var content = new Utf8JsonRequestContent();
 12302            content.JsonWriter.WriteObjectValue(blobContainer);
 12303            request.Content = content;
 12304            return message;
 305        }
 306
 307        /// <summary> Updates container properties as specified in request body. Properties not mentioned in the request
 308        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 309        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 310        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 311        /// <param name="blobContainer"> Properties to update for the blob container. </param>
 312        /// <param name="cancellationToken"> The cancellation token to use. </param>
 313        public async Task<Response<BlobContainer>> UpdateAsync(string resourceGroupName, string accountName, string cont
 314        {
 6315            if (resourceGroupName == null)
 316            {
 0317                throw new ArgumentNullException(nameof(resourceGroupName));
 318            }
 6319            if (accountName == null)
 320            {
 0321                throw new ArgumentNullException(nameof(accountName));
 322            }
 6323            if (containerName == null)
 324            {
 0325                throw new ArgumentNullException(nameof(containerName));
 326            }
 6327            if (blobContainer == null)
 328            {
 0329                throw new ArgumentNullException(nameof(blobContainer));
 330            }
 331
 6332            using var message = CreateUpdateRequest(resourceGroupName, accountName, containerName, blobContainer);
 6333            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6334            switch (message.Response.Status)
 335            {
 336                case 200:
 337                    {
 6338                        BlobContainer value = default;
 6339                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6340                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 341                        {
 0342                            value = null;
 343                        }
 344                        else
 345                        {
 6346                            value = BlobContainer.DeserializeBlobContainer(document.RootElement);
 347                        }
 6348                        return Response.FromValue(value, message.Response);
 349                    }
 350                default:
 0351                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 352            }
 6353        }
 354
 355        /// <summary> Updates container properties as specified in request body. Properties not mentioned in the request
 356        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 357        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 358        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 359        /// <param name="blobContainer"> Properties to update for the blob container. </param>
 360        /// <param name="cancellationToken"> The cancellation token to use. </param>
 361        public Response<BlobContainer> Update(string resourceGroupName, string accountName, string containerName, BlobCo
 362        {
 6363            if (resourceGroupName == null)
 364            {
 0365                throw new ArgumentNullException(nameof(resourceGroupName));
 366            }
 6367            if (accountName == null)
 368            {
 0369                throw new ArgumentNullException(nameof(accountName));
 370            }
 6371            if (containerName == null)
 372            {
 0373                throw new ArgumentNullException(nameof(containerName));
 374            }
 6375            if (blobContainer == null)
 376            {
 0377                throw new ArgumentNullException(nameof(blobContainer));
 378            }
 379
 6380            using var message = CreateUpdateRequest(resourceGroupName, accountName, containerName, blobContainer);
 6381            _pipeline.Send(message, cancellationToken);
 6382            switch (message.Response.Status)
 383            {
 384                case 200:
 385                    {
 6386                        BlobContainer value = default;
 6387                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6388                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 389                        {
 0390                            value = null;
 391                        }
 392                        else
 393                        {
 6394                            value = BlobContainer.DeserializeBlobContainer(document.RootElement);
 395                        }
 6396                        return Response.FromValue(value, message.Response);
 397                    }
 398                default:
 0399                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 400            }
 6401        }
 402
 403        internal HttpMessage CreateGetRequest(string resourceGroupName, string accountName, string containerName)
 404        {
 12405            var message = _pipeline.CreateMessage();
 12406            var request = message.Request;
 12407            request.Method = RequestMethod.Get;
 12408            var uri = new RawRequestUriBuilder();
 12409            uri.Reset(endpoint);
 12410            uri.AppendPath("/subscriptions/", false);
 12411            uri.AppendPath(subscriptionId, true);
 12412            uri.AppendPath("/resourceGroups/", false);
 12413            uri.AppendPath(resourceGroupName, true);
 12414            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 12415            uri.AppendPath(accountName, true);
 12416            uri.AppendPath("/blobServices/default/containers/", false);
 12417            uri.AppendPath(containerName, true);
 12418            uri.AppendQuery("api-version", apiVersion, true);
 12419            request.Uri = uri;
 12420            return message;
 421        }
 422
 423        /// <summary> Gets properties of a specified container. </summary>
 424        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 425        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 426        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 427        /// <param name="cancellationToken"> The cancellation token to use. </param>
 428        public async Task<Response<BlobContainer>> GetAsync(string resourceGroupName, string accountName, string contain
 429        {
 6430            if (resourceGroupName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(resourceGroupName));
 433            }
 6434            if (accountName == null)
 435            {
 0436                throw new ArgumentNullException(nameof(accountName));
 437            }
 6438            if (containerName == null)
 439            {
 0440                throw new ArgumentNullException(nameof(containerName));
 441            }
 442
 6443            using var message = CreateGetRequest(resourceGroupName, accountName, containerName);
 6444            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6445            switch (message.Response.Status)
 446            {
 447                case 200:
 448                    {
 6449                        BlobContainer value = default;
 6450                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6451                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 452                        {
 0453                            value = null;
 454                        }
 455                        else
 456                        {
 6457                            value = BlobContainer.DeserializeBlobContainer(document.RootElement);
 458                        }
 6459                        return Response.FromValue(value, message.Response);
 460                    }
 461                default:
 0462                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 463            }
 6464        }
 465
 466        /// <summary> Gets properties of a specified container. </summary>
 467        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 468        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 469        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 470        /// <param name="cancellationToken"> The cancellation token to use. </param>
 471        public Response<BlobContainer> Get(string resourceGroupName, string accountName, string containerName, Cancellat
 472        {
 6473            if (resourceGroupName == null)
 474            {
 0475                throw new ArgumentNullException(nameof(resourceGroupName));
 476            }
 6477            if (accountName == null)
 478            {
 0479                throw new ArgumentNullException(nameof(accountName));
 480            }
 6481            if (containerName == null)
 482            {
 0483                throw new ArgumentNullException(nameof(containerName));
 484            }
 485
 6486            using var message = CreateGetRequest(resourceGroupName, accountName, containerName);
 6487            _pipeline.Send(message, cancellationToken);
 6488            switch (message.Response.Status)
 489            {
 490                case 200:
 491                    {
 6492                        BlobContainer value = default;
 6493                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6494                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 495                        {
 0496                            value = null;
 497                        }
 498                        else
 499                        {
 6500                            value = BlobContainer.DeserializeBlobContainer(document.RootElement);
 501                        }
 6502                        return Response.FromValue(value, message.Response);
 503                    }
 504                default:
 0505                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 506            }
 6507        }
 508
 509        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string accountName, string containerName)
 510        {
 20511            var message = _pipeline.CreateMessage();
 20512            var request = message.Request;
 20513            request.Method = RequestMethod.Delete;
 20514            var uri = new RawRequestUriBuilder();
 20515            uri.Reset(endpoint);
 20516            uri.AppendPath("/subscriptions/", false);
 20517            uri.AppendPath(subscriptionId, true);
 20518            uri.AppendPath("/resourceGroups/", false);
 20519            uri.AppendPath(resourceGroupName, true);
 20520            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 20521            uri.AppendPath(accountName, true);
 20522            uri.AppendPath("/blobServices/default/containers/", false);
 20523            uri.AppendPath(containerName, true);
 20524            uri.AppendQuery("api-version", apiVersion, true);
 20525            request.Uri = uri;
 20526            return message;
 527        }
 528
 529        /// <summary> Deletes specified container under its account. </summary>
 530        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 531        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 532        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 533        /// <param name="cancellationToken"> The cancellation token to use. </param>
 534        public async Task<Response> DeleteAsync(string resourceGroupName, string accountName, string containerName, Canc
 535        {
 10536            if (resourceGroupName == null)
 537            {
 0538                throw new ArgumentNullException(nameof(resourceGroupName));
 539            }
 10540            if (accountName == null)
 541            {
 0542                throw new ArgumentNullException(nameof(accountName));
 543            }
 10544            if (containerName == null)
 545            {
 0546                throw new ArgumentNullException(nameof(containerName));
 547            }
 548
 10549            using var message = CreateDeleteRequest(resourceGroupName, accountName, containerName);
 10550            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 10551            switch (message.Response.Status)
 552            {
 553                case 200:
 554                case 204:
 10555                    return message.Response;
 556                default:
 0557                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 558            }
 10559        }
 560
 561        /// <summary> Deletes specified container under its account. </summary>
 562        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 563        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 564        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 565        /// <param name="cancellationToken"> The cancellation token to use. </param>
 566        public Response Delete(string resourceGroupName, string accountName, string containerName, CancellationToken can
 567        {
 10568            if (resourceGroupName == null)
 569            {
 0570                throw new ArgumentNullException(nameof(resourceGroupName));
 571            }
 10572            if (accountName == null)
 573            {
 0574                throw new ArgumentNullException(nameof(accountName));
 575            }
 10576            if (containerName == null)
 577            {
 0578                throw new ArgumentNullException(nameof(containerName));
 579            }
 580
 10581            using var message = CreateDeleteRequest(resourceGroupName, accountName, containerName);
 10582            _pipeline.Send(message, cancellationToken);
 10583            switch (message.Response.Status)
 584            {
 585                case 200:
 586                case 204:
 10587                    return message.Response;
 588                default:
 0589                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 590            }
 10591        }
 592
 593        internal HttpMessage CreateSetLegalHoldRequest(string resourceGroupName, string accountName, string containerNam
 594        {
 8595            var message = _pipeline.CreateMessage();
 8596            var request = message.Request;
 8597            request.Method = RequestMethod.Post;
 8598            var uri = new RawRequestUriBuilder();
 8599            uri.Reset(endpoint);
 8600            uri.AppendPath("/subscriptions/", false);
 8601            uri.AppendPath(subscriptionId, true);
 8602            uri.AppendPath("/resourceGroups/", false);
 8603            uri.AppendPath(resourceGroupName, true);
 8604            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 8605            uri.AppendPath(accountName, true);
 8606            uri.AppendPath("/blobServices/default/containers/", false);
 8607            uri.AppendPath(containerName, true);
 8608            uri.AppendPath("/setLegalHold", false);
 8609            uri.AppendQuery("api-version", apiVersion, true);
 8610            request.Uri = uri;
 8611            request.Headers.Add("Content-Type", "application/json");
 8612            var content = new Utf8JsonRequestContent();
 8613            content.JsonWriter.WriteObjectValue(legalHold);
 8614            request.Content = content;
 8615            return message;
 616        }
 617
 618        /// <summary> Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follow
 619        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 620        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 621        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 622        /// <param name="legalHold"> The LegalHold property that will be set to a blob container. </param>
 623        /// <param name="cancellationToken"> The cancellation token to use. </param>
 624        public async Task<Response<LegalHold>> SetLegalHoldAsync(string resourceGroupName, string accountName, string co
 625        {
 4626            if (resourceGroupName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(resourceGroupName));
 629            }
 4630            if (accountName == null)
 631            {
 0632                throw new ArgumentNullException(nameof(accountName));
 633            }
 4634            if (containerName == null)
 635            {
 0636                throw new ArgumentNullException(nameof(containerName));
 637            }
 4638            if (legalHold == null)
 639            {
 0640                throw new ArgumentNullException(nameof(legalHold));
 641            }
 642
 4643            using var message = CreateSetLegalHoldRequest(resourceGroupName, accountName, containerName, legalHold);
 4644            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4645            switch (message.Response.Status)
 646            {
 647                case 200:
 648                    {
 4649                        LegalHold value = default;
 4650                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4651                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 652                        {
 0653                            value = null;
 654                        }
 655                        else
 656                        {
 4657                            value = LegalHold.DeserializeLegalHold(document.RootElement);
 658                        }
 4659                        return Response.FromValue(value, message.Response);
 660                    }
 661                default:
 0662                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 663            }
 4664        }
 665
 666        /// <summary> Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follow
 667        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 668        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 669        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 670        /// <param name="legalHold"> The LegalHold property that will be set to a blob container. </param>
 671        /// <param name="cancellationToken"> The cancellation token to use. </param>
 672        public Response<LegalHold> SetLegalHold(string resourceGroupName, string accountName, string containerName, Lega
 673        {
 4674            if (resourceGroupName == null)
 675            {
 0676                throw new ArgumentNullException(nameof(resourceGroupName));
 677            }
 4678            if (accountName == null)
 679            {
 0680                throw new ArgumentNullException(nameof(accountName));
 681            }
 4682            if (containerName == null)
 683            {
 0684                throw new ArgumentNullException(nameof(containerName));
 685            }
 4686            if (legalHold == null)
 687            {
 0688                throw new ArgumentNullException(nameof(legalHold));
 689            }
 690
 4691            using var message = CreateSetLegalHoldRequest(resourceGroupName, accountName, containerName, legalHold);
 4692            _pipeline.Send(message, cancellationToken);
 4693            switch (message.Response.Status)
 694            {
 695                case 200:
 696                    {
 4697                        LegalHold value = default;
 4698                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4699                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 700                        {
 0701                            value = null;
 702                        }
 703                        else
 704                        {
 4705                            value = LegalHold.DeserializeLegalHold(document.RootElement);
 706                        }
 4707                        return Response.FromValue(value, message.Response);
 708                    }
 709                default:
 0710                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 711            }
 4712        }
 713
 714        internal HttpMessage CreateClearLegalHoldRequest(string resourceGroupName, string accountName, string containerN
 715        {
 8716            var message = _pipeline.CreateMessage();
 8717            var request = message.Request;
 8718            request.Method = RequestMethod.Post;
 8719            var uri = new RawRequestUriBuilder();
 8720            uri.Reset(endpoint);
 8721            uri.AppendPath("/subscriptions/", false);
 8722            uri.AppendPath(subscriptionId, true);
 8723            uri.AppendPath("/resourceGroups/", false);
 8724            uri.AppendPath(resourceGroupName, true);
 8725            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 8726            uri.AppendPath(accountName, true);
 8727            uri.AppendPath("/blobServices/default/containers/", false);
 8728            uri.AppendPath(containerName, true);
 8729            uri.AppendPath("/clearLegalHold", false);
 8730            uri.AppendQuery("api-version", apiVersion, true);
 8731            request.Uri = uri;
 8732            request.Headers.Add("Content-Type", "application/json");
 8733            var content = new Utf8JsonRequestContent();
 8734            content.JsonWriter.WriteObjectValue(legalHold);
 8735            request.Content = content;
 8736            return message;
 737        }
 738
 739        /// <summary> Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. 
 740        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 741        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 742        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 743        /// <param name="legalHold"> The LegalHold property that will be clear from a blob container. </param>
 744        /// <param name="cancellationToken"> The cancellation token to use. </param>
 745        public async Task<Response<LegalHold>> ClearLegalHoldAsync(string resourceGroupName, string accountName, string 
 746        {
 4747            if (resourceGroupName == null)
 748            {
 0749                throw new ArgumentNullException(nameof(resourceGroupName));
 750            }
 4751            if (accountName == null)
 752            {
 0753                throw new ArgumentNullException(nameof(accountName));
 754            }
 4755            if (containerName == null)
 756            {
 0757                throw new ArgumentNullException(nameof(containerName));
 758            }
 4759            if (legalHold == null)
 760            {
 0761                throw new ArgumentNullException(nameof(legalHold));
 762            }
 763
 4764            using var message = CreateClearLegalHoldRequest(resourceGroupName, accountName, containerName, legalHold);
 4765            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4766            switch (message.Response.Status)
 767            {
 768                case 200:
 769                    {
 4770                        LegalHold value = default;
 4771                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4772                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 773                        {
 0774                            value = null;
 775                        }
 776                        else
 777                        {
 4778                            value = LegalHold.DeserializeLegalHold(document.RootElement);
 779                        }
 4780                        return Response.FromValue(value, message.Response);
 781                    }
 782                default:
 0783                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 784            }
 4785        }
 786
 787        /// <summary> Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. 
 788        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 789        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 790        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 791        /// <param name="legalHold"> The LegalHold property that will be clear from a blob container. </param>
 792        /// <param name="cancellationToken"> The cancellation token to use. </param>
 793        public Response<LegalHold> ClearLegalHold(string resourceGroupName, string accountName, string containerName, Le
 794        {
 4795            if (resourceGroupName == null)
 796            {
 0797                throw new ArgumentNullException(nameof(resourceGroupName));
 798            }
 4799            if (accountName == null)
 800            {
 0801                throw new ArgumentNullException(nameof(accountName));
 802            }
 4803            if (containerName == null)
 804            {
 0805                throw new ArgumentNullException(nameof(containerName));
 806            }
 4807            if (legalHold == null)
 808            {
 0809                throw new ArgumentNullException(nameof(legalHold));
 810            }
 811
 4812            using var message = CreateClearLegalHoldRequest(resourceGroupName, accountName, containerName, legalHold);
 4813            _pipeline.Send(message, cancellationToken);
 4814            switch (message.Response.Status)
 815            {
 816                case 200:
 817                    {
 4818                        LegalHold value = default;
 4819                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4820                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 821                        {
 0822                            value = null;
 823                        }
 824                        else
 825                        {
 4826                            value = LegalHold.DeserializeLegalHold(document.RootElement);
 827                        }
 4828                        return Response.FromValue(value, message.Response);
 829                    }
 830                default:
 0831                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 832            }
 4833        }
 834
 835        internal HttpMessage CreateCreateOrUpdateImmutabilityPolicyRequest(string resourceGroupName, string accountName,
 836        {
 32837            var message = _pipeline.CreateMessage();
 32838            var request = message.Request;
 32839            request.Method = RequestMethod.Put;
 32840            var uri = new RawRequestUriBuilder();
 32841            uri.Reset(endpoint);
 32842            uri.AppendPath("/subscriptions/", false);
 32843            uri.AppendPath(subscriptionId, true);
 32844            uri.AppendPath("/resourceGroups/", false);
 32845            uri.AppendPath(resourceGroupName, true);
 32846            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 32847            uri.AppendPath(accountName, true);
 32848            uri.AppendPath("/blobServices/default/containers/", false);
 32849            uri.AppendPath(containerName, true);
 32850            uri.AppendPath("/immutabilityPolicies/", false);
 32851            uri.AppendPath("default", true);
 32852            uri.AppendQuery("api-version", apiVersion, true);
 32853            request.Uri = uri;
 32854            if (ifMatch != null)
 855            {
 8856                request.Headers.Add("If-Match", ifMatch);
 857            }
 32858            request.Headers.Add("Content-Type", "application/json");
 32859            if (parameters != null)
 860            {
 32861                var content = new Utf8JsonRequestContent();
 32862                content.JsonWriter.WriteObjectValue(parameters);
 32863                request.Content = content;
 864            }
 32865            return message;
 866        }
 867
 868        /// <summary> Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not r
 869        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 870        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 871        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 872        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 873        /// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob contai
 874        /// <param name="cancellationToken"> The cancellation token to use. </param>
 875        public async Task<Response<ImmutabilityPolicy>> CreateOrUpdateImmutabilityPolicyAsync(string resourceGroupName, 
 876        {
 16877            if (resourceGroupName == null)
 878            {
 0879                throw new ArgumentNullException(nameof(resourceGroupName));
 880            }
 16881            if (accountName == null)
 882            {
 0883                throw new ArgumentNullException(nameof(accountName));
 884            }
 16885            if (containerName == null)
 886            {
 0887                throw new ArgumentNullException(nameof(containerName));
 888            }
 889
 16890            using var message = CreateCreateOrUpdateImmutabilityPolicyRequest(resourceGroupName, accountName, containerN
 16891            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 16892            switch (message.Response.Status)
 893            {
 894                case 200:
 895                    {
 16896                        ImmutabilityPolicy value = default;
 16897                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 16898                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 899                        {
 0900                            value = null;
 901                        }
 902                        else
 903                        {
 16904                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 905                        }
 16906                        return Response.FromValue(value, message.Response);
 907                    }
 908                default:
 0909                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 910            }
 16911        }
 912
 913        /// <summary> Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not r
 914        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 915        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 916        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 917        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 918        /// <param name="parameters"> The ImmutabilityPolicy Properties that will be created or updated to a blob contai
 919        /// <param name="cancellationToken"> The cancellation token to use. </param>
 920        public Response<ImmutabilityPolicy> CreateOrUpdateImmutabilityPolicy(string resourceGroupName, string accountNam
 921        {
 16922            if (resourceGroupName == null)
 923            {
 0924                throw new ArgumentNullException(nameof(resourceGroupName));
 925            }
 16926            if (accountName == null)
 927            {
 0928                throw new ArgumentNullException(nameof(accountName));
 929            }
 16930            if (containerName == null)
 931            {
 0932                throw new ArgumentNullException(nameof(containerName));
 933            }
 934
 16935            using var message = CreateCreateOrUpdateImmutabilityPolicyRequest(resourceGroupName, accountName, containerN
 16936            _pipeline.Send(message, cancellationToken);
 16937            switch (message.Response.Status)
 938            {
 939                case 200:
 940                    {
 16941                        ImmutabilityPolicy value = default;
 16942                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 16943                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 944                        {
 0945                            value = null;
 946                        }
 947                        else
 948                        {
 16949                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 950                        }
 16951                        return Response.FromValue(value, message.Response);
 952                    }
 953                default:
 0954                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 955            }
 16956        }
 957
 958        internal HttpMessage CreateGetImmutabilityPolicyRequest(string resourceGroupName, string accountName, string con
 959        {
 8960            var message = _pipeline.CreateMessage();
 8961            var request = message.Request;
 8962            request.Method = RequestMethod.Get;
 8963            var uri = new RawRequestUriBuilder();
 8964            uri.Reset(endpoint);
 8965            uri.AppendPath("/subscriptions/", false);
 8966            uri.AppendPath(subscriptionId, true);
 8967            uri.AppendPath("/resourceGroups/", false);
 8968            uri.AppendPath(resourceGroupName, true);
 8969            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 8970            uri.AppendPath(accountName, true);
 8971            uri.AppendPath("/blobServices/default/containers/", false);
 8972            uri.AppendPath(containerName, true);
 8973            uri.AppendPath("/immutabilityPolicies/", false);
 8974            uri.AppendPath("default", true);
 8975            uri.AppendQuery("api-version", apiVersion, true);
 8976            request.Uri = uri;
 8977            if (ifMatch != null)
 978            {
 0979                request.Headers.Add("If-Match", ifMatch);
 980            }
 8981            return message;
 982        }
 983
 984        /// <summary> Gets the existing immutability policy along with the corresponding ETag in response headers and bo
 985        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 986        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 987        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 988        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 989        /// <param name="cancellationToken"> The cancellation token to use. </param>
 990        public async Task<Response<ImmutabilityPolicy>> GetImmutabilityPolicyAsync(string resourceGroupName, string acco
 991        {
 4992            if (resourceGroupName == null)
 993            {
 0994                throw new ArgumentNullException(nameof(resourceGroupName));
 995            }
 4996            if (accountName == null)
 997            {
 0998                throw new ArgumentNullException(nameof(accountName));
 999            }
 41000            if (containerName == null)
 1001            {
 01002                throw new ArgumentNullException(nameof(containerName));
 1003            }
 1004
 41005            using var message = CreateGetImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifMatc
 41006            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 41007            switch (message.Response.Status)
 1008            {
 1009                case 200:
 1010                    {
 41011                        ImmutabilityPolicy value = default;
 41012                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 41013                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1014                        {
 01015                            value = null;
 1016                        }
 1017                        else
 1018                        {
 41019                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1020                        }
 41021                        return Response.FromValue(value, message.Response);
 1022                    }
 1023                default:
 01024                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1025            }
 41026        }
 1027
 1028        /// <summary> Gets the existing immutability policy along with the corresponding ETag in response headers and bo
 1029        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1030        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1031        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1032        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1033        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1034        public Response<ImmutabilityPolicy> GetImmutabilityPolicy(string resourceGroupName, string accountName, string c
 1035        {
 41036            if (resourceGroupName == null)
 1037            {
 01038                throw new ArgumentNullException(nameof(resourceGroupName));
 1039            }
 41040            if (accountName == null)
 1041            {
 01042                throw new ArgumentNullException(nameof(accountName));
 1043            }
 41044            if (containerName == null)
 1045            {
 01046                throw new ArgumentNullException(nameof(containerName));
 1047            }
 1048
 41049            using var message = CreateGetImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifMatc
 41050            _pipeline.Send(message, cancellationToken);
 41051            switch (message.Response.Status)
 1052            {
 1053                case 200:
 1054                    {
 41055                        ImmutabilityPolicy value = default;
 41056                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 41057                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1058                        {
 01059                            value = null;
 1060                        }
 1061                        else
 1062                        {
 41063                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1064                        }
 41065                        return Response.FromValue(value, message.Response);
 1066                    }
 1067                default:
 01068                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1069            }
 41070        }
 1071
 1072        internal HttpMessage CreateDeleteImmutabilityPolicyRequest(string resourceGroupName, string accountName, string 
 1073        {
 41074            var message = _pipeline.CreateMessage();
 41075            var request = message.Request;
 41076            request.Method = RequestMethod.Delete;
 41077            var uri = new RawRequestUriBuilder();
 41078            uri.Reset(endpoint);
 41079            uri.AppendPath("/subscriptions/", false);
 41080            uri.AppendPath(subscriptionId, true);
 41081            uri.AppendPath("/resourceGroups/", false);
 41082            uri.AppendPath(resourceGroupName, true);
 41083            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 41084            uri.AppendPath(accountName, true);
 41085            uri.AppendPath("/blobServices/default/containers/", false);
 41086            uri.AppendPath(containerName, true);
 41087            uri.AppendPath("/immutabilityPolicies/", false);
 41088            uri.AppendPath("default", true);
 41089            uri.AppendQuery("api-version", apiVersion, true);
 41090            request.Uri = uri;
 41091            request.Headers.Add("If-Match", ifMatch);
 41092            return message;
 1093        }
 1094
 1095        /// <summary> Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreation
 1096        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1097        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1098        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1099        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1100        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1101        public async Task<Response<ImmutabilityPolicy>> DeleteImmutabilityPolicyAsync(string resourceGroupName, string a
 1102        {
 21103            if (resourceGroupName == null)
 1104            {
 01105                throw new ArgumentNullException(nameof(resourceGroupName));
 1106            }
 21107            if (accountName == null)
 1108            {
 01109                throw new ArgumentNullException(nameof(accountName));
 1110            }
 21111            if (containerName == null)
 1112            {
 01113                throw new ArgumentNullException(nameof(containerName));
 1114            }
 21115            if (ifMatch == null)
 1116            {
 01117                throw new ArgumentNullException(nameof(ifMatch));
 1118            }
 1119
 21120            using var message = CreateDeleteImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifM
 21121            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 21122            switch (message.Response.Status)
 1123            {
 1124                case 200:
 1125                    {
 21126                        ImmutabilityPolicy value = default;
 21127                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 21128                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1129                        {
 01130                            value = null;
 1131                        }
 1132                        else
 1133                        {
 21134                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1135                        }
 21136                        return Response.FromValue(value, message.Response);
 1137                    }
 1138                default:
 01139                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1140            }
 21141        }
 1142
 1143        /// <summary> Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreation
 1144        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1145        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1146        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1147        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1148        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1149        public Response<ImmutabilityPolicy> DeleteImmutabilityPolicy(string resourceGroupName, string accountName, strin
 1150        {
 21151            if (resourceGroupName == null)
 1152            {
 01153                throw new ArgumentNullException(nameof(resourceGroupName));
 1154            }
 21155            if (accountName == null)
 1156            {
 01157                throw new ArgumentNullException(nameof(accountName));
 1158            }
 21159            if (containerName == null)
 1160            {
 01161                throw new ArgumentNullException(nameof(containerName));
 1162            }
 21163            if (ifMatch == null)
 1164            {
 01165                throw new ArgumentNullException(nameof(ifMatch));
 1166            }
 1167
 21168            using var message = CreateDeleteImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifM
 21169            _pipeline.Send(message, cancellationToken);
 21170            switch (message.Response.Status)
 1171            {
 1172                case 200:
 1173                    {
 21174                        ImmutabilityPolicy value = default;
 21175                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 21176                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1177                        {
 01178                            value = null;
 1179                        }
 1180                        else
 1181                        {
 21182                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1183                        }
 21184                        return Response.FromValue(value, message.Response);
 1185                    }
 1186                default:
 01187                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1188            }
 21189        }
 1190
 1191        internal HttpMessage CreateLockImmutabilityPolicyRequest(string resourceGroupName, string accountName, string co
 1192        {
 121193            var message = _pipeline.CreateMessage();
 121194            var request = message.Request;
 121195            request.Method = RequestMethod.Post;
 121196            var uri = new RawRequestUriBuilder();
 121197            uri.Reset(endpoint);
 121198            uri.AppendPath("/subscriptions/", false);
 121199            uri.AppendPath(subscriptionId, true);
 121200            uri.AppendPath("/resourceGroups/", false);
 121201            uri.AppendPath(resourceGroupName, true);
 121202            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 121203            uri.AppendPath(accountName, true);
 121204            uri.AppendPath("/blobServices/default/containers/", false);
 121205            uri.AppendPath(containerName, true);
 121206            uri.AppendPath("/immutabilityPolicies/default/lock", false);
 121207            uri.AppendQuery("api-version", apiVersion, true);
 121208            request.Uri = uri;
 121209            request.Headers.Add("If-Match", ifMatch);
 121210            return message;
 1211        }
 1212
 1213        /// <summary> Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendI
 1214        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1215        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1216        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1217        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1218        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1219        public async Task<Response<ImmutabilityPolicy>> LockImmutabilityPolicyAsync(string resourceGroupName, string acc
 1220        {
 61221            if (resourceGroupName == null)
 1222            {
 01223                throw new ArgumentNullException(nameof(resourceGroupName));
 1224            }
 61225            if (accountName == null)
 1226            {
 01227                throw new ArgumentNullException(nameof(accountName));
 1228            }
 61229            if (containerName == null)
 1230            {
 01231                throw new ArgumentNullException(nameof(containerName));
 1232            }
 61233            if (ifMatch == null)
 1234            {
 01235                throw new ArgumentNullException(nameof(ifMatch));
 1236            }
 1237
 61238            using var message = CreateLockImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifMat
 61239            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 61240            switch (message.Response.Status)
 1241            {
 1242                case 200:
 1243                    {
 61244                        ImmutabilityPolicy value = default;
 61245                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 61246                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1247                        {
 01248                            value = null;
 1249                        }
 1250                        else
 1251                        {
 61252                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1253                        }
 61254                        return Response.FromValue(value, message.Response);
 1255                    }
 1256                default:
 01257                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1258            }
 61259        }
 1260
 1261        /// <summary> Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendI
 1262        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1263        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1264        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1265        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1266        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1267        public Response<ImmutabilityPolicy> LockImmutabilityPolicy(string resourceGroupName, string accountName, string 
 1268        {
 61269            if (resourceGroupName == null)
 1270            {
 01271                throw new ArgumentNullException(nameof(resourceGroupName));
 1272            }
 61273            if (accountName == null)
 1274            {
 01275                throw new ArgumentNullException(nameof(accountName));
 1276            }
 61277            if (containerName == null)
 1278            {
 01279                throw new ArgumentNullException(nameof(containerName));
 1280            }
 61281            if (ifMatch == null)
 1282            {
 01283                throw new ArgumentNullException(nameof(ifMatch));
 1284            }
 1285
 61286            using var message = CreateLockImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifMat
 61287            _pipeline.Send(message, cancellationToken);
 61288            switch (message.Response.Status)
 1289            {
 1290                case 200:
 1291                    {
 61292                        ImmutabilityPolicy value = default;
 61293                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 61294                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1295                        {
 01296                            value = null;
 1297                        }
 1298                        else
 1299                        {
 61300                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1301                        }
 61302                        return Response.FromValue(value, message.Response);
 1303                    }
 1304                default:
 01305                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1306            }
 61307        }
 1308
 1309        internal HttpMessage CreateExtendImmutabilityPolicyRequest(string resourceGroupName, string accountName, string 
 1310        {
 81311            var message = _pipeline.CreateMessage();
 81312            var request = message.Request;
 81313            request.Method = RequestMethod.Post;
 81314            var uri = new RawRequestUriBuilder();
 81315            uri.Reset(endpoint);
 81316            uri.AppendPath("/subscriptions/", false);
 81317            uri.AppendPath(subscriptionId, true);
 81318            uri.AppendPath("/resourceGroups/", false);
 81319            uri.AppendPath(resourceGroupName, true);
 81320            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 81321            uri.AppendPath(accountName, true);
 81322            uri.AppendPath("/blobServices/default/containers/", false);
 81323            uri.AppendPath(containerName, true);
 81324            uri.AppendPath("/immutabilityPolicies/default/extend", false);
 81325            uri.AppendQuery("api-version", apiVersion, true);
 81326            request.Uri = uri;
 81327            request.Headers.Add("If-Match", ifMatch);
 81328            request.Headers.Add("Content-Type", "application/json");
 81329            if (parameters != null)
 1330            {
 81331                var content = new Utf8JsonRequestContent();
 81332                content.JsonWriter.WriteObjectValue(parameters);
 81333                request.Content = content;
 1334            }
 81335            return message;
 1336        }
 1337
 1338        /// <summary> Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action 
 1339        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1340        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1341        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1342        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1343        /// <param name="parameters"> The ImmutabilityPolicy Properties that will be extended for a blob container. </pa
 1344        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1345        public async Task<Response<ImmutabilityPolicy>> ExtendImmutabilityPolicyAsync(string resourceGroupName, string a
 1346        {
 41347            if (resourceGroupName == null)
 1348            {
 01349                throw new ArgumentNullException(nameof(resourceGroupName));
 1350            }
 41351            if (accountName == null)
 1352            {
 01353                throw new ArgumentNullException(nameof(accountName));
 1354            }
 41355            if (containerName == null)
 1356            {
 01357                throw new ArgumentNullException(nameof(containerName));
 1358            }
 41359            if (ifMatch == null)
 1360            {
 01361                throw new ArgumentNullException(nameof(ifMatch));
 1362            }
 1363
 41364            using var message = CreateExtendImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifM
 41365            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 41366            switch (message.Response.Status)
 1367            {
 1368                case 200:
 1369                    {
 41370                        ImmutabilityPolicy value = default;
 41371                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 41372                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1373                        {
 01374                            value = null;
 1375                        }
 1376                        else
 1377                        {
 41378                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1379                        }
 41380                        return Response.FromValue(value, message.Response);
 1381                    }
 1382                default:
 01383                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1384            }
 41385        }
 1386
 1387        /// <summary> Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action 
 1388        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1389        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1390        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1391        /// <param name="ifMatch"> The entity state (ETag) version of the immutability policy to update. A value of &quo
 1392        /// <param name="parameters"> The ImmutabilityPolicy Properties that will be extended for a blob container. </pa
 1393        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1394        public Response<ImmutabilityPolicy> ExtendImmutabilityPolicy(string resourceGroupName, string accountName, strin
 1395        {
 41396            if (resourceGroupName == null)
 1397            {
 01398                throw new ArgumentNullException(nameof(resourceGroupName));
 1399            }
 41400            if (accountName == null)
 1401            {
 01402                throw new ArgumentNullException(nameof(accountName));
 1403            }
 41404            if (containerName == null)
 1405            {
 01406                throw new ArgumentNullException(nameof(containerName));
 1407            }
 41408            if (ifMatch == null)
 1409            {
 01410                throw new ArgumentNullException(nameof(ifMatch));
 1411            }
 1412
 41413            using var message = CreateExtendImmutabilityPolicyRequest(resourceGroupName, accountName, containerName, ifM
 41414            _pipeline.Send(message, cancellationToken);
 41415            switch (message.Response.Status)
 1416            {
 1417                case 200:
 1418                    {
 41419                        ImmutabilityPolicy value = default;
 41420                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 41421                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1422                        {
 01423                            value = null;
 1424                        }
 1425                        else
 1426                        {
 41427                            value = ImmutabilityPolicy.DeserializeImmutabilityPolicy(document.RootElement);
 1428                        }
 41429                        return Response.FromValue(value, message.Response);
 1430                    }
 1431                default:
 01432                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1433            }
 41434        }
 1435
 1436        internal HttpMessage CreateLeaseRequest(string resourceGroupName, string accountName, string containerName, Leas
 1437        {
 01438            var message = _pipeline.CreateMessage();
 01439            var request = message.Request;
 01440            request.Method = RequestMethod.Post;
 01441            var uri = new RawRequestUriBuilder();
 01442            uri.Reset(endpoint);
 01443            uri.AppendPath("/subscriptions/", false);
 01444            uri.AppendPath(subscriptionId, true);
 01445            uri.AppendPath("/resourceGroups/", false);
 01446            uri.AppendPath(resourceGroupName, true);
 01447            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 01448            uri.AppendPath(accountName, true);
 01449            uri.AppendPath("/blobServices/default/containers/", false);
 01450            uri.AppendPath(containerName, true);
 01451            uri.AppendPath("/lease", false);
 01452            uri.AppendQuery("api-version", apiVersion, true);
 01453            request.Uri = uri;
 01454            request.Headers.Add("Content-Type", "application/json");
 01455            if (parameters != null)
 1456            {
 01457                var content = new Utf8JsonRequestContent();
 01458                content.JsonWriter.WriteObjectValue(parameters);
 01459                request.Content = content;
 1460            }
 01461            return message;
 1462        }
 1463
 1464        /// <summary> The Lease Container operation establishes and manages a lock on a container for delete operations.
 1465        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1466        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1467        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1468        /// <param name="parameters"> Lease Container request body. </param>
 1469        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1470        public async Task<Response<LeaseContainerResponse>> LeaseAsync(string resourceGroupName, string accountName, str
 1471        {
 01472            if (resourceGroupName == null)
 1473            {
 01474                throw new ArgumentNullException(nameof(resourceGroupName));
 1475            }
 01476            if (accountName == null)
 1477            {
 01478                throw new ArgumentNullException(nameof(accountName));
 1479            }
 01480            if (containerName == null)
 1481            {
 01482                throw new ArgumentNullException(nameof(containerName));
 1483            }
 1484
 01485            using var message = CreateLeaseRequest(resourceGroupName, accountName, containerName, parameters);
 01486            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01487            switch (message.Response.Status)
 1488            {
 1489                case 200:
 1490                    {
 01491                        LeaseContainerResponse value = default;
 01492                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01493                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1494                        {
 01495                            value = null;
 1496                        }
 1497                        else
 1498                        {
 01499                            value = LeaseContainerResponse.DeserializeLeaseContainerResponse(document.RootElement);
 1500                        }
 01501                        return Response.FromValue(value, message.Response);
 1502                    }
 1503                default:
 01504                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1505            }
 01506        }
 1507
 1508        /// <summary> The Lease Container operation establishes and manages a lock on a container for delete operations.
 1509        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1510        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1511        /// <param name="containerName"> The name of the blob container within the specified storage account. Blob conta
 1512        /// <param name="parameters"> Lease Container request body. </param>
 1513        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1514        public Response<LeaseContainerResponse> Lease(string resourceGroupName, string accountName, string containerName
 1515        {
 01516            if (resourceGroupName == null)
 1517            {
 01518                throw new ArgumentNullException(nameof(resourceGroupName));
 1519            }
 01520            if (accountName == null)
 1521            {
 01522                throw new ArgumentNullException(nameof(accountName));
 1523            }
 01524            if (containerName == null)
 1525            {
 01526                throw new ArgumentNullException(nameof(containerName));
 1527            }
 1528
 01529            using var message = CreateLeaseRequest(resourceGroupName, accountName, containerName, parameters);
 01530            _pipeline.Send(message, cancellationToken);
 01531            switch (message.Response.Status)
 1532            {
 1533                case 200:
 1534                    {
 01535                        LeaseContainerResponse value = default;
 01536                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01537                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1538                        {
 01539                            value = null;
 1540                        }
 1541                        else
 1542                        {
 01543                            value = LeaseContainerResponse.DeserializeLeaseContainerResponse(document.RootElement);
 1544                        }
 01545                        return Response.FromValue(value, message.Response);
 1546                    }
 1547                default:
 01548                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1549            }
 01550        }
 1551
 1552        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string accountName, st
 1553        {
 41554            var message = _pipeline.CreateMessage();
 41555            var request = message.Request;
 41556            request.Method = RequestMethod.Get;
 41557            var uri = new RawRequestUriBuilder();
 41558            uri.Reset(endpoint);
 41559            uri.AppendRawNextLink(nextLink, false);
 41560            request.Uri = uri;
 41561            return message;
 1562        }
 1563
 1564        /// <summary> Lists all containers and does not support a prefix like data plane. Also SRP today does not return
 1565        /// <param name="nextLink"> The URL to the next page of results. </param>
 1566        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1567        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1568        /// <param name="maxpagesize"> Optional. Specified maximum number of containers that can be included in the list
 1569        /// <param name="filter"> Optional. When specified, only container names starting with the filter will be listed
 1570        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1571        public async Task<Response<ListContainerItems>> ListNextPageAsync(string nextLink, string resourceGroupName, str
 1572        {
 21573            if (nextLink == null)
 1574            {
 01575                throw new ArgumentNullException(nameof(nextLink));
 1576            }
 21577            if (resourceGroupName == null)
 1578            {
 01579                throw new ArgumentNullException(nameof(resourceGroupName));
 1580            }
 21581            if (accountName == null)
 1582            {
 01583                throw new ArgumentNullException(nameof(accountName));
 1584            }
 1585
 21586            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, accountName, maxpagesize, filter)
 21587            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 21588            switch (message.Response.Status)
 1589            {
 1590                case 200:
 1591                    {
 21592                        ListContainerItems value = default;
 21593                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 21594                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1595                        {
 01596                            value = null;
 1597                        }
 1598                        else
 1599                        {
 21600                            value = ListContainerItems.DeserializeListContainerItems(document.RootElement);
 1601                        }
 21602                        return Response.FromValue(value, message.Response);
 1603                    }
 1604                default:
 01605                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1606            }
 21607        }
 1608
 1609        /// <summary> Lists all containers and does not support a prefix like data plane. Also SRP today does not return
 1610        /// <param name="nextLink"> The URL to the next page of results. </param>
 1611        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 1612        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 1613        /// <param name="maxpagesize"> Optional. Specified maximum number of containers that can be included in the list
 1614        /// <param name="filter"> Optional. When specified, only container names starting with the filter will be listed
 1615        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1616        public Response<ListContainerItems> ListNextPage(string nextLink, string resourceGroupName, string accountName, 
 1617        {
 21618            if (nextLink == null)
 1619            {
 01620                throw new ArgumentNullException(nameof(nextLink));
 1621            }
 21622            if (resourceGroupName == null)
 1623            {
 01624                throw new ArgumentNullException(nameof(resourceGroupName));
 1625            }
 21626            if (accountName == null)
 1627            {
 01628                throw new ArgumentNullException(nameof(accountName));
 1629            }
 1630
 21631            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, accountName, maxpagesize, filter)
 21632            _pipeline.Send(message, cancellationToken);
 21633            switch (message.Response.Status)
 1634            {
 1635                case 200:
 1636                    {
 21637                        ListContainerItems value = default;
 21638                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 21639                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1640                        {
 01641                            value = null;
 1642                        }
 1643                        else
 1644                        {
 21645                            value = ListContainerItems.DeserializeListContainerItems(document.RootElement);
 1646                        }
 21647                        return Response.FromValue(value, message.Response);
 1648                    }
 1649                default:
 01650                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1651            }
 21652        }
 1653    }
 1654}