< Summary

Class:Azure.ResourceManager.Compute.GalleryApplicationsRestOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryApplicationsRestOperations.cs
Covered lines:118
Uncovered lines:164
Coverable lines:282
Total lines:627
Line coverage:41.8% (118 of 282)
Covered branches:34
Total branches:124
Branch coverage:27.4% (34 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(...)-0%100%
ListByGalleryAsync()-0%0%
ListByGallery(...)-0%0%
CreateListByGalleryNextPageRequest(...)-0%100%
ListByGalleryNextPageAsync()-0%0%
ListByGalleryNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryApplicationsRestOperations.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 GalleryApplicationsRestOperations
 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 GalleryApplicationsRestOperations. </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 GalleryApplicationsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subs
 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 galleryApp
 47        {
 1648            var message = _pipeline.CreateMessage();
 1649            var request = message.Request;
 1650            request.Method = RequestMethod.Put;
 1651            var uri = new RawRequestUriBuilder();
 1652            uri.Reset(endpoint);
 1653            uri.AppendPath("/subscriptions/", false);
 1654            uri.AppendPath(subscriptionId, true);
 1655            uri.AppendPath("/resourceGroups/", false);
 1656            uri.AppendPath(resourceGroupName, true);
 1657            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 1658            uri.AppendPath(galleryName, true);
 1659            uri.AppendPath("/applications/", false);
 1660            uri.AppendPath(galleryApplicationName, true);
 1661            uri.AppendQuery("api-version", "2019-12-01", true);
 1662            request.Uri = uri;
 1663            request.Headers.Add("Content-Type", "application/json");
 1664            var content = new Utf8JsonRequestContent();
 1665            content.JsonWriter.WriteObjectValue(galleryApplication);
 1666            request.Content = content;
 1667            return message;
 68        }
 69
 70        /// <summary> Create or update a gallery Application Definition. </summary>
 71        /// <param name="resourceGroupName"> The name of the resource group. </param>
 72        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is
 73        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be created or update
 74        /// <param name="galleryApplication"> Parameters supplied to the create or update gallery Application operation.
 75        /// <param name="cancellationToken"> The cancellation token to use. </param>
 76        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string galleryName, string galleryAppl
 77        {
 478            if (resourceGroupName == null)
 79            {
 080                throw new ArgumentNullException(nameof(resourceGroupName));
 81            }
 482            if (galleryName == null)
 83            {
 084                throw new ArgumentNullException(nameof(galleryName));
 85            }
 486            if (galleryApplicationName == null)
 87            {
 088                throw new ArgumentNullException(nameof(galleryApplicationName));
 89            }
 490            if (galleryApplication == null)
 91            {
 092                throw new ArgumentNullException(nameof(galleryApplication));
 93            }
 94
 495            using var message = CreateCreateOrUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, gall
 496            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 497            switch (message.Response.Status)
 98            {
 99                case 200:
 100                case 201:
 101                case 202:
 4102                    return message.Response;
 103                default:
 0104                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 105            }
 4106        }
 107
 108        /// <summary> Create or update a gallery Application Definition. </summary>
 109        /// <param name="resourceGroupName"> The name of the resource group. </param>
 110        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is
 111        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be created or update
 112        /// <param name="galleryApplication"> Parameters supplied to the create or update gallery Application operation.
 113        /// <param name="cancellationToken"> The cancellation token to use. </param>
 114        public Response CreateOrUpdate(string resourceGroupName, string galleryName, string galleryApplicationName, Gall
 115        {
 4116            if (resourceGroupName == null)
 117            {
 0118                throw new ArgumentNullException(nameof(resourceGroupName));
 119            }
 4120            if (galleryName == null)
 121            {
 0122                throw new ArgumentNullException(nameof(galleryName));
 123            }
 4124            if (galleryApplicationName == null)
 125            {
 0126                throw new ArgumentNullException(nameof(galleryApplicationName));
 127            }
 4128            if (galleryApplication == null)
 129            {
 0130                throw new ArgumentNullException(nameof(galleryApplication));
 131            }
 132
 4133            using var message = CreateCreateOrUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, gall
 4134            _pipeline.Send(message, cancellationToken);
 4135            switch (message.Response.Status)
 136            {
 137                case 200:
 138                case 201:
 139                case 202:
 4140                    return message.Response;
 141                default:
 0142                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 143            }
 4144        }
 145
 146        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string galleryName, string galleryApplication
 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("/applications/", false);
 0160            uri.AppendPath(galleryApplicationName, 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(galleryApplication);
 0166            request.Content = content;
 0167            return message;
 168        }
 169
 170        /// <summary> Update a gallery Application Definition. </summary>
 171        /// <param name="resourceGroupName"> The name of the resource group. </param>
 172        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is
 173        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be updated. The allo
 174        /// <param name="galleryApplication"> Parameters supplied to the update gallery Application operation. </param>
 175        /// <param name="cancellationToken"> The cancellation token to use. </param>
 176        public async Task<Response> UpdateAsync(string resourceGroupName, string galleryName, string galleryApplicationN
 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 (galleryApplicationName == null)
 187            {
 0188                throw new ArgumentNullException(nameof(galleryApplicationName));
 189            }
 0190            if (galleryApplication == null)
 191            {
 0192                throw new ArgumentNullException(nameof(galleryApplication));
 193            }
 194
 0195            using var message = CreateUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, galleryAppli
 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 Application Definition. </summary>
 207        /// <param name="resourceGroupName"> The name of the resource group. </param>
 208        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is
 209        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be updated. The allo
 210        /// <param name="galleryApplication"> Parameters supplied to the update gallery Application operation. </param>
 211        /// <param name="cancellationToken"> The cancellation token to use. </param>
 212        public Response Update(string resourceGroupName, string galleryName, string galleryApplicationName, GalleryAppli
 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 (galleryApplicationName == null)
 223            {
 0224                throw new ArgumentNullException(nameof(galleryApplicationName));
 225            }
 0226            if (galleryApplication == null)
 227            {
 0228                throw new ArgumentNullException(nameof(galleryApplication));
 229            }
 230
 0231            using var message = CreateUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, galleryAppli
 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 galleryApplicationNam
 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("/applications/", false);
 8256            uri.AppendPath(galleryApplicationName, 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 Application Definition. </summary>
 263        /// <param name="resourceGroupName"> The name of the resource group. </param>
 264        /// <param name="galleryName"> The name of the Shared Application Gallery from which the Application Definitions
 265        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be retrieved. </para
 266        /// <param name="cancellationToken"> The cancellation token to use. </param>
 267        public async Task<Response<GalleryApplication>> GetAsync(string resourceGroupName, string galleryName, string ga
 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 (galleryApplicationName == null)
 278            {
 0279                throw new ArgumentNullException(nameof(galleryApplicationName));
 280            }
 281
 4282            using var message = CreateGetRequest(resourceGroupName, galleryName, galleryApplicationName);
 4283            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 4284            switch (message.Response.Status)
 285            {
 286                case 200:
 287                    {
 4288                        GalleryApplication 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 = GalleryApplication.DeserializeGalleryApplication(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 Application Definition. </summary>
 306        /// <param name="resourceGroupName"> The name of the resource group. </param>
 307        /// <param name="galleryName"> The name of the Shared Application Gallery from which the Application Definitions
 308        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be retrieved. </para
 309        /// <param name="cancellationToken"> The cancellation token to use. </param>
 310        public Response<GalleryApplication> Get(string resourceGroupName, string galleryName, string galleryApplicationN
 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 (galleryApplicationName == null)
 321            {
 0322                throw new ArgumentNullException(nameof(galleryApplicationName));
 323            }
 324
 4325            using var message = CreateGetRequest(resourceGroupName, galleryName, galleryApplicationName);
 4326            _pipeline.Send(message, cancellationToken);
 4327            switch (message.Response.Status)
 328            {
 329                case 200:
 330                    {
 4331                        GalleryApplication 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 = GalleryApplication.DeserializeGalleryApplication(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 galleryApplication
 349        {
 8350            var message = _pipeline.CreateMessage();
 8351            var request = message.Request;
 8352            request.Method = RequestMethod.Delete;
 8353            var uri = new RawRequestUriBuilder();
 8354            uri.Reset(endpoint);
 8355            uri.AppendPath("/subscriptions/", false);
 8356            uri.AppendPath(subscriptionId, true);
 8357            uri.AppendPath("/resourceGroups/", false);
 8358            uri.AppendPath(resourceGroupName, true);
 8359            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 8360            uri.AppendPath(galleryName, true);
 8361            uri.AppendPath("/applications/", false);
 8362            uri.AppendPath(galleryApplicationName, true);
 8363            uri.AppendQuery("api-version", "2019-12-01", true);
 8364            request.Uri = uri;
 8365            return message;
 366        }
 367
 368        /// <summary> Delete a gallery Application. </summary>
 369        /// <param name="resourceGroupName"> The name of the resource group. </param>
 370        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is
 371        /// <param name="galleryApplicationName"> The name of the gallery Application 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 galleryApplicationN
 374        {
 2375            if (resourceGroupName == null)
 376            {
 0377                throw new ArgumentNullException(nameof(resourceGroupName));
 378            }
 2379            if (galleryName == null)
 380            {
 0381                throw new ArgumentNullException(nameof(galleryName));
 382            }
 2383            if (galleryApplicationName == null)
 384            {
 0385                throw new ArgumentNullException(nameof(galleryApplicationName));
 386            }
 387
 2388            using var message = CreateDeleteRequest(resourceGroupName, galleryName, galleryApplicationName);
 2389            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 2390            switch (message.Response.Status)
 391            {
 392                case 200:
 393                case 202:
 394                case 204:
 2395                    return message.Response;
 396                default:
 0397                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 398            }
 2399        }
 400
 401        /// <summary> Delete a gallery Application. </summary>
 402        /// <param name="resourceGroupName"> The name of the resource group. </param>
 403        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is
 404        /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be deleted. </param>
 405        /// <param name="cancellationToken"> The cancellation token to use. </param>
 406        public Response Delete(string resourceGroupName, string galleryName, string galleryApplicationName, Cancellation
 407        {
 2408            if (resourceGroupName == null)
 409            {
 0410                throw new ArgumentNullException(nameof(resourceGroupName));
 411            }
 2412            if (galleryName == null)
 413            {
 0414                throw new ArgumentNullException(nameof(galleryName));
 415            }
 2416            if (galleryApplicationName == null)
 417            {
 0418                throw new ArgumentNullException(nameof(galleryApplicationName));
 419            }
 420
 2421            using var message = CreateDeleteRequest(resourceGroupName, galleryName, galleryApplicationName);
 2422            _pipeline.Send(message, cancellationToken);
 2423            switch (message.Response.Status)
 424            {
 425                case 200:
 426                case 202:
 427                case 204:
 2428                    return message.Response;
 429                default:
 0430                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 431            }
 2432        }
 433
 434        internal HttpMessage CreateListByGalleryRequest(string resourceGroupName, string galleryName)
 435        {
 0436            var message = _pipeline.CreateMessage();
 0437            var request = message.Request;
 0438            request.Method = RequestMethod.Get;
 0439            var uri = new RawRequestUriBuilder();
 0440            uri.Reset(endpoint);
 0441            uri.AppendPath("/subscriptions/", false);
 0442            uri.AppendPath(subscriptionId, true);
 0443            uri.AppendPath("/resourceGroups/", false);
 0444            uri.AppendPath(resourceGroupName, true);
 0445            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 0446            uri.AppendPath(galleryName, true);
 0447            uri.AppendPath("/applications", false);
 0448            uri.AppendQuery("api-version", "2019-12-01", true);
 0449            request.Uri = uri;
 0450            return message;
 451        }
 452
 453        /// <summary> List gallery Application 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 Application Gallery from which Application Definitions are
 456        /// <param name="cancellationToken"> The cancellation token to use. </param>
 457        public async Task<Response<GalleryApplicationList>> ListByGalleryAsync(string resourceGroupName, string galleryN
 458        {
 0459            if (resourceGroupName == null)
 460            {
 0461                throw new ArgumentNullException(nameof(resourceGroupName));
 462            }
 0463            if (galleryName == null)
 464            {
 0465                throw new ArgumentNullException(nameof(galleryName));
 466            }
 467
 0468            using var message = CreateListByGalleryRequest(resourceGroupName, galleryName);
 0469            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0470            switch (message.Response.Status)
 471            {
 472                case 200:
 473                    {
 0474                        GalleryApplicationList value = default;
 0475                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0476                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 477                        {
 0478                            value = null;
 479                        }
 480                        else
 481                        {
 0482                            value = GalleryApplicationList.DeserializeGalleryApplicationList(document.RootElement);
 483                        }
 0484                        return Response.FromValue(value, message.Response);
 485                    }
 486                default:
 0487                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 488            }
 0489        }
 490
 491        /// <summary> List gallery Application 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 Application Gallery from which Application Definitions are
 494        /// <param name="cancellationToken"> The cancellation token to use. </param>
 495        public Response<GalleryApplicationList> ListByGallery(string resourceGroupName, string galleryName, Cancellation
 496        {
 0497            if (resourceGroupName == null)
 498            {
 0499                throw new ArgumentNullException(nameof(resourceGroupName));
 500            }
 0501            if (galleryName == null)
 502            {
 0503                throw new ArgumentNullException(nameof(galleryName));
 504            }
 505
 0506            using var message = CreateListByGalleryRequest(resourceGroupName, galleryName);
 0507            _pipeline.Send(message, cancellationToken);
 0508            switch (message.Response.Status)
 509            {
 510                case 200:
 511                    {
 0512                        GalleryApplicationList value = default;
 0513                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0514                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 515                        {
 0516                            value = null;
 517                        }
 518                        else
 519                        {
 0520                            value = GalleryApplicationList.DeserializeGalleryApplicationList(document.RootElement);
 521                        }
 0522                        return Response.FromValue(value, message.Response);
 523                    }
 524                default:
 0525                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 526            }
 0527        }
 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 Application 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 Application Gallery from which Application Definitions are
 545        /// <param name="cancellationToken"> The cancellation token to use. </param>
 546        public async Task<Response<GalleryApplicationList>> ListByGalleryNextPageAsync(string nextLink, string resourceG
 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                        GalleryApplicationList 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 = GalleryApplicationList.DeserializeGalleryApplicationList(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 Application 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 Application Gallery from which Application Definitions are
 588        /// <param name="cancellationToken"> The cancellation token to use. </param>
 589        public Response<GalleryApplicationList> ListByGalleryNextPage(string nextLink, string resourceGroupName, string 
 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                        GalleryApplicationList 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 = GalleryApplicationList.DeserializeGalleryApplicationList(document.RootElement);
 619                        }
 0620                        return Response.FromValue(value, message.Response);
 621                    }
 622                default:
 0623                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 624            }
 0625        }
 626    }
 627}