< Summary

Class:Azure.ResourceManager.EventHubs.DisasterRecoveryConfigsOperations
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\DisasterRecoveryConfigsOperations.cs
Covered lines:78
Uncovered lines:130
Coverable lines:208
Total lines:568
Line coverage:37.5% (78 of 208)
Covered branches:4
Total branches:20
Branch coverage:20% (4 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAuthorizationRuleAsync()-57.14%100%
GetAuthorizationRule(...)-57.14%100%
ListKeysAsync()-57.14%100%
ListKeys(...)-57.14%100%
CheckNameAvailabilityAsync()-57.14%100%
CheckNameAvailability(...)-57.14%100%
CreateOrUpdateAsync()-57.14%100%
CreateOrUpdate(...)-57.14%100%
DeleteAsync()-57.14%100%
Delete(...)-57.14%100%
GetAsync()-57.14%100%
Get(...)-57.14%100%
BreakPairingAsync()-57.14%100%
BreakPairing(...)-57.14%100%
FailOverAsync()-57.14%100%
FailOver(...)-57.14%100%
ListAuthorizationRulesAsync(...)-0%0%
<ListAuthorizationRulesAsync()-0%100%
<ListAuthorizationRulesAsync()-0%100%
ListAuthorizationRules(...)-0%0%
ListAsync(...)-14.29%50%
<ListAsync()-0%100%
<ListAsync()-0%100%
List(...)-14.29%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\DisasterRecoveryConfigsOperations.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.EventHubs.Models;
 15
 16namespace Azure.ResourceManager.EventHubs
 17{
 18    /// <summary> The DisasterRecoveryConfigs service client. </summary>
 19    public partial class DisasterRecoveryConfigsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 612423        internal DisasterRecoveryConfigsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of DisasterRecoveryConfigsOperations for mocking. </summary>
 4825        protected DisasterRecoveryConfigsOperations()
 26        {
 4827        }
 28        /// <summary> Initializes a new instance of DisasterRecoveryConfigsOperations. </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"> Subscription credentials that uniquely identify a Microsoft Azure subscription
 32        /// <param name="endpoint"> server parameter. </param>
 4833        internal DisasterRecoveryConfigsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string su
 34        {
 4835            RestClient = new DisasterRecoveryConfigsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint
 4836            _clientDiagnostics = clientDiagnostics;
 4837            _pipeline = pipeline;
 4838        }
 39
 40        /// <summary> Gets an AuthorizationRule for a Namespace by rule name. </summary>
 41        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 42        /// <param name="namespaceName"> The Namespace name. </param>
 43        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 44        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<AuthorizationRule>> GetAuthorizationRuleAsync(string resourceGroupName, strin
 47        {
 448            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.GetAuthorizationRule");
 449            scope.Start();
 50            try
 51            {
 452                return await RestClient.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, @alias, authorizatio
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 459        }
 60
 61        /// <summary> Gets an AuthorizationRule for a Namespace by rule name. </summary>
 62        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 63        /// <param name="namespaceName"> The Namespace name. </param>
 64        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 65        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 66        /// <param name="cancellationToken"> The cancellation token to use. </param>
 67        public virtual Response<AuthorizationRule> GetAuthorizationRule(string resourceGroupName, string namespaceName, 
 68        {
 469            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.GetAuthorizationRule");
 470            scope.Start();
 71            try
 72            {
 473                return RestClient.GetAuthorizationRule(resourceGroupName, namespaceName, @alias, authorizationRuleName, 
 74            }
 075            catch (Exception e)
 76            {
 077                scope.Failed(e);
 078                throw;
 79            }
 480        }
 81
 82        /// <summary> Gets the primary and secondary connection strings for the Namespace. </summary>
 83        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 84        /// <param name="namespaceName"> The Namespace name. </param>
 85        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 86        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 87        /// <param name="cancellationToken"> The cancellation token to use. </param>
 88        public virtual async Task<Response<AccessKeys>> ListKeysAsync(string resourceGroupName, string namespaceName, st
 89        {
 490            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.ListKeys");
 491            scope.Start();
 92            try
 93            {
 494                return await RestClient.ListKeysAsync(resourceGroupName, namespaceName, @alias, authorizationRuleName, c
 95            }
 096            catch (Exception e)
 97            {
 098                scope.Failed(e);
 099                throw;
 100            }
 4101        }
 102
 103        /// <summary> Gets the primary and secondary connection strings for the Namespace. </summary>
 104        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 105        /// <param name="namespaceName"> The Namespace name. </param>
 106        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 107        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 108        /// <param name="cancellationToken"> The cancellation token to use. </param>
 109        public virtual Response<AccessKeys> ListKeys(string resourceGroupName, string namespaceName, string @alias, stri
 110        {
 4111            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.ListKeys");
 4112            scope.Start();
 113            try
 114            {
 4115                return RestClient.ListKeys(resourceGroupName, namespaceName, @alias, authorizationRuleName, cancellation
 116            }
 0117            catch (Exception e)
 118            {
 0119                scope.Failed(e);
 0120                throw;
 121            }
 4122        }
 123
 124        /// <summary> Check the give Namespace name availability. </summary>
 125        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 126        /// <param name="namespaceName"> The Namespace name. </param>
 127        /// <param name="parameters"> Parameters to check availability of the given Alias name. </param>
 128        /// <param name="cancellationToken"> The cancellation token to use. </param>
 129        public virtual async Task<Response<CheckNameAvailabilityResult>> CheckNameAvailabilityAsync(string resourceGroup
 130        {
 6131            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.CheckNameAvailability");
 6132            scope.Start();
 133            try
 134            {
 6135                return await RestClient.CheckNameAvailabilityAsync(resourceGroupName, namespaceName, parameters, cancell
 136            }
 0137            catch (Exception e)
 138            {
 0139                scope.Failed(e);
 0140                throw;
 141            }
 6142        }
 143
 144        /// <summary> Check the give Namespace name availability. </summary>
 145        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 146        /// <param name="namespaceName"> The Namespace name. </param>
 147        /// <param name="parameters"> Parameters to check availability of the given Alias name. </param>
 148        /// <param name="cancellationToken"> The cancellation token to use. </param>
 149        public virtual Response<CheckNameAvailabilityResult> CheckNameAvailability(string resourceGroupName, string name
 150        {
 6151            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.CheckNameAvailability");
 6152            scope.Start();
 153            try
 154            {
 6155                return RestClient.CheckNameAvailability(resourceGroupName, namespaceName, parameters, cancellationToken)
 156            }
 0157            catch (Exception e)
 158            {
 0159                scope.Failed(e);
 0160                throw;
 161            }
 6162        }
 163
 164        /// <summary> Creates or updates a new Alias(Disaster Recovery configuration). </summary>
 165        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 166        /// <param name="namespaceName"> The Namespace name. </param>
 167        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 168        /// <param name="parameters"> Parameters required to create an Alias(Disaster Recovery configuration). </param>
 169        /// <param name="cancellationToken"> The cancellation token to use. </param>
 170        public virtual async Task<Response<ArmDisasterRecovery>> CreateOrUpdateAsync(string resourceGroupName, string na
 171        {
 8172            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.CreateOrUpdate");
 8173            scope.Start();
 174            try
 175            {
 8176                return await RestClient.CreateOrUpdateAsync(resourceGroupName, namespaceName, @alias, parameters, cancel
 177            }
 0178            catch (Exception e)
 179            {
 0180                scope.Failed(e);
 0181                throw;
 182            }
 8183        }
 184
 185        /// <summary> Creates or updates a new Alias(Disaster Recovery configuration). </summary>
 186        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 187        /// <param name="namespaceName"> The Namespace name. </param>
 188        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 189        /// <param name="parameters"> Parameters required to create an Alias(Disaster Recovery configuration). </param>
 190        /// <param name="cancellationToken"> The cancellation token to use. </param>
 191        public virtual Response<ArmDisasterRecovery> CreateOrUpdate(string resourceGroupName, string namespaceName, stri
 192        {
 8193            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.CreateOrUpdate");
 8194            scope.Start();
 195            try
 196            {
 8197                return RestClient.CreateOrUpdate(resourceGroupName, namespaceName, @alias, parameters, cancellationToken
 198            }
 0199            catch (Exception e)
 200            {
 0201                scope.Failed(e);
 0202                throw;
 203            }
 8204        }
 205
 206        /// <summary> Deletes an Alias(Disaster Recovery configuration). </summary>
 207        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 208        /// <param name="namespaceName"> The Namespace name. </param>
 209        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 210        /// <param name="cancellationToken"> The cancellation token to use. </param>
 211        public virtual async Task<Response> DeleteAsync(string resourceGroupName, string namespaceName, string @alias, C
 212        {
 4213            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.Delete");
 4214            scope.Start();
 215            try
 216            {
 4217                return await RestClient.DeleteAsync(resourceGroupName, namespaceName, @alias, cancellationToken).Configu
 218            }
 0219            catch (Exception e)
 220            {
 0221                scope.Failed(e);
 0222                throw;
 223            }
 4224        }
 225
 226        /// <summary> Deletes an Alias(Disaster Recovery configuration). </summary>
 227        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 228        /// <param name="namespaceName"> The Namespace name. </param>
 229        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 230        /// <param name="cancellationToken"> The cancellation token to use. </param>
 231        public virtual Response Delete(string resourceGroupName, string namespaceName, string @alias, CancellationToken 
 232        {
 4233            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.Delete");
 4234            scope.Start();
 235            try
 236            {
 4237                return RestClient.Delete(resourceGroupName, namespaceName, @alias, cancellationToken);
 238            }
 0239            catch (Exception e)
 240            {
 0241                scope.Failed(e);
 0242                throw;
 243            }
 4244        }
 245
 246        /// <summary> Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. </summary>
 247        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 248        /// <param name="namespaceName"> The Namespace name. </param>
 249        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 250        /// <param name="cancellationToken"> The cancellation token to use. </param>
 251        public virtual async Task<Response<ArmDisasterRecovery>> GetAsync(string resourceGroupName, string namespaceName
 252        {
 3138253            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.Get");
 3138254            scope.Start();
 255            try
 256            {
 3138257                return await RestClient.GetAsync(resourceGroupName, namespaceName, @alias, cancellationToken).ConfigureA
 258            }
 0259            catch (Exception e)
 260            {
 0261                scope.Failed(e);
 0262                throw;
 263            }
 3138264        }
 265
 266        /// <summary> Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. </summary>
 267        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 268        /// <param name="namespaceName"> The Namespace name. </param>
 269        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 270        /// <param name="cancellationToken"> The cancellation token to use. </param>
 271        public virtual Response<ArmDisasterRecovery> Get(string resourceGroupName, string namespaceName, string @alias, 
 272        {
 2918273            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.Get");
 2918274            scope.Start();
 275            try
 276            {
 2918277                return RestClient.Get(resourceGroupName, namespaceName, @alias, cancellationToken);
 278            }
 0279            catch (Exception e)
 280            {
 0281                scope.Failed(e);
 0282                throw;
 283            }
 2918284        }
 285
 286        /// <summary> This operation disables the Disaster Recovery and stops replicating changes from primary to second
 287        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 288        /// <param name="namespaceName"> The Namespace name. </param>
 289        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 290        /// <param name="cancellationToken"> The cancellation token to use. </param>
 291        public virtual async Task<Response> BreakPairingAsync(string resourceGroupName, string namespaceName, string @al
 292        {
 4293            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.BreakPairing");
 4294            scope.Start();
 295            try
 296            {
 4297                return await RestClient.BreakPairingAsync(resourceGroupName, namespaceName, @alias, cancellationToken).C
 298            }
 0299            catch (Exception e)
 300            {
 0301                scope.Failed(e);
 0302                throw;
 303            }
 4304        }
 305
 306        /// <summary> This operation disables the Disaster Recovery and stops replicating changes from primary to second
 307        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 308        /// <param name="namespaceName"> The Namespace name. </param>
 309        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 310        /// <param name="cancellationToken"> The cancellation token to use. </param>
 311        public virtual Response BreakPairing(string resourceGroupName, string namespaceName, string @alias, Cancellation
 312        {
 4313            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.BreakPairing");
 4314            scope.Start();
 315            try
 316            {
 4317                return RestClient.BreakPairing(resourceGroupName, namespaceName, @alias, cancellationToken);
 318            }
 0319            catch (Exception e)
 320            {
 0321                scope.Failed(e);
 0322                throw;
 323            }
 4324        }
 325
 326        /// <summary> Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. </summary>
 327        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 328        /// <param name="namespaceName"> The Namespace name. </param>
 329        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 330        /// <param name="cancellationToken"> The cancellation token to use. </param>
 331        public virtual async Task<Response> FailOverAsync(string resourceGroupName, string namespaceName, string @alias,
 332        {
 4333            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.FailOver");
 4334            scope.Start();
 335            try
 336            {
 4337                return await RestClient.FailOverAsync(resourceGroupName, namespaceName, @alias, cancellationToken).Confi
 338            }
 0339            catch (Exception e)
 340            {
 0341                scope.Failed(e);
 0342                throw;
 343            }
 4344        }
 345
 346        /// <summary> Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. </summary>
 347        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 348        /// <param name="namespaceName"> The Namespace name. </param>
 349        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 350        /// <param name="cancellationToken"> The cancellation token to use. </param>
 351        public virtual Response FailOver(string resourceGroupName, string namespaceName, string @alias, CancellationToke
 352        {
 4353            using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.FailOver");
 4354            scope.Start();
 355            try
 356            {
 4357                return RestClient.FailOver(resourceGroupName, namespaceName, @alias, cancellationToken);
 358            }
 0359            catch (Exception e)
 360            {
 0361                scope.Failed(e);
 0362                throw;
 363            }
 4364        }
 365
 366        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 367        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 368        /// <param name="namespaceName"> The Namespace name. </param>
 369        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 370        /// <param name="cancellationToken"> The cancellation token to use. </param>
 371        public virtual AsyncPageable<AuthorizationRule> ListAuthorizationRulesAsync(string resourceGroupName, string nam
 372        {
 0373            if (resourceGroupName == null)
 374            {
 0375                throw new ArgumentNullException(nameof(resourceGroupName));
 376            }
 0377            if (namespaceName == null)
 378            {
 0379                throw new ArgumentNullException(nameof(namespaceName));
 380            }
 0381            if (@alias == null)
 382            {
 0383                throw new ArgumentNullException(nameof(@alias));
 384            }
 385
 386            async Task<Page<AuthorizationRule>> FirstPageFunc(int? pageSizeHint)
 387            {
 0388                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.ListAuthorizationRul
 0389                scope.Start();
 390                try
 391                {
 0392                    var response = await RestClient.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, alias,
 0393                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 394                }
 0395                catch (Exception e)
 396                {
 0397                    scope.Failed(e);
 0398                    throw;
 399                }
 0400            }
 401            async Task<Page<AuthorizationRule>> NextPageFunc(string nextLink, int? pageSizeHint)
 402            {
 0403                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.ListAuthorizationRul
 0404                scope.Start();
 405                try
 406                {
 0407                    var response = await RestClient.ListAuthorizationRulesNextPageAsync(nextLink, resourceGroupName, nam
 0408                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 409                }
 0410                catch (Exception e)
 411                {
 0412                    scope.Failed(e);
 0413                    throw;
 414                }
 0415            }
 0416            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 417        }
 418
 419        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 420        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 421        /// <param name="namespaceName"> The Namespace name. </param>
 422        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 423        /// <param name="cancellationToken"> The cancellation token to use. </param>
 424        public virtual Pageable<AuthorizationRule> ListAuthorizationRules(string resourceGroupName, string namespaceName
 425        {
 0426            if (resourceGroupName == null)
 427            {
 0428                throw new ArgumentNullException(nameof(resourceGroupName));
 429            }
 0430            if (namespaceName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(namespaceName));
 433            }
 0434            if (@alias == null)
 435            {
 0436                throw new ArgumentNullException(nameof(@alias));
 437            }
 438
 439            Page<AuthorizationRule> FirstPageFunc(int? pageSizeHint)
 440            {
 0441                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.ListAuthorizationRul
 0442                scope.Start();
 443                try
 444                {
 0445                    var response = RestClient.ListAuthorizationRules(resourceGroupName, namespaceName, alias, cancellati
 0446                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 447                }
 0448                catch (Exception e)
 449                {
 0450                    scope.Failed(e);
 0451                    throw;
 452                }
 0453            }
 454            Page<AuthorizationRule> NextPageFunc(string nextLink, int? pageSizeHint)
 455            {
 0456                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.ListAuthorizationRul
 0457                scope.Start();
 458                try
 459                {
 0460                    var response = RestClient.ListAuthorizationRulesNextPage(nextLink, resourceGroupName, namespaceName,
 0461                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 462                }
 0463                catch (Exception e)
 464                {
 0465                    scope.Failed(e);
 0466                    throw;
 467                }
 0468            }
 0469            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 470        }
 471
 472        /// <summary> Gets all Alias(Disaster Recovery configurations). </summary>
 473        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 474        /// <param name="namespaceName"> The Namespace name. </param>
 475        /// <param name="cancellationToken"> The cancellation token to use. </param>
 476        public virtual AsyncPageable<ArmDisasterRecovery> ListAsync(string resourceGroupName, string namespaceName, Canc
 477        {
 4478            if (resourceGroupName == null)
 479            {
 0480                throw new ArgumentNullException(nameof(resourceGroupName));
 481            }
 4482            if (namespaceName == null)
 483            {
 0484                throw new ArgumentNullException(nameof(namespaceName));
 485            }
 486
 487            async Task<Page<ArmDisasterRecovery>> FirstPageFunc(int? pageSizeHint)
 488            {
 0489                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.List");
 0490                scope.Start();
 491                try
 492                {
 0493                    var response = await RestClient.ListAsync(resourceGroupName, namespaceName, cancellationToken).Confi
 0494                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 495                }
 0496                catch (Exception e)
 497                {
 0498                    scope.Failed(e);
 0499                    throw;
 500                }
 0501            }
 502            async Task<Page<ArmDisasterRecovery>> NextPageFunc(string nextLink, int? pageSizeHint)
 503            {
 0504                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.List");
 0505                scope.Start();
 506                try
 507                {
 0508                    var response = await RestClient.ListNextPageAsync(nextLink, resourceGroupName, namespaceName, cancel
 0509                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 510                }
 0511                catch (Exception e)
 512                {
 0513                    scope.Failed(e);
 0514                    throw;
 515                }
 0516            }
 4517            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 518        }
 519
 520        /// <summary> Gets all Alias(Disaster Recovery configurations). </summary>
 521        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 522        /// <param name="namespaceName"> The Namespace name. </param>
 523        /// <param name="cancellationToken"> The cancellation token to use. </param>
 524        public virtual Pageable<ArmDisasterRecovery> List(string resourceGroupName, string namespaceName, CancellationTo
 525        {
 4526            if (resourceGroupName == null)
 527            {
 0528                throw new ArgumentNullException(nameof(resourceGroupName));
 529            }
 4530            if (namespaceName == null)
 531            {
 0532                throw new ArgumentNullException(nameof(namespaceName));
 533            }
 534
 535            Page<ArmDisasterRecovery> FirstPageFunc(int? pageSizeHint)
 536            {
 0537                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.List");
 0538                scope.Start();
 539                try
 540                {
 0541                    var response = RestClient.List(resourceGroupName, namespaceName, cancellationToken);
 0542                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 543                }
 0544                catch (Exception e)
 545                {
 0546                    scope.Failed(e);
 0547                    throw;
 548                }
 0549            }
 550            Page<ArmDisasterRecovery> NextPageFunc(string nextLink, int? pageSizeHint)
 551            {
 0552                using var scope = _clientDiagnostics.CreateScope("DisasterRecoveryConfigsOperations.List");
 0553                scope.Start();
 554                try
 555                {
 0556                    var response = RestClient.ListNextPage(nextLink, resourceGroupName, namespaceName, cancellationToken
 0557                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 558                }
 0559                catch (Exception e)
 560                {
 0561                    scope.Failed(e);
 0562                    throw;
 563                }
 0564            }
 4565            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 566        }
 567    }
 568}