< Summary

Class:Azure.ResourceManager.Storage.EncryptionScopesRestOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\EncryptionScopesRestOperations.cs
Covered lines:179
Uncovered lines:86
Coverable lines:265
Total lines:594
Line coverage:67.5% (179 of 265)
Covered branches:45
Total branches:110
Branch coverage:40.9% (45 of 110)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-83.33%50%
CreatePutRequest(...)-100%100%
PutAsync()-68.42%50%
Put(...)-68.42%50%
CreatePatchRequest(...)-100%100%
PatchAsync()-68.42%50%
Patch(...)-68.42%50%
CreateGetRequest(...)-100%100%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateListRequest(...)-100%100%
ListAsync()-73.33%50%
List(...)-73.33%50%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\EncryptionScopesRestOperations.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 EncryptionScopesRestOperations
 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 EncryptionScopesRestOperations. </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 EncryptionScopesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscri
 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 CreatePutRequest(string resourceGroupName, string accountName, string encryptionScopeName, 
 54        {
 1255            var message = _pipeline.CreateMessage();
 1256            var request = message.Request;
 1257            request.Method = RequestMethod.Put;
 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("/encryptionScopes/", false);
 1267            uri.AppendPath(encryptionScopeName, true);
 1268            uri.AppendQuery("api-version", apiVersion, true);
 1269            request.Uri = uri;
 1270            request.Headers.Add("Content-Type", "application/json");
 1271            var content = new Utf8JsonRequestContent();
 1272            content.JsonWriter.WriteObjectValue(encryptionScope);
 1273            request.Content = content;
 1274            return message;
 75        }
 76
 77        /// <summary> Synchronously creates or updates an encryption scope under the specified storage account. If an en
 78        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 79        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 80        /// <param name="encryptionScopeName"> The name of the encryption scope within the specified storage account. En
 81        /// <param name="encryptionScope"> Encryption scope properties to be used for the create or update. </param>
 82        /// <param name="cancellationToken"> The cancellation token to use. </param>
 83        public async Task<Response<EncryptionScope>> PutAsync(string resourceGroupName, string accountName, string encry
 84        {
 685            if (resourceGroupName == null)
 86            {
 087                throw new ArgumentNullException(nameof(resourceGroupName));
 88            }
 689            if (accountName == null)
 90            {
 091                throw new ArgumentNullException(nameof(accountName));
 92            }
 693            if (encryptionScopeName == null)
 94            {
 095                throw new ArgumentNullException(nameof(encryptionScopeName));
 96            }
 697            if (encryptionScope == null)
 98            {
 099                throw new ArgumentNullException(nameof(encryptionScope));
 100            }
 101
 6102            using var message = CreatePutRequest(resourceGroupName, accountName, encryptionScopeName, encryptionScope);
 6103            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6104            switch (message.Response.Status)
 105            {
 106                case 200:
 107                case 201:
 108                    {
 6109                        EncryptionScope value = default;
 6110                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6111                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 112                        {
 0113                            value = null;
 114                        }
 115                        else
 116                        {
 6117                            value = EncryptionScope.DeserializeEncryptionScope(document.RootElement);
 118                        }
 6119                        return Response.FromValue(value, message.Response);
 120                    }
 121                default:
 0122                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 123            }
 6124        }
 125
 126        /// <summary> Synchronously creates or updates an encryption scope under the specified storage account. If an en
 127        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 128        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 129        /// <param name="encryptionScopeName"> The name of the encryption scope within the specified storage account. En
 130        /// <param name="encryptionScope"> Encryption scope properties to be used for the create or update. </param>
 131        /// <param name="cancellationToken"> The cancellation token to use. </param>
 132        public Response<EncryptionScope> Put(string resourceGroupName, string accountName, string encryptionScopeName, E
 133        {
 6134            if (resourceGroupName == null)
 135            {
 0136                throw new ArgumentNullException(nameof(resourceGroupName));
 137            }
 6138            if (accountName == null)
 139            {
 0140                throw new ArgumentNullException(nameof(accountName));
 141            }
 6142            if (encryptionScopeName == null)
 143            {
 0144                throw new ArgumentNullException(nameof(encryptionScopeName));
 145            }
 6146            if (encryptionScope == null)
 147            {
 0148                throw new ArgumentNullException(nameof(encryptionScope));
 149            }
 150
 6151            using var message = CreatePutRequest(resourceGroupName, accountName, encryptionScopeName, encryptionScope);
 6152            _pipeline.Send(message, cancellationToken);
 6153            switch (message.Response.Status)
 154            {
 155                case 200:
 156                case 201:
 157                    {
 6158                        EncryptionScope value = default;
 6159                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6160                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 161                        {
 0162                            value = null;
 163                        }
 164                        else
 165                        {
 6166                            value = EncryptionScope.DeserializeEncryptionScope(document.RootElement);
 167                        }
 6168                        return Response.FromValue(value, message.Response);
 169                    }
 170                default:
 0171                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 172            }
 6173        }
 174
 175        internal HttpMessage CreatePatchRequest(string resourceGroupName, string accountName, string encryptionScopeName
 176        {
 4177            var message = _pipeline.CreateMessage();
 4178            var request = message.Request;
 4179            request.Method = RequestMethod.Patch;
 4180            var uri = new RawRequestUriBuilder();
 4181            uri.Reset(endpoint);
 4182            uri.AppendPath("/subscriptions/", false);
 4183            uri.AppendPath(subscriptionId, true);
 4184            uri.AppendPath("/resourceGroups/", false);
 4185            uri.AppendPath(resourceGroupName, true);
 4186            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 4187            uri.AppendPath(accountName, true);
 4188            uri.AppendPath("/encryptionScopes/", false);
 4189            uri.AppendPath(encryptionScopeName, true);
 4190            uri.AppendQuery("api-version", apiVersion, true);
 4191            request.Uri = uri;
 4192            request.Headers.Add("Content-Type", "application/json");
 4193            var content = new Utf8JsonRequestContent();
 4194            content.JsonWriter.WriteObjectValue(encryptionScope);
 4195            request.Content = content;
 4196            return message;
 197        }
 198
 199        /// <summary> Update encryption scope properties as specified in the request body. Update fails if the specified
 200        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 201        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 202        /// <param name="encryptionScopeName"> The name of the encryption scope within the specified storage account. En
 203        /// <param name="encryptionScope"> Encryption scope properties to be used for the update. </param>
 204        /// <param name="cancellationToken"> The cancellation token to use. </param>
 205        public async Task<Response<EncryptionScope>> PatchAsync(string resourceGroupName, string accountName, string enc
 206        {
 2207            if (resourceGroupName == null)
 208            {
 0209                throw new ArgumentNullException(nameof(resourceGroupName));
 210            }
 2211            if (accountName == null)
 212            {
 0213                throw new ArgumentNullException(nameof(accountName));
 214            }
 2215            if (encryptionScopeName == null)
 216            {
 0217                throw new ArgumentNullException(nameof(encryptionScopeName));
 218            }
 2219            if (encryptionScope == null)
 220            {
 0221                throw new ArgumentNullException(nameof(encryptionScope));
 222            }
 223
 2224            using var message = CreatePatchRequest(resourceGroupName, accountName, encryptionScopeName, encryptionScope)
 2225            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2226            switch (message.Response.Status)
 227            {
 228                case 200:
 229                    {
 2230                        EncryptionScope value = default;
 2231                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2232                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 233                        {
 0234                            value = null;
 235                        }
 236                        else
 237                        {
 2238                            value = EncryptionScope.DeserializeEncryptionScope(document.RootElement);
 239                        }
 2240                        return Response.FromValue(value, message.Response);
 241                    }
 242                default:
 0243                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 244            }
 2245        }
 246
 247        /// <summary> Update encryption scope properties as specified in the request body. Update fails if the specified
 248        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 249        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 250        /// <param name="encryptionScopeName"> The name of the encryption scope within the specified storage account. En
 251        /// <param name="encryptionScope"> Encryption scope properties to be used for the update. </param>
 252        /// <param name="cancellationToken"> The cancellation token to use. </param>
 253        public Response<EncryptionScope> Patch(string resourceGroupName, string accountName, string encryptionScopeName,
 254        {
 2255            if (resourceGroupName == null)
 256            {
 0257                throw new ArgumentNullException(nameof(resourceGroupName));
 258            }
 2259            if (accountName == null)
 260            {
 0261                throw new ArgumentNullException(nameof(accountName));
 262            }
 2263            if (encryptionScopeName == null)
 264            {
 0265                throw new ArgumentNullException(nameof(encryptionScopeName));
 266            }
 2267            if (encryptionScope == null)
 268            {
 0269                throw new ArgumentNullException(nameof(encryptionScope));
 270            }
 271
 2272            using var message = CreatePatchRequest(resourceGroupName, accountName, encryptionScopeName, encryptionScope)
 2273            _pipeline.Send(message, cancellationToken);
 2274            switch (message.Response.Status)
 275            {
 276                case 200:
 277                    {
 2278                        EncryptionScope value = default;
 2279                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2280                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 281                        {
 0282                            value = null;
 283                        }
 284                        else
 285                        {
 2286                            value = EncryptionScope.DeserializeEncryptionScope(document.RootElement);
 287                        }
 2288                        return Response.FromValue(value, message.Response);
 289                    }
 290                default:
 0291                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 292            }
 2293        }
 294
 295        internal HttpMessage CreateGetRequest(string resourceGroupName, string accountName, string encryptionScopeName)
 296        {
 4297            var message = _pipeline.CreateMessage();
 4298            var request = message.Request;
 4299            request.Method = RequestMethod.Get;
 4300            var uri = new RawRequestUriBuilder();
 4301            uri.Reset(endpoint);
 4302            uri.AppendPath("/subscriptions/", false);
 4303            uri.AppendPath(subscriptionId, true);
 4304            uri.AppendPath("/resourceGroups/", false);
 4305            uri.AppendPath(resourceGroupName, true);
 4306            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 4307            uri.AppendPath(accountName, true);
 4308            uri.AppendPath("/encryptionScopes/", false);
 4309            uri.AppendPath(encryptionScopeName, true);
 4310            uri.AppendQuery("api-version", apiVersion, true);
 4311            request.Uri = uri;
 4312            return message;
 313        }
 314
 315        /// <summary> Returns the properties for the specified encryption scope. </summary>
 316        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 317        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 318        /// <param name="encryptionScopeName"> The name of the encryption scope within the specified storage account. En
 319        /// <param name="cancellationToken"> The cancellation token to use. </param>
 320        public async Task<Response<EncryptionScope>> GetAsync(string resourceGroupName, string accountName, string encry
 321        {
 2322            if (resourceGroupName == null)
 323            {
 0324                throw new ArgumentNullException(nameof(resourceGroupName));
 325            }
 2326            if (accountName == null)
 327            {
 0328                throw new ArgumentNullException(nameof(accountName));
 329            }
 2330            if (encryptionScopeName == null)
 331            {
 0332                throw new ArgumentNullException(nameof(encryptionScopeName));
 333            }
 334
 2335            using var message = CreateGetRequest(resourceGroupName, accountName, encryptionScopeName);
 2336            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2337            switch (message.Response.Status)
 338            {
 339                case 200:
 340                    {
 2341                        EncryptionScope value = default;
 2342                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2343                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 344                        {
 0345                            value = null;
 346                        }
 347                        else
 348                        {
 2349                            value = EncryptionScope.DeserializeEncryptionScope(document.RootElement);
 350                        }
 2351                        return Response.FromValue(value, message.Response);
 352                    }
 353                default:
 0354                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 355            }
 2356        }
 357
 358        /// <summary> Returns the properties for the specified encryption scope. </summary>
 359        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 360        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 361        /// <param name="encryptionScopeName"> The name of the encryption scope within the specified storage account. En
 362        /// <param name="cancellationToken"> The cancellation token to use. </param>
 363        public Response<EncryptionScope> Get(string resourceGroupName, string accountName, string encryptionScopeName, C
 364        {
 2365            if (resourceGroupName == null)
 366            {
 0367                throw new ArgumentNullException(nameof(resourceGroupName));
 368            }
 2369            if (accountName == null)
 370            {
 0371                throw new ArgumentNullException(nameof(accountName));
 372            }
 2373            if (encryptionScopeName == null)
 374            {
 0375                throw new ArgumentNullException(nameof(encryptionScopeName));
 376            }
 377
 2378            using var message = CreateGetRequest(resourceGroupName, accountName, encryptionScopeName);
 2379            _pipeline.Send(message, cancellationToken);
 2380            switch (message.Response.Status)
 381            {
 382                case 200:
 383                    {
 2384                        EncryptionScope value = default;
 2385                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2386                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 387                        {
 0388                            value = null;
 389                        }
 390                        else
 391                        {
 2392                            value = EncryptionScope.DeserializeEncryptionScope(document.RootElement);
 393                        }
 2394                        return Response.FromValue(value, message.Response);
 395                    }
 396                default:
 0397                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 398            }
 2399        }
 400
 401        internal HttpMessage CreateListRequest(string resourceGroupName, string accountName)
 402        {
 4403            var message = _pipeline.CreateMessage();
 4404            var request = message.Request;
 4405            request.Method = RequestMethod.Get;
 4406            var uri = new RawRequestUriBuilder();
 4407            uri.Reset(endpoint);
 4408            uri.AppendPath("/subscriptions/", false);
 4409            uri.AppendPath(subscriptionId, true);
 4410            uri.AppendPath("/resourceGroups/", false);
 4411            uri.AppendPath(resourceGroupName, true);
 4412            uri.AppendPath("/providers/Microsoft.Storage/storageAccounts/", false);
 4413            uri.AppendPath(accountName, true);
 4414            uri.AppendPath("/encryptionScopes", false);
 4415            uri.AppendQuery("api-version", apiVersion, true);
 4416            request.Uri = uri;
 4417            return message;
 418        }
 419
 420        /// <summary> Lists all the encryption scopes available under the specified storage account. </summary>
 421        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 422        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 423        /// <param name="cancellationToken"> The cancellation token to use. </param>
 424        public async Task<Response<EncryptionScopeListResult>> ListAsync(string resourceGroupName, string accountName, C
 425        {
 2426            if (resourceGroupName == null)
 427            {
 0428                throw new ArgumentNullException(nameof(resourceGroupName));
 429            }
 2430            if (accountName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(accountName));
 433            }
 434
 2435            using var message = CreateListRequest(resourceGroupName, accountName);
 2436            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2437            switch (message.Response.Status)
 438            {
 439                case 200:
 440                    {
 2441                        EncryptionScopeListResult value = default;
 2442                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2443                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 444                        {
 0445                            value = null;
 446                        }
 447                        else
 448                        {
 2449                            value = EncryptionScopeListResult.DeserializeEncryptionScopeListResult(document.RootElement)
 450                        }
 2451                        return Response.FromValue(value, message.Response);
 452                    }
 453                default:
 0454                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 455            }
 2456        }
 457
 458        /// <summary> Lists all the encryption scopes available under the specified storage account. </summary>
 459        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 460        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 461        /// <param name="cancellationToken"> The cancellation token to use. </param>
 462        public Response<EncryptionScopeListResult> List(string resourceGroupName, string accountName, CancellationToken 
 463        {
 2464            if (resourceGroupName == null)
 465            {
 0466                throw new ArgumentNullException(nameof(resourceGroupName));
 467            }
 2468            if (accountName == null)
 469            {
 0470                throw new ArgumentNullException(nameof(accountName));
 471            }
 472
 2473            using var message = CreateListRequest(resourceGroupName, accountName);
 2474            _pipeline.Send(message, cancellationToken);
 2475            switch (message.Response.Status)
 476            {
 477                case 200:
 478                    {
 2479                        EncryptionScopeListResult value = default;
 2480                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2481                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 482                        {
 0483                            value = null;
 484                        }
 485                        else
 486                        {
 2487                            value = EncryptionScopeListResult.DeserializeEncryptionScopeListResult(document.RootElement)
 488                        }
 2489                        return Response.FromValue(value, message.Response);
 490                    }
 491                default:
 0492                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 493            }
 2494        }
 495
 496        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string accountName)
 497        {
 0498            var message = _pipeline.CreateMessage();
 0499            var request = message.Request;
 0500            request.Method = RequestMethod.Get;
 0501            var uri = new RawRequestUriBuilder();
 0502            uri.Reset(endpoint);
 0503            uri.AppendRawNextLink(nextLink, false);
 0504            request.Uri = uri;
 0505            return message;
 506        }
 507
 508        /// <summary> Lists all the encryption scopes available under the specified storage account. </summary>
 509        /// <param name="nextLink"> The URL to the next page of results. </param>
 510        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 511        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 512        /// <param name="cancellationToken"> The cancellation token to use. </param>
 513        public async Task<Response<EncryptionScopeListResult>> ListNextPageAsync(string nextLink, string resourceGroupNa
 514        {
 0515            if (nextLink == null)
 516            {
 0517                throw new ArgumentNullException(nameof(nextLink));
 518            }
 0519            if (resourceGroupName == null)
 520            {
 0521                throw new ArgumentNullException(nameof(resourceGroupName));
 522            }
 0523            if (accountName == null)
 524            {
 0525                throw new ArgumentNullException(nameof(accountName));
 526            }
 527
 0528            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, accountName);
 0529            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0530            switch (message.Response.Status)
 531            {
 532                case 200:
 533                    {
 0534                        EncryptionScopeListResult value = default;
 0535                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0536                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 537                        {
 0538                            value = null;
 539                        }
 540                        else
 541                        {
 0542                            value = EncryptionScopeListResult.DeserializeEncryptionScopeListResult(document.RootElement)
 543                        }
 0544                        return Response.FromValue(value, message.Response);
 545                    }
 546                default:
 0547                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 548            }
 0549        }
 550
 551        /// <summary> Lists all the encryption scopes available under the specified storage account. </summary>
 552        /// <param name="nextLink"> The URL to the next page of results. </param>
 553        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 554        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 555        /// <param name="cancellationToken"> The cancellation token to use. </param>
 556        public Response<EncryptionScopeListResult> ListNextPage(string nextLink, string resourceGroupName, string accoun
 557        {
 0558            if (nextLink == null)
 559            {
 0560                throw new ArgumentNullException(nameof(nextLink));
 561            }
 0562            if (resourceGroupName == null)
 563            {
 0564                throw new ArgumentNullException(nameof(resourceGroupName));
 565            }
 0566            if (accountName == null)
 567            {
 0568                throw new ArgumentNullException(nameof(accountName));
 569            }
 570
 0571            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, accountName);
 0572            _pipeline.Send(message, cancellationToken);
 0573            switch (message.Response.Status)
 574            {
 575                case 200:
 576                    {
 0577                        EncryptionScopeListResult value = default;
 0578                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0579                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 580                        {
 0581                            value = null;
 582                        }
 583                        else
 584                        {
 0585                            value = EncryptionScopeListResult.DeserializeEncryptionScopeListResult(document.RootElement)
 586                        }
 0587                        return Response.FromValue(value, message.Response);
 588                    }
 589                default:
 0590                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 591            }
 0592        }
 593    }
 594}