< Summary

Class:Azure.ResourceManager.EventHubs.ConsumerGroupsRestOperations
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\ConsumerGroupsRestOperations.cs
Covered lines:217
Uncovered lines:59
Coverable lines:276
Total lines:623
Line coverage:78.6% (217 of 276)
Covered branches:66
Total branches:128
Branch coverage:51.5% (66 of 128)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-66.67%50%
CreateOrUpdate(...)-66.67%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-64.29%50%
Delete(...)-64.29%50%
CreateGetRequest(...)-100%100%
GetAsync()-68.42%50%
Get(...)-68.42%50%
CreateListByEventHubRequest(...)-100%100%
ListByEventHubAsync()-70.59%50%
ListByEventHub(...)-70.59%50%
CreateListByEventHubNextPageRequest(...)-100%100%
ListByEventHubNextPageAsync()-68.42%50%
ListByEventHubNextPage(...)-68.42%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\ConsumerGroupsRestOperations.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 ConsumerGroupsRestOperations
 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 ConsumerGroupsRestOperations. </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 ConsumerGroupsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscript
 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 CreateCreateOrUpdateRequest(string resourceGroupName, string namespaceName, string eventHub
 47        {
 5648            var message = _pipeline.CreateMessage();
 5649            var request = message.Request;
 5650            request.Method = RequestMethod.Put;
 5651            var uri = new RawRequestUriBuilder();
 5652            uri.Reset(endpoint);
 5653            uri.AppendPath("/subscriptions/", false);
 5654            uri.AppendPath(subscriptionId, true);
 5655            uri.AppendPath("/resourceGroups/", false);
 5656            uri.AppendPath(resourceGroupName, true);
 5657            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 5658            uri.AppendPath(namespaceName, true);
 5659            uri.AppendPath("/eventhubs/", false);
 5660            uri.AppendPath(eventHubName, true);
 5661            uri.AppendPath("/consumergroups/", false);
 5662            uri.AppendPath(consumerGroupName, true);
 5663            uri.AppendQuery("api-version", "2017-04-01", true);
 5664            request.Uri = uri;
 5665            request.Headers.Add("Content-Type", "application/json");
 5666            var content = new Utf8JsonRequestContent();
 5667            content.JsonWriter.WriteObjectValue(parameters);
 5668            request.Content = content;
 5669            return message;
 70        }
 71
 72        /// <summary> Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. </summary
 73        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 74        /// <param name="namespaceName"> The Namespace name. </param>
 75        /// <param name="eventHubName"> The Event Hub name. </param>
 76        /// <param name="consumerGroupName"> The consumer group name. </param>
 77        /// <param name="parameters"> Parameters supplied to create or update a consumer group resource. </param>
 78        /// <param name="cancellationToken"> The cancellation token to use. </param>
 79        public async Task<Response<ConsumerGroup>> CreateOrUpdateAsync(string resourceGroupName, string namespaceName, s
 80        {
 2881            if (resourceGroupName == null)
 82            {
 083                throw new ArgumentNullException(nameof(resourceGroupName));
 84            }
 2885            if (namespaceName == null)
 86            {
 087                throw new ArgumentNullException(nameof(namespaceName));
 88            }
 2889            if (eventHubName == null)
 90            {
 091                throw new ArgumentNullException(nameof(eventHubName));
 92            }
 2893            if (consumerGroupName == null)
 94            {
 095                throw new ArgumentNullException(nameof(consumerGroupName));
 96            }
 2897            if (parameters == null)
 98            {
 099                throw new ArgumentNullException(nameof(parameters));
 100            }
 101
 28102            using var message = CreateCreateOrUpdateRequest(resourceGroupName, namespaceName, eventHubName, consumerGrou
 28103            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 28104            switch (message.Response.Status)
 105            {
 106                case 200:
 107                    {
 28108                        ConsumerGroup value = default;
 28109                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 28110                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 111                        {
 0112                            value = null;
 113                        }
 114                        else
 115                        {
 28116                            value = ConsumerGroup.DeserializeConsumerGroup(document.RootElement);
 117                        }
 28118                        return Response.FromValue(value, message.Response);
 119                    }
 120                default:
 0121                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 122            }
 28123        }
 124
 125        /// <summary> Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. </summary
 126        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 127        /// <param name="namespaceName"> The Namespace name. </param>
 128        /// <param name="eventHubName"> The Event Hub name. </param>
 129        /// <param name="consumerGroupName"> The consumer group name. </param>
 130        /// <param name="parameters"> Parameters supplied to create or update a consumer group resource. </param>
 131        /// <param name="cancellationToken"> The cancellation token to use. </param>
 132        public Response<ConsumerGroup> CreateOrUpdate(string resourceGroupName, string namespaceName, string eventHubNam
 133        {
 28134            if (resourceGroupName == null)
 135            {
 0136                throw new ArgumentNullException(nameof(resourceGroupName));
 137            }
 28138            if (namespaceName == null)
 139            {
 0140                throw new ArgumentNullException(nameof(namespaceName));
 141            }
 28142            if (eventHubName == null)
 143            {
 0144                throw new ArgumentNullException(nameof(eventHubName));
 145            }
 28146            if (consumerGroupName == null)
 147            {
 0148                throw new ArgumentNullException(nameof(consumerGroupName));
 149            }
 28150            if (parameters == null)
 151            {
 0152                throw new ArgumentNullException(nameof(parameters));
 153            }
 154
 28155            using var message = CreateCreateOrUpdateRequest(resourceGroupName, namespaceName, eventHubName, consumerGrou
 28156            _pipeline.Send(message, cancellationToken);
 28157            switch (message.Response.Status)
 158            {
 159                case 200:
 160                    {
 28161                        ConsumerGroup value = default;
 28162                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 28163                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 164                        {
 0165                            value = null;
 166                        }
 167                        else
 168                        {
 28169                            value = ConsumerGroup.DeserializeConsumerGroup(document.RootElement);
 170                        }
 28171                        return Response.FromValue(value, message.Response);
 172                    }
 173                default:
 0174                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 175            }
 28176        }
 177
 178        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string namespaceName, string eventHubName, st
 179        {
 8180            var message = _pipeline.CreateMessage();
 8181            var request = message.Request;
 8182            request.Method = RequestMethod.Delete;
 8183            var uri = new RawRequestUriBuilder();
 8184            uri.Reset(endpoint);
 8185            uri.AppendPath("/subscriptions/", false);
 8186            uri.AppendPath(subscriptionId, true);
 8187            uri.AppendPath("/resourceGroups/", false);
 8188            uri.AppendPath(resourceGroupName, true);
 8189            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 8190            uri.AppendPath(namespaceName, true);
 8191            uri.AppendPath("/eventhubs/", false);
 8192            uri.AppendPath(eventHubName, true);
 8193            uri.AppendPath("/consumergroups/", false);
 8194            uri.AppendPath(consumerGroupName, true);
 8195            uri.AppendQuery("api-version", "2017-04-01", true);
 8196            request.Uri = uri;
 8197            return message;
 198        }
 199
 200        /// <summary> Deletes a consumer group from the specified Event Hub and resource group. </summary>
 201        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 202        /// <param name="namespaceName"> The Namespace name. </param>
 203        /// <param name="eventHubName"> The Event Hub name. </param>
 204        /// <param name="consumerGroupName"> The consumer group name. </param>
 205        /// <param name="cancellationToken"> The cancellation token to use. </param>
 206        public async Task<Response> DeleteAsync(string resourceGroupName, string namespaceName, string eventHubName, str
 207        {
 4208            if (resourceGroupName == null)
 209            {
 0210                throw new ArgumentNullException(nameof(resourceGroupName));
 211            }
 4212            if (namespaceName == null)
 213            {
 0214                throw new ArgumentNullException(nameof(namespaceName));
 215            }
 4216            if (eventHubName == null)
 217            {
 0218                throw new ArgumentNullException(nameof(eventHubName));
 219            }
 4220            if (consumerGroupName == null)
 221            {
 0222                throw new ArgumentNullException(nameof(consumerGroupName));
 223            }
 224
 4225            using var message = CreateDeleteRequest(resourceGroupName, namespaceName, eventHubName, consumerGroupName);
 4226            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4227            switch (message.Response.Status)
 228            {
 229                case 200:
 230                case 204:
 4231                    return message.Response;
 232                default:
 0233                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 234            }
 4235        }
 236
 237        /// <summary> Deletes a consumer group from the specified Event Hub and resource group. </summary>
 238        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 239        /// <param name="namespaceName"> The Namespace name. </param>
 240        /// <param name="eventHubName"> The Event Hub name. </param>
 241        /// <param name="consumerGroupName"> The consumer group name. </param>
 242        /// <param name="cancellationToken"> The cancellation token to use. </param>
 243        public Response Delete(string resourceGroupName, string namespaceName, string eventHubName, string consumerGroup
 244        {
 4245            if (resourceGroupName == null)
 246            {
 0247                throw new ArgumentNullException(nameof(resourceGroupName));
 248            }
 4249            if (namespaceName == null)
 250            {
 0251                throw new ArgumentNullException(nameof(namespaceName));
 252            }
 4253            if (eventHubName == null)
 254            {
 0255                throw new ArgumentNullException(nameof(eventHubName));
 256            }
 4257            if (consumerGroupName == null)
 258            {
 0259                throw new ArgumentNullException(nameof(consumerGroupName));
 260            }
 261
 4262            using var message = CreateDeleteRequest(resourceGroupName, namespaceName, eventHubName, consumerGroupName);
 4263            _pipeline.Send(message, cancellationToken);
 4264            switch (message.Response.Status)
 265            {
 266                case 200:
 267                case 204:
 4268                    return message.Response;
 269                default:
 0270                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 271            }
 4272        }
 273
 274        internal HttpMessage CreateGetRequest(string resourceGroupName, string namespaceName, string eventHubName, strin
 275        {
 16276            var message = _pipeline.CreateMessage();
 16277            var request = message.Request;
 16278            request.Method = RequestMethod.Get;
 16279            var uri = new RawRequestUriBuilder();
 16280            uri.Reset(endpoint);
 16281            uri.AppendPath("/subscriptions/", false);
 16282            uri.AppendPath(subscriptionId, true);
 16283            uri.AppendPath("/resourceGroups/", false);
 16284            uri.AppendPath(resourceGroupName, true);
 16285            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 16286            uri.AppendPath(namespaceName, true);
 16287            uri.AppendPath("/eventhubs/", false);
 16288            uri.AppendPath(eventHubName, true);
 16289            uri.AppendPath("/consumergroups/", false);
 16290            uri.AppendPath(consumerGroupName, true);
 16291            uri.AppendQuery("api-version", "2017-04-01", true);
 16292            request.Uri = uri;
 16293            return message;
 294        }
 295
 296        /// <summary> Gets a description for the specified consumer 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="consumerGroupName"> The consumer group name. </param>
 301        /// <param name="cancellationToken"> The cancellation token to use. </param>
 302        public async Task<Response<ConsumerGroup>> GetAsync(string resourceGroupName, string namespaceName, string event
 303        {
 8304            if (resourceGroupName == null)
 305            {
 0306                throw new ArgumentNullException(nameof(resourceGroupName));
 307            }
 8308            if (namespaceName == null)
 309            {
 0310                throw new ArgumentNullException(nameof(namespaceName));
 311            }
 8312            if (eventHubName == null)
 313            {
 0314                throw new ArgumentNullException(nameof(eventHubName));
 315            }
 8316            if (consumerGroupName == null)
 317            {
 0318                throw new ArgumentNullException(nameof(consumerGroupName));
 319            }
 320
 8321            using var message = CreateGetRequest(resourceGroupName, namespaceName, eventHubName, consumerGroupName);
 8322            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 8323            switch (message.Response.Status)
 324            {
 325                case 200:
 326                    {
 8327                        ConsumerGroup value = default;
 8328                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 8329                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 330                        {
 0331                            value = null;
 332                        }
 333                        else
 334                        {
 8335                            value = ConsumerGroup.DeserializeConsumerGroup(document.RootElement);
 336                        }
 8337                        return Response.FromValue(value, message.Response);
 338                    }
 339                default:
 0340                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 341            }
 8342        }
 343
 344        /// <summary> Gets a description for the specified consumer group. </summary>
 345        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 346        /// <param name="namespaceName"> The Namespace name. </param>
 347        /// <param name="eventHubName"> The Event Hub name. </param>
 348        /// <param name="consumerGroupName"> The consumer group name. </param>
 349        /// <param name="cancellationToken"> The cancellation token to use. </param>
 350        public Response<ConsumerGroup> Get(string resourceGroupName, string namespaceName, string eventHubName, string c
 351        {
 8352            if (resourceGroupName == null)
 353            {
 0354                throw new ArgumentNullException(nameof(resourceGroupName));
 355            }
 8356            if (namespaceName == null)
 357            {
 0358                throw new ArgumentNullException(nameof(namespaceName));
 359            }
 8360            if (eventHubName == null)
 361            {
 0362                throw new ArgumentNullException(nameof(eventHubName));
 363            }
 8364            if (consumerGroupName == null)
 365            {
 0366                throw new ArgumentNullException(nameof(consumerGroupName));
 367            }
 368
 8369            using var message = CreateGetRequest(resourceGroupName, namespaceName, eventHubName, consumerGroupName);
 8370            _pipeline.Send(message, cancellationToken);
 8371            switch (message.Response.Status)
 372            {
 373                case 200:
 374                    {
 8375                        ConsumerGroup value = default;
 8376                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 8377                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 378                        {
 0379                            value = null;
 380                        }
 381                        else
 382                        {
 8383                            value = ConsumerGroup.DeserializeConsumerGroup(document.RootElement);
 384                        }
 8385                        return Response.FromValue(value, message.Response);
 386                    }
 387                default:
 0388                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 389            }
 8390        }
 391
 392        internal HttpMessage CreateListByEventHubRequest(string resourceGroupName, string namespaceName, string eventHub
 393        {
 16394            var message = _pipeline.CreateMessage();
 16395            var request = message.Request;
 16396            request.Method = RequestMethod.Get;
 16397            var uri = new RawRequestUriBuilder();
 16398            uri.Reset(endpoint);
 16399            uri.AppendPath("/subscriptions/", false);
 16400            uri.AppendPath(subscriptionId, true);
 16401            uri.AppendPath("/resourceGroups/", false);
 16402            uri.AppendPath(resourceGroupName, true);
 16403            uri.AppendPath("/providers/Microsoft.EventHub/namespaces/", false);
 16404            uri.AppendPath(namespaceName, true);
 16405            uri.AppendPath("/eventhubs/", false);
 16406            uri.AppendPath(eventHubName, true);
 16407            uri.AppendPath("/consumergroups", false);
 16408            uri.AppendQuery("api-version", "2017-04-01", true);
 16409            if (skip != null)
 410            {
 4411                uri.AppendQuery("$skip", skip.Value, true);
 412            }
 16413            if (top != null)
 414            {
 4415                uri.AppendQuery("$top", top.Value, true);
 416            }
 16417            request.Uri = uri;
 16418            return message;
 419        }
 420
 421        /// <summary> Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists
 422        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 423        /// <param name="namespaceName"> The Namespace name. </param>
 424        /// <param name="eventHubName"> The Event Hub name. </param>
 425        /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo
 426        /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
 427        /// <param name="cancellationToken"> The cancellation token to use. </param>
 428        public async Task<Response<ConsumerGroupListResult>> ListByEventHubAsync(string resourceGroupName, string namesp
 429        {
 8430            if (resourceGroupName == null)
 431            {
 0432                throw new ArgumentNullException(nameof(resourceGroupName));
 433            }
 8434            if (namespaceName == null)
 435            {
 0436                throw new ArgumentNullException(nameof(namespaceName));
 437            }
 8438            if (eventHubName == null)
 439            {
 0440                throw new ArgumentNullException(nameof(eventHubName));
 441            }
 442
 8443            using var message = CreateListByEventHubRequest(resourceGroupName, namespaceName, eventHubName, skip, top);
 8444            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 8445            switch (message.Response.Status)
 446            {
 447                case 200:
 448                    {
 8449                        ConsumerGroupListResult value = default;
 8450                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 8451                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 452                        {
 0453                            value = null;
 454                        }
 455                        else
 456                        {
 8457                            value = ConsumerGroupListResult.DeserializeConsumerGroupListResult(document.RootElement);
 458                        }
 8459                        return Response.FromValue(value, message.Response);
 460                    }
 461                default:
 0462                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 463            }
 8464        }
 465
 466        /// <summary> Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists
 467        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 468        /// <param name="namespaceName"> The Namespace name. </param>
 469        /// <param name="eventHubName"> The Event Hub name. </param>
 470        /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo
 471        /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
 472        /// <param name="cancellationToken"> The cancellation token to use. </param>
 473        public Response<ConsumerGroupListResult> ListByEventHub(string resourceGroupName, string namespaceName, string e
 474        {
 8475            if (resourceGroupName == null)
 476            {
 0477                throw new ArgumentNullException(nameof(resourceGroupName));
 478            }
 8479            if (namespaceName == null)
 480            {
 0481                throw new ArgumentNullException(nameof(namespaceName));
 482            }
 8483            if (eventHubName == null)
 484            {
 0485                throw new ArgumentNullException(nameof(eventHubName));
 486            }
 487
 8488            using var message = CreateListByEventHubRequest(resourceGroupName, namespaceName, eventHubName, skip, top);
 8489            _pipeline.Send(message, cancellationToken);
 8490            switch (message.Response.Status)
 491            {
 492                case 200:
 493                    {
 8494                        ConsumerGroupListResult value = default;
 8495                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 8496                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 497                        {
 0498                            value = null;
 499                        }
 500                        else
 501                        {
 8502                            value = ConsumerGroupListResult.DeserializeConsumerGroupListResult(document.RootElement);
 503                        }
 8504                        return Response.FromValue(value, message.Response);
 505                    }
 506                default:
 0507                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 508            }
 8509        }
 510
 511        internal HttpMessage CreateListByEventHubNextPageRequest(string nextLink, string resourceGroupName, string names
 512        {
 4513            var message = _pipeline.CreateMessage();
 4514            var request = message.Request;
 4515            request.Method = RequestMethod.Get;
 4516            var uri = new RawRequestUriBuilder();
 4517            uri.Reset(endpoint);
 4518            uri.AppendRawNextLink(nextLink, false);
 4519            request.Uri = uri;
 4520            return message;
 521        }
 522
 523        /// <summary> Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists
 524        /// <param name="nextLink"> The URL to the next page of results. </param>
 525        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 526        /// <param name="namespaceName"> The Namespace name. </param>
 527        /// <param name="eventHubName"> The Event Hub name. </param>
 528        /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo
 529        /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
 530        /// <param name="cancellationToken"> The cancellation token to use. </param>
 531        public async Task<Response<ConsumerGroupListResult>> ListByEventHubNextPageAsync(string nextLink, string resourc
 532        {
 2533            if (nextLink == null)
 534            {
 0535                throw new ArgumentNullException(nameof(nextLink));
 536            }
 2537            if (resourceGroupName == null)
 538            {
 0539                throw new ArgumentNullException(nameof(resourceGroupName));
 540            }
 2541            if (namespaceName == null)
 542            {
 0543                throw new ArgumentNullException(nameof(namespaceName));
 544            }
 2545            if (eventHubName == null)
 546            {
 0547                throw new ArgumentNullException(nameof(eventHubName));
 548            }
 549
 2550            using var message = CreateListByEventHubNextPageRequest(nextLink, resourceGroupName, namespaceName, eventHub
 2551            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2552            switch (message.Response.Status)
 553            {
 554                case 200:
 555                    {
 2556                        ConsumerGroupListResult value = default;
 2557                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2558                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 559                        {
 0560                            value = null;
 561                        }
 562                        else
 563                        {
 2564                            value = ConsumerGroupListResult.DeserializeConsumerGroupListResult(document.RootElement);
 565                        }
 2566                        return Response.FromValue(value, message.Response);
 567                    }
 568                default:
 0569                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 570            }
 2571        }
 572
 573        /// <summary> Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists
 574        /// <param name="nextLink"> The URL to the next page of results. </param>
 575        /// <param name="resourceGroupName"> Name of the resource group within the azure subscription. </param>
 576        /// <param name="namespaceName"> The Namespace name. </param>
 577        /// <param name="eventHubName"> The Event Hub name. </param>
 578        /// <param name="skip"> Skip is only used if a previous operation returned a partial result. If a previous respo
 579        /// <param name="top"> May be used to limit the number of results to the most recent N usageDetails. </param>
 580        /// <param name="cancellationToken"> The cancellation token to use. </param>
 581        public Response<ConsumerGroupListResult> ListByEventHubNextPage(string nextLink, string resourceGroupName, strin
 582        {
 2583            if (nextLink == null)
 584            {
 0585                throw new ArgumentNullException(nameof(nextLink));
 586            }
 2587            if (resourceGroupName == null)
 588            {
 0589                throw new ArgumentNullException(nameof(resourceGroupName));
 590            }
 2591            if (namespaceName == null)
 592            {
 0593                throw new ArgumentNullException(nameof(namespaceName));
 594            }
 2595            if (eventHubName == null)
 596            {
 0597                throw new ArgumentNullException(nameof(eventHubName));
 598            }
 599
 2600            using var message = CreateListByEventHubNextPageRequest(nextLink, resourceGroupName, namespaceName, eventHub
 2601            _pipeline.Send(message, cancellationToken);
 2602            switch (message.Response.Status)
 603            {
 604                case 200:
 605                    {
 2606                        ConsumerGroupListResult value = default;
 2607                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2608                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 609                        {
 0610                            value = null;
 611                        }
 612                        else
 613                        {
 2614                            value = ConsumerGroupListResult.DeserializeConsumerGroupListResult(document.RootElement);
 615                        }
 2616                        return Response.FromValue(value, message.Response);
 617                    }
 618                default:
 0619                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 620            }
 2621        }
 622    }
 623}