< Summary

Class:Azure.ResourceManager.Storage.StorageAccountsOperations
Assembly:Azure.ResourceManager.Storage
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\StorageAccountsOperations.cs
Covered lines:146
Uncovered lines:124
Coverable lines:270
Total lines:715
Line coverage:54% (146 of 270)
Covered branches:8
Total branches:36
Branch coverage:22.2% (8 of 36)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
CheckNameAvailabilityAsync()-57.14%100%
CheckNameAvailability(...)-57.14%100%
DeleteAsync()-57.14%100%
Delete(...)-57.14%100%
GetPropertiesAsync()-57.14%100%
GetProperties(...)-57.14%100%
UpdateAsync()-100%100%
Update(...)-100%100%
ListKeysAsync()-57.14%100%
ListKeys(...)-57.14%100%
RegenerateKeyAsync()-57.14%100%
RegenerateKey(...)-57.14%100%
ListAccountSASAsync()-100%100%
ListAccountSAS(...)-100%100%
ListServiceSASAsync()-100%100%
ListServiceSAS(...)-100%100%
RevokeUserDelegationKeysAsync()-57.14%100%
RevokeUserDelegationKeys(...)-57.14%100%
<ListAsync()-62.5%100%
<ListAsync()-0%100%
ListAsync(...)-100%100%
List(...)-100%100%
ListByResourceGroupAsync(...)-63.64%50%
<ListByResourceGroupAsync()-62.5%100%
ListByResourceGroup(...)-63.64%50%
StartCreateAsync()-78.57%50%
StartCreate(...)-78.57%50%
StartFailoverAsync()-0%0%
StartFailover(...)-0%0%
StartRestoreBlobRangesAsync()-0%0%
StartRestoreBlobRanges(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.ResourceManager.Storage\src\Generated\StorageAccountsOperations.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.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Storage.Models;
 15
 16namespace Azure.ResourceManager.Storage
 17{
 18    /// <summary> The StorageAccounts service client. </summary>
 19    public partial class StorageAccountsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 84423        internal StorageAccountsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of StorageAccountsOperations for mocking. </summary>
 24025        protected StorageAccountsOperations()
 26        {
 24027        }
 28        /// <summary> Initializes a new instance of StorageAccountsOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 33        /// <param name="apiVersion"> Api Version. </param>
 24034        internal StorageAccountsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscripti
 35        {
 24036            RestClient = new StorageAccountsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint, apiVer
 24037            _clientDiagnostics = clientDiagnostics;
 24038            _pipeline = pipeline;
 24039        }
 40
 41        /// <summary> Checks that the storage account name is valid and is not already in use. </summary>
 42        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 43        /// <param name="cancellationToken"> The cancellation token to use. </param>
 44        public virtual async Task<Response<CheckNameAvailabilityResult>> CheckNameAvailabilityAsync(StorageAccountCheckN
 45        {
 646            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.CheckNameAvailability");
 647            scope.Start();
 48            try
 49            {
 650                return await RestClient.CheckNameAvailabilityAsync(accountName, cancellationToken).ConfigureAwait(false)
 51            }
 052            catch (Exception e)
 53            {
 054                scope.Failed(e);
 055                throw;
 56            }
 657        }
 58
 59        /// <summary> Checks that the storage account name is valid and is not already in use. </summary>
 60        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 61        /// <param name="cancellationToken"> The cancellation token to use. </param>
 62        public virtual Response<CheckNameAvailabilityResult> CheckNameAvailability(StorageAccountCheckNameAvailabilityPa
 63        {
 664            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.CheckNameAvailability");
 665            scope.Start();
 66            try
 67            {
 668                return RestClient.CheckNameAvailability(accountName, cancellationToken);
 69            }
 070            catch (Exception e)
 71            {
 072                scope.Failed(e);
 073                throw;
 74            }
 675        }
 76
 77        /// <summary> Deletes a storage account in Microsoft Azure. </summary>
 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="cancellationToken"> The cancellation token to use. </param>
 81        public virtual async Task<Response> DeleteAsync(string resourceGroupName, string accountName, CancellationToken 
 82        {
 683            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.Delete");
 684            scope.Start();
 85            try
 86            {
 687                return await RestClient.DeleteAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(fa
 88            }
 089            catch (Exception e)
 90            {
 091                scope.Failed(e);
 092                throw;
 93            }
 694        }
 95
 96        /// <summary> Deletes a storage account in Microsoft Azure. </summary>
 97        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 98        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 99        /// <param name="cancellationToken"> The cancellation token to use. </param>
 100        public virtual Response Delete(string resourceGroupName, string accountName, CancellationToken cancellationToken
 101        {
 6102            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.Delete");
 6103            scope.Start();
 104            try
 105            {
 6106                return RestClient.Delete(resourceGroupName, accountName, cancellationToken);
 107            }
 0108            catch (Exception e)
 109            {
 0110                scope.Failed(e);
 0111                throw;
 112            }
 6113        }
 114
 115        /// <summary> Returns the properties for the specified storage account including but not limited to name, SKU na
 116        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 117        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 118        /// <param name="expand"> May be used to expand the properties within account&apos;s properties. By default, dat
 119        /// <param name="cancellationToken"> The cancellation token to use. </param>
 120        public virtual async Task<Response<StorageAccount>> GetPropertiesAsync(string resourceGroupName, string accountN
 121        {
 58122            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.GetProperties");
 58123            scope.Start();
 124            try
 125            {
 58126                return await RestClient.GetPropertiesAsync(resourceGroupName, accountName, expand, cancellationToken).Co
 127            }
 0128            catch (Exception e)
 129            {
 0130                scope.Failed(e);
 0131                throw;
 132            }
 58133        }
 134
 135        /// <summary> Returns the properties for the specified storage account including but not limited to name, SKU na
 136        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 137        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 138        /// <param name="expand"> May be used to expand the properties within account&apos;s properties. By default, dat
 139        /// <param name="cancellationToken"> The cancellation token to use. </param>
 140        public virtual Response<StorageAccount> GetProperties(string resourceGroupName, string accountName, StorageAccou
 141        {
 58142            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.GetProperties");
 58143            scope.Start();
 144            try
 145            {
 58146                return RestClient.GetProperties(resourceGroupName, accountName, expand, cancellationToken);
 147            }
 0148            catch (Exception e)
 149            {
 0150                scope.Failed(e);
 0151                throw;
 152            }
 58153        }
 154
 155        /// <summary> The update operation can be used to update the SKU, encryption, access tier, or tags for a storage
 156        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 157        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 158        /// <param name="parameters"> The parameters to provide for the updated account. </param>
 159        /// <param name="cancellationToken"> The cancellation token to use. </param>
 160        public virtual async Task<Response<StorageAccount>> UpdateAsync(string resourceGroupName, string accountName, St
 161        {
 30162            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.Update");
 30163            scope.Start();
 164            try
 165            {
 30166                return await RestClient.UpdateAsync(resourceGroupName, accountName, parameters, cancellationToken).Confi
 167            }
 2168            catch (Exception e)
 169            {
 2170                scope.Failed(e);
 2171                throw;
 172            }
 28173        }
 174
 175        /// <summary> The update operation can be used to update the SKU, encryption, access tier, or tags for a storage
 176        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 177        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 178        /// <param name="parameters"> The parameters to provide for the updated account. </param>
 179        /// <param name="cancellationToken"> The cancellation token to use. </param>
 180        public virtual Response<StorageAccount> Update(string resourceGroupName, string accountName, StorageAccountUpdat
 181        {
 30182            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.Update");
 30183            scope.Start();
 184            try
 185            {
 30186                return RestClient.Update(resourceGroupName, accountName, parameters, cancellationToken);
 187            }
 2188            catch (Exception e)
 189            {
 2190                scope.Failed(e);
 2191                throw;
 192            }
 28193        }
 194
 195        /// <summary> Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage acc
 196        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 197        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 198        /// <param name="cancellationToken"> The cancellation token to use. </param>
 199        public virtual async Task<Response<StorageAccountListKeysResult>> ListKeysAsync(string resourceGroupName, string
 200        {
 4201            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListKeys");
 4202            scope.Start();
 203            try
 204            {
 4205                return await RestClient.ListKeysAsync(resourceGroupName, accountName, cancellationToken).ConfigureAwait(
 206            }
 0207            catch (Exception e)
 208            {
 0209                scope.Failed(e);
 0210                throw;
 211            }
 4212        }
 213
 214        /// <summary> Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage acc
 215        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 216        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 217        /// <param name="cancellationToken"> The cancellation token to use. </param>
 218        public virtual Response<StorageAccountListKeysResult> ListKeys(string resourceGroupName, string accountName, Can
 219        {
 4220            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListKeys");
 4221            scope.Start();
 222            try
 223            {
 4224                return RestClient.ListKeys(resourceGroupName, accountName, cancellationToken);
 225            }
 0226            catch (Exception e)
 227            {
 0228                scope.Failed(e);
 0229                throw;
 230            }
 4231        }
 232
 233        /// <summary> Regenerates one of the access keys or Kerberos keys for the specified storage account. </summary>
 234        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 235        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 236        /// <param name="regenerateKey"> Specifies name of the key which should be regenerated -- key1, key2, kerb1, ker
 237        /// <param name="cancellationToken"> The cancellation token to use. </param>
 238        public virtual async Task<Response<StorageAccountListKeysResult>> RegenerateKeyAsync(string resourceGroupName, s
 239        {
 2240            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.RegenerateKey");
 2241            scope.Start();
 242            try
 243            {
 2244                return await RestClient.RegenerateKeyAsync(resourceGroupName, accountName, regenerateKey, cancellationTo
 245            }
 0246            catch (Exception e)
 247            {
 0248                scope.Failed(e);
 0249                throw;
 250            }
 2251        }
 252
 253        /// <summary> Regenerates one of the access keys or Kerberos keys for the specified storage account. </summary>
 254        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 255        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 256        /// <param name="regenerateKey"> Specifies name of the key which should be regenerated -- key1, key2, kerb1, ker
 257        /// <param name="cancellationToken"> The cancellation token to use. </param>
 258        public virtual Response<StorageAccountListKeysResult> RegenerateKey(string resourceGroupName, string accountName
 259        {
 2260            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.RegenerateKey");
 2261            scope.Start();
 262            try
 263            {
 2264                return RestClient.RegenerateKey(resourceGroupName, accountName, regenerateKey, cancellationToken);
 265            }
 0266            catch (Exception e)
 267            {
 0268                scope.Failed(e);
 0269                throw;
 270            }
 2271        }
 272
 273        /// <summary> List SAS credentials of a storage account. </summary>
 274        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 275        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 276        /// <param name="parameters"> The parameters to provide to list SAS credentials for the storage account. </param
 277        /// <param name="cancellationToken"> The cancellation token to use. </param>
 278        public virtual async Task<Response<ListAccountSasResponse>> ListAccountSASAsync(string resourceGroupName, string
 279        {
 6280            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListAccountSAS");
 6281            scope.Start();
 282            try
 283            {
 6284                return await RestClient.ListAccountSASAsync(resourceGroupName, accountName, parameters, cancellationToke
 285            }
 2286            catch (Exception e)
 287            {
 2288                scope.Failed(e);
 2289                throw;
 290            }
 4291        }
 292
 293        /// <summary> List SAS credentials of a storage account. </summary>
 294        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 295        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 296        /// <param name="parameters"> The parameters to provide to list SAS credentials for the storage account. </param
 297        /// <param name="cancellationToken"> The cancellation token to use. </param>
 298        public virtual Response<ListAccountSasResponse> ListAccountSAS(string resourceGroupName, string accountName, Acc
 299        {
 6300            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListAccountSAS");
 6301            scope.Start();
 302            try
 303            {
 6304                return RestClient.ListAccountSAS(resourceGroupName, accountName, parameters, cancellationToken);
 305            }
 2306            catch (Exception e)
 307            {
 2308                scope.Failed(e);
 2309                throw;
 310            }
 4311        }
 312
 313        /// <summary> List service SAS credentials of a specific resource. </summary>
 314        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 315        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 316        /// <param name="parameters"> The parameters to provide to list service SAS credentials. </param>
 317        /// <param name="cancellationToken"> The cancellation token to use. </param>
 318        public virtual async Task<Response<ListServiceSasResponse>> ListServiceSASAsync(string resourceGroupName, string
 319        {
 6320            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListServiceSAS");
 6321            scope.Start();
 322            try
 323            {
 6324                return await RestClient.ListServiceSASAsync(resourceGroupName, accountName, parameters, cancellationToke
 325            }
 2326            catch (Exception e)
 327            {
 2328                scope.Failed(e);
 2329                throw;
 330            }
 4331        }
 332
 333        /// <summary> List service SAS credentials of a specific resource. </summary>
 334        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 335        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 336        /// <param name="parameters"> The parameters to provide to list service SAS credentials. </param>
 337        /// <param name="cancellationToken"> The cancellation token to use. </param>
 338        public virtual Response<ListServiceSasResponse> ListServiceSAS(string resourceGroupName, string accountName, Ser
 339        {
 6340            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListServiceSAS");
 6341            scope.Start();
 342            try
 343            {
 6344                return RestClient.ListServiceSAS(resourceGroupName, accountName, parameters, cancellationToken);
 345            }
 2346            catch (Exception e)
 347            {
 2348                scope.Failed(e);
 2349                throw;
 350            }
 4351        }
 352
 353        /// <summary> Revoke user delegation keys. </summary>
 354        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 355        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 356        /// <param name="cancellationToken"> The cancellation token to use. </param>
 357        public virtual async Task<Response> RevokeUserDelegationKeysAsync(string resourceGroupName, string accountName, 
 358        {
 2359            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.RevokeUserDelegationKeys");
 2360            scope.Start();
 361            try
 362            {
 2363                return await RestClient.RevokeUserDelegationKeysAsync(resourceGroupName, accountName, cancellationToken)
 364            }
 0365            catch (Exception e)
 366            {
 0367                scope.Failed(e);
 0368                throw;
 369            }
 2370        }
 371
 372        /// <summary> Revoke user delegation keys. </summary>
 373        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 374        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 375        /// <param name="cancellationToken"> The cancellation token to use. </param>
 376        public virtual Response RevokeUserDelegationKeys(string resourceGroupName, string accountName, CancellationToken
 377        {
 2378            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.RevokeUserDelegationKeys");
 2379            scope.Start();
 380            try
 381            {
 2382                return RestClient.RevokeUserDelegationKeys(resourceGroupName, accountName, cancellationToken);
 383            }
 0384            catch (Exception e)
 385            {
 0386                scope.Failed(e);
 0387                throw;
 388            }
 2389        }
 390
 391        /// <summary> Lists all the storage accounts available under the subscription. Note that storage keys are not re
 392        /// <param name="cancellationToken"> The cancellation token to use. </param>
 393        public virtual AsyncPageable<StorageAccount> ListAsync(CancellationToken cancellationToken = default)
 394        {
 395            async Task<Page<StorageAccount>> FirstPageFunc(int? pageSizeHint)
 396            {
 2397                using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.List");
 2398                scope.Start();
 399                try
 400                {
 2401                    var response = await RestClient.ListAsync(cancellationToken).ConfigureAwait(false);
 2402                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 403                }
 0404                catch (Exception e)
 405                {
 0406                    scope.Failed(e);
 0407                    throw;
 408                }
 2409            }
 410            async Task<Page<StorageAccount>> NextPageFunc(string nextLink, int? pageSizeHint)
 411            {
 0412                using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.List");
 0413                scope.Start();
 414                try
 415                {
 0416                    var response = await RestClient.ListNextPageAsync(nextLink, cancellationToken).ConfigureAwait(false)
 0417                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 418                }
 0419                catch (Exception e)
 420                {
 0421                    scope.Failed(e);
 0422                    throw;
 423                }
 0424            }
 2425            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 426        }
 427
 428        /// <summary> Lists all the storage accounts available under the subscription. Note that storage keys are not re
 429        /// <param name="cancellationToken"> The cancellation token to use. </param>
 430        public virtual Pageable<StorageAccount> List(CancellationToken cancellationToken = default)
 431        {
 432            Page<StorageAccount> FirstPageFunc(int? pageSizeHint)
 433            {
 2434                using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.List");
 2435                scope.Start();
 436                try
 437                {
 2438                    var response = RestClient.List(cancellationToken);
 2439                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 440                }
 0441                catch (Exception e)
 442                {
 0443                    scope.Failed(e);
 0444                    throw;
 445                }
 2446            }
 447            Page<StorageAccount> NextPageFunc(string nextLink, int? pageSizeHint)
 448            {
 0449                using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.List");
 0450                scope.Start();
 451                try
 452                {
 0453                    var response = RestClient.ListNextPage(nextLink, cancellationToken);
 0454                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 455                }
 0456                catch (Exception e)
 457                {
 0458                    scope.Failed(e);
 0459                    throw;
 460                }
 0461            }
 2462            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 463        }
 464
 465        /// <summary> Lists all the storage accounts available under the given resource group. Note that storage keys ar
 466        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 467        /// <param name="cancellationToken"> The cancellation token to use. </param>
 468        public virtual AsyncPageable<StorageAccount> ListByResourceGroupAsync(string resourceGroupName, CancellationToke
 469        {
 6470            if (resourceGroupName == null)
 471            {
 0472                throw new ArgumentNullException(nameof(resourceGroupName));
 473            }
 474
 475            async Task<Page<StorageAccount>> FirstPageFunc(int? pageSizeHint)
 476            {
 6477                using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListByResourceGroup");
 6478                scope.Start();
 479                try
 480                {
 6481                    var response = await RestClient.ListByResourceGroupAsync(resourceGroupName, cancellationToken).Confi
 6482                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 483                }
 0484                catch (Exception e)
 485                {
 0486                    scope.Failed(e);
 0487                    throw;
 488                }
 6489            }
 6490            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null);
 491        }
 492
 493        /// <summary> Lists all the storage accounts available under the given resource group. Note that storage keys ar
 494        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 495        /// <param name="cancellationToken"> The cancellation token to use. </param>
 496        public virtual Pageable<StorageAccount> ListByResourceGroup(string resourceGroupName, CancellationToken cancella
 497        {
 6498            if (resourceGroupName == null)
 499            {
 0500                throw new ArgumentNullException(nameof(resourceGroupName));
 501            }
 502
 503            Page<StorageAccount> FirstPageFunc(int? pageSizeHint)
 504            {
 6505                using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.ListByResourceGroup");
 6506                scope.Start();
 507                try
 508                {
 6509                    var response = RestClient.ListByResourceGroup(resourceGroupName, cancellationToken);
 6510                    return Page.FromValues(response.Value.Value, null, response.GetRawResponse());
 511                }
 0512                catch (Exception e)
 513                {
 0514                    scope.Failed(e);
 0515                    throw;
 516                }
 6517            }
 6518            return PageableHelpers.CreateEnumerable(FirstPageFunc, null);
 519        }
 520
 521        /// <summary> Asynchronously creates a new storage account with the specified parameters. If an account is alrea
 522        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 523        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 524        /// <param name="parameters"> The parameters to provide for the created account. </param>
 525        /// <param name="cancellationToken"> The cancellation token to use. </param>
 526        public virtual async Task<StorageAccountsCreateOperation> StartCreateAsync(string resourceGroupName, string acco
 527        {
 148528            if (resourceGroupName == null)
 529            {
 0530                throw new ArgumentNullException(nameof(resourceGroupName));
 531            }
 148532            if (accountName == null)
 533            {
 0534                throw new ArgumentNullException(nameof(accountName));
 535            }
 148536            if (parameters == null)
 537            {
 0538                throw new ArgumentNullException(nameof(parameters));
 539            }
 540
 148541            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.StartCreate");
 148542            scope.Start();
 543            try
 544            {
 148545                var originalResponse = await RestClient.CreateAsync(resourceGroupName, accountName, parameters, cancella
 146546                return new StorageAccountsCreateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateRequest(
 547            }
 2548            catch (Exception e)
 549            {
 2550                scope.Failed(e);
 2551                throw;
 552            }
 146553        }
 554
 555        /// <summary> Asynchronously creates a new storage account with the specified parameters. If an account is alrea
 556        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 557        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 558        /// <param name="parameters"> The parameters to provide for the created account. </param>
 559        /// <param name="cancellationToken"> The cancellation token to use. </param>
 560        public virtual StorageAccountsCreateOperation StartCreate(string resourceGroupName, string accountName, StorageA
 561        {
 148562            if (resourceGroupName == null)
 563            {
 0564                throw new ArgumentNullException(nameof(resourceGroupName));
 565            }
 148566            if (accountName == null)
 567            {
 0568                throw new ArgumentNullException(nameof(accountName));
 569            }
 148570            if (parameters == null)
 571            {
 0572                throw new ArgumentNullException(nameof(parameters));
 573            }
 574
 148575            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.StartCreate");
 148576            scope.Start();
 577            try
 578            {
 148579                var originalResponse = RestClient.Create(resourceGroupName, accountName, parameters, cancellationToken);
 146580                return new StorageAccountsCreateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCreateRequest(
 581            }
 2582            catch (Exception e)
 583            {
 2584                scope.Failed(e);
 2585                throw;
 586            }
 146587        }
 588
 589        /// <summary> Failover request can be triggered for a storage account in case of availability issues. The failov
 590        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 591        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 592        /// <param name="cancellationToken"> The cancellation token to use. </param>
 593        public virtual async Task<StorageAccountsFailoverOperation> StartFailoverAsync(string resourceGroupName, string 
 594        {
 0595            if (resourceGroupName == null)
 596            {
 0597                throw new ArgumentNullException(nameof(resourceGroupName));
 598            }
 0599            if (accountName == null)
 600            {
 0601                throw new ArgumentNullException(nameof(accountName));
 602            }
 603
 0604            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.StartFailover");
 0605            scope.Start();
 606            try
 607            {
 0608                var originalResponse = await RestClient.FailoverAsync(resourceGroupName, accountName, cancellationToken)
 0609                return new StorageAccountsFailoverOperation(_clientDiagnostics, _pipeline, RestClient.CreateFailoverRequ
 610            }
 0611            catch (Exception e)
 612            {
 0613                scope.Failed(e);
 0614                throw;
 615            }
 0616        }
 617
 618        /// <summary> Failover request can be triggered for a storage account in case of availability issues. The failov
 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="cancellationToken"> The cancellation token to use. </param>
 622        public virtual StorageAccountsFailoverOperation StartFailover(string resourceGroupName, string accountName, Canc
 623        {
 0624            if (resourceGroupName == null)
 625            {
 0626                throw new ArgumentNullException(nameof(resourceGroupName));
 627            }
 0628            if (accountName == null)
 629            {
 0630                throw new ArgumentNullException(nameof(accountName));
 631            }
 632
 0633            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.StartFailover");
 0634            scope.Start();
 635            try
 636            {
 0637                var originalResponse = RestClient.Failover(resourceGroupName, accountName, cancellationToken);
 0638                return new StorageAccountsFailoverOperation(_clientDiagnostics, _pipeline, RestClient.CreateFailoverRequ
 639            }
 0640            catch (Exception e)
 641            {
 0642                scope.Failed(e);
 0643                throw;
 644            }
 0645        }
 646
 647        /// <summary> Restore blobs in the specified blob ranges. </summary>
 648        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 649        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 650        /// <param name="parameters"> The parameters to provide for restore blob ranges. </param>
 651        /// <param name="cancellationToken"> The cancellation token to use. </param>
 652        public virtual async Task<StorageAccountsRestoreBlobRangesOperation> StartRestoreBlobRangesAsync(string resource
 653        {
 0654            if (resourceGroupName == null)
 655            {
 0656                throw new ArgumentNullException(nameof(resourceGroupName));
 657            }
 0658            if (accountName == null)
 659            {
 0660                throw new ArgumentNullException(nameof(accountName));
 661            }
 0662            if (parameters == null)
 663            {
 0664                throw new ArgumentNullException(nameof(parameters));
 665            }
 666
 0667            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.StartRestoreBlobRanges");
 0668            scope.Start();
 669            try
 670            {
 0671                var originalResponse = await RestClient.RestoreBlobRangesAsync(resourceGroupName, accountName, parameter
 0672                return new StorageAccountsRestoreBlobRangesOperation(_clientDiagnostics, _pipeline, RestClient.CreateRes
 673            }
 0674            catch (Exception e)
 675            {
 0676                scope.Failed(e);
 0677                throw;
 678            }
 0679        }
 680
 681        /// <summary> Restore blobs in the specified blob ranges. </summary>
 682        /// <param name="resourceGroupName"> The name of the resource group within the user&apos;s subscription. The nam
 683        /// <param name="accountName"> The name of the storage account within the specified resource group. Storage acco
 684        /// <param name="parameters"> The parameters to provide for restore blob ranges. </param>
 685        /// <param name="cancellationToken"> The cancellation token to use. </param>
 686        public virtual StorageAccountsRestoreBlobRangesOperation StartRestoreBlobRanges(string resourceGroupName, string
 687        {
 0688            if (resourceGroupName == null)
 689            {
 0690                throw new ArgumentNullException(nameof(resourceGroupName));
 691            }
 0692            if (accountName == null)
 693            {
 0694                throw new ArgumentNullException(nameof(accountName));
 695            }
 0696            if (parameters == null)
 697            {
 0698                throw new ArgumentNullException(nameof(parameters));
 699            }
 700
 0701            using var scope = _clientDiagnostics.CreateScope("StorageAccountsOperations.StartRestoreBlobRanges");
 0702            scope.Start();
 703            try
 704            {
 0705                var originalResponse = RestClient.RestoreBlobRanges(resourceGroupName, accountName, parameters, cancella
 0706                return new StorageAccountsRestoreBlobRangesOperation(_clientDiagnostics, _pipeline, RestClient.CreateRes
 707            }
 0708            catch (Exception e)
 709            {
 0710                scope.Failed(e);
 0711                throw;
 712            }
 0713        }
 714    }
 715}