< Summary

Class:Azure.ResourceManager.Compute.GalleryImagesRestOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryImagesRestOperations.cs
Covered lines:155
Uncovered lines:127
Coverable lines:282
Total lines:627
Line coverage:54.9% (155 of 282)
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%
CreateGetRequest(...)-100%100%
GetAsync()-70.59%50%
Get(...)-70.59%50%
CreateDeleteRequest(...)-100%100%
DeleteAsync()-66.67%50%
Delete(...)-66.67%50%
CreateListByGalleryRequest(...)-100%100%
ListByGalleryAsync()-73.33%50%
ListByGallery(...)-73.33%50%
CreateListByGalleryNextPageRequest(...)-0%100%
ListByGalleryNextPageAsync()-0%0%
ListByGalleryNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryImagesRestOperations.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 GalleryImagesRestOperations
 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 GalleryImagesRestOperations. </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 GalleryImagesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscripti
 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 galleryName, string galleryIma
 47        {
 2448            var message = _pipeline.CreateMessage();
 2449            var request = message.Request;
 2450            request.Method = RequestMethod.Put;
 2451            var uri = new RawRequestUriBuilder();
 2452            uri.Reset(endpoint);
 2453            uri.AppendPath("/subscriptions/", false);
 2454            uri.AppendPath(subscriptionId, true);
 2455            uri.AppendPath("/resourceGroups/", false);
 2456            uri.AppendPath(resourceGroupName, true);
 2457            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 2458            uri.AppendPath(galleryName, true);
 2459            uri.AppendPath("/images/", false);
 2460            uri.AppendPath(galleryImageName, true);
 2461            uri.AppendQuery("api-version", "2019-12-01", true);
 2462            request.Uri = uri;
 2463            request.Headers.Add("Content-Type", "application/json");
 2464            var content = new Utf8JsonRequestContent();
 2465            content.JsonWriter.WriteObjectValue(galleryImage);
 2466            request.Content = content;
 2467            return message;
 68        }
 69
 70        /// <summary> Create or update a gallery Image Definition. </summary>
 71        /// <param name="resourceGroupName"> The name of the resource group. </param>
 72        /// <param name="galleryName"> The name of the Shared Image Gallery in which the Image Definition is to be creat
 73        /// <param name="galleryImageName"> The name of the gallery Image Definition to be created or updated. The allow
 74        /// <param name="galleryImage"> Parameters supplied to the create or update gallery image operation. </param>
 75        /// <param name="cancellationToken"> The cancellation token to use. </param>
 76        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string galleryName, string galleryImag
 77        {
 678            if (resourceGroupName == null)
 79            {
 080                throw new ArgumentNullException(nameof(resourceGroupName));
 81            }
 682            if (galleryName == null)
 83            {
 084                throw new ArgumentNullException(nameof(galleryName));
 85            }
 686            if (galleryImageName == null)
 87            {
 088                throw new ArgumentNullException(nameof(galleryImageName));
 89            }
 690            if (galleryImage == null)
 91            {
 092                throw new ArgumentNullException(nameof(galleryImage));
 93            }
 94
 695            using var message = CreateCreateOrUpdateRequest(resourceGroupName, galleryName, galleryImageName, galleryIma
 696            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 697            switch (message.Response.Status)
 98            {
 99                case 200:
 100                case 201:
 101                case 202:
 6102                    return message.Response;
 103                default:
 0104                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 105            }
 6106        }
 107
 108        /// <summary> Create or update a gallery Image Definition. </summary>
 109        /// <param name="resourceGroupName"> The name of the resource group. </param>
 110        /// <param name="galleryName"> The name of the Shared Image Gallery in which the Image Definition is to be creat
 111        /// <param name="galleryImageName"> The name of the gallery Image Definition to be created or updated. The allow
 112        /// <param name="galleryImage"> Parameters supplied to the create or update gallery image operation. </param>
 113        /// <param name="cancellationToken"> The cancellation token to use. </param>
 114        public Response CreateOrUpdate(string resourceGroupName, string galleryName, string galleryImageName, GalleryIma
 115        {
 6116            if (resourceGroupName == null)
 117            {
 0118                throw new ArgumentNullException(nameof(resourceGroupName));
 119            }
 6120            if (galleryName == null)
 121            {
 0122                throw new ArgumentNullException(nameof(galleryName));
 123            }
 6124            if (galleryImageName == null)
 125            {
 0126                throw new ArgumentNullException(nameof(galleryImageName));
 127            }
 6128            if (galleryImage == null)
 129            {
 0130                throw new ArgumentNullException(nameof(galleryImage));
 131            }
 132
 6133            using var message = CreateCreateOrUpdateRequest(resourceGroupName, galleryName, galleryImageName, galleryIma
 6134            _pipeline.Send(message, cancellationToken);
 6135            switch (message.Response.Status)
 136            {
 137                case 200:
 138                case 201:
 139                case 202:
 6140                    return message.Response;
 141                default:
 0142                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 143            }
 6144        }
 145
 146        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string galleryName, string galleryImageName, 
 147        {
 0148            var message = _pipeline.CreateMessage();
 0149            var request = message.Request;
 0150            request.Method = RequestMethod.Patch;
 0151            var uri = new RawRequestUriBuilder();
 0152            uri.Reset(endpoint);
 0153            uri.AppendPath("/subscriptions/", false);
 0154            uri.AppendPath(subscriptionId, true);
 0155            uri.AppendPath("/resourceGroups/", false);
 0156            uri.AppendPath(resourceGroupName, true);
 0157            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 0158            uri.AppendPath(galleryName, true);
 0159            uri.AppendPath("/images/", false);
 0160            uri.AppendPath(galleryImageName, true);
 0161            uri.AppendQuery("api-version", "2019-12-01", true);
 0162            request.Uri = uri;
 0163            request.Headers.Add("Content-Type", "application/json");
 0164            var content = new Utf8JsonRequestContent();
 0165            content.JsonWriter.WriteObjectValue(galleryImage);
 0166            request.Content = content;
 0167            return message;
 168        }
 169
 170        /// <summary> Update a gallery Image Definition. </summary>
 171        /// <param name="resourceGroupName"> The name of the resource group. </param>
 172        /// <param name="galleryName"> The name of the Shared Image Gallery in which the Image Definition is to be updat
 173        /// <param name="galleryImageName"> The name of the gallery Image Definition to be updated. The allowed characte
 174        /// <param name="galleryImage"> Parameters supplied to the update gallery image operation. </param>
 175        /// <param name="cancellationToken"> The cancellation token to use. </param>
 176        public async Task<Response> UpdateAsync(string resourceGroupName, string galleryName, string galleryImageName, G
 177        {
 0178            if (resourceGroupName == null)
 179            {
 0180                throw new ArgumentNullException(nameof(resourceGroupName));
 181            }
 0182            if (galleryName == null)
 183            {
 0184                throw new ArgumentNullException(nameof(galleryName));
 185            }
 0186            if (galleryImageName == null)
 187            {
 0188                throw new ArgumentNullException(nameof(galleryImageName));
 189            }
 0190            if (galleryImage == null)
 191            {
 0192                throw new ArgumentNullException(nameof(galleryImage));
 193            }
 194
 0195            using var message = CreateUpdateRequest(resourceGroupName, galleryName, galleryImageName, galleryImage);
 0196            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0197            switch (message.Response.Status)
 198            {
 199                case 200:
 0200                    return message.Response;
 201                default:
 0202                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 203            }
 0204        }
 205
 206        /// <summary> Update a gallery Image Definition. </summary>
 207        /// <param name="resourceGroupName"> The name of the resource group. </param>
 208        /// <param name="galleryName"> The name of the Shared Image Gallery in which the Image Definition is to be updat
 209        /// <param name="galleryImageName"> The name of the gallery Image Definition to be updated. The allowed characte
 210        /// <param name="galleryImage"> Parameters supplied to the update gallery image operation. </param>
 211        /// <param name="cancellationToken"> The cancellation token to use. </param>
 212        public Response Update(string resourceGroupName, string galleryName, string galleryImageName, GalleryImageUpdate
 213        {
 0214            if (resourceGroupName == null)
 215            {
 0216                throw new ArgumentNullException(nameof(resourceGroupName));
 217            }
 0218            if (galleryName == null)
 219            {
 0220                throw new ArgumentNullException(nameof(galleryName));
 221            }
 0222            if (galleryImageName == null)
 223            {
 0224                throw new ArgumentNullException(nameof(galleryImageName));
 225            }
 0226            if (galleryImage == null)
 227            {
 0228                throw new ArgumentNullException(nameof(galleryImage));
 229            }
 230
 0231            using var message = CreateUpdateRequest(resourceGroupName, galleryName, galleryImageName, galleryImage);
 0232            _pipeline.Send(message, cancellationToken);
 0233            switch (message.Response.Status)
 234            {
 235                case 200:
 0236                    return message.Response;
 237                default:
 0238                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 239            }
 0240        }
 241
 242        internal HttpMessage CreateGetRequest(string resourceGroupName, string galleryName, string galleryImageName)
 243        {
 8244            var message = _pipeline.CreateMessage();
 8245            var request = message.Request;
 8246            request.Method = RequestMethod.Get;
 8247            var uri = new RawRequestUriBuilder();
 8248            uri.Reset(endpoint);
 8249            uri.AppendPath("/subscriptions/", false);
 8250            uri.AppendPath(subscriptionId, true);
 8251            uri.AppendPath("/resourceGroups/", false);
 8252            uri.AppendPath(resourceGroupName, true);
 8253            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 8254            uri.AppendPath(galleryName, true);
 8255            uri.AppendPath("/images/", false);
 8256            uri.AppendPath(galleryImageName, true);
 8257            uri.AppendQuery("api-version", "2019-12-01", true);
 8258            request.Uri = uri;
 8259            return message;
 260        }
 261
 262        /// <summary> Retrieves information about a gallery Image Definition. </summary>
 263        /// <param name="resourceGroupName"> The name of the resource group. </param>
 264        /// <param name="galleryName"> The name of the Shared Image Gallery from which the Image Definitions are to be r
 265        /// <param name="galleryImageName"> The name of the gallery Image Definition to be retrieved. </param>
 266        /// <param name="cancellationToken"> The cancellation token to use. </param>
 267        public async Task<Response<GalleryImage>> GetAsync(string resourceGroupName, string galleryName, string galleryI
 268        {
 4269            if (resourceGroupName == null)
 270            {
 0271                throw new ArgumentNullException(nameof(resourceGroupName));
 272            }
 4273            if (galleryName == null)
 274            {
 0275                throw new ArgumentNullException(nameof(galleryName));
 276            }
 4277            if (galleryImageName == null)
 278            {
 0279                throw new ArgumentNullException(nameof(galleryImageName));
 280            }
 281
 4282            using var message = CreateGetRequest(resourceGroupName, galleryName, galleryImageName);
 4283            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4284            switch (message.Response.Status)
 285            {
 286                case 200:
 287                    {
 4288                        GalleryImage value = default;
 4289                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4290                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 291                        {
 0292                            value = null;
 293                        }
 294                        else
 295                        {
 4296                            value = GalleryImage.DeserializeGalleryImage(document.RootElement);
 297                        }
 4298                        return Response.FromValue(value, message.Response);
 299                    }
 300                default:
 0301                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 302            }
 4303        }
 304
 305        /// <summary> Retrieves information about a gallery Image Definition. </summary>
 306        /// <param name="resourceGroupName"> The name of the resource group. </param>
 307        /// <param name="galleryName"> The name of the Shared Image Gallery from which the Image Definitions are to be r
 308        /// <param name="galleryImageName"> The name of the gallery Image Definition to be retrieved. </param>
 309        /// <param name="cancellationToken"> The cancellation token to use. </param>
 310        public Response<GalleryImage> Get(string resourceGroupName, string galleryName, string galleryImageName, Cancell
 311        {
 4312            if (resourceGroupName == null)
 313            {
 0314                throw new ArgumentNullException(nameof(resourceGroupName));
 315            }
 4316            if (galleryName == null)
 317            {
 0318                throw new ArgumentNullException(nameof(galleryName));
 319            }
 4320            if (galleryImageName == null)
 321            {
 0322                throw new ArgumentNullException(nameof(galleryImageName));
 323            }
 324
 4325            using var message = CreateGetRequest(resourceGroupName, galleryName, galleryImageName);
 4326            _pipeline.Send(message, cancellationToken);
 4327            switch (message.Response.Status)
 328            {
 329                case 200:
 330                    {
 4331                        GalleryImage value = default;
 4332                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4333                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 334                        {
 0335                            value = null;
 336                        }
 337                        else
 338                        {
 4339                            value = GalleryImage.DeserializeGalleryImage(document.RootElement);
 340                        }
 4341                        return Response.FromValue(value, message.Response);
 342                    }
 343                default:
 0344                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 345            }
 4346        }
 347
 348        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string galleryName, string galleryImageName)
 349        {
 16350            var message = _pipeline.CreateMessage();
 16351            var request = message.Request;
 16352            request.Method = RequestMethod.Delete;
 16353            var uri = new RawRequestUriBuilder();
 16354            uri.Reset(endpoint);
 16355            uri.AppendPath("/subscriptions/", false);
 16356            uri.AppendPath(subscriptionId, true);
 16357            uri.AppendPath("/resourceGroups/", false);
 16358            uri.AppendPath(resourceGroupName, true);
 16359            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 16360            uri.AppendPath(galleryName, true);
 16361            uri.AppendPath("/images/", false);
 16362            uri.AppendPath(galleryImageName, true);
 16363            uri.AppendQuery("api-version", "2019-12-01", true);
 16364            request.Uri = uri;
 16365            return message;
 366        }
 367
 368        /// <summary> Delete a gallery image. </summary>
 369        /// <param name="resourceGroupName"> The name of the resource group. </param>
 370        /// <param name="galleryName"> The name of the Shared Image Gallery in which the Image Definition is to be delet
 371        /// <param name="galleryImageName"> The name of the gallery Image Definition to be deleted. </param>
 372        /// <param name="cancellationToken"> The cancellation token to use. </param>
 373        public async Task<Response> DeleteAsync(string resourceGroupName, string galleryName, string galleryImageName, C
 374        {
 4375            if (resourceGroupName == null)
 376            {
 0377                throw new ArgumentNullException(nameof(resourceGroupName));
 378            }
 4379            if (galleryName == null)
 380            {
 0381                throw new ArgumentNullException(nameof(galleryName));
 382            }
 4383            if (galleryImageName == null)
 384            {
 0385                throw new ArgumentNullException(nameof(galleryImageName));
 386            }
 387
 4388            using var message = CreateDeleteRequest(resourceGroupName, galleryName, galleryImageName);
 4389            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4390            switch (message.Response.Status)
 391            {
 392                case 200:
 393                case 202:
 394                case 204:
 4395                    return message.Response;
 396                default:
 0397                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 398            }
 4399        }
 400
 401        /// <summary> Delete a gallery image. </summary>
 402        /// <param name="resourceGroupName"> The name of the resource group. </param>
 403        /// <param name="galleryName"> The name of the Shared Image Gallery in which the Image Definition is to be delet
 404        /// <param name="galleryImageName"> The name of the gallery Image Definition to be deleted. </param>
 405        /// <param name="cancellationToken"> The cancellation token to use. </param>
 406        public Response Delete(string resourceGroupName, string galleryName, string galleryImageName, CancellationToken 
 407        {
 4408            if (resourceGroupName == null)
 409            {
 0410                throw new ArgumentNullException(nameof(resourceGroupName));
 411            }
 4412            if (galleryName == null)
 413            {
 0414                throw new ArgumentNullException(nameof(galleryName));
 415            }
 4416            if (galleryImageName == null)
 417            {
 0418                throw new ArgumentNullException(nameof(galleryImageName));
 419            }
 420
 4421            using var message = CreateDeleteRequest(resourceGroupName, galleryName, galleryImageName);
 4422            _pipeline.Send(message, cancellationToken);
 4423            switch (message.Response.Status)
 424            {
 425                case 200:
 426                case 202:
 427                case 204:
 4428                    return message.Response;
 429                default:
 0430                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 431            }
 4432        }
 433
 434        internal HttpMessage CreateListByGalleryRequest(string resourceGroupName, string galleryName)
 435        {
 8436            var message = _pipeline.CreateMessage();
 8437            var request = message.Request;
 8438            request.Method = RequestMethod.Get;
 8439            var uri = new RawRequestUriBuilder();
 8440            uri.Reset(endpoint);
 8441            uri.AppendPath("/subscriptions/", false);
 8442            uri.AppendPath(subscriptionId, true);
 8443            uri.AppendPath("/resourceGroups/", false);
 8444            uri.AppendPath(resourceGroupName, true);
 8445            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 8446            uri.AppendPath(galleryName, true);
 8447            uri.AppendPath("/images", false);
 8448            uri.AppendQuery("api-version", "2019-12-01", true);
 8449            request.Uri = uri;
 8450            return message;
 451        }
 452
 453        /// <summary> List gallery Image Definitions in a gallery. </summary>
 454        /// <param name="resourceGroupName"> The name of the resource group. </param>
 455        /// <param name="galleryName"> The name of the Shared Image Gallery from which Image Definitions are to be liste
 456        /// <param name="cancellationToken"> The cancellation token to use. </param>
 457        public async Task<Response<GalleryImageList>> ListByGalleryAsync(string resourceGroupName, string galleryName, C
 458        {
 4459            if (resourceGroupName == null)
 460            {
 0461                throw new ArgumentNullException(nameof(resourceGroupName));
 462            }
 4463            if (galleryName == null)
 464            {
 0465                throw new ArgumentNullException(nameof(galleryName));
 466            }
 467
 4468            using var message = CreateListByGalleryRequest(resourceGroupName, galleryName);
 4469            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4470            switch (message.Response.Status)
 471            {
 472                case 200:
 473                    {
 4474                        GalleryImageList value = default;
 4475                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 4476                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 477                        {
 0478                            value = null;
 479                        }
 480                        else
 481                        {
 4482                            value = GalleryImageList.DeserializeGalleryImageList(document.RootElement);
 483                        }
 4484                        return Response.FromValue(value, message.Response);
 485                    }
 486                default:
 0487                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 488            }
 4489        }
 490
 491        /// <summary> List gallery Image Definitions in a gallery. </summary>
 492        /// <param name="resourceGroupName"> The name of the resource group. </param>
 493        /// <param name="galleryName"> The name of the Shared Image Gallery from which Image Definitions are to be liste
 494        /// <param name="cancellationToken"> The cancellation token to use. </param>
 495        public Response<GalleryImageList> ListByGallery(string resourceGroupName, string galleryName, CancellationToken 
 496        {
 4497            if (resourceGroupName == null)
 498            {
 0499                throw new ArgumentNullException(nameof(resourceGroupName));
 500            }
 4501            if (galleryName == null)
 502            {
 0503                throw new ArgumentNullException(nameof(galleryName));
 504            }
 505
 4506            using var message = CreateListByGalleryRequest(resourceGroupName, galleryName);
 4507            _pipeline.Send(message, cancellationToken);
 4508            switch (message.Response.Status)
 509            {
 510                case 200:
 511                    {
 4512                        GalleryImageList value = default;
 4513                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 4514                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 515                        {
 0516                            value = null;
 517                        }
 518                        else
 519                        {
 4520                            value = GalleryImageList.DeserializeGalleryImageList(document.RootElement);
 521                        }
 4522                        return Response.FromValue(value, message.Response);
 523                    }
 524                default:
 0525                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 526            }
 4527        }
 528
 529        internal HttpMessage CreateListByGalleryNextPageRequest(string nextLink, string resourceGroupName, string galler
 530        {
 0531            var message = _pipeline.CreateMessage();
 0532            var request = message.Request;
 0533            request.Method = RequestMethod.Get;
 0534            var uri = new RawRequestUriBuilder();
 0535            uri.Reset(endpoint);
 0536            uri.AppendRawNextLink(nextLink, false);
 0537            request.Uri = uri;
 0538            return message;
 539        }
 540
 541        /// <summary> List gallery Image Definitions in a gallery. </summary>
 542        /// <param name="nextLink"> The URL to the next page of results. </param>
 543        /// <param name="resourceGroupName"> The name of the resource group. </param>
 544        /// <param name="galleryName"> The name of the Shared Image Gallery from which Image Definitions are to be liste
 545        /// <param name="cancellationToken"> The cancellation token to use. </param>
 546        public async Task<Response<GalleryImageList>> ListByGalleryNextPageAsync(string nextLink, string resourceGroupNa
 547        {
 0548            if (nextLink == null)
 549            {
 0550                throw new ArgumentNullException(nameof(nextLink));
 551            }
 0552            if (resourceGroupName == null)
 553            {
 0554                throw new ArgumentNullException(nameof(resourceGroupName));
 555            }
 0556            if (galleryName == null)
 557            {
 0558                throw new ArgumentNullException(nameof(galleryName));
 559            }
 560
 0561            using var message = CreateListByGalleryNextPageRequest(nextLink, resourceGroupName, galleryName);
 0562            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0563            switch (message.Response.Status)
 564            {
 565                case 200:
 566                    {
 0567                        GalleryImageList value = default;
 0568                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0569                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 570                        {
 0571                            value = null;
 572                        }
 573                        else
 574                        {
 0575                            value = GalleryImageList.DeserializeGalleryImageList(document.RootElement);
 576                        }
 0577                        return Response.FromValue(value, message.Response);
 578                    }
 579                default:
 0580                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 581            }
 0582        }
 583
 584        /// <summary> List gallery Image Definitions in a gallery. </summary>
 585        /// <param name="nextLink"> The URL to the next page of results. </param>
 586        /// <param name="resourceGroupName"> The name of the resource group. </param>
 587        /// <param name="galleryName"> The name of the Shared Image Gallery from which Image Definitions are to be liste
 588        /// <param name="cancellationToken"> The cancellation token to use. </param>
 589        public Response<GalleryImageList> ListByGalleryNextPage(string nextLink, string resourceGroupName, string galler
 590        {
 0591            if (nextLink == null)
 592            {
 0593                throw new ArgumentNullException(nameof(nextLink));
 594            }
 0595            if (resourceGroupName == null)
 596            {
 0597                throw new ArgumentNullException(nameof(resourceGroupName));
 598            }
 0599            if (galleryName == null)
 600            {
 0601                throw new ArgumentNullException(nameof(galleryName));
 602            }
 603
 0604            using var message = CreateListByGalleryNextPageRequest(nextLink, resourceGroupName, galleryName);
 0605            _pipeline.Send(message, cancellationToken);
 0606            switch (message.Response.Status)
 607            {
 608                case 200:
 609                    {
 0610                        GalleryImageList value = default;
 0611                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0612                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 613                        {
 0614                            value = null;
 615                        }
 616                        else
 617                        {
 0618                            value = GalleryImageList.DeserializeGalleryImageList(document.RootElement);
 619                        }
 0620                        return Response.FromValue(value, message.Response);
 621                    }
 622                default:
 0623                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 624            }
 0625        }
 626    }
 627}