< Summary

Class:Azure.ResourceManager.EventHubs.EventHubsOperations
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\EventHubsOperations.cs
Covered lines:106
Uncovered lines:102
Coverable lines:208
Total lines:582
Line coverage:50.9% (106 of 208)
Covered branches:10
Total branches:20
Branch coverage:50% (10 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
CreateOrUpdateAuthorizationRuleAsync()-57.14%100%
CreateOrUpdateAuthorizationRule(...)-57.14%100%
GetAuthorizationRuleAsync()-57.14%100%
GetAuthorizationRule(...)-57.14%100%
DeleteAuthorizationRuleAsync()-57.14%100%
DeleteAuthorizationRule(...)-57.14%100%
ListKeysAsync()-57.14%100%
ListKeys(...)-57.14%100%
RegenerateKeysAsync()-57.14%100%
RegenerateKeys(...)-57.14%100%
CreateOrUpdateAsync()-57.14%100%
CreateOrUpdate(...)-57.14%100%
DeleteAsync()-57.14%100%
Delete(...)-57.14%100%
GetAsync()-57.14%100%
Get(...)-57.14%100%
ListAuthorizationRulesAsync(...)-39.13%50%
<ListAuthorizationRulesAsync()-62.5%100%
<ListAuthorizationRulesAsync()-0%100%
ListAuthorizationRules(...)-39.13%50%
ListByNamespaceAsync(...)-38.1%50%
<ListByNamespaceAsync()-62.5%100%
<ListByNamespaceAsync()-0%100%
ListByNamespace(...)-38.1%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\EventHubsOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.EventHubs.Models;
 15
 16namespace Azure.ResourceManager.EventHubs
 17{
 18    /// <summary> The EventHubs service client. </summary>
 19    public partial class EventHubsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 19223        internal EventHubsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of EventHubsOperations for mocking. </summary>
 4825        protected EventHubsOperations()
 26        {
 4827        }
 28        /// <summary> Initializes a new instance of EventHubsOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> Subscription credentials that uniquely identify a Microsoft Azure subscription
 32        /// <param name="endpoint"> server parameter. </param>
 4833        internal EventHubsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, 
 34        {
 4835            RestClient = new EventHubsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 4836            _clientDiagnostics = clientDiagnostics;
 4837            _pipeline = pipeline;
 4838        }
 39
 40        /// <summary> Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the Author
 41        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 42        /// <param name="namespaceName"> The Namespace name. </param>
 43        /// <param name="eventHubName"> The Event Hub name. </param>
 44        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 45        /// <param name="parameters"> The shared access AuthorizationRule. </param>
 46        /// <param name="cancellationToken"> The cancellation token to use. </param>
 47        public virtual async Task<Response<AuthorizationRule>> CreateOrUpdateAuthorizationRuleAsync(string resourceGroup
 48        {
 849            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdateAuthorizationRule");
 850            scope.Start();
 51            try
 52            {
 853                return await RestClient.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubN
 54            }
 055            catch (Exception e)
 56            {
 057                scope.Failed(e);
 058                throw;
 59            }
 860        }
 61
 62        /// <summary> Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update of the Author
 63        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 64        /// <param name="namespaceName"> The Namespace name. </param>
 65        /// <param name="eventHubName"> The Event Hub name. </param>
 66        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 67        /// <param name="parameters"> The shared access AuthorizationRule. </param>
 68        /// <param name="cancellationToken"> The cancellation token to use. </param>
 69        public virtual Response<AuthorizationRule> CreateOrUpdateAuthorizationRule(string resourceGroupName, string name
 70        {
 871            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdateAuthorizationRule");
 872            scope.Start();
 73            try
 74            {
 875                return RestClient.CreateOrUpdateAuthorizationRule(resourceGroupName, namespaceName, eventHubName, author
 76            }
 077            catch (Exception e)
 78            {
 079                scope.Failed(e);
 080                throw;
 81            }
 882        }
 83
 84        /// <summary> Gets an AuthorizationRule for an Event Hub by rule name. </summary>
 85        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 86        /// <param name="namespaceName"> The Namespace name. </param>
 87        /// <param name="eventHubName"> The Event Hub name. </param>
 88        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 89        /// <param name="cancellationToken"> The cancellation token to use. </param>
 90        public virtual async Task<Response<AuthorizationRule>> GetAuthorizationRuleAsync(string resourceGroupName, strin
 91        {
 892            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.GetAuthorizationRule");
 893            scope.Start();
 94            try
 95            {
 896                return await RestClient.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, author
 97            }
 098            catch (Exception e)
 99            {
 0100                scope.Failed(e);
 0101                throw;
 102            }
 8103        }
 104
 105        /// <summary> Gets an AuthorizationRule for an Event Hub by rule name. </summary>
 106        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 107        /// <param name="namespaceName"> The Namespace name. </param>
 108        /// <param name="eventHubName"> The Event Hub name. </param>
 109        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 110        /// <param name="cancellationToken"> The cancellation token to use. </param>
 111        public virtual Response<AuthorizationRule> GetAuthorizationRule(string resourceGroupName, string namespaceName, 
 112        {
 8113            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.GetAuthorizationRule");
 8114            scope.Start();
 115            try
 116            {
 8117                return RestClient.GetAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationRule
 118            }
 0119            catch (Exception e)
 120            {
 0121                scope.Failed(e);
 0122                throw;
 123            }
 8124        }
 125
 126        /// <summary> Deletes an Event Hub AuthorizationRule. </summary>
 127        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 128        /// <param name="namespaceName"> The Namespace name. </param>
 129        /// <param name="eventHubName"> The Event Hub name. </param>
 130        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 131        /// <param name="cancellationToken"> The cancellation token to use. </param>
 132        public virtual async Task<Response> DeleteAuthorizationRuleAsync(string resourceGroupName, string namespaceName,
 133        {
 4134            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.DeleteAuthorizationRule");
 4135            scope.Start();
 136            try
 137            {
 4138                return await RestClient.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, eventHubName, aut
 139            }
 0140            catch (Exception e)
 141            {
 0142                scope.Failed(e);
 0143                throw;
 144            }
 4145        }
 146
 147        /// <summary> Deletes an Event Hub AuthorizationRule. </summary>
 148        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 149        /// <param name="namespaceName"> The Namespace name. </param>
 150        /// <param name="eventHubName"> The Event Hub name. </param>
 151        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 152        /// <param name="cancellationToken"> The cancellation token to use. </param>
 153        public virtual Response DeleteAuthorizationRule(string resourceGroupName, string namespaceName, string eventHubN
 154        {
 4155            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.DeleteAuthorizationRule");
 4156            scope.Start();
 157            try
 158            {
 4159                return RestClient.DeleteAuthorizationRule(resourceGroupName, namespaceName, eventHubName, authorizationR
 160            }
 0161            catch (Exception e)
 162            {
 0163                scope.Failed(e);
 0164                throw;
 165            }
 4166        }
 167
 168        /// <summary> Gets the ACS and SAS connection strings for the Event Hub. </summary>
 169        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 170        /// <param name="namespaceName"> The Namespace name. </param>
 171        /// <param name="eventHubName"> The Event Hub name. </param>
 172        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 173        /// <param name="cancellationToken"> The cancellation token to use. </param>
 174        public virtual async Task<Response<AccessKeys>> ListKeysAsync(string resourceGroupName, string namespaceName, st
 175        {
 4176            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListKeys");
 4177            scope.Start();
 178            try
 179            {
 4180                return await RestClient.ListKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizationRuleN
 181            }
 0182            catch (Exception e)
 183            {
 0184                scope.Failed(e);
 0185                throw;
 186            }
 4187        }
 188
 189        /// <summary> Gets the ACS and SAS connection strings for the Event Hub. </summary>
 190        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 191        /// <param name="namespaceName"> The Namespace name. </param>
 192        /// <param name="eventHubName"> The Event Hub name. </param>
 193        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 194        /// <param name="cancellationToken"> The cancellation token to use. </param>
 195        public virtual Response<AccessKeys> ListKeys(string resourceGroupName, string namespaceName, string eventHubName
 196        {
 4197            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListKeys");
 4198            scope.Start();
 199            try
 200            {
 4201                return RestClient.ListKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, cancel
 202            }
 0203            catch (Exception e)
 204            {
 0205                scope.Failed(e);
 0206                throw;
 207            }
 4208        }
 209
 210        /// <summary> Regenerates the ACS and SAS connection strings for the Event Hub. </summary>
 211        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 212        /// <param name="namespaceName"> The Namespace name. </param>
 213        /// <param name="eventHubName"> The Event Hub name. </param>
 214        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 215        /// <param name="parameters"> Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/Secondary
 216        /// <param name="cancellationToken"> The cancellation token to use. </param>
 217        public virtual async Task<Response<AccessKeys>> RegenerateKeysAsync(string resourceGroupName, string namespaceNa
 218        {
 8219            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.RegenerateKeys");
 8220            scope.Start();
 221            try
 222            {
 8223                return await RestClient.RegenerateKeysAsync(resourceGroupName, namespaceName, eventHubName, authorizatio
 224            }
 0225            catch (Exception e)
 226            {
 0227                scope.Failed(e);
 0228                throw;
 229            }
 8230        }
 231
 232        /// <summary> Regenerates the ACS and SAS connection strings for the Event Hub. </summary>
 233        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 234        /// <param name="namespaceName"> The Namespace name. </param>
 235        /// <param name="eventHubName"> The Event Hub name. </param>
 236        /// <param name="authorizationRuleName"> The authorization rule name. </param>
 237        /// <param name="parameters"> Parameters supplied to regenerate the AuthorizationRule Keys (PrimaryKey/Secondary
 238        /// <param name="cancellationToken"> The cancellation token to use. </param>
 239        public virtual Response<AccessKeys> RegenerateKeys(string resourceGroupName, string namespaceName, string eventH
 240        {
 8241            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.RegenerateKeys");
 8242            scope.Start();
 243            try
 244            {
 8245                return RestClient.RegenerateKeys(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, 
 246            }
 0247            catch (Exception e)
 248            {
 0249                scope.Failed(e);
 0250                throw;
 251            }
 8252        }
 253
 254        /// <summary> Creates or updates a new Event Hub as a nested resource within a Namespace. </summary>
 255        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 256        /// <param name="namespaceName"> The Namespace name. </param>
 257        /// <param name="eventHubName"> The Event Hub name. </param>
 258        /// <param name="parameters"> Parameters supplied to create an Event Hub resource. </param>
 259        /// <param name="cancellationToken"> The cancellation token to use. </param>
 260        public virtual async Task<Response<Eventhub>> CreateOrUpdateAsync(string resourceGroupName, string namespaceName
 261        {
 32262            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdate");
 32263            scope.Start();
 264            try
 265            {
 32266                return await RestClient.CreateOrUpdateAsync(resourceGroupName, namespaceName, eventHubName, parameters, 
 267            }
 0268            catch (Exception e)
 269            {
 0270                scope.Failed(e);
 0271                throw;
 272            }
 32273        }
 274
 275        /// <summary> Creates or updates a new Event Hub as a nested resource within a Namespace. </summary>
 276        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 277        /// <param name="namespaceName"> The Namespace name. </param>
 278        /// <param name="eventHubName"> The Event Hub name. </param>
 279        /// <param name="parameters"> Parameters supplied to create an Event Hub resource. </param>
 280        /// <param name="cancellationToken"> The cancellation token to use. </param>
 281        public virtual Response<Eventhub> CreateOrUpdate(string resourceGroupName, string namespaceName, string eventHub
 282        {
 32283            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.CreateOrUpdate");
 32284            scope.Start();
 285            try
 286            {
 32287                return RestClient.CreateOrUpdate(resourceGroupName, namespaceName, eventHubName, parameters, cancellatio
 288            }
 0289            catch (Exception e)
 290            {
 0291                scope.Failed(e);
 0292                throw;
 293            }
 32294        }
 295
 296        /// <summary> Deletes an Event Hub from the specified Namespace and resource group. </summary>
 297        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 298        /// <param name="namespaceName"> The Namespace name. </param>
 299        /// <param name="eventHubName"> The Event Hub name. </param>
 300        /// <param name="cancellationToken"> The cancellation token to use. </param>
 301        public virtual async Task<Response> DeleteAsync(string resourceGroupName, string namespaceName, string eventHubN
 302        {
 10303            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Delete");
 10304            scope.Start();
 305            try
 306            {
 10307                return await RestClient.DeleteAsync(resourceGroupName, namespaceName, eventHubName, cancellationToken).C
 308            }
 0309            catch (Exception e)
 310            {
 0311                scope.Failed(e);
 0312                throw;
 313            }
 10314        }
 315
 316        /// <summary> Deletes an Event Hub from the specified Namespace and resource group. </summary>
 317        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 318        /// <param name="namespaceName"> The Namespace name. </param>
 319        /// <param name="eventHubName"> The Event Hub name. </param>
 320        /// <param name="cancellationToken"> The cancellation token to use. </param>
 321        public virtual Response Delete(string resourceGroupName, string namespaceName, string eventHubName, Cancellation
 322        {
 10323            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Delete");
 10324            scope.Start();
 325            try
 326            {
 10327                return RestClient.Delete(resourceGroupName, namespaceName, eventHubName, cancellationToken);
 328            }
 0329            catch (Exception e)
 330            {
 0331                scope.Failed(e);
 0332                throw;
 333            }
 10334        }
 335
 336        /// <summary> Gets an Event Hubs description for the specified Event Hub. </summary>
 337        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 338        /// <param name="namespaceName"> The Namespace name. </param>
 339        /// <param name="eventHubName"> The Event Hub name. </param>
 340        /// <param name="cancellationToken"> The cancellation token to use. </param>
 341        public virtual async Task<Response<Eventhub>> GetAsync(string resourceGroupName, string namespaceName, string ev
 342        {
 12343            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Get");
 12344            scope.Start();
 345            try
 346            {
 12347                return await RestClient.GetAsync(resourceGroupName, namespaceName, eventHubName, cancellationToken).Conf
 348            }
 0349            catch (Exception e)
 350            {
 0351                scope.Failed(e);
 0352                throw;
 353            }
 12354        }
 355
 356        /// <summary> Gets an Event Hubs description for the specified Event Hub. </summary>
 357        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 358        /// <param name="namespaceName"> The Namespace name. </param>
 359        /// <param name="eventHubName"> The Event Hub name. </param>
 360        /// <param name="cancellationToken"> The cancellation token to use. </param>
 361        public virtual Response<Eventhub> Get(string resourceGroupName, string namespaceName, string eventHubName, Cance
 362        {
 12363            using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.Get");
 12364            scope.Start();
 365            try
 366            {
 12367                return RestClient.Get(resourceGroupName, namespaceName, eventHubName, cancellationToken);
 368            }
 0369            catch (Exception e)
 370            {
 0371                scope.Failed(e);
 0372                throw;
 373            }
 12374        }
 375
 376        /// <summary> Gets the authorization rules for an Event Hub. </summary>
 377        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 378        /// <param name="namespaceName"> The Namespace name. </param>
 379        /// <param name="eventHubName"> The Event Hub name. </param>
 380        /// <param name="cancellationToken"> The cancellation token to use. </param>
 381        public virtual AsyncPageable<AuthorizationRule> ListAuthorizationRulesAsync(string resourceGroupName, string nam
 382        {
 4383            if (resourceGroupName == null)
 384            {
 0385                throw new ArgumentNullException(nameof(resourceGroupName));
 386            }
 4387            if (namespaceName == null)
 388            {
 0389                throw new ArgumentNullException(nameof(namespaceName));
 390            }
 4391            if (eventHubName == null)
 392            {
 0393                throw new ArgumentNullException(nameof(eventHubName));
 394            }
 395
 396            async Task<Page<AuthorizationRule>> FirstPageFunc(int? pageSizeHint)
 397            {
 4398                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules");
 4399                scope.Start();
 400                try
 401                {
 4402                    var response = await RestClient.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, eventH
 4403                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 404                }
 0405                catch (Exception e)
 406                {
 0407                    scope.Failed(e);
 0408                    throw;
 409                }
 4410            }
 411            async Task<Page<AuthorizationRule>> NextPageFunc(string nextLink, int? pageSizeHint)
 412            {
 0413                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules");
 0414                scope.Start();
 415                try
 416                {
 0417                    var response = await RestClient.ListAuthorizationRulesNextPageAsync(nextLink, resourceGroupName, nam
 0418                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 419                }
 0420                catch (Exception e)
 421                {
 0422                    scope.Failed(e);
 0423                    throw;
 424                }
 0425            }
 4426            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 427        }
 428
 429        /// <summary> Gets the authorization rules for an Event Hub. </summary>
 430        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 431        /// <param name="namespaceName"> The Namespace name. </param>
 432        /// <param name="eventHubName"> The Event Hub name. </param>
 433        /// <param name="cancellationToken"> The cancellation token to use. </param>
 434        public virtual Pageable<AuthorizationRule> ListAuthorizationRules(string resourceGroupName, string namespaceName
 435        {
 4436            if (resourceGroupName == null)
 437            {
 0438                throw new ArgumentNullException(nameof(resourceGroupName));
 439            }
 4440            if (namespaceName == null)
 441            {
 0442                throw new ArgumentNullException(nameof(namespaceName));
 443            }
 4444            if (eventHubName == null)
 445            {
 0446                throw new ArgumentNullException(nameof(eventHubName));
 447            }
 448
 449            Page<AuthorizationRule> FirstPageFunc(int? pageSizeHint)
 450            {
 4451                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules");
 4452                scope.Start();
 453                try
 454                {
 4455                    var response = RestClient.ListAuthorizationRules(resourceGroupName, namespaceName, eventHubName, can
 4456                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 457                }
 0458                catch (Exception e)
 459                {
 0460                    scope.Failed(e);
 0461                    throw;
 462                }
 4463            }
 464            Page<AuthorizationRule> NextPageFunc(string nextLink, int? pageSizeHint)
 465            {
 0466                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListAuthorizationRules");
 0467                scope.Start();
 468                try
 469                {
 0470                    var response = RestClient.ListAuthorizationRulesNextPage(nextLink, resourceGroupName, namespaceName,
 0471                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 472                }
 0473                catch (Exception e)
 474                {
 0475                    scope.Failed(e);
 0476                    throw;
 477                }
 0478            }
 4479            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 480        }
 481
 482        /// <summary> Gets all the Event Hubs in a Namespace. </summary>
 483        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 484        /// <param name="namespaceName"> The Namespace name. </param>
 485        /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo
 486        /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
 487        /// <param name="cancellationToken"> The cancellation token to use. </param>
 488        public virtual AsyncPageable<Eventhub> ListByNamespaceAsync(string resourceGroupName, string namespaceName, int?
 489        {
 6490            if (resourceGroupName == null)
 491            {
 0492                throw new ArgumentNullException(nameof(resourceGroupName));
 493            }
 6494            if (namespaceName == null)
 495            {
 0496                throw new ArgumentNullException(nameof(namespaceName));
 497            }
 498
 499            async Task<Page<Eventhub>> FirstPageFunc(int? pageSizeHint)
 500            {
 6501                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace");
 6502                scope.Start();
 503                try
 504                {
 6505                    var response = await RestClient.ListByNamespaceAsync(resourceGroupName, namespaceName, skip, top, ca
 6506                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 507                }
 0508                catch (Exception e)
 509                {
 0510                    scope.Failed(e);
 0511                    throw;
 512                }
 6513            }
 514            async Task<Page<Eventhub>> NextPageFunc(string nextLink, int? pageSizeHint)
 515            {
 0516                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace");
 0517                scope.Start();
 518                try
 519                {
 0520                    var response = await RestClient.ListByNamespaceNextPageAsync(nextLink, resourceGroupName, namespaceN
 0521                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 522                }
 0523                catch (Exception e)
 524                {
 0525                    scope.Failed(e);
 0526                    throw;
 527                }
 0528            }
 6529            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 530        }
 531
 532        /// <summary> Gets all the Event Hubs in a Namespace. </summary>
 533        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 534        /// <param name="namespaceName"> The Namespace name. </param>
 535        /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo
 536        /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
 537        /// <param name="cancellationToken"> The cancellation token to use. </param>
 538        public virtual Pageable<Eventhub> ListByNamespace(string resourceGroupName, string namespaceName, int? skip = nu
 539        {
 6540            if (resourceGroupName == null)
 541            {
 0542                throw new ArgumentNullException(nameof(resourceGroupName));
 543            }
 6544            if (namespaceName == null)
 545            {
 0546                throw new ArgumentNullException(nameof(namespaceName));
 547            }
 548
 549            Page<Eventhub> FirstPageFunc(int? pageSizeHint)
 550            {
 6551                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace");
 6552                scope.Start();
 553                try
 554                {
 6555                    var response = RestClient.ListByNamespace(resourceGroupName, namespaceName, skip, top, cancellationT
 6556                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 557                }
 0558                catch (Exception e)
 559                {
 0560                    scope.Failed(e);
 0561                    throw;
 562                }
 6563            }
 564            Page<Eventhub> NextPageFunc(string nextLink, int? pageSizeHint)
 565            {
 0566                using var scope = _clientDiagnostics.CreateScope("EventHubsOperations.ListByNamespace");
 0567                scope.Start();
 568                try
 569                {
 0570                    var response = RestClient.ListByNamespaceNextPage(nextLink, resourceGroupName, namespaceName, skip, 
 0571                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 572                }
 0573                catch (Exception e)
 574                {
 0575                    scope.Failed(e);
 0576                    throw;
 577                }
 0578            }
 6579            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 580        }
 581    }
 582}