< Summary

Class:Azure.ResourceManager.Compute.DedicatedHostsRestOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\DedicatedHostsRestOperations.cs
Covered lines:156
Uncovered lines:127
Coverable lines:283
Total lines:626
Line coverage:55.1% (156 of 283)
Covered branches:42
Total branches:124
Branch coverage:33.8% (42 of 124)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateCreateOrUpdateRequest(...)-100%100%
CreateOrUpdateAsync()-64.29%50%
CreateOrUpdate(...)-64.29%50%
CreateUpdateRequest(...)-0%100%
UpdateAsync()-0%0%
Update(...)-0%0%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-66.67%50%
Delete(...)-66.67%50%
CreateGetRequest(...)-100%100%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateListByHostGroupRequest(...)-100%100%
ListByHostGroupAsync()-73.33%50%
ListByHostGroup(...)-73.33%50%
CreateListByHostGroupNextPageRequest(...)-0%100%
ListByHostGroupNextPageAsync()-0%0%
ListByHostGroupNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\DedicatedHostsRestOperations.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.Compute.Models;
 16
 17namespace Azure.ResourceManager.Compute
 18{
 19    internal partial class DedicatedHostsRestOperations
 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 DedicatedHostsRestOperations. </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 which uniquely identify 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
 39632        public DedicatedHostsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscript
 33        {
 39634            if (subscriptionId == null)
 35            {
 036                throw new ArgumentNullException(nameof(subscriptionId));
 37            }
 39638            endpoint ??= new Uri("https://management.azure.com");
 39
 39640            this.subscriptionId = subscriptionId;
 39641            this.endpoint = endpoint;
 39642            _clientDiagnostics = clientDiagnostics;
 39643            _pipeline = pipeline;
 39644        }
 45
 46        internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string hostGroupName, string hostName
 47        {
 848            var message = _pipeline.CreateMessage();
 849            var request = message.Request;
 850            request.Method = RequestMethod.Put;
 851            var uri = new RawRequestUriBuilder();
 852            uri.Reset(endpoint);
 853            uri.AppendPath("/subscriptions/", false);
 854            uri.AppendPath(subscriptionId, true);
 855            uri.AppendPath("/resourceGroups/", false);
 856            uri.AppendPath(resourceGroupName, true);
 857            uri.AppendPath("/providers/Microsoft.Compute/hostGroups/", false);
 858            uri.AppendPath(hostGroupName, true);
 859            uri.AppendPath("/hosts/", false);
 860            uri.AppendPath(hostName, true);
 861            uri.AppendQuery("api-version", "2019-12-01", true);
 862            request.Uri = uri;
 863            request.Headers.Add("Content-Type", "application/json");
 864            var content = new Utf8JsonRequestContent();
 865            content.JsonWriter.WriteObjectValue(parameters);
 866            request.Content = content;
 867            return message;
 68        }
 69
 70        /// <summary> Create or update a dedicated host . </summary>
 71        /// <param name="resourceGroupName"> The name of the resource group. </param>
 72        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 73        /// <param name="hostName"> The name of the dedicated host . </param>
 74        /// <param name="parameters"> Parameters supplied to the Create Dedicated Host. </param>
 75        /// <param name="cancellationToken"> The cancellation token to use. </param>
 76        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string hostGroupName, string hostName,
 77        {
 278            if (resourceGroupName == null)
 79            {
 080                throw new ArgumentNullException(nameof(resourceGroupName));
 81            }
 282            if (hostGroupName == null)
 83            {
 084                throw new ArgumentNullException(nameof(hostGroupName));
 85            }
 286            if (hostName == null)
 87            {
 088                throw new ArgumentNullException(nameof(hostName));
 89            }
 290            if (parameters == null)
 91            {
 092                throw new ArgumentNullException(nameof(parameters));
 93            }
 94
 295            using var message = CreateCreateOrUpdateRequest(resourceGroupName, hostGroupName, hostName, parameters);
 296            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 297            switch (message.Response.Status)
 98            {
 99                case 200:
 100                case 201:
 2101                    return message.Response;
 102                default:
 0103                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 104            }
 2105        }
 106
 107        /// <summary> Create or update a dedicated host . </summary>
 108        /// <param name="resourceGroupName"> The name of the resource group. </param>
 109        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 110        /// <param name="hostName"> The name of the dedicated host . </param>
 111        /// <param name="parameters"> Parameters supplied to the Create Dedicated Host. </param>
 112        /// <param name="cancellationToken"> The cancellation token to use. </param>
 113        public Response CreateOrUpdate(string resourceGroupName, string hostGroupName, string hostName, DedicatedHost pa
 114        {
 2115            if (resourceGroupName == null)
 116            {
 0117                throw new ArgumentNullException(nameof(resourceGroupName));
 118            }
 2119            if (hostGroupName == null)
 120            {
 0121                throw new ArgumentNullException(nameof(hostGroupName));
 122            }
 2123            if (hostName == null)
 124            {
 0125                throw new ArgumentNullException(nameof(hostName));
 126            }
 2127            if (parameters == null)
 128            {
 0129                throw new ArgumentNullException(nameof(parameters));
 130            }
 131
 2132            using var message = CreateCreateOrUpdateRequest(resourceGroupName, hostGroupName, hostName, parameters);
 2133            _pipeline.Send(message, cancellationToken);
 2134            switch (message.Response.Status)
 135            {
 136                case 200:
 137                case 201:
 2138                    return message.Response;
 139                default:
 0140                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 141            }
 2142        }
 143
 144        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string hostGroupName, string hostName, Dedica
 145        {
 0146            var message = _pipeline.CreateMessage();
 0147            var request = message.Request;
 0148            request.Method = RequestMethod.Patch;
 0149            var uri = new RawRequestUriBuilder();
 0150            uri.Reset(endpoint);
 0151            uri.AppendPath("/subscriptions/", false);
 0152            uri.AppendPath(subscriptionId, true);
 0153            uri.AppendPath("/resourceGroups/", false);
 0154            uri.AppendPath(resourceGroupName, true);
 0155            uri.AppendPath("/providers/Microsoft.Compute/hostGroups/", false);
 0156            uri.AppendPath(hostGroupName, true);
 0157            uri.AppendPath("/hosts/", false);
 0158            uri.AppendPath(hostName, true);
 0159            uri.AppendQuery("api-version", "2019-12-01", true);
 0160            request.Uri = uri;
 0161            request.Headers.Add("Content-Type", "application/json");
 0162            var content = new Utf8JsonRequestContent();
 0163            content.JsonWriter.WriteObjectValue(parameters);
 0164            request.Content = content;
 0165            return message;
 166        }
 167
 168        /// <summary> Update an dedicated host . </summary>
 169        /// <param name="resourceGroupName"> The name of the resource group. </param>
 170        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 171        /// <param name="hostName"> The name of the dedicated host . </param>
 172        /// <param name="parameters"> Parameters supplied to the Update Dedicated Host operation. </param>
 173        /// <param name="cancellationToken"> The cancellation token to use. </param>
 174        public async Task<Response> UpdateAsync(string resourceGroupName, string hostGroupName, string hostName, Dedicat
 175        {
 0176            if (resourceGroupName == null)
 177            {
 0178                throw new ArgumentNullException(nameof(resourceGroupName));
 179            }
 0180            if (hostGroupName == null)
 181            {
 0182                throw new ArgumentNullException(nameof(hostGroupName));
 183            }
 0184            if (hostName == null)
 185            {
 0186                throw new ArgumentNullException(nameof(hostName));
 187            }
 0188            if (parameters == null)
 189            {
 0190                throw new ArgumentNullException(nameof(parameters));
 191            }
 192
 0193            using var message = CreateUpdateRequest(resourceGroupName, hostGroupName, hostName, parameters);
 0194            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0195            switch (message.Response.Status)
 196            {
 197                case 200:
 0198                    return message.Response;
 199                default:
 0200                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 201            }
 0202        }
 203
 204        /// <summary> Update an dedicated host . </summary>
 205        /// <param name="resourceGroupName"> The name of the resource group. </param>
 206        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 207        /// <param name="hostName"> The name of the dedicated host . </param>
 208        /// <param name="parameters"> Parameters supplied to the Update Dedicated Host operation. </param>
 209        /// <param name="cancellationToken"> The cancellation token to use. </param>
 210        public Response Update(string resourceGroupName, string hostGroupName, string hostName, DedicatedHostUpdate para
 211        {
 0212            if (resourceGroupName == null)
 213            {
 0214                throw new ArgumentNullException(nameof(resourceGroupName));
 215            }
 0216            if (hostGroupName == null)
 217            {
 0218                throw new ArgumentNullException(nameof(hostGroupName));
 219            }
 0220            if (hostName == null)
 221            {
 0222                throw new ArgumentNullException(nameof(hostName));
 223            }
 0224            if (parameters == null)
 225            {
 0226                throw new ArgumentNullException(nameof(parameters));
 227            }
 228
 0229            using var message = CreateUpdateRequest(resourceGroupName, hostGroupName, hostName, parameters);
 0230            _pipeline.Send(message, cancellationToken);
 0231            switch (message.Response.Status)
 232            {
 233                case 200:
 0234                    return message.Response;
 235                default:
 0236                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 237            }
 0238        }
 239
 240        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string hostGroupName, string hostName)
 241        {
 8242            var message = _pipeline.CreateMessage();
 8243            var request = message.Request;
 8244            request.Method = RequestMethod.Delete;
 8245            var uri = new RawRequestUriBuilder();
 8246            uri.Reset(endpoint);
 8247            uri.AppendPath("/subscriptions/", false);
 8248            uri.AppendPath(subscriptionId, true);
 8249            uri.AppendPath("/resourceGroups/", false);
 8250            uri.AppendPath(resourceGroupName, true);
 8251            uri.AppendPath("/providers/Microsoft.Compute/hostGroups/", false);
 8252            uri.AppendPath(hostGroupName, true);
 8253            uri.AppendPath("/hosts/", false);
 8254            uri.AppendPath(hostName, true);
 8255            uri.AppendQuery("api-version", "2019-12-01", true);
 8256            request.Uri = uri;
 8257            return message;
 258        }
 259
 260        /// <summary> Delete a dedicated host. </summary>
 261        /// <param name="resourceGroupName"> The name of the resource group. </param>
 262        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 263        /// <param name="hostName"> The name of the dedicated host. </param>
 264        /// <param name="cancellationToken"> The cancellation token to use. </param>
 265        public async Task<Response> DeleteAsync(string resourceGroupName, string hostGroupName, string hostName, Cancell
 266        {
 2267            if (resourceGroupName == null)
 268            {
 0269                throw new ArgumentNullException(nameof(resourceGroupName));
 270            }
 2271            if (hostGroupName == null)
 272            {
 0273                throw new ArgumentNullException(nameof(hostGroupName));
 274            }
 2275            if (hostName == null)
 276            {
 0277                throw new ArgumentNullException(nameof(hostName));
 278            }
 279
 2280            using var message = CreateDeleteRequest(resourceGroupName, hostGroupName, hostName);
 2281            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2282            switch (message.Response.Status)
 283            {
 284                case 200:
 285                case 202:
 286                case 204:
 2287                    return message.Response;
 288                default:
 0289                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 290            }
 2291        }
 292
 293        /// <summary> Delete a dedicated host. </summary>
 294        /// <param name="resourceGroupName"> The name of the resource group. </param>
 295        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 296        /// <param name="hostName"> The name of the dedicated host. </param>
 297        /// <param name="cancellationToken"> The cancellation token to use. </param>
 298        public Response Delete(string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancel
 299        {
 2300            if (resourceGroupName == null)
 301            {
 0302                throw new ArgumentNullException(nameof(resourceGroupName));
 303            }
 2304            if (hostGroupName == null)
 305            {
 0306                throw new ArgumentNullException(nameof(hostGroupName));
 307            }
 2308            if (hostName == null)
 309            {
 0310                throw new ArgumentNullException(nameof(hostName));
 311            }
 312
 2313            using var message = CreateDeleteRequest(resourceGroupName, hostGroupName, hostName);
 2314            _pipeline.Send(message, cancellationToken);
 2315            switch (message.Response.Status)
 316            {
 317                case 200:
 318                case 202:
 319                case 204:
 2320                    return message.Response;
 321                default:
 0322                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 323            }
 2324        }
 325
 326        internal HttpMessage CreateGetRequest(string resourceGroupName, string hostGroupName, string hostName)
 327        {
 4328            var message = _pipeline.CreateMessage();
 4329            var request = message.Request;
 4330            request.Method = RequestMethod.Get;
 4331            var uri = new RawRequestUriBuilder();
 4332            uri.Reset(endpoint);
 4333            uri.AppendPath("/subscriptions/", false);
 4334            uri.AppendPath(subscriptionId, true);
 4335            uri.AppendPath("/resourceGroups/", false);
 4336            uri.AppendPath(resourceGroupName, true);
 4337            uri.AppendPath("/providers/Microsoft.Compute/hostGroups/", false);
 4338            uri.AppendPath(hostGroupName, true);
 4339            uri.AppendPath("/hosts/", false);
 4340            uri.AppendPath(hostName, true);
 4341            uri.AppendQuery("$expand", "instanceView", true);
 4342            uri.AppendQuery("api-version", "2019-12-01", true);
 4343            request.Uri = uri;
 4344            return message;
 345        }
 346
 347        /// <summary> Retrieves information about a dedicated host. </summary>
 348        /// <param name="resourceGroupName"> The name of the resource group. </param>
 349        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 350        /// <param name="hostName"> The name of the dedicated host. </param>
 351        /// <param name="cancellationToken"> The cancellation token to use. </param>
 352        public async Task<Response<DedicatedHost>> GetAsync(string resourceGroupName, string hostGroupName, string hostN
 353        {
 2354            if (resourceGroupName == null)
 355            {
 0356                throw new ArgumentNullException(nameof(resourceGroupName));
 357            }
 2358            if (hostGroupName == null)
 359            {
 0360                throw new ArgumentNullException(nameof(hostGroupName));
 361            }
 2362            if (hostName == null)
 363            {
 0364                throw new ArgumentNullException(nameof(hostName));
 365            }
 366
 2367            using var message = CreateGetRequest(resourceGroupName, hostGroupName, hostName);
 2368            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2369            switch (message.Response.Status)
 370            {
 371                case 200:
 372                    {
 2373                        DedicatedHost value = default;
 2374                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2375                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 376                        {
 0377                            value = null;
 378                        }
 379                        else
 380                        {
 2381                            value = DedicatedHost.DeserializeDedicatedHost(document.RootElement);
 382                        }
 2383                        return Response.FromValue(value, message.Response);
 384                    }
 385                default:
 0386                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 387            }
 2388        }
 389
 390        /// <summary> Retrieves information about a dedicated host. </summary>
 391        /// <param name="resourceGroupName"> The name of the resource group. </param>
 392        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 393        /// <param name="hostName"> The name of the dedicated host. </param>
 394        /// <param name="cancellationToken"> The cancellation token to use. </param>
 395        public Response<DedicatedHost> Get(string resourceGroupName, string hostGroupName, string hostName, Cancellation
 396        {
 2397            if (resourceGroupName == null)
 398            {
 0399                throw new ArgumentNullException(nameof(resourceGroupName));
 400            }
 2401            if (hostGroupName == null)
 402            {
 0403                throw new ArgumentNullException(nameof(hostGroupName));
 404            }
 2405            if (hostName == null)
 406            {
 0407                throw new ArgumentNullException(nameof(hostName));
 408            }
 409
 2410            using var message = CreateGetRequest(resourceGroupName, hostGroupName, hostName);
 2411            _pipeline.Send(message, cancellationToken);
 2412            switch (message.Response.Status)
 413            {
 414                case 200:
 415                    {
 2416                        DedicatedHost value = default;
 2417                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2418                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 419                        {
 0420                            value = null;
 421                        }
 422                        else
 423                        {
 2424                            value = DedicatedHost.DeserializeDedicatedHost(document.RootElement);
 425                        }
 2426                        return Response.FromValue(value, message.Response);
 427                    }
 428                default:
 0429                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 430            }
 2431        }
 432
 433        internal HttpMessage CreateListByHostGroupRequest(string resourceGroupName, string hostGroupName)
 434        {
 4435            var message = _pipeline.CreateMessage();
 4436            var request = message.Request;
 4437            request.Method = RequestMethod.Get;
 4438            var uri = new RawRequestUriBuilder();
 4439            uri.Reset(endpoint);
 4440            uri.AppendPath("/subscriptions/", false);
 4441            uri.AppendPath(subscriptionId, true);
 4442            uri.AppendPath("/resourceGroups/", false);
 4443            uri.AppendPath(resourceGroupName, true);
 4444            uri.AppendPath("/providers/Microsoft.Compute/hostGroups/", false);
 4445            uri.AppendPath(hostGroupName, true);
 4446            uri.AppendPath("/hosts", false);
 4447            uri.AppendQuery("api-version", "2019-12-01", true);
 4448            request.Uri = uri;
 4449            return message;
 450        }
 451
 452        /// <summary> Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property 
 453        /// <param name="resourceGroupName"> The name of the resource group. </param>
 454        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 455        /// <param name="cancellationToken"> The cancellation token to use. </param>
 456        public async Task<Response<DedicatedHostListResult>> ListByHostGroupAsync(string resourceGroupName, string hostG
 457        {
 2458            if (resourceGroupName == null)
 459            {
 0460                throw new ArgumentNullException(nameof(resourceGroupName));
 461            }
 2462            if (hostGroupName == null)
 463            {
 0464                throw new ArgumentNullException(nameof(hostGroupName));
 465            }
 466
 2467            using var message = CreateListByHostGroupRequest(resourceGroupName, hostGroupName);
 2468            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2469            switch (message.Response.Status)
 470            {
 471                case 200:
 472                    {
 2473                        DedicatedHostListResult value = default;
 2474                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 2475                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 476                        {
 0477                            value = null;
 478                        }
 479                        else
 480                        {
 2481                            value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement);
 482                        }
 2483                        return Response.FromValue(value, message.Response);
 484                    }
 485                default:
 0486                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 487            }
 2488        }
 489
 490        /// <summary> Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property 
 491        /// <param name="resourceGroupName"> The name of the resource group. </param>
 492        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 493        /// <param name="cancellationToken"> The cancellation token to use. </param>
 494        public Response<DedicatedHostListResult> ListByHostGroup(string resourceGroupName, string hostGroupName, Cancell
 495        {
 2496            if (resourceGroupName == null)
 497            {
 0498                throw new ArgumentNullException(nameof(resourceGroupName));
 499            }
 2500            if (hostGroupName == null)
 501            {
 0502                throw new ArgumentNullException(nameof(hostGroupName));
 503            }
 504
 2505            using var message = CreateListByHostGroupRequest(resourceGroupName, hostGroupName);
 2506            _pipeline.Send(message, cancellationToken);
 2507            switch (message.Response.Status)
 508            {
 509                case 200:
 510                    {
 2511                        DedicatedHostListResult value = default;
 2512                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 2513                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 514                        {
 0515                            value = null;
 516                        }
 517                        else
 518                        {
 2519                            value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement);
 520                        }
 2521                        return Response.FromValue(value, message.Response);
 522                    }
 523                default:
 0524                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 525            }
 2526        }
 527
 528        internal HttpMessage CreateListByHostGroupNextPageRequest(string nextLink, string resourceGroupName, string host
 529        {
 0530            var message = _pipeline.CreateMessage();
 0531            var request = message.Request;
 0532            request.Method = RequestMethod.Get;
 0533            var uri = new RawRequestUriBuilder();
 0534            uri.Reset(endpoint);
 0535            uri.AppendRawNextLink(nextLink, false);
 0536            request.Uri = uri;
 0537            return message;
 538        }
 539
 540        /// <summary> Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property 
 541        /// <param name="nextLink"> The URL to the next page of results. </param>
 542        /// <param name="resourceGroupName"> The name of the resource group. </param>
 543        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 544        /// <param name="cancellationToken"> The cancellation token to use. </param>
 545        public async Task<Response<DedicatedHostListResult>> ListByHostGroupNextPageAsync(string nextLink, string resour
 546        {
 0547            if (nextLink == null)
 548            {
 0549                throw new ArgumentNullException(nameof(nextLink));
 550            }
 0551            if (resourceGroupName == null)
 552            {
 0553                throw new ArgumentNullException(nameof(resourceGroupName));
 554            }
 0555            if (hostGroupName == null)
 556            {
 0557                throw new ArgumentNullException(nameof(hostGroupName));
 558            }
 559
 0560            using var message = CreateListByHostGroupNextPageRequest(nextLink, resourceGroupName, hostGroupName);
 0561            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0562            switch (message.Response.Status)
 563            {
 564                case 200:
 565                    {
 0566                        DedicatedHostListResult value = default;
 0567                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0568                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 569                        {
 0570                            value = null;
 571                        }
 572                        else
 573                        {
 0574                            value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement);
 575                        }
 0576                        return Response.FromValue(value, message.Response);
 577                    }
 578                default:
 0579                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 580            }
 0581        }
 582
 583        /// <summary> Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property 
 584        /// <param name="nextLink"> The URL to the next page of results. </param>
 585        /// <param name="resourceGroupName"> The name of the resource group. </param>
 586        /// <param name="hostGroupName"> The name of the dedicated host group. </param>
 587        /// <param name="cancellationToken"> The cancellation token to use. </param>
 588        public Response<DedicatedHostListResult> ListByHostGroupNextPage(string nextLink, string resourceGroupName, stri
 589        {
 0590            if (nextLink == null)
 591            {
 0592                throw new ArgumentNullException(nameof(nextLink));
 593            }
 0594            if (resourceGroupName == null)
 595            {
 0596                throw new ArgumentNullException(nameof(resourceGroupName));
 597            }
 0598            if (hostGroupName == null)
 599            {
 0600                throw new ArgumentNullException(nameof(hostGroupName));
 601            }
 602
 0603            using var message = CreateListByHostGroupNextPageRequest(nextLink, resourceGroupName, hostGroupName);
 0604            _pipeline.Send(message, cancellationToken);
 0605            switch (message.Response.Status)
 606            {
 607                case 200:
 608                    {
 0609                        DedicatedHostListResult value = default;
 0610                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0611                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 612                        {
 0613                            value = null;
 614                        }
 615                        else
 616                        {
 0617                            value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement);
 618                        }
 0619                        return Response.FromValue(value, message.Response);
 620                    }
 621                default:
 0622                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 623            }
 0624        }
 625    }
 626}