< Summary

Class:Azure.ResourceManager.EventHubs.DisasterRecoveryConfigsRestOperations
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\DisasterRecoveryConfigsRestOperations.cs
Covered lines:324
Uncovered lines:267
Coverable lines:591
Total lines:1278
Line coverage:54.8% (324 of 591)
Covered branches:82
Total branches:248
Branch coverage:33% (82 of 248)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateListAuthorizationRulesRequest(...)-0%100%
ListAuthorizationRulesAsync()-0%0%
ListAuthorizationRules(...)-0%0%
CreateGetAuthorizationRuleRequest(...)-100%100%
GetAuthorizationRuleAsync()-68.42%50%
GetAuthorizationRule(...)-68.42%50%
CreateListKeysRequest(...)-100%100%
ListKeysAsync()-68.42%50%
ListKeys(...)-68.42%50%
CreateCheckNameAvailabilityRequest(...)-100%100%
CheckNameAvailabilityAsync()-70.59%50%
CheckNameAvailability(...)-70.59%50%
CreateListRequest(...)-0%100%
ListAsync()-0%0%
List(...)-0%0%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-65%42.86%
CreateOrUpdate(...)-65%42.86%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-66.67%50%
Delete(...)-66.67%50%
CreateGetRequest(...)-100%100%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateBreakPairingRequest(...)-100%100%
BreakPairingAsync()-66.67%50%
BreakPairing(...)-66.67%50%
CreateFailOverRequest(...)-100%100%
FailOverAsync()-66.67%50%
FailOver(...)-66.67%50%
CreateListAuthorizationRulesNextPageRequest(...)-0%100%
ListAuthorizationRulesNextPageAsync()-0%0%
ListAuthorizationRulesNextPage(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\DisasterRecoveryConfigsRestOperations.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.EventHubs.Models;
 16
 17namespace Azure.ResourceManager.EventHubs
 18{
 19    internal partial class DisasterRecoveryConfigsRestOperations
 20    {
 21        private string subscriptionId;
 22        private Uri endpoint;
 23        private ClientDiagnostics _clientDiagnostics;
 24        private HttpPipeline _pipeline;
 25
 26        /// <summary> Initializes a new instance of DisasterRecoveryConfigsRestOperations. </summary>
 27        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 28        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 29        /// <param name="subscriptionId"> Subscription credentials that uniquely identify a Microsoft Azure subscription
 30        /// <param name="endpoint"> server parameter. </param>
 31        /// <exception cref="ArgumentNullException"> This occurs when one of the required arguments is null. </exception
 4832        public DisasterRecoveryConfigsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string 
 33        {
 4834            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 4838            endpoint ??= new Uri("https://management.azure.com");
 39
 4840            this.subscriptionId = subscriptionId;
 4841            this.endpoint = endpoint;
 4842            _clientDiagnostics = clientDiagnostics;
 4843            _pipeline = pipeline;
 4844        }
 45
 46        internal HttpMessage CreateListAuthorizationRulesRequest(string resourceGroupName, string namespaceName, string 
 47        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Get;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/resourceGroups/", false);
 056            uri.AppendPath(resourceGroupName, true);
 057            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 058            uri.AppendPath(namespaceName, true);
 059            uri.AppendPath("/disasterRecoveryConfigs/", false);
 060            uri.AppendPath(@alias, true);
 061            uri.AppendPath("/authorizationRules", false);
 062            uri.AppendQuery("api-version", "2017-04-01", true);
 063            request.Uri = uri;
 064            return message;
 65        }
 66
 67        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 68        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 69        /// <param name="namespaceName"> The Namespace name. </param>
 70        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 71        /// <param name="cancellationToken"> The cancellation token to use. </param>
 72        public async Task<Response<AuthorizationRuleListResult>> ListAuthorizationRulesAsync(string resourceGroupName, s
 73        {
 074            if (resourceGroupName == null)
 75            {
 076                throw new ArgumentNullException(nameof(resourceGroupName));
 77            }
 078            if (namespaceName == null)
 79            {
 080                throw new ArgumentNullException(nameof(namespaceName));
 81            }
 082            if (@alias == null)
 83            {
 084                throw new ArgumentNullException(nameof(@alias));
 85            }
 86
 087            using var message = CreateListAuthorizationRulesRequest(resourceGroupName, namespaceName, @alias);
 088            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 089            switch (message.Response.Status)
 90            {
 91                case 200:
 92                    {
 093                        AuthorizationRuleListResult value = default;
 094                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 095                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 96                        {
 097                            value = null;
 98                        }
 99                        else
 100                        {
 0101                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 102                        }
 0103                        return Response.FromValue(value, message.Response);
 104                    }
 105                default:
 0106                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 107            }
 0108        }
 109
 110        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 111        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 112        /// <param name="namespaceName"> The Namespace name. </param>
 113        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 114        /// <param name="cancellationToken"> The cancellation token to use. </param>
 115        public Response<AuthorizationRuleListResult> ListAuthorizationRules(string resourceGroupName, string namespaceNa
 116        {
 0117            if (resourceGroupName == null)
 118            {
 0119                throw new ArgumentNullException(nameof(resourceGroupName));
 120            }
 0121            if (namespaceName == null)
 122            {
 0123                throw new ArgumentNullException(nameof(namespaceName));
 124            }
 0125            if (@alias == null)
 126            {
 0127                throw new ArgumentNullException(nameof(@alias));
 128            }
 129
 0130            using var message = CreateListAuthorizationRulesRequest(resourceGroupName, namespaceName, @alias);
 0131            _pipeline.Send(message, cancellationToken);
 0132            switch (message.Response.Status)
 133            {
 134                case 200:
 135                    {
 0136                        AuthorizationRuleListResult value = default;
 0137                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0138                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 139                        {
 0140                            value = null;
 141                        }
 142                        else
 143                        {
 0144                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 145                        }
 0146                        return Response.FromValue(value, message.Response);
 147                    }
 148                default:
 0149                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 150            }
 0151        }
 152
 153        internal HttpMessage CreateGetAuthorizationRuleRequest(string resourceGroupName, string namespaceName, string @a
 154        {
 8155            var message = _pipeline.CreateMessage();
 8156            var request = message.Request;
 8157            request.Method = RequestMethod.Get;
 8158            var uri = new RawRequestUriBuilder();
 8159            uri.Reset(endpoint);
 8160            uri.AppendPath("/subscriptions/", false);
 8161            uri.AppendPath(subscriptionId, true);
 8162            uri.AppendPath("/resourceGroups/", false);
 8163            uri.AppendPath(resourceGroupName, true);
 8164            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 8165            uri.AppendPath(namespaceName, true);
 8166            uri.AppendPath("/disasterRecoveryConfigs/", false);
 8167            uri.AppendPath(@alias, true);
 8168            uri.AppendPath("/authorizationRules/", false);
 8169            uri.AppendPath(authorizationRuleName, true);
 8170            uri.AppendQuery("api-version", "2017-04-01", true);
 8171            request.Uri = uri;
 8172            return message;
 173        }
 174
 175        /// <summary> Gets an AuthorizationRule for a Namespace by rule name. </summary>
 176        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 177        /// <param name="namespaceName"> The Namespace name. </param>
 178        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 179        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 180        /// <param name="cancellationToken"> The cancellation token to use. </param>
 181        public async Task<Response<AuthorizationRule>> GetAuthorizationRuleAsync(string resourceGroupName, string namesp
 182        {
 4183            if (resourceGroupName == null)
 184            {
 0185                throw new ArgumentNullException(nameof(resourceGroupName));
 186            }
 4187            if (namespaceName == null)
 188            {
 0189                throw new ArgumentNullException(nameof(namespaceName));
 190            }
 4191            if (@alias == null)
 192            {
 0193                throw new ArgumentNullException(nameof(@alias));
 194            }
 4195            if (authorizationRuleName == null)
 196            {
 0197                throw new ArgumentNullException(nameof(authorizationRuleName));
 198            }
 199
 4200            using var message = CreateGetAuthorizationRuleRequest(resourceGroupName, namespaceName, @alias, authorizatio
 4201            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4202            switch (message.Response.Status)
 203            {
 204                case 200:
 205                    {
 4206                        AuthorizationRule value = default;
 4207                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4208                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 209                        {
 0210                            value = null;
 211                        }
 212                        else
 213                        {
 4214                            value = AuthorizationRule.DeserializeAuthorizationRule(document.RootElement);
 215                        }
 4216                        return Response.FromValue(value, message.Response);
 217                    }
 218                default:
 0219                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 220            }
 4221        }
 222
 223        /// <summary> Gets an AuthorizationRule for a Namespace by rule name. </summary>
 224        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 225        /// <param name="namespaceName"> The Namespace name. </param>
 226        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 227        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 228        /// <param name="cancellationToken"> The cancellation token to use. </param>
 229        public Response<AuthorizationRule> GetAuthorizationRule(string resourceGroupName, string namespaceName, string @
 230        {
 4231            if (resourceGroupName == null)
 232            {
 0233                throw new ArgumentNullException(nameof(resourceGroupName));
 234            }
 4235            if (namespaceName == null)
 236            {
 0237                throw new ArgumentNullException(nameof(namespaceName));
 238            }
 4239            if (@alias == null)
 240            {
 0241                throw new ArgumentNullException(nameof(@alias));
 242            }
 4243            if (authorizationRuleName == null)
 244            {
 0245                throw new ArgumentNullException(nameof(authorizationRuleName));
 246            }
 247
 4248            using var message = CreateGetAuthorizationRuleRequest(resourceGroupName, namespaceName, @alias, authorizatio
 4249            _pipeline.Send(message, cancellationToken);
 4250            switch (message.Response.Status)
 251            {
 252                case 200:
 253                    {
 4254                        AuthorizationRule value = default;
 4255                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4256                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 257                        {
 0258                            value = null;
 259                        }
 260                        else
 261                        {
 4262                            value = AuthorizationRule.DeserializeAuthorizationRule(document.RootElement);
 263                        }
 4264                        return Response.FromValue(value, message.Response);
 265                    }
 266                default:
 0267                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 268            }
 4269        }
 270
 271        internal HttpMessage CreateListKeysRequest(string resourceGroupName, string namespaceName, string @alias, string
 272        {
 8273            var message = _pipeline.CreateMessage();
 8274            var request = message.Request;
 8275            request.Method = RequestMethod.Post;
 8276            var uri = new RawRequestUriBuilder();
 8277            uri.Reset(endpoint);
 8278            uri.AppendPath("/subscriptions/", false);
 8279            uri.AppendPath(subscriptionId, true);
 8280            uri.AppendPath("/resourceGroups/", false);
 8281            uri.AppendPath(resourceGroupName, true);
 8282            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 8283            uri.AppendPath(namespaceName, true);
 8284            uri.AppendPath("/disasterRecoveryConfigs/", false);
 8285            uri.AppendPath(@alias, true);
 8286            uri.AppendPath("/authorizationRules/", false);
 8287            uri.AppendPath(authorizationRuleName, true);
 8288            uri.AppendPath("/listKeys", false);
 8289            uri.AppendQuery("api-version", "2017-04-01", true);
 8290            request.Uri = uri;
 8291            return message;
 292        }
 293
 294        /// <summary> Gets the primary and secondary connection strings for the Namespace. </summary>
 295        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 296        /// <param name="namespaceName"> The Namespace name. </param>
 297        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 298        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 299        /// <param name="cancellationToken"> The cancellation token to use. </param>
 300        public async Task<Response<AccessKeys>> ListKeysAsync(string resourceGroupName, string namespaceName, string @al
 301        {
 4302            if (resourceGroupName == null)
 303            {
 0304                throw new ArgumentNullException(nameof(resourceGroupName));
 305            }
 4306            if (namespaceName == null)
 307            {
 0308                throw new ArgumentNullException(nameof(namespaceName));
 309            }
 4310            if (@alias == null)
 311            {
 0312                throw new ArgumentNullException(nameof(@alias));
 313            }
 4314            if (authorizationRuleName == null)
 315            {
 0316                throw new ArgumentNullException(nameof(authorizationRuleName));
 317            }
 318
 4319            using var message = CreateListKeysRequest(resourceGroupName, namespaceName, @alias, authorizationRuleName);
 4320            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4321            switch (message.Response.Status)
 322            {
 323                case 200:
 324                    {
 4325                        AccessKeys value = default;
 4326                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4327                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 328                        {
 0329                            value = null;
 330                        }
 331                        else
 332                        {
 4333                            value = AccessKeys.DeserializeAccessKeys(document.RootElement);
 334                        }
 4335                        return Response.FromValue(value, message.Response);
 336                    }
 337                default:
 0338                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 339            }
 4340        }
 341
 342        /// <summary> Gets the primary and secondary connection strings for the Namespace. </summary>
 343        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 344        /// <param name="namespaceName"> The Namespace name. </param>
 345        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 346        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 347        /// <param name="cancellationToken"> The cancellation token to use. </param>
 348        public Response<AccessKeys> ListKeys(string resourceGroupName, string namespaceName, string @alias, string autho
 349        {
 4350            if (resourceGroupName == null)
 351            {
 0352                throw new ArgumentNullException(nameof(resourceGroupName));
 353            }
 4354            if (namespaceName == null)
 355            {
 0356                throw new ArgumentNullException(nameof(namespaceName));
 357            }
 4358            if (@alias == null)
 359            {
 0360                throw new ArgumentNullException(nameof(@alias));
 361            }
 4362            if (authorizationRuleName == null)
 363            {
 0364                throw new ArgumentNullException(nameof(authorizationRuleName));
 365            }
 366
 4367            using var message = CreateListKeysRequest(resourceGroupName, namespaceName, @alias, authorizationRuleName);
 4368            _pipeline.Send(message, cancellationToken);
 4369            switch (message.Response.Status)
 370            {
 371                case 200:
 372                    {
 4373                        AccessKeys value = default;
 4374                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4375                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 376                        {
 0377                            value = null;
 378                        }
 379                        else
 380                        {
 4381                            value = AccessKeys.DeserializeAccessKeys(document.RootElement);
 382                        }
 4383                        return Response.FromValue(value, message.Response);
 384                    }
 385                default:
 0386                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 387            }
 4388        }
 389
 390        internal HttpMessage CreateCheckNameAvailabilityRequest(string resourceGroupName, string namespaceName, CheckNam
 391        {
 12392            var message = _pipeline.CreateMessage();
 12393            var request = message.Request;
 12394            request.Method = RequestMethod.Post;
 12395            var uri = new RawRequestUriBuilder();
 12396            uri.Reset(endpoint);
 12397            uri.AppendPath("/subscriptions/", false);
 12398            uri.AppendPath(subscriptionId, true);
 12399            uri.AppendPath("/resourceGroups/", false);
 12400            uri.AppendPath(resourceGroupName, true);
 12401            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 12402            uri.AppendPath(namespaceName, true);
 12403            uri.AppendPath("/disasterRecoveryConfigs/checkNameAvailability", false);
 12404            uri.AppendQuery("api-version", "2017-04-01", true);
 12405            request.Uri = uri;
 12406            request.Headers.Add("Content-Type", "application/json");
 12407            var content = new Utf8JsonRequestContent();
 12408            content.JsonWriter.WriteObjectValue(parameters);
 12409            request.Content = content;
 12410            return message;
 411        }
 412
 413        /// <summary> Check the give Namespace name availability. </summary>
 414        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 415        /// <param name="namespaceName"> The Namespace name. </param>
 416        /// <param name="parameters"> Parameters to check availability of the given Alias name. </param>
 417        /// <param name="cancellationToken"> The cancellation token to use. </param>
 418        public async Task<Response<CheckNameAvailabilityResult>> CheckNameAvailabilityAsync(string resourceGroupName, st
 419        {
 6420            if (resourceGroupName == null)
 421            {
 0422                throw new ArgumentNullException(nameof(resourceGroupName));
 423            }
 6424            if (namespaceName == null)
 425            {
 0426                throw new ArgumentNullException(nameof(namespaceName));
 427            }
 6428            if (parameters == null)
 429            {
 0430                throw new ArgumentNullException(nameof(parameters));
 431            }
 432
 6433            using var message = CreateCheckNameAvailabilityRequest(resourceGroupName, namespaceName, parameters);
 6434            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 6435            switch (message.Response.Status)
 436            {
 437                case 200:
 438                    {
 6439                        CheckNameAvailabilityResult value = default;
 6440                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 6441                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 442                        {
 0443                            value = null;
 444                        }
 445                        else
 446                        {
 6447                            value = CheckNameAvailabilityResult.DeserializeCheckNameAvailabilityResult(document.RootElem
 448                        }
 6449                        return Response.FromValue(value, message.Response);
 450                    }
 451                default:
 0452                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 453            }
 6454        }
 455
 456        /// <summary> Check the give Namespace name availability. </summary>
 457        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 458        /// <param name="namespaceName"> The Namespace name. </param>
 459        /// <param name="parameters"> Parameters to check availability of the given Alias name. </param>
 460        /// <param name="cancellationToken"> The cancellation token to use. </param>
 461        public Response<CheckNameAvailabilityResult> CheckNameAvailability(string resourceGroupName, string namespaceNam
 462        {
 6463            if (resourceGroupName == null)
 464            {
 0465                throw new ArgumentNullException(nameof(resourceGroupName));
 466            }
 6467            if (namespaceName == null)
 468            {
 0469                throw new ArgumentNullException(nameof(namespaceName));
 470            }
 6471            if (parameters == null)
 472            {
 0473                throw new ArgumentNullException(nameof(parameters));
 474            }
 475
 6476            using var message = CreateCheckNameAvailabilityRequest(resourceGroupName, namespaceName, parameters);
 6477            _pipeline.Send(message, cancellationToken);
 6478            switch (message.Response.Status)
 479            {
 480                case 200:
 481                    {
 6482                        CheckNameAvailabilityResult value = default;
 6483                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 6484                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 485                        {
 0486                            value = null;
 487                        }
 488                        else
 489                        {
 6490                            value = CheckNameAvailabilityResult.DeserializeCheckNameAvailabilityResult(document.RootElem
 491                        }
 6492                        return Response.FromValue(value, message.Response);
 493                    }
 494                default:
 0495                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 496            }
 6497        }
 498
 499        internal HttpMessage CreateListRequest(string resourceGroupName, string namespaceName)
 500        {
 0501            var message = _pipeline.CreateMessage();
 0502            var request = message.Request;
 0503            request.Method = RequestMethod.Get;
 0504            var uri = new RawRequestUriBuilder();
 0505            uri.Reset(endpoint);
 0506            uri.AppendPath("/subscriptions/", false);
 0507            uri.AppendPath(subscriptionId, true);
 0508            uri.AppendPath("/resourceGroups/", false);
 0509            uri.AppendPath(resourceGroupName, true);
 0510            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 0511            uri.AppendPath(namespaceName, true);
 0512            uri.AppendPath("/disasterRecoveryConfigs", false);
 0513            uri.AppendQuery("api-version", "2017-04-01", true);
 0514            request.Uri = uri;
 0515            return message;
 516        }
 517
 518        /// <summary> Gets all Alias(Disaster Recovery configurations). </summary>
 519        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 520        /// <param name="namespaceName"> The Namespace name. </param>
 521        /// <param name="cancellationToken"> The cancellation token to use. </param>
 522        public async Task<Response<ArmDisasterRecoveryListResult>> ListAsync(string resourceGroupName, string namespaceN
 523        {
 0524            if (resourceGroupName == null)
 525            {
 0526                throw new ArgumentNullException(nameof(resourceGroupName));
 527            }
 0528            if (namespaceName == null)
 529            {
 0530                throw new ArgumentNullException(nameof(namespaceName));
 531            }
 532
 0533            using var message = CreateListRequest(resourceGroupName, namespaceName);
 0534            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0535            switch (message.Response.Status)
 536            {
 537                case 200:
 538                    {
 0539                        ArmDisasterRecoveryListResult value = default;
 0540                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0541                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 542                        {
 0543                            value = null;
 544                        }
 545                        else
 546                        {
 0547                            value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.Root
 548                        }
 0549                        return Response.FromValue(value, message.Response);
 550                    }
 551                default:
 0552                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 553            }
 0554        }
 555
 556        /// <summary> Gets all Alias(Disaster Recovery configurations). </summary>
 557        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 558        /// <param name="namespaceName"> The Namespace name. </param>
 559        /// <param name="cancellationToken"> The cancellation token to use. </param>
 560        public Response<ArmDisasterRecoveryListResult> List(string resourceGroupName, string namespaceName, Cancellation
 561        {
 0562            if (resourceGroupName == null)
 563            {
 0564                throw new ArgumentNullException(nameof(resourceGroupName));
 565            }
 0566            if (namespaceName == null)
 567            {
 0568                throw new ArgumentNullException(nameof(namespaceName));
 569            }
 570
 0571            using var message = CreateListRequest(resourceGroupName, namespaceName);
 0572            _pipeline.Send(message, cancellationToken);
 0573            switch (message.Response.Status)
 574            {
 575                case 200:
 576                    {
 0577                        ArmDisasterRecoveryListResult 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 = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.Root
 586                        }
 0587                        return Response.FromValue(value, message.Response);
 588                    }
 589                default:
 0590                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 591            }
 0592        }
 593
 594        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string namespaceName, string @alias, 
 595        {
 16596            var message = _pipeline.CreateMessage();
 16597            var request = message.Request;
 16598            request.Method = RequestMethod.Put;
 16599            var uri = new RawRequestUriBuilder();
 16600            uri.Reset(endpoint);
 16601            uri.AppendPath("/subscriptions/", false);
 16602            uri.AppendPath(subscriptionId, true);
 16603            uri.AppendPath("/resourceGroups/", false);
 16604            uri.AppendPath(resourceGroupName, true);
 16605            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 16606            uri.AppendPath(namespaceName, true);
 16607            uri.AppendPath("/disasterRecoveryConfigs/", false);
 16608            uri.AppendPath(@alias, true);
 16609            uri.AppendQuery("api-version", "2017-04-01", true);
 16610            request.Uri = uri;
 16611            request.Headers.Add("Content-Type", "application/json");
 16612            var content = new Utf8JsonRequestContent();
 16613            content.JsonWriter.WriteObjectValue(parameters);
 16614            request.Content = content;
 16615            return message;
 616        }
 617
 618        /// <summary> Creates or updates a new Alias(Disaster Recovery configuration). </summary>
 619        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 620        /// <param name="namespaceName"> The Namespace name. </param>
 621        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 622        /// <param name="parameters"> Parameters required to create an Alias(Disaster Recovery configuration). </param>
 623        /// <param name="cancellationToken"> The cancellation token to use. </param>
 624        public async Task<Response<ArmDisasterRecovery>> CreateOrUpdateAsync(string resourceGroupName, string namespaceN
 625        {
 8626            if (resourceGroupName == null)
 627            {
 0628                throw new ArgumentNullException(nameof(resourceGroupName));
 629            }
 8630            if (namespaceName == null)
 631            {
 0632                throw new ArgumentNullException(nameof(namespaceName));
 633            }
 8634            if (@alias == null)
 635            {
 0636                throw new ArgumentNullException(nameof(@alias));
 637            }
 8638            if (parameters == null)
 639            {
 0640                throw new ArgumentNullException(nameof(parameters));
 641            }
 642
 8643            using var message = CreateCreateOrUpdateRequest(resourceGroupName, namespaceName, @alias, parameters);
 8644            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 8645            switch (message.Response.Status)
 646            {
 647                case 200:
 648                    {
 8649                        ArmDisasterRecovery value = default;
 8650                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 8651                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 652                        {
 0653                            value = null;
 654                        }
 655                        else
 656                        {
 8657                            value = ArmDisasterRecovery.DeserializeArmDisasterRecovery(document.RootElement);
 658                        }
 8659                        return Response.FromValue(value, message.Response);
 660                    }
 661                case 201:
 0662                    return Response.FromValue<ArmDisasterRecovery>(null, message.Response);
 663                default:
 0664                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 665            }
 8666        }
 667
 668        /// <summary> Creates or updates a new Alias(Disaster Recovery configuration). </summary>
 669        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 670        /// <param name="namespaceName"> The Namespace name. </param>
 671        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 672        /// <param name="parameters"> Parameters required to create an Alias(Disaster Recovery configuration). </param>
 673        /// <param name="cancellationToken"> The cancellation token to use. </param>
 674        public Response<ArmDisasterRecovery> CreateOrUpdate(string resourceGroupName, string namespaceName, string @alia
 675        {
 8676            if (resourceGroupName == null)
 677            {
 0678                throw new ArgumentNullException(nameof(resourceGroupName));
 679            }
 8680            if (namespaceName == null)
 681            {
 0682                throw new ArgumentNullException(nameof(namespaceName));
 683            }
 8684            if (@alias == null)
 685            {
 0686                throw new ArgumentNullException(nameof(@alias));
 687            }
 8688            if (parameters == null)
 689            {
 0690                throw new ArgumentNullException(nameof(parameters));
 691            }
 692
 8693            using var message = CreateCreateOrUpdateRequest(resourceGroupName, namespaceName, @alias, parameters);
 8694            _pipeline.Send(message, cancellationToken);
 8695            switch (message.Response.Status)
 696            {
 697                case 200:
 698                    {
 8699                        ArmDisasterRecovery value = default;
 8700                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 8701                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 702                        {
 0703                            value = null;
 704                        }
 705                        else
 706                        {
 8707                            value = ArmDisasterRecovery.DeserializeArmDisasterRecovery(document.RootElement);
 708                        }
 8709                        return Response.FromValue(value, message.Response);
 710                    }
 711                case 201:
 0712                    return Response.FromValue<ArmDisasterRecovery>(null, message.Response);
 713                default:
 0714                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 715            }
 8716        }
 717
 718        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string namespaceName, string @alias)
 719        {
 8720            var message = _pipeline.CreateMessage();
 8721            var request = message.Request;
 8722            request.Method = RequestMethod.Delete;
 8723            var uri = new RawRequestUriBuilder();
 8724            uri.Reset(endpoint);
 8725            uri.AppendPath("/subscriptions/", false);
 8726            uri.AppendPath(subscriptionId, true);
 8727            uri.AppendPath("/resourceGroups/", false);
 8728            uri.AppendPath(resourceGroupName, true);
 8729            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 8730            uri.AppendPath(namespaceName, true);
 8731            uri.AppendPath("/disasterRecoveryConfigs/", false);
 8732            uri.AppendPath(@alias, true);
 8733            uri.AppendQuery("api-version", "2017-04-01", true);
 8734            request.Uri = uri;
 8735            return message;
 736        }
 737
 738        /// <summary> Deletes an Alias(Disaster Recovery configuration). </summary>
 739        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 740        /// <param name="namespaceName"> The Namespace name. </param>
 741        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 742        /// <param name="cancellationToken"> The cancellation token to use. </param>
 743        public async Task<Response> DeleteAsync(string resourceGroupName, string namespaceName, string @alias, Cancellat
 744        {
 4745            if (resourceGroupName == null)
 746            {
 0747                throw new ArgumentNullException(nameof(resourceGroupName));
 748            }
 4749            if (namespaceName == null)
 750            {
 0751                throw new ArgumentNullException(nameof(namespaceName));
 752            }
 4753            if (@alias == null)
 754            {
 0755                throw new ArgumentNullException(nameof(@alias));
 756            }
 757
 4758            using var message = CreateDeleteRequest(resourceGroupName, namespaceName, @alias);
 4759            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4760            switch (message.Response.Status)
 761            {
 762                case 200:
 4763                    return message.Response;
 764                default:
 0765                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 766            }
 4767        }
 768
 769        /// <summary> Deletes an Alias(Disaster Recovery configuration). </summary>
 770        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 771        /// <param name="namespaceName"> The Namespace name. </param>
 772        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 773        /// <param name="cancellationToken"> The cancellation token to use. </param>
 774        public Response Delete(string resourceGroupName, string namespaceName, string @alias, CancellationToken cancella
 775        {
 4776            if (resourceGroupName == null)
 777            {
 0778                throw new ArgumentNullException(nameof(resourceGroupName));
 779            }
 4780            if (namespaceName == null)
 781            {
 0782                throw new ArgumentNullException(nameof(namespaceName));
 783            }
 4784            if (@alias == null)
 785            {
 0786                throw new ArgumentNullException(nameof(@alias));
 787            }
 788
 4789            using var message = CreateDeleteRequest(resourceGroupName, namespaceName, @alias);
 4790            _pipeline.Send(message, cancellationToken);
 4791            switch (message.Response.Status)
 792            {
 793                case 200:
 4794                    return message.Response;
 795                default:
 0796                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 797            }
 4798        }
 799
 800        internal HttpMessage CreateGetRequest(string resourceGroupName, string namespaceName, string @alias)
 801        {
 6056802            var message = _pipeline.CreateMessage();
 6056803            var request = message.Request;
 6056804            request.Method = RequestMethod.Get;
 6056805            var uri = new RawRequestUriBuilder();
 6056806            uri.Reset(endpoint);
 6056807            uri.AppendPath("/subscriptions/", false);
 6056808            uri.AppendPath(subscriptionId, true);
 6056809            uri.AppendPath("/resourceGroups/", false);
 6056810            uri.AppendPath(resourceGroupName, true);
 6056811            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 6056812            uri.AppendPath(namespaceName, true);
 6056813            uri.AppendPath("/disasterRecoveryConfigs/", false);
 6056814            uri.AppendPath(@alias, true);
 6056815            uri.AppendQuery("api-version", "2017-04-01", true);
 6056816            request.Uri = uri;
 6056817            return message;
 818        }
 819
 820        /// <summary> Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. </summary>
 821        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 822        /// <param name="namespaceName"> The Namespace name. </param>
 823        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 824        /// <param name="cancellationToken"> The cancellation token to use. </param>
 825        public async Task<Response<ArmDisasterRecovery>> GetAsync(string resourceGroupName, string namespaceName, string
 826        {
 3138827            if (resourceGroupName == null)
 828            {
 0829                throw new ArgumentNullException(nameof(resourceGroupName));
 830            }
 3138831            if (namespaceName == null)
 832            {
 0833                throw new ArgumentNullException(nameof(namespaceName));
 834            }
 3138835            if (@alias == null)
 836            {
 0837                throw new ArgumentNullException(nameof(@alias));
 838            }
 839
 3138840            using var message = CreateGetRequest(resourceGroupName, namespaceName, @alias);
 3138841            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 3138842            switch (message.Response.Status)
 843            {
 844                case 200:
 845                    {
 3138846                        ArmDisasterRecovery value = default;
 3138847                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 3138848                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 849                        {
 0850                            value = null;
 851                        }
 852                        else
 853                        {
 3138854                            value = ArmDisasterRecovery.DeserializeArmDisasterRecovery(document.RootElement);
 855                        }
 3138856                        return Response.FromValue(value, message.Response);
 857                    }
 858                default:
 0859                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 860            }
 3138861        }
 862
 863        /// <summary> Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace. </summary>
 864        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 865        /// <param name="namespaceName"> The Namespace name. </param>
 866        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 867        /// <param name="cancellationToken"> The cancellation token to use. </param>
 868        public Response<ArmDisasterRecovery> Get(string resourceGroupName, string namespaceName, string @alias, Cancella
 869        {
 2918870            if (resourceGroupName == null)
 871            {
 0872                throw new ArgumentNullException(nameof(resourceGroupName));
 873            }
 2918874            if (namespaceName == null)
 875            {
 0876                throw new ArgumentNullException(nameof(namespaceName));
 877            }
 2918878            if (@alias == null)
 879            {
 0880                throw new ArgumentNullException(nameof(@alias));
 881            }
 882
 2918883            using var message = CreateGetRequest(resourceGroupName, namespaceName, @alias);
 2918884            _pipeline.Send(message, cancellationToken);
 2918885            switch (message.Response.Status)
 886            {
 887                case 200:
 888                    {
 2918889                        ArmDisasterRecovery value = default;
 2918890                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2918891                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 892                        {
 0893                            value = null;
 894                        }
 895                        else
 896                        {
 2918897                            value = ArmDisasterRecovery.DeserializeArmDisasterRecovery(document.RootElement);
 898                        }
 2918899                        return Response.FromValue(value, message.Response);
 900                    }
 901                default:
 0902                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 903            }
 2918904        }
 905
 906        internal HttpMessage CreateBreakPairingRequest(string resourceGroupName, string namespaceName, string @alias)
 907        {
 8908            var message = _pipeline.CreateMessage();
 8909            var request = message.Request;
 8910            request.Method = RequestMethod.Post;
 8911            var uri = new RawRequestUriBuilder();
 8912            uri.Reset(endpoint);
 8913            uri.AppendPath("/subscriptions/", false);
 8914            uri.AppendPath(subscriptionId, true);
 8915            uri.AppendPath("/resourceGroups/", false);
 8916            uri.AppendPath(resourceGroupName, true);
 8917            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 8918            uri.AppendPath(namespaceName, true);
 8919            uri.AppendPath("/disasterRecoveryConfigs/", false);
 8920            uri.AppendPath(@alias, true);
 8921            uri.AppendPath("/breakPairing", false);
 8922            uri.AppendQuery("api-version", "2017-04-01", true);
 8923            request.Uri = uri;
 8924            return message;
 925        }
 926
 927        /// <summary> This operation disables the Disaster Recovery and stops replicating changes from primary to second
 928        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 929        /// <param name="namespaceName"> The Namespace name. </param>
 930        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 931        /// <param name="cancellationToken"> The cancellation token to use. </param>
 932        public async Task<Response> BreakPairingAsync(string resourceGroupName, string namespaceName, string @alias, Can
 933        {
 4934            if (resourceGroupName == null)
 935            {
 0936                throw new ArgumentNullException(nameof(resourceGroupName));
 937            }
 4938            if (namespaceName == null)
 939            {
 0940                throw new ArgumentNullException(nameof(namespaceName));
 941            }
 4942            if (@alias == null)
 943            {
 0944                throw new ArgumentNullException(nameof(@alias));
 945            }
 946
 4947            using var message = CreateBreakPairingRequest(resourceGroupName, namespaceName, @alias);
 4948            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4949            switch (message.Response.Status)
 950            {
 951                case 200:
 4952                    return message.Response;
 953                default:
 0954                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 955            }
 4956        }
 957
 958        /// <summary> This operation disables the Disaster Recovery and stops replicating changes from primary to second
 959        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 960        /// <param name="namespaceName"> The Namespace name. </param>
 961        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 962        /// <param name="cancellationToken"> The cancellation token to use. </param>
 963        public Response BreakPairing(string resourceGroupName, string namespaceName, string @alias, CancellationToken ca
 964        {
 4965            if (resourceGroupName == null)
 966            {
 0967                throw new ArgumentNullException(nameof(resourceGroupName));
 968            }
 4969            if (namespaceName == null)
 970            {
 0971                throw new ArgumentNullException(nameof(namespaceName));
 972            }
 4973            if (@alias == null)
 974            {
 0975                throw new ArgumentNullException(nameof(@alias));
 976            }
 977
 4978            using var message = CreateBreakPairingRequest(resourceGroupName, namespaceName, @alias);
 4979            _pipeline.Send(message, cancellationToken);
 4980            switch (message.Response.Status)
 981            {
 982                case 200:
 4983                    return message.Response;
 984                default:
 0985                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 986            }
 4987        }
 988
 989        internal HttpMessage CreateFailOverRequest(string resourceGroupName, string namespaceName, string @alias)
 990        {
 8991            var message = _pipeline.CreateMessage();
 8992            var request = message.Request;
 8993            request.Method = RequestMethod.Post;
 8994            var uri = new RawRequestUriBuilder();
 8995            uri.Reset(endpoint);
 8996            uri.AppendPath("/subscriptions/", false);
 8997            uri.AppendPath(subscriptionId, true);
 8998            uri.AppendPath("/resourceGroups/", false);
 8999            uri.AppendPath(resourceGroupName, true);
 81000            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 81001            uri.AppendPath(namespaceName, true);
 81002            uri.AppendPath("/disasterRecoveryConfigs/", false);
 81003            uri.AppendPath(@alias, true);
 81004            uri.AppendPath("/failover", false);
 81005            uri.AppendQuery("api-version", "2017-04-01", true);
 81006            request.Uri = uri;
 81007            return message;
 1008        }
 1009
 1010        /// <summary> Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. </summary>
 1011        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1012        /// <param name="namespaceName"> The Namespace name. </param>
 1013        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 1014        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1015        public async Task<Response> FailOverAsync(string resourceGroupName, string namespaceName, string @alias, Cancell
 1016        {
 41017            if (resourceGroupName == null)
 1018            {
 01019                throw new ArgumentNullException(nameof(resourceGroupName));
 1020            }
 41021            if (namespaceName == null)
 1022            {
 01023                throw new ArgumentNullException(nameof(namespaceName));
 1024            }
 41025            if (@alias == null)
 1026            {
 01027                throw new ArgumentNullException(nameof(@alias));
 1028            }
 1029
 41030            using var message = CreateFailOverRequest(resourceGroupName, namespaceName, @alias);
 41031            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 41032            switch (message.Response.Status)
 1033            {
 1034                case 200:
 41035                    return message.Response;
 1036                default:
 01037                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1038            }
 41039        }
 1040
 1041        /// <summary> Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace. </summary>
 1042        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1043        /// <param name="namespaceName"> The Namespace name. </param>
 1044        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 1045        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1046        public Response FailOver(string resourceGroupName, string namespaceName, string @alias, CancellationToken cancel
 1047        {
 41048            if (resourceGroupName == null)
 1049            {
 01050                throw new ArgumentNullException(nameof(resourceGroupName));
 1051            }
 41052            if (namespaceName == null)
 1053            {
 01054                throw new ArgumentNullException(nameof(namespaceName));
 1055            }
 41056            if (@alias == null)
 1057            {
 01058                throw new ArgumentNullException(nameof(@alias));
 1059            }
 1060
 41061            using var message = CreateFailOverRequest(resourceGroupName, namespaceName, @alias);
 41062            _pipeline.Send(message, cancellationToken);
 41063            switch (message.Response.Status)
 1064            {
 1065                case 200:
 41066                    return message.Response;
 1067                default:
 01068                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1069            }
 41070        }
 1071
 1072        internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink, string resourceGroupName, stri
 1073        {
 01074            var message = _pipeline.CreateMessage();
 01075            var request = message.Request;
 01076            request.Method = RequestMethod.Get;
 01077            var uri = new RawRequestUriBuilder();
 01078            uri.Reset(endpoint);
 01079            uri.AppendRawNextLink(nextLink, false);
 01080            request.Uri = uri;
 01081            return message;
 1082        }
 1083
 1084        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 1085        /// <param name="nextLink"> The URL to the next page of results. </param>
 1086        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1087        /// <param name="namespaceName"> The Namespace name. </param>
 1088        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 1089        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1090        public async Task<Response<AuthorizationRuleListResult>> ListAuthorizationRulesNextPageAsync(string nextLink, st
 1091        {
 01092            if (nextLink == null)
 1093            {
 01094                throw new ArgumentNullException(nameof(nextLink));
 1095            }
 01096            if (resourceGroupName == null)
 1097            {
 01098                throw new ArgumentNullException(nameof(resourceGroupName));
 1099            }
 01100            if (namespaceName == null)
 1101            {
 01102                throw new ArgumentNullException(nameof(namespaceName));
 1103            }
 01104            if (@alias == null)
 1105            {
 01106                throw new ArgumentNullException(nameof(@alias));
 1107            }
 1108
 01109            using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, resourceGroupName, namespaceName, 
 01110            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01111            switch (message.Response.Status)
 1112            {
 1113                case 200:
 1114                    {
 01115                        AuthorizationRuleListResult value = default;
 01116                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01117                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1118                        {
 01119                            value = null;
 1120                        }
 1121                        else
 1122                        {
 01123                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 1124                        }
 01125                        return Response.FromValue(value, message.Response);
 1126                    }
 1127                default:
 01128                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1129            }
 01130        }
 1131
 1132        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 1133        /// <param name="nextLink"> The URL to the next page of results. </param>
 1134        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1135        /// <param name="namespaceName"> The Namespace name. </param>
 1136        /// <param name="alias"> The Disaster Recovery configuration name. </param>
 1137        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1138        public Response<AuthorizationRuleListResult> ListAuthorizationRulesNextPage(string nextLink, string resourceGrou
 1139        {
 01140            if (nextLink == null)
 1141            {
 01142                throw new ArgumentNullException(nameof(nextLink));
 1143            }
 01144            if (resourceGroupName == null)
 1145            {
 01146                throw new ArgumentNullException(nameof(resourceGroupName));
 1147            }
 01148            if (namespaceName == null)
 1149            {
 01150                throw new ArgumentNullException(nameof(namespaceName));
 1151            }
 01152            if (@alias == null)
 1153            {
 01154                throw new ArgumentNullException(nameof(@alias));
 1155            }
 1156
 01157            using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, resourceGroupName, namespaceName, 
 01158            _pipeline.Send(message, cancellationToken);
 01159            switch (message.Response.Status)
 1160            {
 1161                case 200:
 1162                    {
 01163                        AuthorizationRuleListResult value = default;
 01164                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01165                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1166                        {
 01167                            value = null;
 1168                        }
 1169                        else
 1170                        {
 01171                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 1172                        }
 01173                        return Response.FromValue(value, message.Response);
 1174                    }
 1175                default:
 01176                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1177            }
 01178        }
 1179
 1180        internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceGroupName, string namespaceName)
 1181        {
 01182            var message = _pipeline.CreateMessage();
 01183            var request = message.Request;
 01184            request.Method = RequestMethod.Get;
 01185            var uri = new RawRequestUriBuilder();
 01186            uri.Reset(endpoint);
 01187            uri.AppendRawNextLink(nextLink, false);
 01188            request.Uri = uri;
 01189            return message;
 1190        }
 1191
 1192        /// <summary> Gets all Alias(Disaster Recovery configurations). </summary>
 1193        /// <param name="nextLink"> The URL to the next page of results. </param>
 1194        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1195        /// <param name="namespaceName"> The Namespace name. </param>
 1196        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1197        public async Task<Response<ArmDisasterRecoveryListResult>> ListNextPageAsync(string nextLink, string resourceGro
 1198        {
 01199            if (nextLink == null)
 1200            {
 01201                throw new ArgumentNullException(nameof(nextLink));
 1202            }
 01203            if (resourceGroupName == null)
 1204            {
 01205                throw new ArgumentNullException(nameof(resourceGroupName));
 1206            }
 01207            if (namespaceName == null)
 1208            {
 01209                throw new ArgumentNullException(nameof(namespaceName));
 1210            }
 1211
 01212            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, namespaceName);
 01213            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01214            switch (message.Response.Status)
 1215            {
 1216                case 200:
 1217                    {
 01218                        ArmDisasterRecoveryListResult value = default;
 01219                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01220                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1221                        {
 01222                            value = null;
 1223                        }
 1224                        else
 1225                        {
 01226                            value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.Root
 1227                        }
 01228                        return Response.FromValue(value, message.Response);
 1229                    }
 1230                default:
 01231                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1232            }
 01233        }
 1234
 1235        /// <summary> Gets all Alias(Disaster Recovery configurations). </summary>
 1236        /// <param name="nextLink"> The URL to the next page of results. </param>
 1237        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1238        /// <param name="namespaceName"> The Namespace name. </param>
 1239        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1240        public Response<ArmDisasterRecoveryListResult> ListNextPage(string nextLink, string resourceGroupName, string na
 1241        {
 01242            if (nextLink == null)
 1243            {
 01244                throw new ArgumentNullException(nameof(nextLink));
 1245            }
 01246            if (resourceGroupName == null)
 1247            {
 01248                throw new ArgumentNullException(nameof(resourceGroupName));
 1249            }
 01250            if (namespaceName == null)
 1251            {
 01252                throw new ArgumentNullException(nameof(namespaceName));
 1253            }
 1254
 01255            using var message = CreateListNextPageRequest(nextLink, resourceGroupName, namespaceName);
 01256            _pipeline.Send(message, cancellationToken);
 01257            switch (message.Response.Status)
 1258            {
 1259                case 200:
 1260                    {
 01261                        ArmDisasterRecoveryListResult value = default;
 01262                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01263                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1264                        {
 01265                            value = null;
 1266                        }
 1267                        else
 1268                        {
 01269                            value = ArmDisasterRecoveryListResult.DeserializeArmDisasterRecoveryListResult(document.Root
 1270                        }
 01271                        return Response.FromValue(value, message.Response);
 1272                    }
 1273                default:
 01274                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1275            }
 01276        }
 1277    }
 1278}