< Summary

Class:Azure.ResourceManager.EventHubs.NamespacesRestOperations
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\NamespacesRestOperations.cs
Covered lines:568
Uncovered lines:713
Coverable lines:1281
Total lines:2762
Line coverage:44.3% (568 of 1281)
Covered branches:134
Total branches:520
Branch coverage:25.7% (134 of 520)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateListIPFilterRulesRequest(...)-0%100%
ListIPFilterRulesAsync()-0%0%
ListIPFilterRules(...)-0%0%
CreateCreateOrUpdateIpFilterRuleRequest(...)-0%100%
CreateOrUpdateIpFilterRuleAsync()-0%0%
CreateOrUpdateIpFilterRule(...)-0%0%
CreateDeleteIpFilterRuleRequest(...)-0%100%
DeleteIpFilterRuleAsync()-0%0%
DeleteIpFilterRule(...)-0%0%
CreateGetIpFilterRuleRequest(...)-0%100%
GetIpFilterRuleAsync()-0%0%
GetIpFilterRule(...)-0%0%
CreateListRequest()-100%100%
ListAsync()-81.82%50%
List(...)-81.82%50%
CreateListByResourceGroupRequest(...)-100%100%
ListByResourceGroupAsync()-76.92%50%
ListByResourceGroup(...)-76.92%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-66.67%50%
CreateOrUpdate(...)-66.67%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-70%50%
Delete(...)-70%50%
CreateGetRequest(...)-100%100%
GetAsync()-73.33%50%
Get(...)-73.33%50%
CreateUpdateRequest(...)-100%100%
UpdateAsync()-66.67%41.67%
Update(...)-66.67%41.67%
CreateListVirtualNetworkRulesRequest(...)-0%100%
ListVirtualNetworkRulesAsync()-0%0%
ListVirtualNetworkRules(...)-0%0%
CreateCreateOrUpdateVirtualNetworkRuleRequest(...)-0%100%
CreateOrUpdateVirtualNetworkRuleAsync()-0%0%
CreateOrUpdateVirtualNetworkRule(...)-0%0%
CreateDeleteVirtualNetworkRuleRequest(...)-0%100%
DeleteVirtualNetworkRuleAsync()-0%0%
DeleteVirtualNetworkRule(...)-0%0%
CreateGetVirtualNetworkRuleRequest(...)-0%100%
GetVirtualNetworkRuleAsync()-0%0%
GetVirtualNetworkRule(...)-0%0%
CreateCreateOrUpdateNetworkRuleSetRequest(...)-100%100%
CreateOrUpdateNetworkRuleSetAsync()-70.59%50%
CreateOrUpdateNetworkRuleSet(...)-70.59%50%
CreateGetNetworkRuleSetRequest(...)-100%100%
GetNetworkRuleSetAsync()-73.33%50%
GetNetworkRuleSet(...)-73.33%50%
CreateListAuthorizationRulesRequest(...)-100%100%
ListAuthorizationRulesAsync()-73.33%50%
ListAuthorizationRules(...)-73.33%50%
CreateCreateOrUpdateAuthorizationRuleRequest(...)-100%100%
CreateOrUpdateAuthorizationRuleAsync()-68.42%50%
CreateOrUpdateAuthorizationRule(...)-68.42%50%
CreateDeleteAuthorizationRuleRequest(...)-100%100%
DeleteAuthorizationRuleAsync()-66.67%50%
DeleteAuthorizationRule(...)-66.67%50%
CreateGetAuthorizationRuleRequest(...)-100%100%
GetAuthorizationRuleAsync()-70.59%50%
GetAuthorizationRule(...)-70.59%50%
CreateListKeysRequest(...)-100%100%
ListKeysAsync()-70.59%50%
ListKeys(...)-70.59%50%
CreateRegenerateKeysRequest(...)-100%100%
RegenerateKeysAsync()-68.42%50%
RegenerateKeys(...)-68.42%50%
CreateCheckNameAvailabilityRequest(...)-100%100%
CheckNameAvailabilityAsync()-76.92%50%
CheckNameAvailability(...)-76.92%50%
CreateListIPFilterRulesNextPageRequest(...)-0%100%
ListIPFilterRulesNextPageAsync()-0%0%
ListIPFilterRulesNextPage(...)-0%0%
CreateListNextPageRequest(...)-0%100%
ListNextPageAsync()-0%0%
ListNextPage(...)-0%0%
CreateListByResourceGroupNextPageRequest(...)-0%100%
ListByResourceGroupNextPageAsync()-0%0%
ListByResourceGroupNextPage(...)-0%0%
CreateListVirtualNetworkRulesNextPageRequest(...)-0%100%
ListVirtualNetworkRulesNextPageAsync()-0%0%
ListVirtualNetworkRulesNextPage(...)-0%0%
CreateListAuthorizationRulesNextPageRequest(...)-0%100%
ListAuthorizationRulesNextPageAsync()-0%0%
ListAuthorizationRulesNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\NamespacesRestOperations.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 NamespacesRestOperations
 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 NamespacesRestOperations. </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 NamespacesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionI
 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 CreateListIPFilterRulesRequest(string resourceGroupName, string namespaceName)
 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("/ipfilterrules", false);
 060            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 061            request.Uri = uri;
 062            return message;
 63        }
 64
 65        /// <summary> Gets a list of IP Filter rules for a Namespace. </summary>
 66        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 67        /// <param name="namespaceName"> The Namespace name. </param>
 68        /// <param name="cancellationToken"> The cancellation token to use. </param>
 69        public async Task<Response<IpFilterRuleListResult>> ListIPFilterRulesAsync(string resourceGroupName, string name
 70        {
 071            if (resourceGroupName == null)
 72            {
 073                throw new ArgumentNullException(nameof(resourceGroupName));
 74            }
 075            if (namespaceName == null)
 76            {
 077                throw new ArgumentNullException(nameof(namespaceName));
 78            }
 79
 080            using var message = CreateListIPFilterRulesRequest(resourceGroupName, namespaceName);
 081            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 082            switch (message.Response.Status)
 83            {
 84                case 200:
 85                    {
 086                        IpFilterRuleListResult value = default;
 087                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 088                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 89                        {
 090                            value = null;
 91                        }
 92                        else
 93                        {
 094                            value = IpFilterRuleListResult.DeserializeIpFilterRuleListResult(document.RootElement);
 95                        }
 096                        return Response.FromValue(value, message.Response);
 97                    }
 98                default:
 099                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 100            }
 0101        }
 102
 103        /// <summary> Gets a list of IP Filter rules for a 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="cancellationToken"> The cancellation token to use. </param>
 107        public Response<IpFilterRuleListResult> ListIPFilterRules(string resourceGroupName, string namespaceName, Cancel
 108        {
 0109            if (resourceGroupName == null)
 110            {
 0111                throw new ArgumentNullException(nameof(resourceGroupName));
 112            }
 0113            if (namespaceName == null)
 114            {
 0115                throw new ArgumentNullException(nameof(namespaceName));
 116            }
 117
 0118            using var message = CreateListIPFilterRulesRequest(resourceGroupName, namespaceName);
 0119            _pipeline.Send(message, cancellationToken);
 0120            switch (message.Response.Status)
 121            {
 122                case 200:
 123                    {
 0124                        IpFilterRuleListResult value = default;
 0125                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0126                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 127                        {
 0128                            value = null;
 129                        }
 130                        else
 131                        {
 0132                            value = IpFilterRuleListResult.DeserializeIpFilterRuleListResult(document.RootElement);
 133                        }
 0134                        return Response.FromValue(value, message.Response);
 135                    }
 136                default:
 0137                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 138            }
 0139        }
 140
 141        internal HttpMessage CreateCreateOrUpdateIpFilterRuleRequest(string resourceGroupName, string namespaceName, str
 142        {
 0143            var message = _pipeline.CreateMessage();
 0144            var request = message.Request;
 0145            request.Method = RequestMethod.Put;
 0146            var uri = new RawRequestUriBuilder();
 0147            uri.Reset(endpoint);
 0148            uri.AppendPath("/subscriptions/", false);
 0149            uri.AppendPath(subscriptionId, true);
 0150            uri.AppendPath("/resourceGroups/", false);
 0151            uri.AppendPath(resourceGroupName, true);
 0152            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 0153            uri.AppendPath(namespaceName, true);
 0154            uri.AppendPath("/ipfilterrules/", false);
 0155            uri.AppendPath(ipFilterRuleName, true);
 0156            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 0157            request.Uri = uri;
 0158            request.Headers.Add("Content-Type", "application/json");
 0159            var content = new Utf8JsonRequestContent();
 0160            content.JsonWriter.WriteObjectValue(parameters);
 0161            request.Content = content;
 0162            return message;
 163        }
 164
 165        /// <summary> Creates or updates an IpFilterRule for a Namespace. </summary>
 166        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 167        /// <param name="namespaceName"> The Namespace name. </param>
 168        /// <param name="ipFilterRuleName"> The IP Filter Rule name. </param>
 169        /// <param name="parameters"> The Namespace IpFilterRule. </param>
 170        /// <param name="cancellationToken"> The cancellation token to use. </param>
 171        public async Task<Response<IpFilterRule>> CreateOrUpdateIpFilterRuleAsync(string resourceGroupName, string names
 172        {
 0173            if (resourceGroupName == null)
 174            {
 0175                throw new ArgumentNullException(nameof(resourceGroupName));
 176            }
 0177            if (namespaceName == null)
 178            {
 0179                throw new ArgumentNullException(nameof(namespaceName));
 180            }
 0181            if (ipFilterRuleName == null)
 182            {
 0183                throw new ArgumentNullException(nameof(ipFilterRuleName));
 184            }
 0185            if (parameters == null)
 186            {
 0187                throw new ArgumentNullException(nameof(parameters));
 188            }
 189
 0190            using var message = CreateCreateOrUpdateIpFilterRuleRequest(resourceGroupName, namespaceName, ipFilterRuleNa
 0191            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0192            switch (message.Response.Status)
 193            {
 194                case 200:
 195                    {
 0196                        IpFilterRule value = default;
 0197                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0198                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 199                        {
 0200                            value = null;
 201                        }
 202                        else
 203                        {
 0204                            value = IpFilterRule.DeserializeIpFilterRule(document.RootElement);
 205                        }
 0206                        return Response.FromValue(value, message.Response);
 207                    }
 208                default:
 0209                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 210            }
 0211        }
 212
 213        /// <summary> Creates or updates an IpFilterRule for a Namespace. </summary>
 214        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 215        /// <param name="namespaceName"> The Namespace name. </param>
 216        /// <param name="ipFilterRuleName"> The IP Filter Rule name. </param>
 217        /// <param name="parameters"> The Namespace IpFilterRule. </param>
 218        /// <param name="cancellationToken"> The cancellation token to use. </param>
 219        public Response<IpFilterRule> CreateOrUpdateIpFilterRule(string resourceGroupName, string namespaceName, string 
 220        {
 0221            if (resourceGroupName == null)
 222            {
 0223                throw new ArgumentNullException(nameof(resourceGroupName));
 224            }
 0225            if (namespaceName == null)
 226            {
 0227                throw new ArgumentNullException(nameof(namespaceName));
 228            }
 0229            if (ipFilterRuleName == null)
 230            {
 0231                throw new ArgumentNullException(nameof(ipFilterRuleName));
 232            }
 0233            if (parameters == null)
 234            {
 0235                throw new ArgumentNullException(nameof(parameters));
 236            }
 237
 0238            using var message = CreateCreateOrUpdateIpFilterRuleRequest(resourceGroupName, namespaceName, ipFilterRuleNa
 0239            _pipeline.Send(message, cancellationToken);
 0240            switch (message.Response.Status)
 241            {
 242                case 200:
 243                    {
 0244                        IpFilterRule value = default;
 0245                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0246                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 247                        {
 0248                            value = null;
 249                        }
 250                        else
 251                        {
 0252                            value = IpFilterRule.DeserializeIpFilterRule(document.RootElement);
 253                        }
 0254                        return Response.FromValue(value, message.Response);
 255                    }
 256                default:
 0257                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 258            }
 0259        }
 260
 261        internal HttpMessage CreateDeleteIpFilterRuleRequest(string resourceGroupName, string namespaceName, string ipFi
 262        {
 0263            var message = _pipeline.CreateMessage();
 0264            var request = message.Request;
 0265            request.Method = RequestMethod.Delete;
 0266            var uri = new RawRequestUriBuilder();
 0267            uri.Reset(endpoint);
 0268            uri.AppendPath("/subscriptions/", false);
 0269            uri.AppendPath(subscriptionId, true);
 0270            uri.AppendPath("/resourceGroups/", false);
 0271            uri.AppendPath(resourceGroupName, true);
 0272            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 0273            uri.AppendPath(namespaceName, true);
 0274            uri.AppendPath("/ipfilterrules/", false);
 0275            uri.AppendPath(ipFilterRuleName, true);
 0276            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 0277            request.Uri = uri;
 0278            return message;
 279        }
 280
 281        /// <summary> Deletes an IpFilterRule for a Namespace. </summary>
 282        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 283        /// <param name="namespaceName"> The Namespace name. </param>
 284        /// <param name="ipFilterRuleName"> The IP Filter Rule name. </param>
 285        /// <param name="cancellationToken"> The cancellation token to use. </param>
 286        public async Task<Response> DeleteIpFilterRuleAsync(string resourceGroupName, string namespaceName, string ipFil
 287        {
 0288            if (resourceGroupName == null)
 289            {
 0290                throw new ArgumentNullException(nameof(resourceGroupName));
 291            }
 0292            if (namespaceName == null)
 293            {
 0294                throw new ArgumentNullException(nameof(namespaceName));
 295            }
 0296            if (ipFilterRuleName == null)
 297            {
 0298                throw new ArgumentNullException(nameof(ipFilterRuleName));
 299            }
 300
 0301            using var message = CreateDeleteIpFilterRuleRequest(resourceGroupName, namespaceName, ipFilterRuleName);
 0302            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0303            switch (message.Response.Status)
 304            {
 305                case 200:
 306                case 204:
 0307                    return message.Response;
 308                default:
 0309                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 310            }
 0311        }
 312
 313        /// <summary> Deletes an IpFilterRule for a Namespace. </summary>
 314        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 315        /// <param name="namespaceName"> The Namespace name. </param>
 316        /// <param name="ipFilterRuleName"> The IP Filter Rule name. </param>
 317        /// <param name="cancellationToken"> The cancellation token to use. </param>
 318        public Response DeleteIpFilterRule(string resourceGroupName, string namespaceName, string ipFilterRuleName, Canc
 319        {
 0320            if (resourceGroupName == null)
 321            {
 0322                throw new ArgumentNullException(nameof(resourceGroupName));
 323            }
 0324            if (namespaceName == null)
 325            {
 0326                throw new ArgumentNullException(nameof(namespaceName));
 327            }
 0328            if (ipFilterRuleName == null)
 329            {
 0330                throw new ArgumentNullException(nameof(ipFilterRuleName));
 331            }
 332
 0333            using var message = CreateDeleteIpFilterRuleRequest(resourceGroupName, namespaceName, ipFilterRuleName);
 0334            _pipeline.Send(message, cancellationToken);
 0335            switch (message.Response.Status)
 336            {
 337                case 200:
 338                case 204:
 0339                    return message.Response;
 340                default:
 0341                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 342            }
 0343        }
 344
 345        internal HttpMessage CreateGetIpFilterRuleRequest(string resourceGroupName, string namespaceName, string ipFilte
 346        {
 0347            var message = _pipeline.CreateMessage();
 0348            var request = message.Request;
 0349            request.Method = RequestMethod.Get;
 0350            var uri = new RawRequestUriBuilder();
 0351            uri.Reset(endpoint);
 0352            uri.AppendPath("/subscriptions/", false);
 0353            uri.AppendPath(subscriptionId, true);
 0354            uri.AppendPath("/resourceGroups/", false);
 0355            uri.AppendPath(resourceGroupName, true);
 0356            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 0357            uri.AppendPath(namespaceName, true);
 0358            uri.AppendPath("/ipfilterrules/", false);
 0359            uri.AppendPath(ipFilterRuleName, true);
 0360            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 0361            request.Uri = uri;
 0362            return message;
 363        }
 364
 365        /// <summary> Gets an IpFilterRule for a Namespace by rule name. </summary>
 366        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 367        /// <param name="namespaceName"> The Namespace name. </param>
 368        /// <param name="ipFilterRuleName"> The IP Filter Rule name. </param>
 369        /// <param name="cancellationToken"> The cancellation token to use. </param>
 370        public async Task<Response<IpFilterRule>> GetIpFilterRuleAsync(string resourceGroupName, string namespaceName, s
 371        {
 0372            if (resourceGroupName == null)
 373            {
 0374                throw new ArgumentNullException(nameof(resourceGroupName));
 375            }
 0376            if (namespaceName == null)
 377            {
 0378                throw new ArgumentNullException(nameof(namespaceName));
 379            }
 0380            if (ipFilterRuleName == null)
 381            {
 0382                throw new ArgumentNullException(nameof(ipFilterRuleName));
 383            }
 384
 0385            using var message = CreateGetIpFilterRuleRequest(resourceGroupName, namespaceName, ipFilterRuleName);
 0386            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0387            switch (message.Response.Status)
 388            {
 389                case 200:
 390                    {
 0391                        IpFilterRule value = default;
 0392                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0393                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 394                        {
 0395                            value = null;
 396                        }
 397                        else
 398                        {
 0399                            value = IpFilterRule.DeserializeIpFilterRule(document.RootElement);
 400                        }
 0401                        return Response.FromValue(value, message.Response);
 402                    }
 403                default:
 0404                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 405            }
 0406        }
 407
 408        /// <summary> Gets an IpFilterRule for a Namespace by rule name. </summary>
 409        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 410        /// <param name="namespaceName"> The Namespace name. </param>
 411        /// <param name="ipFilterRuleName"> The IP Filter Rule name. </param>
 412        /// <param name="cancellationToken"> The cancellation token to use. </param>
 413        public Response<IpFilterRule> GetIpFilterRule(string resourceGroupName, string namespaceName, string ipFilterRul
 414        {
 0415            if (resourceGroupName == null)
 416            {
 0417                throw new ArgumentNullException(nameof(resourceGroupName));
 418            }
 0419            if (namespaceName == null)
 420            {
 0421                throw new ArgumentNullException(nameof(namespaceName));
 422            }
 0423            if (ipFilterRuleName == null)
 424            {
 0425                throw new ArgumentNullException(nameof(ipFilterRuleName));
 426            }
 427
 0428            using var message = CreateGetIpFilterRuleRequest(resourceGroupName, namespaceName, ipFilterRuleName);
 0429            _pipeline.Send(message, cancellationToken);
 0430            switch (message.Response.Status)
 431            {
 432                case 200:
 433                    {
 0434                        IpFilterRule value = default;
 0435                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0436                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 437                        {
 0438                            value = null;
 439                        }
 440                        else
 441                        {
 0442                            value = IpFilterRule.DeserializeIpFilterRule(document.RootElement);
 443                        }
 0444                        return Response.FromValue(value, message.Response);
 445                    }
 446                default:
 0447                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 448            }
 0449        }
 450
 451        internal HttpMessage CreateListRequest()
 452        {
 4453            var message = _pipeline.CreateMessage();
 4454            var request = message.Request;
 4455            request.Method = RequestMethod.Get;
 4456            var uri = new RawRequestUriBuilder();
 4457            uri.Reset(endpoint);
 4458            uri.AppendPath("/subscriptions/", false);
 4459            uri.AppendPath(subscriptionId, true);
 4460            uri.AppendPath("/providers/Microsoft.EventHub/namespaces", false);
 4461            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 4462            request.Uri = uri;
 4463            return message;
 464        }
 465
 466        /// <summary> Lists all the available Namespaces within a subscription, irrespective of the resource groups. </s
 467        /// <param name="cancellationToken"> The cancellation token to use. </param>
 468        public async Task<Response<EHNamespaceListResult>> ListAsync(CancellationToken cancellationToken = default)
 469        {
 2470            using var message = CreateListRequest();
 2471            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2472            switch (message.Response.Status)
 473            {
 474                case 200:
 475                    {
 2476                        EHNamespaceListResult value = default;
 2477                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2478                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 479                        {
 0480                            value = null;
 481                        }
 482                        else
 483                        {
 2484                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 485                        }
 2486                        return Response.FromValue(value, message.Response);
 487                    }
 488                default:
 0489                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 490            }
 2491        }
 492
 493        /// <summary> Lists all the available Namespaces within a subscription, irrespective of the resource groups. </s
 494        /// <param name="cancellationToken"> The cancellation token to use. </param>
 495        public Response<EHNamespaceListResult> List(CancellationToken cancellationToken = default)
 496        {
 2497            using var message = CreateListRequest();
 2498            _pipeline.Send(message, cancellationToken);
 2499            switch (message.Response.Status)
 500            {
 501                case 200:
 502                    {
 2503                        EHNamespaceListResult value = default;
 2504                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2505                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 506                        {
 0507                            value = null;
 508                        }
 509                        else
 510                        {
 2511                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 512                        }
 2513                        return Response.FromValue(value, message.Response);
 514                    }
 515                default:
 0516                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 517            }
 2518        }
 519
 520        internal HttpMessage CreateListByResourceGroupRequest(string resourceGroupName)
 521        {
 8522            var message = _pipeline.CreateMessage();
 8523            var request = message.Request;
 8524            request.Method = RequestMethod.Get;
 8525            var uri = new RawRequestUriBuilder();
 8526            uri.Reset(endpoint);
 8527            uri.AppendPath("/subscriptions/", false);
 8528            uri.AppendPath(subscriptionId, true);
 8529            uri.AppendPath("/resourceGroups/", false);
 8530            uri.AppendPath(resourceGroupName, true);
 8531            uri.AppendPath("/providers/Microsoft.EventHub/namespaces", false);
 8532            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 8533            request.Uri = uri;
 8534            return message;
 535        }
 536
 537        /// <summary> Lists the available Namespaces within a resource group. </summary>
 538        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 539        /// <param name="cancellationToken"> The cancellation token to use. </param>
 540        public async Task<Response<EHNamespaceListResult>> ListByResourceGroupAsync(string resourceGroupName, Cancellati
 541        {
 4542            if (resourceGroupName == null)
 543            {
 0544                throw new ArgumentNullException(nameof(resourceGroupName));
 545            }
 546
 4547            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 4548            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4549            switch (message.Response.Status)
 550            {
 551                case 200:
 552                    {
 4553                        EHNamespaceListResult value = default;
 4554                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4555                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 556                        {
 0557                            value = null;
 558                        }
 559                        else
 560                        {
 4561                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 562                        }
 4563                        return Response.FromValue(value, message.Response);
 564                    }
 565                default:
 0566                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 567            }
 4568        }
 569
 570        /// <summary> Lists the available Namespaces within a resource group. </summary>
 571        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 572        /// <param name="cancellationToken"> The cancellation token to use. </param>
 573        public Response<EHNamespaceListResult> ListByResourceGroup(string resourceGroupName, CancellationToken cancellat
 574        {
 4575            if (resourceGroupName == null)
 576            {
 0577                throw new ArgumentNullException(nameof(resourceGroupName));
 578            }
 579
 4580            using var message = CreateListByResourceGroupRequest(resourceGroupName);
 4581            _pipeline.Send(message, cancellationToken);
 4582            switch (message.Response.Status)
 583            {
 584                case 200:
 585                    {
 4586                        EHNamespaceListResult value = default;
 4587                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4588                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 589                        {
 0590                            value = null;
 591                        }
 592                        else
 593                        {
 4594                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 595                        }
 4596                        return Response.FromValue(value, message.Response);
 597                    }
 598                default:
 0599                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 600            }
 4601        }
 602
 603        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string namespaceName, EHNamespace par
 604        {
 112605            var message = _pipeline.CreateMessage();
 112606            var request = message.Request;
 112607            request.Method = RequestMethod.Put;
 112608            var uri = new RawRequestUriBuilder();
 112609            uri.Reset(endpoint);
 112610            uri.AppendPath("/subscriptions/", false);
 112611            uri.AppendPath(subscriptionId, true);
 112612            uri.AppendPath("/resourceGroups/", false);
 112613            uri.AppendPath(resourceGroupName, true);
 112614            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 112615            uri.AppendPath(namespaceName, true);
 112616            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 112617            request.Uri = uri;
 112618            request.Headers.Add("Content-Type", "application/json");
 112619            var content = new Utf8JsonRequestContent();
 112620            content.JsonWriter.WriteObjectValue(parameters);
 112621            request.Content = content;
 112622            return message;
 623        }
 624
 625        /// <summary> Creates or updates a namespace. Once created, this namespace&apos;s resource manifest is immutable
 626        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 627        /// <param name="namespaceName"> The Namespace name. </param>
 628        /// <param name="parameters"> Parameters for creating a namespace resource. </param>
 629        /// <param name="cancellationToken"> The cancellation token to use. </param>
 630        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string namespaceName, EHNamespace para
 631        {
 28632            if (resourceGroupName == null)
 633            {
 0634                throw new ArgumentNullException(nameof(resourceGroupName));
 635            }
 28636            if (namespaceName == null)
 637            {
 0638                throw new ArgumentNullException(nameof(namespaceName));
 639            }
 28640            if (parameters == null)
 641            {
 0642                throw new ArgumentNullException(nameof(parameters));
 643            }
 644
 28645            using var message = CreateCreateOrUpdateRequest(resourceGroupName, namespaceName, parameters);
 28646            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 28647            switch (message.Response.Status)
 648            {
 649                case 200:
 650                case 201:
 651                case 202:
 28652                    return message.Response;
 653                default:
 0654                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 655            }
 28656        }
 657
 658        /// <summary> Creates or updates a namespace. Once created, this namespace&apos;s resource manifest is immutable
 659        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 660        /// <param name="namespaceName"> The Namespace name. </param>
 661        /// <param name="parameters"> Parameters for creating a namespace resource. </param>
 662        /// <param name="cancellationToken"> The cancellation token to use. </param>
 663        public Response CreateOrUpdate(string resourceGroupName, string namespaceName, EHNamespace parameters, Cancellat
 664        {
 28665            if (resourceGroupName == null)
 666            {
 0667                throw new ArgumentNullException(nameof(resourceGroupName));
 668            }
 28669            if (namespaceName == null)
 670            {
 0671                throw new ArgumentNullException(nameof(namespaceName));
 672            }
 28673            if (parameters == null)
 674            {
 0675                throw new ArgumentNullException(nameof(parameters));
 676            }
 677
 28678            using var message = CreateCreateOrUpdateRequest(resourceGroupName, namespaceName, parameters);
 28679            _pipeline.Send(message, cancellationToken);
 28680            switch (message.Response.Status)
 681            {
 682                case 200:
 683                case 201:
 684                case 202:
 28685                    return message.Response;
 686                default:
 0687                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 688            }
 28689        }
 690
 691        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string namespaceName)
 692        {
 96693            var message = _pipeline.CreateMessage();
 96694            var request = message.Request;
 96695            request.Method = RequestMethod.Delete;
 96696            var uri = new RawRequestUriBuilder();
 96697            uri.Reset(endpoint);
 96698            uri.AppendPath("/subscriptions/", false);
 96699            uri.AppendPath(subscriptionId, true);
 96700            uri.AppendPath("/resourceGroups/", false);
 96701            uri.AppendPath(resourceGroupName, true);
 96702            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 96703            uri.AppendPath(namespaceName, true);
 96704            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 96705            request.Uri = uri;
 96706            return message;
 707        }
 708
 709        /// <summary> Deletes an existing namespace. This operation also removes all associated resources under the name
 710        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 711        /// <param name="namespaceName"> The Namespace name. </param>
 712        /// <param name="cancellationToken"> The cancellation token to use. </param>
 713        public async Task<Response> DeleteAsync(string resourceGroupName, string namespaceName, CancellationToken cancel
 714        {
 24715            if (resourceGroupName == null)
 716            {
 0717                throw new ArgumentNullException(nameof(resourceGroupName));
 718            }
 24719            if (namespaceName == null)
 720            {
 0721                throw new ArgumentNullException(nameof(namespaceName));
 722            }
 723
 24724            using var message = CreateDeleteRequest(resourceGroupName, namespaceName);
 24725            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 24726            switch (message.Response.Status)
 727            {
 728                case 200:
 729                case 202:
 730                case 204:
 24731                    return message.Response;
 732                default:
 0733                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 734            }
 24735        }
 736
 737        /// <summary> Deletes an existing namespace. This operation also removes all associated resources under the name
 738        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 739        /// <param name="namespaceName"> The Namespace name. </param>
 740        /// <param name="cancellationToken"> The cancellation token to use. </param>
 741        public Response Delete(string resourceGroupName, string namespaceName, CancellationToken cancellationToken = def
 742        {
 24743            if (resourceGroupName == null)
 744            {
 0745                throw new ArgumentNullException(nameof(resourceGroupName));
 746            }
 24747            if (namespaceName == null)
 748            {
 0749                throw new ArgumentNullException(nameof(namespaceName));
 750            }
 751
 24752            using var message = CreateDeleteRequest(resourceGroupName, namespaceName);
 24753            _pipeline.Send(message, cancellationToken);
 24754            switch (message.Response.Status)
 755            {
 756                case 200:
 757                case 202:
 758                case 204:
 24759                    return message.Response;
 760                default:
 0761                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 762            }
 24763        }
 764
 765        internal HttpMessage CreateGetRequest(string resourceGroupName, string namespaceName)
 766        {
 56767            var message = _pipeline.CreateMessage();
 56768            var request = message.Request;
 56769            request.Method = RequestMethod.Get;
 56770            var uri = new RawRequestUriBuilder();
 56771            uri.Reset(endpoint);
 56772            uri.AppendPath("/subscriptions/", false);
 56773            uri.AppendPath(subscriptionId, true);
 56774            uri.AppendPath("/resourceGroups/", false);
 56775            uri.AppendPath(resourceGroupName, true);
 56776            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 56777            uri.AppendPath(namespaceName, true);
 56778            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 56779            request.Uri = uri;
 56780            return message;
 781        }
 782
 783        /// <summary> Gets the description of the specified namespace. </summary>
 784        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 785        /// <param name="namespaceName"> The Namespace name. </param>
 786        /// <param name="cancellationToken"> The cancellation token to use. </param>
 787        public async Task<Response<EHNamespace>> GetAsync(string resourceGroupName, string namespaceName, CancellationTo
 788        {
 28789            if (resourceGroupName == null)
 790            {
 0791                throw new ArgumentNullException(nameof(resourceGroupName));
 792            }
 28793            if (namespaceName == null)
 794            {
 0795                throw new ArgumentNullException(nameof(namespaceName));
 796            }
 797
 28798            using var message = CreateGetRequest(resourceGroupName, namespaceName);
 28799            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 28800            switch (message.Response.Status)
 801            {
 802                case 200:
 803                case 201:
 804                    {
 28805                        EHNamespace value = default;
 28806                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 28807                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 808                        {
 0809                            value = null;
 810                        }
 811                        else
 812                        {
 28813                            value = EHNamespace.DeserializeEHNamespace(document.RootElement);
 814                        }
 28815                        return Response.FromValue(value, message.Response);
 816                    }
 817                default:
 0818                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 819            }
 28820        }
 821
 822        /// <summary> Gets the description of the specified namespace. </summary>
 823        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 824        /// <param name="namespaceName"> The Namespace name. </param>
 825        /// <param name="cancellationToken"> The cancellation token to use. </param>
 826        public Response<EHNamespace> Get(string resourceGroupName, string namespaceName, CancellationToken cancellationT
 827        {
 28828            if (resourceGroupName == null)
 829            {
 0830                throw new ArgumentNullException(nameof(resourceGroupName));
 831            }
 28832            if (namespaceName == null)
 833            {
 0834                throw new ArgumentNullException(nameof(namespaceName));
 835            }
 836
 28837            using var message = CreateGetRequest(resourceGroupName, namespaceName);
 28838            _pipeline.Send(message, cancellationToken);
 28839            switch (message.Response.Status)
 840            {
 841                case 200:
 842                case 201:
 843                    {
 28844                        EHNamespace value = default;
 28845                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 28846                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 847                        {
 0848                            value = null;
 849                        }
 850                        else
 851                        {
 28852                            value = EHNamespace.DeserializeEHNamespace(document.RootElement);
 853                        }
 28854                        return Response.FromValue(value, message.Response);
 855                    }
 856                default:
 0857                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 858            }
 28859        }
 860
 861        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string namespaceName, EHNamespace parameters)
 862        {
 8863            var message = _pipeline.CreateMessage();
 8864            var request = message.Request;
 8865            request.Method = RequestMethod.Patch;
 8866            var uri = new RawRequestUriBuilder();
 8867            uri.Reset(endpoint);
 8868            uri.AppendPath("/subscriptions/", false);
 8869            uri.AppendPath(subscriptionId, true);
 8870            uri.AppendPath("/resourceGroups/", false);
 8871            uri.AppendPath(resourceGroupName, true);
 8872            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 8873            uri.AppendPath(namespaceName, true);
 8874            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 8875            request.Uri = uri;
 8876            request.Headers.Add("Content-Type", "application/json");
 8877            var content = new Utf8JsonRequestContent();
 8878            content.JsonWriter.WriteObjectValue(parameters);
 8879            request.Content = content;
 8880            return message;
 881        }
 882
 883        /// <summary> Creates or updates a namespace. Once created, this namespace&apos;s resource manifest is immutable
 884        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 885        /// <param name="namespaceName"> The Namespace name. </param>
 886        /// <param name="parameters"> Parameters for updating a namespace resource. </param>
 887        /// <param name="cancellationToken"> The cancellation token to use. </param>
 888        public async Task<Response<EHNamespace>> UpdateAsync(string resourceGroupName, string namespaceName, EHNamespace
 889        {
 4890            if (resourceGroupName == null)
 891            {
 0892                throw new ArgumentNullException(nameof(resourceGroupName));
 893            }
 4894            if (namespaceName == null)
 895            {
 0896                throw new ArgumentNullException(nameof(namespaceName));
 897            }
 4898            if (parameters == null)
 899            {
 0900                throw new ArgumentNullException(nameof(parameters));
 901            }
 902
 4903            using var message = CreateUpdateRequest(resourceGroupName, namespaceName, parameters);
 4904            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4905            switch (message.Response.Status)
 906            {
 907                case 200:
 908                case 201:
 909                    {
 4910                        EHNamespace value = default;
 4911                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4912                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 913                        {
 0914                            value = null;
 915                        }
 916                        else
 917                        {
 4918                            value = EHNamespace.DeserializeEHNamespace(document.RootElement);
 919                        }
 4920                        return Response.FromValue(value, message.Response);
 921                    }
 922                case 202:
 0923                    return Response.FromValue<EHNamespace>(null, message.Response);
 924                default:
 0925                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 926            }
 4927        }
 928
 929        /// <summary> Creates or updates a namespace. Once created, this namespace&apos;s resource manifest is immutable
 930        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 931        /// <param name="namespaceName"> The Namespace name. </param>
 932        /// <param name="parameters"> Parameters for updating a namespace resource. </param>
 933        /// <param name="cancellationToken"> The cancellation token to use. </param>
 934        public Response<EHNamespace> Update(string resourceGroupName, string namespaceName, EHNamespace parameters, Canc
 935        {
 4936            if (resourceGroupName == null)
 937            {
 0938                throw new ArgumentNullException(nameof(resourceGroupName));
 939            }
 4940            if (namespaceName == null)
 941            {
 0942                throw new ArgumentNullException(nameof(namespaceName));
 943            }
 4944            if (parameters == null)
 945            {
 0946                throw new ArgumentNullException(nameof(parameters));
 947            }
 948
 4949            using var message = CreateUpdateRequest(resourceGroupName, namespaceName, parameters);
 4950            _pipeline.Send(message, cancellationToken);
 4951            switch (message.Response.Status)
 952            {
 953                case 200:
 954                case 201:
 955                    {
 4956                        EHNamespace value = default;
 4957                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4958                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 959                        {
 0960                            value = null;
 961                        }
 962                        else
 963                        {
 4964                            value = EHNamespace.DeserializeEHNamespace(document.RootElement);
 965                        }
 4966                        return Response.FromValue(value, message.Response);
 967                    }
 968                case 202:
 0969                    return Response.FromValue<EHNamespace>(null, message.Response);
 970                default:
 0971                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 972            }
 4973        }
 974
 975        internal HttpMessage CreateListVirtualNetworkRulesRequest(string resourceGroupName, string namespaceName)
 976        {
 0977            var message = _pipeline.CreateMessage();
 0978            var request = message.Request;
 0979            request.Method = RequestMethod.Get;
 0980            var uri = new RawRequestUriBuilder();
 0981            uri.Reset(endpoint);
 0982            uri.AppendPath("/subscriptions/", false);
 0983            uri.AppendPath(subscriptionId, true);
 0984            uri.AppendPath("/resourceGroups/", false);
 0985            uri.AppendPath(resourceGroupName, true);
 0986            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 0987            uri.AppendPath(namespaceName, true);
 0988            uri.AppendPath("/virtualnetworkrules", false);
 0989            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 0990            request.Uri = uri;
 0991            return message;
 992        }
 993
 994        /// <summary> Gets a list of VirtualNetwork rules for a Namespace. </summary>
 995        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 996        /// <param name="namespaceName"> The Namespace name. </param>
 997        /// <param name="cancellationToken"> The cancellation token to use. </param>
 998        public async Task<Response<VirtualNetworkRuleListResult>> ListVirtualNetworkRulesAsync(string resourceGroupName,
 999        {
 01000            if (resourceGroupName == null)
 1001            {
 01002                throw new ArgumentNullException(nameof(resourceGroupName));
 1003            }
 01004            if (namespaceName == null)
 1005            {
 01006                throw new ArgumentNullException(nameof(namespaceName));
 1007            }
 1008
 01009            using var message = CreateListVirtualNetworkRulesRequest(resourceGroupName, namespaceName);
 01010            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01011            switch (message.Response.Status)
 1012            {
 1013                case 200:
 1014                    {
 01015                        VirtualNetworkRuleListResult value = default;
 01016                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01017                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1018                        {
 01019                            value = null;
 1020                        }
 1021                        else
 1022                        {
 01023                            value = VirtualNetworkRuleListResult.DeserializeVirtualNetworkRuleListResult(document.RootEl
 1024                        }
 01025                        return Response.FromValue(value, message.Response);
 1026                    }
 1027                default:
 01028                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1029            }
 01030        }
 1031
 1032        /// <summary> Gets a list of VirtualNetwork rules for a Namespace. </summary>
 1033        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1034        /// <param name="namespaceName"> The Namespace name. </param>
 1035        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1036        public Response<VirtualNetworkRuleListResult> ListVirtualNetworkRules(string resourceGroupName, string namespace
 1037        {
 01038            if (resourceGroupName == null)
 1039            {
 01040                throw new ArgumentNullException(nameof(resourceGroupName));
 1041            }
 01042            if (namespaceName == null)
 1043            {
 01044                throw new ArgumentNullException(nameof(namespaceName));
 1045            }
 1046
 01047            using var message = CreateListVirtualNetworkRulesRequest(resourceGroupName, namespaceName);
 01048            _pipeline.Send(message, cancellationToken);
 01049            switch (message.Response.Status)
 1050            {
 1051                case 200:
 1052                    {
 01053                        VirtualNetworkRuleListResult value = default;
 01054                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01055                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1056                        {
 01057                            value = null;
 1058                        }
 1059                        else
 1060                        {
 01061                            value = VirtualNetworkRuleListResult.DeserializeVirtualNetworkRuleListResult(document.RootEl
 1062                        }
 01063                        return Response.FromValue(value, message.Response);
 1064                    }
 1065                default:
 01066                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1067            }
 01068        }
 1069
 1070        internal HttpMessage CreateCreateOrUpdateVirtualNetworkRuleRequest(string resourceGroupName, string namespaceNam
 1071        {
 01072            var message = _pipeline.CreateMessage();
 01073            var request = message.Request;
 01074            request.Method = RequestMethod.Put;
 01075            var uri = new RawRequestUriBuilder();
 01076            uri.Reset(endpoint);
 01077            uri.AppendPath("/subscriptions/", false);
 01078            uri.AppendPath(subscriptionId, true);
 01079            uri.AppendPath("/resourceGroups/", false);
 01080            uri.AppendPath(resourceGroupName, true);
 01081            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 01082            uri.AppendPath(namespaceName, true);
 01083            uri.AppendPath("/virtualnetworkrules/", false);
 01084            uri.AppendPath(virtualNetworkRuleName, true);
 01085            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 01086            request.Uri = uri;
 01087            request.Headers.Add("Content-Type", "application/json");
 01088            var content = new Utf8JsonRequestContent();
 01089            content.JsonWriter.WriteObjectValue(parameters);
 01090            request.Content = content;
 01091            return message;
 1092        }
 1093
 1094        /// <summary> Creates or updates an VirtualNetworkRule for a Namespace. </summary>
 1095        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1096        /// <param name="namespaceName"> The Namespace name. </param>
 1097        /// <param name="virtualNetworkRuleName"> The Virtual Network Rule name. </param>
 1098        /// <param name="parameters"> The Namespace VirtualNetworkRule. </param>
 1099        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1100        public async Task<Response<VirtualNetworkRule>> CreateOrUpdateVirtualNetworkRuleAsync(string resourceGroupName, 
 1101        {
 01102            if (resourceGroupName == null)
 1103            {
 01104                throw new ArgumentNullException(nameof(resourceGroupName));
 1105            }
 01106            if (namespaceName == null)
 1107            {
 01108                throw new ArgumentNullException(nameof(namespaceName));
 1109            }
 01110            if (virtualNetworkRuleName == null)
 1111            {
 01112                throw new ArgumentNullException(nameof(virtualNetworkRuleName));
 1113            }
 01114            if (parameters == null)
 1115            {
 01116                throw new ArgumentNullException(nameof(parameters));
 1117            }
 1118
 01119            using var message = CreateCreateOrUpdateVirtualNetworkRuleRequest(resourceGroupName, namespaceName, virtualN
 01120            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01121            switch (message.Response.Status)
 1122            {
 1123                case 200:
 1124                    {
 01125                        VirtualNetworkRule value = default;
 01126                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01127                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1128                        {
 01129                            value = null;
 1130                        }
 1131                        else
 1132                        {
 01133                            value = VirtualNetworkRule.DeserializeVirtualNetworkRule(document.RootElement);
 1134                        }
 01135                        return Response.FromValue(value, message.Response);
 1136                    }
 1137                default:
 01138                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1139            }
 01140        }
 1141
 1142        /// <summary> Creates or updates an VirtualNetworkRule for a Namespace. </summary>
 1143        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1144        /// <param name="namespaceName"> The Namespace name. </param>
 1145        /// <param name="virtualNetworkRuleName"> The Virtual Network Rule name. </param>
 1146        /// <param name="parameters"> The Namespace VirtualNetworkRule. </param>
 1147        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1148        public Response<VirtualNetworkRule> CreateOrUpdateVirtualNetworkRule(string resourceGroupName, string namespaceN
 1149        {
 01150            if (resourceGroupName == null)
 1151            {
 01152                throw new ArgumentNullException(nameof(resourceGroupName));
 1153            }
 01154            if (namespaceName == null)
 1155            {
 01156                throw new ArgumentNullException(nameof(namespaceName));
 1157            }
 01158            if (virtualNetworkRuleName == null)
 1159            {
 01160                throw new ArgumentNullException(nameof(virtualNetworkRuleName));
 1161            }
 01162            if (parameters == null)
 1163            {
 01164                throw new ArgumentNullException(nameof(parameters));
 1165            }
 1166
 01167            using var message = CreateCreateOrUpdateVirtualNetworkRuleRequest(resourceGroupName, namespaceName, virtualN
 01168            _pipeline.Send(message, cancellationToken);
 01169            switch (message.Response.Status)
 1170            {
 1171                case 200:
 1172                    {
 01173                        VirtualNetworkRule value = default;
 01174                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01175                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1176                        {
 01177                            value = null;
 1178                        }
 1179                        else
 1180                        {
 01181                            value = VirtualNetworkRule.DeserializeVirtualNetworkRule(document.RootElement);
 1182                        }
 01183                        return Response.FromValue(value, message.Response);
 1184                    }
 1185                default:
 01186                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1187            }
 01188        }
 1189
 1190        internal HttpMessage CreateDeleteVirtualNetworkRuleRequest(string resourceGroupName, string namespaceName, strin
 1191        {
 01192            var message = _pipeline.CreateMessage();
 01193            var request = message.Request;
 01194            request.Method = RequestMethod.Delete;
 01195            var uri = new RawRequestUriBuilder();
 01196            uri.Reset(endpoint);
 01197            uri.AppendPath("/subscriptions/", false);
 01198            uri.AppendPath(subscriptionId, true);
 01199            uri.AppendPath("/resourceGroups/", false);
 01200            uri.AppendPath(resourceGroupName, true);
 01201            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 01202            uri.AppendPath(namespaceName, true);
 01203            uri.AppendPath("/virtualnetworkrules/", false);
 01204            uri.AppendPath(virtualNetworkRuleName, true);
 01205            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 01206            request.Uri = uri;
 01207            return message;
 1208        }
 1209
 1210        /// <summary> Deletes an VirtualNetworkRule for a Namespace. </summary>
 1211        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1212        /// <param name="namespaceName"> The Namespace name. </param>
 1213        /// <param name="virtualNetworkRuleName"> The Virtual Network Rule name. </param>
 1214        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1215        public async Task<Response> DeleteVirtualNetworkRuleAsync(string resourceGroupName, string namespaceName, string
 1216        {
 01217            if (resourceGroupName == null)
 1218            {
 01219                throw new ArgumentNullException(nameof(resourceGroupName));
 1220            }
 01221            if (namespaceName == null)
 1222            {
 01223                throw new ArgumentNullException(nameof(namespaceName));
 1224            }
 01225            if (virtualNetworkRuleName == null)
 1226            {
 01227                throw new ArgumentNullException(nameof(virtualNetworkRuleName));
 1228            }
 1229
 01230            using var message = CreateDeleteVirtualNetworkRuleRequest(resourceGroupName, namespaceName, virtualNetworkRu
 01231            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01232            switch (message.Response.Status)
 1233            {
 1234                case 200:
 1235                case 204:
 01236                    return message.Response;
 1237                default:
 01238                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1239            }
 01240        }
 1241
 1242        /// <summary> Deletes an VirtualNetworkRule for a Namespace. </summary>
 1243        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1244        /// <param name="namespaceName"> The Namespace name. </param>
 1245        /// <param name="virtualNetworkRuleName"> The Virtual Network Rule name. </param>
 1246        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1247        public Response DeleteVirtualNetworkRule(string resourceGroupName, string namespaceName, string virtualNetworkRu
 1248        {
 01249            if (resourceGroupName == null)
 1250            {
 01251                throw new ArgumentNullException(nameof(resourceGroupName));
 1252            }
 01253            if (namespaceName == null)
 1254            {
 01255                throw new ArgumentNullException(nameof(namespaceName));
 1256            }
 01257            if (virtualNetworkRuleName == null)
 1258            {
 01259                throw new ArgumentNullException(nameof(virtualNetworkRuleName));
 1260            }
 1261
 01262            using var message = CreateDeleteVirtualNetworkRuleRequest(resourceGroupName, namespaceName, virtualNetworkRu
 01263            _pipeline.Send(message, cancellationToken);
 01264            switch (message.Response.Status)
 1265            {
 1266                case 200:
 1267                case 204:
 01268                    return message.Response;
 1269                default:
 01270                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1271            }
 01272        }
 1273
 1274        internal HttpMessage CreateGetVirtualNetworkRuleRequest(string resourceGroupName, string namespaceName, string v
 1275        {
 01276            var message = _pipeline.CreateMessage();
 01277            var request = message.Request;
 01278            request.Method = RequestMethod.Get;
 01279            var uri = new RawRequestUriBuilder();
 01280            uri.Reset(endpoint);
 01281            uri.AppendPath("/subscriptions/", false);
 01282            uri.AppendPath(subscriptionId, true);
 01283            uri.AppendPath("/resourceGroups/", false);
 01284            uri.AppendPath(resourceGroupName, true);
 01285            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 01286            uri.AppendPath(namespaceName, true);
 01287            uri.AppendPath("/virtualnetworkrules/", false);
 01288            uri.AppendPath(virtualNetworkRuleName, true);
 01289            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 01290            request.Uri = uri;
 01291            return message;
 1292        }
 1293
 1294        /// <summary> Gets an VirtualNetworkRule for a Namespace by rule name. </summary>
 1295        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1296        /// <param name="namespaceName"> The Namespace name. </param>
 1297        /// <param name="virtualNetworkRuleName"> The Virtual Network Rule name. </param>
 1298        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1299        public async Task<Response<VirtualNetworkRule>> GetVirtualNetworkRuleAsync(string resourceGroupName, string name
 1300        {
 01301            if (resourceGroupName == null)
 1302            {
 01303                throw new ArgumentNullException(nameof(resourceGroupName));
 1304            }
 01305            if (namespaceName == null)
 1306            {
 01307                throw new ArgumentNullException(nameof(namespaceName));
 1308            }
 01309            if (virtualNetworkRuleName == null)
 1310            {
 01311                throw new ArgumentNullException(nameof(virtualNetworkRuleName));
 1312            }
 1313
 01314            using var message = CreateGetVirtualNetworkRuleRequest(resourceGroupName, namespaceName, virtualNetworkRuleN
 01315            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 01316            switch (message.Response.Status)
 1317            {
 1318                case 200:
 1319                    {
 01320                        VirtualNetworkRule value = default;
 01321                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 01322                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1323                        {
 01324                            value = null;
 1325                        }
 1326                        else
 1327                        {
 01328                            value = VirtualNetworkRule.DeserializeVirtualNetworkRule(document.RootElement);
 1329                        }
 01330                        return Response.FromValue(value, message.Response);
 1331                    }
 1332                default:
 01333                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1334            }
 01335        }
 1336
 1337        /// <summary> Gets an VirtualNetworkRule for a Namespace by rule name. </summary>
 1338        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1339        /// <param name="namespaceName"> The Namespace name. </param>
 1340        /// <param name="virtualNetworkRuleName"> The Virtual Network Rule name. </param>
 1341        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1342        public Response<VirtualNetworkRule> GetVirtualNetworkRule(string resourceGroupName, string namespaceName, string
 1343        {
 01344            if (resourceGroupName == null)
 1345            {
 01346                throw new ArgumentNullException(nameof(resourceGroupName));
 1347            }
 01348            if (namespaceName == null)
 1349            {
 01350                throw new ArgumentNullException(nameof(namespaceName));
 1351            }
 01352            if (virtualNetworkRuleName == null)
 1353            {
 01354                throw new ArgumentNullException(nameof(virtualNetworkRuleName));
 1355            }
 1356
 01357            using var message = CreateGetVirtualNetworkRuleRequest(resourceGroupName, namespaceName, virtualNetworkRuleN
 01358            _pipeline.Send(message, cancellationToken);
 01359            switch (message.Response.Status)
 1360            {
 1361                case 200:
 1362                    {
 01363                        VirtualNetworkRule value = default;
 01364                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 01365                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1366                        {
 01367                            value = null;
 1368                        }
 1369                        else
 1370                        {
 01371                            value = VirtualNetworkRule.DeserializeVirtualNetworkRule(document.RootElement);
 1372                        }
 01373                        return Response.FromValue(value, message.Response);
 1374                    }
 1375                default:
 01376                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1377            }
 01378        }
 1379
 1380        internal HttpMessage CreateCreateOrUpdateNetworkRuleSetRequest(string resourceGroupName, string namespaceName, N
 1381        {
 81382            var message = _pipeline.CreateMessage();
 81383            var request = message.Request;
 81384            request.Method = RequestMethod.Put;
 81385            var uri = new RawRequestUriBuilder();
 81386            uri.Reset(endpoint);
 81387            uri.AppendPath("/subscriptions/", false);
 81388            uri.AppendPath(subscriptionId, true);
 81389            uri.AppendPath("/resourceGroups/", false);
 81390            uri.AppendPath(resourceGroupName, true);
 81391            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 81392            uri.AppendPath(namespaceName, true);
 81393            uri.AppendPath("/networkRuleSets/default", false);
 81394            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 81395            request.Uri = uri;
 81396            request.Headers.Add("Content-Type", "application/json");
 81397            var content = new Utf8JsonRequestContent();
 81398            content.JsonWriter.WriteObjectValue(parameters);
 81399            request.Content = content;
 81400            return message;
 1401        }
 1402
 1403        /// <summary> Create or update NetworkRuleSet for a Namespace. </summary>
 1404        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1405        /// <param name="namespaceName"> The Namespace name. </param>
 1406        /// <param name="parameters"> The Namespace IpFilterRule. </param>
 1407        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1408        public async Task<Response<NetworkRuleSet>> CreateOrUpdateNetworkRuleSetAsync(string resourceGroupName, string n
 1409        {
 41410            if (resourceGroupName == null)
 1411            {
 01412                throw new ArgumentNullException(nameof(resourceGroupName));
 1413            }
 41414            if (namespaceName == null)
 1415            {
 01416                throw new ArgumentNullException(nameof(namespaceName));
 1417            }
 41418            if (parameters == null)
 1419            {
 01420                throw new ArgumentNullException(nameof(parameters));
 1421            }
 1422
 41423            using var message = CreateCreateOrUpdateNetworkRuleSetRequest(resourceGroupName, namespaceName, parameters);
 41424            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 41425            switch (message.Response.Status)
 1426            {
 1427                case 200:
 1428                    {
 41429                        NetworkRuleSet value = default;
 41430                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 41431                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1432                        {
 01433                            value = null;
 1434                        }
 1435                        else
 1436                        {
 41437                            value = NetworkRuleSet.DeserializeNetworkRuleSet(document.RootElement);
 1438                        }
 41439                        return Response.FromValue(value, message.Response);
 1440                    }
 1441                default:
 01442                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1443            }
 41444        }
 1445
 1446        /// <summary> Create or update NetworkRuleSet for a Namespace. </summary>
 1447        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1448        /// <param name="namespaceName"> The Namespace name. </param>
 1449        /// <param name="parameters"> The Namespace IpFilterRule. </param>
 1450        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1451        public Response<NetworkRuleSet> CreateOrUpdateNetworkRuleSet(string resourceGroupName, string namespaceName, Net
 1452        {
 41453            if (resourceGroupName == null)
 1454            {
 01455                throw new ArgumentNullException(nameof(resourceGroupName));
 1456            }
 41457            if (namespaceName == null)
 1458            {
 01459                throw new ArgumentNullException(nameof(namespaceName));
 1460            }
 41461            if (parameters == null)
 1462            {
 01463                throw new ArgumentNullException(nameof(parameters));
 1464            }
 1465
 41466            using var message = CreateCreateOrUpdateNetworkRuleSetRequest(resourceGroupName, namespaceName, parameters);
 41467            _pipeline.Send(message, cancellationToken);
 41468            switch (message.Response.Status)
 1469            {
 1470                case 200:
 1471                    {
 41472                        NetworkRuleSet value = default;
 41473                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 41474                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1475                        {
 01476                            value = null;
 1477                        }
 1478                        else
 1479                        {
 41480                            value = NetworkRuleSet.DeserializeNetworkRuleSet(document.RootElement);
 1481                        }
 41482                        return Response.FromValue(value, message.Response);
 1483                    }
 1484                default:
 01485                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1486            }
 41487        }
 1488
 1489        internal HttpMessage CreateGetNetworkRuleSetRequest(string resourceGroupName, string namespaceName)
 1490        {
 81491            var message = _pipeline.CreateMessage();
 81492            var request = message.Request;
 81493            request.Method = RequestMethod.Get;
 81494            var uri = new RawRequestUriBuilder();
 81495            uri.Reset(endpoint);
 81496            uri.AppendPath("/subscriptions/", false);
 81497            uri.AppendPath(subscriptionId, true);
 81498            uri.AppendPath("/resourceGroups/", false);
 81499            uri.AppendPath(resourceGroupName, true);
 81500            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 81501            uri.AppendPath(namespaceName, true);
 81502            uri.AppendPath("/networkRuleSets/default", false);
 81503            uri.AppendQuery("api-version", "2018-01-01-preview", true);
 81504            request.Uri = uri;
 81505            return message;
 1506        }
 1507
 1508        /// <summary> Gets NetworkRuleSet for a Namespace. </summary>
 1509        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1510        /// <param name="namespaceName"> The Namespace name. </param>
 1511        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1512        public async Task<Response<NetworkRuleSet>> GetNetworkRuleSetAsync(string resourceGroupName, string namespaceNam
 1513        {
 41514            if (resourceGroupName == null)
 1515            {
 01516                throw new ArgumentNullException(nameof(resourceGroupName));
 1517            }
 41518            if (namespaceName == null)
 1519            {
 01520                throw new ArgumentNullException(nameof(namespaceName));
 1521            }
 1522
 41523            using var message = CreateGetNetworkRuleSetRequest(resourceGroupName, namespaceName);
 41524            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 41525            switch (message.Response.Status)
 1526            {
 1527                case 200:
 1528                    {
 41529                        NetworkRuleSet value = default;
 41530                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 41531                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1532                        {
 01533                            value = null;
 1534                        }
 1535                        else
 1536                        {
 41537                            value = NetworkRuleSet.DeserializeNetworkRuleSet(document.RootElement);
 1538                        }
 41539                        return Response.FromValue(value, message.Response);
 1540                    }
 1541                default:
 01542                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1543            }
 41544        }
 1545
 1546        /// <summary> Gets NetworkRuleSet for a Namespace. </summary>
 1547        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1548        /// <param name="namespaceName"> The Namespace name. </param>
 1549        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1550        public Response<NetworkRuleSet> GetNetworkRuleSet(string resourceGroupName, string namespaceName, CancellationTo
 1551        {
 41552            if (resourceGroupName == null)
 1553            {
 01554                throw new ArgumentNullException(nameof(resourceGroupName));
 1555            }
 41556            if (namespaceName == null)
 1557            {
 01558                throw new ArgumentNullException(nameof(namespaceName));
 1559            }
 1560
 41561            using var message = CreateGetNetworkRuleSetRequest(resourceGroupName, namespaceName);
 41562            _pipeline.Send(message, cancellationToken);
 41563            switch (message.Response.Status)
 1564            {
 1565                case 200:
 1566                    {
 41567                        NetworkRuleSet value = default;
 41568                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 41569                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1570                        {
 01571                            value = null;
 1572                        }
 1573                        else
 1574                        {
 41575                            value = NetworkRuleSet.DeserializeNetworkRuleSet(document.RootElement);
 1576                        }
 41577                        return Response.FromValue(value, message.Response);
 1578                    }
 1579                default:
 01580                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1581            }
 41582        }
 1583
 1584        internal HttpMessage CreateListAuthorizationRulesRequest(string resourceGroupName, string namespaceName)
 1585        {
 41586            var message = _pipeline.CreateMessage();
 41587            var request = message.Request;
 41588            request.Method = RequestMethod.Get;
 41589            var uri = new RawRequestUriBuilder();
 41590            uri.Reset(endpoint);
 41591            uri.AppendPath("/subscriptions/", false);
 41592            uri.AppendPath(subscriptionId, true);
 41593            uri.AppendPath("/resourceGroups/", false);
 41594            uri.AppendPath(resourceGroupName, true);
 41595            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 41596            uri.AppendPath(namespaceName, true);
 41597            uri.AppendPath("/authorizationRules", false);
 41598            uri.AppendQuery("api-version", "2017-04-01", true);
 41599            request.Uri = uri;
 41600            return message;
 1601        }
 1602
 1603        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 1604        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1605        /// <param name="namespaceName"> The Namespace name. </param>
 1606        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1607        public async Task<Response<AuthorizationRuleListResult>> ListAuthorizationRulesAsync(string resourceGroupName, s
 1608        {
 21609            if (resourceGroupName == null)
 1610            {
 01611                throw new ArgumentNullException(nameof(resourceGroupName));
 1612            }
 21613            if (namespaceName == null)
 1614            {
 01615                throw new ArgumentNullException(nameof(namespaceName));
 1616            }
 1617
 21618            using var message = CreateListAuthorizationRulesRequest(resourceGroupName, namespaceName);
 21619            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 21620            switch (message.Response.Status)
 1621            {
 1622                case 200:
 1623                    {
 21624                        AuthorizationRuleListResult value = default;
 21625                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 21626                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1627                        {
 01628                            value = null;
 1629                        }
 1630                        else
 1631                        {
 21632                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 1633                        }
 21634                        return Response.FromValue(value, message.Response);
 1635                    }
 1636                default:
 01637                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1638            }
 21639        }
 1640
 1641        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 1642        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1643        /// <param name="namespaceName"> The Namespace name. </param>
 1644        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1645        public Response<AuthorizationRuleListResult> ListAuthorizationRules(string resourceGroupName, string namespaceNa
 1646        {
 21647            if (resourceGroupName == null)
 1648            {
 01649                throw new ArgumentNullException(nameof(resourceGroupName));
 1650            }
 21651            if (namespaceName == null)
 1652            {
 01653                throw new ArgumentNullException(nameof(namespaceName));
 1654            }
 1655
 21656            using var message = CreateListAuthorizationRulesRequest(resourceGroupName, namespaceName);
 21657            _pipeline.Send(message, cancellationToken);
 21658            switch (message.Response.Status)
 1659            {
 1660                case 200:
 1661                    {
 21662                        AuthorizationRuleListResult value = default;
 21663                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 21664                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1665                        {
 01666                            value = null;
 1667                        }
 1668                        else
 1669                        {
 21670                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 1671                        }
 21672                        return Response.FromValue(value, message.Response);
 1673                    }
 1674                default:
 01675                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1676            }
 21677        }
 1678
 1679        internal HttpMessage CreateCreateOrUpdateAuthorizationRuleRequest(string resourceGroupName, string namespaceName
 1680        {
 161681            var message = _pipeline.CreateMessage();
 161682            var request = message.Request;
 161683            request.Method = RequestMethod.Put;
 161684            var uri = new RawRequestUriBuilder();
 161685            uri.Reset(endpoint);
 161686            uri.AppendPath("/subscriptions/", false);
 161687            uri.AppendPath(subscriptionId, true);
 161688            uri.AppendPath("/resourceGroups/", false);
 161689            uri.AppendPath(resourceGroupName, true);
 161690            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 161691            uri.AppendPath(namespaceName, true);
 161692            uri.AppendPath("/authorizationRules/", false);
 161693            uri.AppendPath(authorizationRuleName, true);
 161694            uri.AppendQuery("api-version", "2017-04-01", true);
 161695            request.Uri = uri;
 161696            request.Headers.Add("Content-Type", "application/json");
 161697            var content = new Utf8JsonRequestContent();
 161698            content.JsonWriter.WriteObjectValue(parameters);
 161699            request.Content = content;
 161700            return message;
 1701        }
 1702
 1703        /// <summary> Creates or updates an AuthorizationRule for a Namespace. </summary>
 1704        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1705        /// <param name="namespaceName"> The Namespace name. </param>
 1706        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 1707        /// <param name="parameters"> The shared access AuthorizationRule. </param>
 1708        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1709        public async Task<Response<AuthorizationRule>> CreateOrUpdateAuthorizationRuleAsync(string resourceGroupName, st
 1710        {
 81711            if (resourceGroupName == null)
 1712            {
 01713                throw new ArgumentNullException(nameof(resourceGroupName));
 1714            }
 81715            if (namespaceName == null)
 1716            {
 01717                throw new ArgumentNullException(nameof(namespaceName));
 1718            }
 81719            if (authorizationRuleName == null)
 1720            {
 01721                throw new ArgumentNullException(nameof(authorizationRuleName));
 1722            }
 81723            if (parameters == null)
 1724            {
 01725                throw new ArgumentNullException(nameof(parameters));
 1726            }
 1727
 81728            using var message = CreateCreateOrUpdateAuthorizationRuleRequest(resourceGroupName, namespaceName, authoriza
 81729            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 81730            switch (message.Response.Status)
 1731            {
 1732                case 200:
 1733                    {
 81734                        AuthorizationRule value = default;
 81735                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 81736                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1737                        {
 01738                            value = null;
 1739                        }
 1740                        else
 1741                        {
 81742                            value = AuthorizationRule.DeserializeAuthorizationRule(document.RootElement);
 1743                        }
 81744                        return Response.FromValue(value, message.Response);
 1745                    }
 1746                default:
 01747                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1748            }
 81749        }
 1750
 1751        /// <summary> Creates or updates an AuthorizationRule for a Namespace. </summary>
 1752        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1753        /// <param name="namespaceName"> The Namespace name. </param>
 1754        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 1755        /// <param name="parameters"> The shared access AuthorizationRule. </param>
 1756        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1757        public Response<AuthorizationRule> CreateOrUpdateAuthorizationRule(string resourceGroupName, string namespaceNam
 1758        {
 81759            if (resourceGroupName == null)
 1760            {
 01761                throw new ArgumentNullException(nameof(resourceGroupName));
 1762            }
 81763            if (namespaceName == null)
 1764            {
 01765                throw new ArgumentNullException(nameof(namespaceName));
 1766            }
 81767            if (authorizationRuleName == null)
 1768            {
 01769                throw new ArgumentNullException(nameof(authorizationRuleName));
 1770            }
 81771            if (parameters == null)
 1772            {
 01773                throw new ArgumentNullException(nameof(parameters));
 1774            }
 1775
 81776            using var message = CreateCreateOrUpdateAuthorizationRuleRequest(resourceGroupName, namespaceName, authoriza
 81777            _pipeline.Send(message, cancellationToken);
 81778            switch (message.Response.Status)
 1779            {
 1780                case 200:
 1781                    {
 81782                        AuthorizationRule value = default;
 81783                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 81784                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1785                        {
 01786                            value = null;
 1787                        }
 1788                        else
 1789                        {
 81790                            value = AuthorizationRule.DeserializeAuthorizationRule(document.RootElement);
 1791                        }
 81792                        return Response.FromValue(value, message.Response);
 1793                    }
 1794                default:
 01795                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1796            }
 81797        }
 1798
 1799        internal HttpMessage CreateDeleteAuthorizationRuleRequest(string resourceGroupName, string namespaceName, string
 1800        {
 41801            var message = _pipeline.CreateMessage();
 41802            var request = message.Request;
 41803            request.Method = RequestMethod.Delete;
 41804            var uri = new RawRequestUriBuilder();
 41805            uri.Reset(endpoint);
 41806            uri.AppendPath("/subscriptions/", false);
 41807            uri.AppendPath(subscriptionId, true);
 41808            uri.AppendPath("/resourceGroups/", false);
 41809            uri.AppendPath(resourceGroupName, true);
 41810            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 41811            uri.AppendPath(namespaceName, true);
 41812            uri.AppendPath("/authorizationRules/", false);
 41813            uri.AppendPath(authorizationRuleName, true);
 41814            uri.AppendQuery("api-version", "2017-04-01", true);
 41815            request.Uri = uri;
 41816            return message;
 1817        }
 1818
 1819        /// <summary> Deletes an AuthorizationRule for a Namespace. </summary>
 1820        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1821        /// <param name="namespaceName"> The Namespace name. </param>
 1822        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 1823        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1824        public async Task<Response> DeleteAuthorizationRuleAsync(string resourceGroupName, string namespaceName, string 
 1825        {
 21826            if (resourceGroupName == null)
 1827            {
 01828                throw new ArgumentNullException(nameof(resourceGroupName));
 1829            }
 21830            if (namespaceName == null)
 1831            {
 01832                throw new ArgumentNullException(nameof(namespaceName));
 1833            }
 21834            if (authorizationRuleName == null)
 1835            {
 01836                throw new ArgumentNullException(nameof(authorizationRuleName));
 1837            }
 1838
 21839            using var message = CreateDeleteAuthorizationRuleRequest(resourceGroupName, namespaceName, authorizationRule
 21840            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 21841            switch (message.Response.Status)
 1842            {
 1843                case 200:
 1844                case 204:
 21845                    return message.Response;
 1846                default:
 01847                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1848            }
 21849        }
 1850
 1851        /// <summary> Deletes an AuthorizationRule for a Namespace. </summary>
 1852        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1853        /// <param name="namespaceName"> The Namespace name. </param>
 1854        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 1855        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1856        public Response DeleteAuthorizationRule(string resourceGroupName, string namespaceName, string authorizationRule
 1857        {
 21858            if (resourceGroupName == null)
 1859            {
 01860                throw new ArgumentNullException(nameof(resourceGroupName));
 1861            }
 21862            if (namespaceName == null)
 1863            {
 01864                throw new ArgumentNullException(nameof(namespaceName));
 1865            }
 21866            if (authorizationRuleName == null)
 1867            {
 01868                throw new ArgumentNullException(nameof(authorizationRuleName));
 1869            }
 1870
 21871            using var message = CreateDeleteAuthorizationRuleRequest(resourceGroupName, namespaceName, authorizationRule
 21872            _pipeline.Send(message, cancellationToken);
 21873            switch (message.Response.Status)
 1874            {
 1875                case 200:
 1876                case 204:
 21877                    return message.Response;
 1878                default:
 01879                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1880            }
 21881        }
 1882
 1883        internal HttpMessage CreateGetAuthorizationRuleRequest(string resourceGroupName, string namespaceName, string au
 1884        {
 201885            var message = _pipeline.CreateMessage();
 201886            var request = message.Request;
 201887            request.Method = RequestMethod.Get;
 201888            var uri = new RawRequestUriBuilder();
 201889            uri.Reset(endpoint);
 201890            uri.AppendPath("/subscriptions/", false);
 201891            uri.AppendPath(subscriptionId, true);
 201892            uri.AppendPath("/resourceGroups/", false);
 201893            uri.AppendPath(resourceGroupName, true);
 201894            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 201895            uri.AppendPath(namespaceName, true);
 201896            uri.AppendPath("/authorizationRules/", false);
 201897            uri.AppendPath(authorizationRuleName, true);
 201898            uri.AppendQuery("api-version", "2017-04-01", true);
 201899            request.Uri = uri;
 201900            return message;
 1901        }
 1902
 1903        /// <summary> Gets an AuthorizationRule for a Namespace by rule name. </summary>
 1904        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1905        /// <param name="namespaceName"> The Namespace name. </param>
 1906        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 1907        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1908        public async Task<Response<AuthorizationRule>> GetAuthorizationRuleAsync(string resourceGroupName, string namesp
 1909        {
 101910            if (resourceGroupName == null)
 1911            {
 01912                throw new ArgumentNullException(nameof(resourceGroupName));
 1913            }
 101914            if (namespaceName == null)
 1915            {
 01916                throw new ArgumentNullException(nameof(namespaceName));
 1917            }
 101918            if (authorizationRuleName == null)
 1919            {
 01920                throw new ArgumentNullException(nameof(authorizationRuleName));
 1921            }
 1922
 101923            using var message = CreateGetAuthorizationRuleRequest(resourceGroupName, namespaceName, authorizationRuleNam
 101924            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 101925            switch (message.Response.Status)
 1926            {
 1927                case 200:
 1928                    {
 101929                        AuthorizationRule value = default;
 101930                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 101931                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1932                        {
 01933                            value = null;
 1934                        }
 1935                        else
 1936                        {
 101937                            value = AuthorizationRule.DeserializeAuthorizationRule(document.RootElement);
 1938                        }
 101939                        return Response.FromValue(value, message.Response);
 1940                    }
 1941                default:
 01942                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 1943            }
 101944        }
 1945
 1946        /// <summary> Gets an AuthorizationRule for a Namespace by rule name. </summary>
 1947        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 1948        /// <param name="namespaceName"> The Namespace name. </param>
 1949        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 1950        /// <param name="cancellationToken"> The cancellation token to use. </param>
 1951        public Response<AuthorizationRule> GetAuthorizationRule(string resourceGroupName, string namespaceName, string a
 1952        {
 101953            if (resourceGroupName == null)
 1954            {
 01955                throw new ArgumentNullException(nameof(resourceGroupName));
 1956            }
 101957            if (namespaceName == null)
 1958            {
 01959                throw new ArgumentNullException(nameof(namespaceName));
 1960            }
 101961            if (authorizationRuleName == null)
 1962            {
 01963                throw new ArgumentNullException(nameof(authorizationRuleName));
 1964            }
 1965
 101966            using var message = CreateGetAuthorizationRuleRequest(resourceGroupName, namespaceName, authorizationRuleNam
 101967            _pipeline.Send(message, cancellationToken);
 101968            switch (message.Response.Status)
 1969            {
 1970                case 200:
 1971                    {
 101972                        AuthorizationRule value = default;
 101973                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 101974                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 1975                        {
 01976                            value = null;
 1977                        }
 1978                        else
 1979                        {
 101980                            value = AuthorizationRule.DeserializeAuthorizationRule(document.RootElement);
 1981                        }
 101982                        return Response.FromValue(value, message.Response);
 1983                    }
 1984                default:
 01985                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 1986            }
 101987        }
 1988
 1989        internal HttpMessage CreateListKeysRequest(string resourceGroupName, string namespaceName, string authorizationR
 1990        {
 121991            var message = _pipeline.CreateMessage();
 121992            var request = message.Request;
 121993            request.Method = RequestMethod.Post;
 121994            var uri = new RawRequestUriBuilder();
 121995            uri.Reset(endpoint);
 121996            uri.AppendPath("/subscriptions/", false);
 121997            uri.AppendPath(subscriptionId, true);
 121998            uri.AppendPath("/resourceGroups/", false);
 121999            uri.AppendPath(resourceGroupName, true);
 122000            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 122001            uri.AppendPath(namespaceName, true);
 122002            uri.AppendPath("/authorizationRules/", false);
 122003            uri.AppendPath(authorizationRuleName, true);
 122004            uri.AppendPath("/listKeys", false);
 122005            uri.AppendQuery("api-version", "2017-04-01", true);
 122006            request.Uri = uri;
 122007            return message;
 2008        }
 2009
 2010        /// <summary> Gets the primary and secondary connection strings for the Namespace. </summary>
 2011        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2012        /// <param name="namespaceName"> The Namespace name. </param>
 2013        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 2014        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2015        public async Task<Response<AccessKeys>> ListKeysAsync(string resourceGroupName, string namespaceName, string aut
 2016        {
 62017            if (resourceGroupName == null)
 2018            {
 02019                throw new ArgumentNullException(nameof(resourceGroupName));
 2020            }
 62021            if (namespaceName == null)
 2022            {
 02023                throw new ArgumentNullException(nameof(namespaceName));
 2024            }
 62025            if (authorizationRuleName == null)
 2026            {
 02027                throw new ArgumentNullException(nameof(authorizationRuleName));
 2028            }
 2029
 62030            using var message = CreateListKeysRequest(resourceGroupName, namespaceName, authorizationRuleName);
 62031            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 62032            switch (message.Response.Status)
 2033            {
 2034                case 200:
 2035                    {
 62036                        AccessKeys value = default;
 62037                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 62038                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2039                        {
 02040                            value = null;
 2041                        }
 2042                        else
 2043                        {
 62044                            value = AccessKeys.DeserializeAccessKeys(document.RootElement);
 2045                        }
 62046                        return Response.FromValue(value, message.Response);
 2047                    }
 2048                default:
 02049                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2050            }
 62051        }
 2052
 2053        /// <summary> Gets the primary and secondary connection strings for the Namespace. </summary>
 2054        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2055        /// <param name="namespaceName"> The Namespace name. </param>
 2056        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 2057        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2058        public Response<AccessKeys> ListKeys(string resourceGroupName, string namespaceName, string authorizationRuleNam
 2059        {
 62060            if (resourceGroupName == null)
 2061            {
 02062                throw new ArgumentNullException(nameof(resourceGroupName));
 2063            }
 62064            if (namespaceName == null)
 2065            {
 02066                throw new ArgumentNullException(nameof(namespaceName));
 2067            }
 62068            if (authorizationRuleName == null)
 2069            {
 02070                throw new ArgumentNullException(nameof(authorizationRuleName));
 2071            }
 2072
 62073            using var message = CreateListKeysRequest(resourceGroupName, namespaceName, authorizationRuleName);
 62074            _pipeline.Send(message, cancellationToken);
 62075            switch (message.Response.Status)
 2076            {
 2077                case 200:
 2078                    {
 62079                        AccessKeys value = default;
 62080                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 62081                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2082                        {
 02083                            value = null;
 2084                        }
 2085                        else
 2086                        {
 62087                            value = AccessKeys.DeserializeAccessKeys(document.RootElement);
 2088                        }
 62089                        return Response.FromValue(value, message.Response);
 2090                    }
 2091                default:
 02092                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2093            }
 62094        }
 2095
 2096        internal HttpMessage CreateRegenerateKeysRequest(string resourceGroupName, string namespaceName, string authoriz
 2097        {
 82098            var message = _pipeline.CreateMessage();
 82099            var request = message.Request;
 82100            request.Method = RequestMethod.Post;
 82101            var uri = new RawRequestUriBuilder();
 82102            uri.Reset(endpoint);
 82103            uri.AppendPath("/subscriptions/", false);
 82104            uri.AppendPath(subscriptionId, true);
 82105            uri.AppendPath("/resourceGroups/", false);
 82106            uri.AppendPath(resourceGroupName, true);
 82107            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 82108            uri.AppendPath(namespaceName, true);
 82109            uri.AppendPath("/authorizationRules/", false);
 82110            uri.AppendPath(authorizationRuleName, true);
 82111            uri.AppendPath("/regenerateKeys", false);
 82112            uri.AppendQuery("api-version", "2017-04-01", true);
 82113            request.Uri = uri;
 82114            request.Headers.Add("Content-Type", "application/json");
 82115            var content = new Utf8JsonRequestContent();
 82116            content.JsonWriter.WriteObjectValue(parameters);
 82117            request.Content = content;
 82118            return message;
 2119        }
 2120
 2121        /// <summary> Regenerates the primary or secondary connection strings for the specified Namespace. </summary>
 2122        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2123        /// <param name="namespaceName"> The Namespace name. </param>
 2124        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 2125        /// <param name="parameters"> Parameters required to regenerate the connection string. </param>
 2126        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2127        public async Task<Response<AccessKeys>> RegenerateKeysAsync(string resourceGroupName, string namespaceName, stri
 2128        {
 42129            if (resourceGroupName == null)
 2130            {
 02131                throw new ArgumentNullException(nameof(resourceGroupName));
 2132            }
 42133            if (namespaceName == null)
 2134            {
 02135                throw new ArgumentNullException(nameof(namespaceName));
 2136            }
 42137            if (authorizationRuleName == null)
 2138            {
 02139                throw new ArgumentNullException(nameof(authorizationRuleName));
 2140            }
 42141            if (parameters == null)
 2142            {
 02143                throw new ArgumentNullException(nameof(parameters));
 2144            }
 2145
 42146            using var message = CreateRegenerateKeysRequest(resourceGroupName, namespaceName, authorizationRuleName, par
 42147            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 42148            switch (message.Response.Status)
 2149            {
 2150                case 200:
 2151                    {
 42152                        AccessKeys value = default;
 42153                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 42154                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2155                        {
 02156                            value = null;
 2157                        }
 2158                        else
 2159                        {
 42160                            value = AccessKeys.DeserializeAccessKeys(document.RootElement);
 2161                        }
 42162                        return Response.FromValue(value, message.Response);
 2163                    }
 2164                default:
 02165                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2166            }
 42167        }
 2168
 2169        /// <summary> Regenerates the primary or secondary connection strings for the specified Namespace. </summary>
 2170        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2171        /// <param name="namespaceName"> The Namespace name. </param>
 2172        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 2173        /// <param name="parameters"> Parameters required to regenerate the connection string. </param>
 2174        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2175        public Response<AccessKeys> RegenerateKeys(string resourceGroupName, string namespaceName, string authorizationR
 2176        {
 42177            if (resourceGroupName == null)
 2178            {
 02179                throw new ArgumentNullException(nameof(resourceGroupName));
 2180            }
 42181            if (namespaceName == null)
 2182            {
 02183                throw new ArgumentNullException(nameof(namespaceName));
 2184            }
 42185            if (authorizationRuleName == null)
 2186            {
 02187                throw new ArgumentNullException(nameof(authorizationRuleName));
 2188            }
 42189            if (parameters == null)
 2190            {
 02191                throw new ArgumentNullException(nameof(parameters));
 2192            }
 2193
 42194            using var message = CreateRegenerateKeysRequest(resourceGroupName, namespaceName, authorizationRuleName, par
 42195            _pipeline.Send(message, cancellationToken);
 42196            switch (message.Response.Status)
 2197            {
 2198                case 200:
 2199                    {
 42200                        AccessKeys value = default;
 42201                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 42202                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2203                        {
 02204                            value = null;
 2205                        }
 2206                        else
 2207                        {
 42208                            value = AccessKeys.DeserializeAccessKeys(document.RootElement);
 2209                        }
 42210                        return Response.FromValue(value, message.Response);
 2211                    }
 2212                default:
 02213                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2214            }
 42215        }
 2216
 2217        internal HttpMessage CreateCheckNameAvailabilityRequest(CheckNameAvailabilityParameter parameters)
 2218        {
 42219            var message = _pipeline.CreateMessage();
 42220            var request = message.Request;
 42221            request.Method = RequestMethod.Post;
 42222            var uri = new RawRequestUriBuilder();
 42223            uri.Reset(endpoint);
 42224            uri.AppendPath("/subscriptions/", false);
 42225            uri.AppendPath(subscriptionId, true);
 42226            uri.AppendPath("/providers/Microsoft.EventHub/checkNameAvailability", false);
 42227            uri.AppendQuery("api-version", "2017-04-01", true);
 42228            request.Uri = uri;
 42229            request.Headers.Add("Content-Type", "application/json");
 42230            var content = new Utf8JsonRequestContent();
 42231            content.JsonWriter.WriteObjectValue(parameters);
 42232            request.Content = content;
 42233            return message;
 2234        }
 2235
 2236        /// <summary> Check the give Namespace name availability. </summary>
 2237        /// <param name="parameters"> Parameters to check availability of the given Namespace name. </param>
 2238        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2239        public async Task<Response<CheckNameAvailabilityResult>> CheckNameAvailabilityAsync(CheckNameAvailabilityParamet
 2240        {
 22241            if (parameters == null)
 2242            {
 02243                throw new ArgumentNullException(nameof(parameters));
 2244            }
 2245
 22246            using var message = CreateCheckNameAvailabilityRequest(parameters);
 22247            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 22248            switch (message.Response.Status)
 2249            {
 2250                case 200:
 2251                    {
 22252                        CheckNameAvailabilityResult value = default;
 22253                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 22254                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2255                        {
 02256                            value = null;
 2257                        }
 2258                        else
 2259                        {
 22260                            value = CheckNameAvailabilityResult.DeserializeCheckNameAvailabilityResult(document.RootElem
 2261                        }
 22262                        return Response.FromValue(value, message.Response);
 2263                    }
 2264                default:
 02265                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2266            }
 22267        }
 2268
 2269        /// <summary> Check the give Namespace name availability. </summary>
 2270        /// <param name="parameters"> Parameters to check availability of the given Namespace name. </param>
 2271        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2272        public Response<CheckNameAvailabilityResult> CheckNameAvailability(CheckNameAvailabilityParameter parameters, Ca
 2273        {
 22274            if (parameters == null)
 2275            {
 02276                throw new ArgumentNullException(nameof(parameters));
 2277            }
 2278
 22279            using var message = CreateCheckNameAvailabilityRequest(parameters);
 22280            _pipeline.Send(message, cancellationToken);
 22281            switch (message.Response.Status)
 2282            {
 2283                case 200:
 2284                    {
 22285                        CheckNameAvailabilityResult value = default;
 22286                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 22287                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2288                        {
 02289                            value = null;
 2290                        }
 2291                        else
 2292                        {
 22293                            value = CheckNameAvailabilityResult.DeserializeCheckNameAvailabilityResult(document.RootElem
 2294                        }
 22295                        return Response.FromValue(value, message.Response);
 2296                    }
 2297                default:
 02298                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2299            }
 22300        }
 2301
 2302        internal HttpMessage CreateListIPFilterRulesNextPageRequest(string nextLink, string resourceGroupName, string na
 2303        {
 02304            var message = _pipeline.CreateMessage();
 02305            var request = message.Request;
 02306            request.Method = RequestMethod.Get;
 02307            var uri = new RawRequestUriBuilder();
 02308            uri.Reset(endpoint);
 02309            uri.AppendRawNextLink(nextLink, false);
 02310            request.Uri = uri;
 02311            return message;
 2312        }
 2313
 2314        /// <summary> Gets a list of IP Filter rules for a Namespace. </summary>
 2315        /// <param name="nextLink"> The URL to the next page of results. </param>
 2316        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2317        /// <param name="namespaceName"> The Namespace name. </param>
 2318        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2319        public async Task<Response<IpFilterRuleListResult>> ListIPFilterRulesNextPageAsync(string nextLink, string resou
 2320        {
 02321            if (nextLink == null)
 2322            {
 02323                throw new ArgumentNullException(nameof(nextLink));
 2324            }
 02325            if (resourceGroupName == null)
 2326            {
 02327                throw new ArgumentNullException(nameof(resourceGroupName));
 2328            }
 02329            if (namespaceName == null)
 2330            {
 02331                throw new ArgumentNullException(nameof(namespaceName));
 2332            }
 2333
 02334            using var message = CreateListIPFilterRulesNextPageRequest(nextLink, resourceGroupName, namespaceName);
 02335            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 02336            switch (message.Response.Status)
 2337            {
 2338                case 200:
 2339                    {
 02340                        IpFilterRuleListResult value = default;
 02341                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 02342                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2343                        {
 02344                            value = null;
 2345                        }
 2346                        else
 2347                        {
 02348                            value = IpFilterRuleListResult.DeserializeIpFilterRuleListResult(document.RootElement);
 2349                        }
 02350                        return Response.FromValue(value, message.Response);
 2351                    }
 2352                default:
 02353                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2354            }
 02355        }
 2356
 2357        /// <summary> Gets a list of IP Filter rules for a Namespace. </summary>
 2358        /// <param name="nextLink"> The URL to the next page of results. </param>
 2359        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2360        /// <param name="namespaceName"> The Namespace name. </param>
 2361        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2362        public Response<IpFilterRuleListResult> ListIPFilterRulesNextPage(string nextLink, string resourceGroupName, str
 2363        {
 02364            if (nextLink == null)
 2365            {
 02366                throw new ArgumentNullException(nameof(nextLink));
 2367            }
 02368            if (resourceGroupName == null)
 2369            {
 02370                throw new ArgumentNullException(nameof(resourceGroupName));
 2371            }
 02372            if (namespaceName == null)
 2373            {
 02374                throw new ArgumentNullException(nameof(namespaceName));
 2375            }
 2376
 02377            using var message = CreateListIPFilterRulesNextPageRequest(nextLink, resourceGroupName, namespaceName);
 02378            _pipeline.Send(message, cancellationToken);
 02379            switch (message.Response.Status)
 2380            {
 2381                case 200:
 2382                    {
 02383                        IpFilterRuleListResult value = default;
 02384                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 02385                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2386                        {
 02387                            value = null;
 2388                        }
 2389                        else
 2390                        {
 02391                            value = IpFilterRuleListResult.DeserializeIpFilterRuleListResult(document.RootElement);
 2392                        }
 02393                        return Response.FromValue(value, message.Response);
 2394                    }
 2395                default:
 02396                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2397            }
 02398        }
 2399
 2400        internal HttpMessage CreateListNextPageRequest(string nextLink)
 2401        {
 02402            var message = _pipeline.CreateMessage();
 02403            var request = message.Request;
 02404            request.Method = RequestMethod.Get;
 02405            var uri = new RawRequestUriBuilder();
 02406            uri.Reset(endpoint);
 02407            uri.AppendRawNextLink(nextLink, false);
 02408            request.Uri = uri;
 02409            return message;
 2410        }
 2411
 2412        /// <summary> Lists all the available Namespaces within a subscription, irrespective of the resource groups. </s
 2413        /// <param name="nextLink"> The URL to the next page of results. </param>
 2414        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2415        public async Task<Response<EHNamespaceListResult>> ListNextPageAsync(string nextLink, CancellationToken cancella
 2416        {
 02417            if (nextLink == null)
 2418            {
 02419                throw new ArgumentNullException(nameof(nextLink));
 2420            }
 2421
 02422            using var message = CreateListNextPageRequest(nextLink);
 02423            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 02424            switch (message.Response.Status)
 2425            {
 2426                case 200:
 2427                    {
 02428                        EHNamespaceListResult value = default;
 02429                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 02430                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2431                        {
 02432                            value = null;
 2433                        }
 2434                        else
 2435                        {
 02436                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 2437                        }
 02438                        return Response.FromValue(value, message.Response);
 2439                    }
 2440                default:
 02441                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2442            }
 02443        }
 2444
 2445        /// <summary> Lists all the available Namespaces within a subscription, irrespective of the resource groups. </s
 2446        /// <param name="nextLink"> The URL to the next page of results. </param>
 2447        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2448        public Response<EHNamespaceListResult> ListNextPage(string nextLink, CancellationToken cancellationToken = defau
 2449        {
 02450            if (nextLink == null)
 2451            {
 02452                throw new ArgumentNullException(nameof(nextLink));
 2453            }
 2454
 02455            using var message = CreateListNextPageRequest(nextLink);
 02456            _pipeline.Send(message, cancellationToken);
 02457            switch (message.Response.Status)
 2458            {
 2459                case 200:
 2460                    {
 02461                        EHNamespaceListResult value = default;
 02462                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 02463                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2464                        {
 02465                            value = null;
 2466                        }
 2467                        else
 2468                        {
 02469                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 2470                        }
 02471                        return Response.FromValue(value, message.Response);
 2472                    }
 2473                default:
 02474                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2475            }
 02476        }
 2477
 2478        internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string resourceGroupName)
 2479        {
 02480            var message = _pipeline.CreateMessage();
 02481            var request = message.Request;
 02482            request.Method = RequestMethod.Get;
 02483            var uri = new RawRequestUriBuilder();
 02484            uri.Reset(endpoint);
 02485            uri.AppendRawNextLink(nextLink, false);
 02486            request.Uri = uri;
 02487            return message;
 2488        }
 2489
 2490        /// <summary> Lists the available Namespaces within a resource group. </summary>
 2491        /// <param name="nextLink"> The URL to the next page of results. </param>
 2492        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2493        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2494        public async Task<Response<EHNamespaceListResult>> ListByResourceGroupNextPageAsync(string nextLink, string reso
 2495        {
 02496            if (nextLink == null)
 2497            {
 02498                throw new ArgumentNullException(nameof(nextLink));
 2499            }
 02500            if (resourceGroupName == null)
 2501            {
 02502                throw new ArgumentNullException(nameof(resourceGroupName));
 2503            }
 2504
 02505            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 02506            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 02507            switch (message.Response.Status)
 2508            {
 2509                case 200:
 2510                    {
 02511                        EHNamespaceListResult value = default;
 02512                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 02513                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2514                        {
 02515                            value = null;
 2516                        }
 2517                        else
 2518                        {
 02519                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 2520                        }
 02521                        return Response.FromValue(value, message.Response);
 2522                    }
 2523                default:
 02524                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2525            }
 02526        }
 2527
 2528        /// <summary> Lists the available Namespaces within a resource group. </summary>
 2529        /// <param name="nextLink"> The URL to the next page of results. </param>
 2530        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2531        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2532        public Response<EHNamespaceListResult> ListByResourceGroupNextPage(string nextLink, string resourceGroupName, Ca
 2533        {
 02534            if (nextLink == null)
 2535            {
 02536                throw new ArgumentNullException(nameof(nextLink));
 2537            }
 02538            if (resourceGroupName == null)
 2539            {
 02540                throw new ArgumentNullException(nameof(resourceGroupName));
 2541            }
 2542
 02543            using var message = CreateListByResourceGroupNextPageRequest(nextLink, resourceGroupName);
 02544            _pipeline.Send(message, cancellationToken);
 02545            switch (message.Response.Status)
 2546            {
 2547                case 200:
 2548                    {
 02549                        EHNamespaceListResult value = default;
 02550                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 02551                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2552                        {
 02553                            value = null;
 2554                        }
 2555                        else
 2556                        {
 02557                            value = EHNamespaceListResult.DeserializeEHNamespaceListResult(document.RootElement);
 2558                        }
 02559                        return Response.FromValue(value, message.Response);
 2560                    }
 2561                default:
 02562                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2563            }
 02564        }
 2565
 2566        internal HttpMessage CreateListVirtualNetworkRulesNextPageRequest(string nextLink, string resourceGroupName, str
 2567        {
 02568            var message = _pipeline.CreateMessage();
 02569            var request = message.Request;
 02570            request.Method = RequestMethod.Get;
 02571            var uri = new RawRequestUriBuilder();
 02572            uri.Reset(endpoint);
 02573            uri.AppendRawNextLink(nextLink, false);
 02574            request.Uri = uri;
 02575            return message;
 2576        }
 2577
 2578        /// <summary> Gets a list of VirtualNetwork rules for a Namespace. </summary>
 2579        /// <param name="nextLink"> The URL to the next page of results. </param>
 2580        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2581        /// <param name="namespaceName"> The Namespace name. </param>
 2582        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2583        public async Task<Response<VirtualNetworkRuleListResult>> ListVirtualNetworkRulesNextPageAsync(string nextLink, 
 2584        {
 02585            if (nextLink == null)
 2586            {
 02587                throw new ArgumentNullException(nameof(nextLink));
 2588            }
 02589            if (resourceGroupName == null)
 2590            {
 02591                throw new ArgumentNullException(nameof(resourceGroupName));
 2592            }
 02593            if (namespaceName == null)
 2594            {
 02595                throw new ArgumentNullException(nameof(namespaceName));
 2596            }
 2597
 02598            using var message = CreateListVirtualNetworkRulesNextPageRequest(nextLink, resourceGroupName, namespaceName)
 02599            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 02600            switch (message.Response.Status)
 2601            {
 2602                case 200:
 2603                    {
 02604                        VirtualNetworkRuleListResult value = default;
 02605                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 02606                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2607                        {
 02608                            value = null;
 2609                        }
 2610                        else
 2611                        {
 02612                            value = VirtualNetworkRuleListResult.DeserializeVirtualNetworkRuleListResult(document.RootEl
 2613                        }
 02614                        return Response.FromValue(value, message.Response);
 2615                    }
 2616                default:
 02617                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2618            }
 02619        }
 2620
 2621        /// <summary> Gets a list of VirtualNetwork rules for a Namespace. </summary>
 2622        /// <param name="nextLink"> The URL to the next page of results. </param>
 2623        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2624        /// <param name="namespaceName"> The Namespace name. </param>
 2625        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2626        public Response<VirtualNetworkRuleListResult> ListVirtualNetworkRulesNextPage(string nextLink, string resourceGr
 2627        {
 02628            if (nextLink == null)
 2629            {
 02630                throw new ArgumentNullException(nameof(nextLink));
 2631            }
 02632            if (resourceGroupName == null)
 2633            {
 02634                throw new ArgumentNullException(nameof(resourceGroupName));
 2635            }
 02636            if (namespaceName == null)
 2637            {
 02638                throw new ArgumentNullException(nameof(namespaceName));
 2639            }
 2640
 02641            using var message = CreateListVirtualNetworkRulesNextPageRequest(nextLink, resourceGroupName, namespaceName)
 02642            _pipeline.Send(message, cancellationToken);
 02643            switch (message.Response.Status)
 2644            {
 2645                case 200:
 2646                    {
 02647                        VirtualNetworkRuleListResult value = default;
 02648                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 02649                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2650                        {
 02651                            value = null;
 2652                        }
 2653                        else
 2654                        {
 02655                            value = VirtualNetworkRuleListResult.DeserializeVirtualNetworkRuleListResult(document.RootEl
 2656                        }
 02657                        return Response.FromValue(value, message.Response);
 2658                    }
 2659                default:
 02660                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2661            }
 02662        }
 2663
 2664        internal HttpMessage CreateListAuthorizationRulesNextPageRequest(string nextLink, string resourceGroupName, stri
 2665        {
 02666            var message = _pipeline.CreateMessage();
 02667            var request = message.Request;
 02668            request.Method = RequestMethod.Get;
 02669            var uri = new RawRequestUriBuilder();
 02670            uri.Reset(endpoint);
 02671            uri.AppendRawNextLink(nextLink, false);
 02672            request.Uri = uri;
 02673            return message;
 2674        }
 2675
 2676        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 2677        /// <param name="nextLink"> The URL to the next page of results. </param>
 2678        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2679        /// <param name="namespaceName"> The Namespace name. </param>
 2680        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2681        public async Task<Response<AuthorizationRuleListResult>> ListAuthorizationRulesNextPageAsync(string nextLink, st
 2682        {
 02683            if (nextLink == null)
 2684            {
 02685                throw new ArgumentNullException(nameof(nextLink));
 2686            }
 02687            if (resourceGroupName == null)
 2688            {
 02689                throw new ArgumentNullException(nameof(resourceGroupName));
 2690            }
 02691            if (namespaceName == null)
 2692            {
 02693                throw new ArgumentNullException(nameof(namespaceName));
 2694            }
 2695
 02696            using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, resourceGroupName, namespaceName);
 02697            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 02698            switch (message.Response.Status)
 2699            {
 2700                case 200:
 2701                    {
 02702                        AuthorizationRuleListResult value = default;
 02703                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 02704                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2705                        {
 02706                            value = null;
 2707                        }
 2708                        else
 2709                        {
 02710                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 2711                        }
 02712                        return Response.FromValue(value, message.Response);
 2713                    }
 2714                default:
 02715                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 2716            }
 02717        }
 2718
 2719        /// <summary> Gets a list of authorization rules for a Namespace. </summary>
 2720        /// <param name="nextLink"> The URL to the next page of results. </param>
 2721        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 2722        /// <param name="namespaceName"> The Namespace name. </param>
 2723        /// <param name="cancellationToken"> The cancellation token to use. </param>
 2724        public Response<AuthorizationRuleListResult> ListAuthorizationRulesNextPage(string nextLink, string resourceGrou
 2725        {
 02726            if (nextLink == null)
 2727            {
 02728                throw new ArgumentNullException(nameof(nextLink));
 2729            }
 02730            if (resourceGroupName == null)
 2731            {
 02732                throw new ArgumentNullException(nameof(resourceGroupName));
 2733            }
 02734            if (namespaceName == null)
 2735            {
 02736                throw new ArgumentNullException(nameof(namespaceName));
 2737            }
 2738
 02739            using var message = CreateListAuthorizationRulesNextPageRequest(nextLink, resourceGroupName, namespaceName);
 02740            _pipeline.Send(message, cancellationToken);
 02741            switch (message.Response.Status)
 2742            {
 2743                case 200:
 2744                    {
 02745                        AuthorizationRuleListResult value = default;
 02746                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 02747                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 2748                        {
 02749                            value = null;
 2750                        }
 2751                        else
 2752                        {
 02753                            value = AuthorizationRuleListResult.DeserializeAuthorizationRuleListResult(document.RootElem
 2754                        }
 02755                        return Response.FromValue(value, message.Response);
 2756                    }
 2757                default:
 02758                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 2759            }
 02760        }
 2761    }
 2762}

Methods/Properties

.ctor(...)
CreateListIPFilterRulesRequest(...)
ListIPFilterRulesAsync()
ListIPFilterRules(...)
CreateCreateOrUpdateIpFilterRuleRequest(...)
CreateOrUpdateIpFilterRuleAsync()
CreateOrUpdateIpFilterRule(...)
CreateDeleteIpFilterRuleRequest(...)
DeleteIpFilterRuleAsync()
DeleteIpFilterRule(...)
CreateGetIpFilterRuleRequest(...)
GetIpFilterRuleAsync()
GetIpFilterRule(...)
CreateListRequest()
ListAsync()
List(...)
CreateListByResourceGroupRequest(...)
ListByResourceGroupAsync()
ListByResourceGroup(...)
CreateCreateOrUpdateRequest(...)
CreateOrUpdateAsync()
CreateOrUpdate(...)
CreateDeleteRequest(...)
DeleteAsync()
Delete(...)
CreateGetRequest(...)
GetAsync()
Get(...)
CreateUpdateRequest(...)
UpdateAsync()
Update(...)
CreateListVirtualNetworkRulesRequest(...)
ListVirtualNetworkRulesAsync()
ListVirtualNetworkRules(...)
CreateCreateOrUpdateVirtualNetworkRuleRequest(...)
CreateOrUpdateVirtualNetworkRuleAsync()
CreateOrUpdateVirtualNetworkRule(...)
CreateDeleteVirtualNetworkRuleRequest(...)
DeleteVirtualNetworkRuleAsync()
DeleteVirtualNetworkRule(...)
CreateGetVirtualNetworkRuleRequest(...)
GetVirtualNetworkRuleAsync()
GetVirtualNetworkRule(...)
CreateCreateOrUpdateNetworkRuleSetRequest(...)
CreateOrUpdateNetworkRuleSetAsync()
CreateOrUpdateNetworkRuleSet(...)
CreateGetNetworkRuleSetRequest(...)
GetNetworkRuleSetAsync()
GetNetworkRuleSet(...)
CreateListAuthorizationRulesRequest(...)
ListAuthorizationRulesAsync()
ListAuthorizationRules(...)
CreateCreateOrUpdateAuthorizationRuleRequest(...)
CreateOrUpdateAuthorizationRuleAsync()
CreateOrUpdateAuthorizationRule(...)
CreateDeleteAuthorizationRuleRequest(...)
DeleteAuthorizationRuleAsync()
DeleteAuthorizationRule(...)
CreateGetAuthorizationRuleRequest(...)
GetAuthorizationRuleAsync()
GetAuthorizationRule(...)
CreateListKeysRequest(...)
ListKeysAsync()
ListKeys(...)
CreateRegenerateKeysRequest(...)
RegenerateKeysAsync()
RegenerateKeys(...)
CreateCheckNameAvailabilityRequest(...)
CheckNameAvailabilityAsync()
CheckNameAvailability(...)
CreateListIPFilterRulesNextPageRequest(...)
ListIPFilterRulesNextPageAsync()
ListIPFilterRulesNextPage(...)
CreateListNextPageRequest(...)
ListNextPageAsync()
ListNextPage(...)
CreateListByResourceGroupNextPageRequest(...)
ListByResourceGroupNextPageAsync()
ListByResourceGroupNextPage(...)
CreateListVirtualNetworkRulesNextPageRequest(...)
ListVirtualNetworkRulesNextPageAsync()
ListVirtualNetworkRulesNextPage(...)
CreateListAuthorizationRulesNextPageRequest(...)
ListAuthorizationRulesNextPageAsync()
ListAuthorizationRulesNextPage(...)