< Summary

Class:Azure.ResourceManager.Compute.GalleryApplicationVersionsRestOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryApplicationVersionsRestOperations.cs
Covered lines:8
Uncovered lines:309
Coverable lines:317
Total lines:698
Line coverage:2.5% (8 of 317)
Covered branches:2
Total branches:148
Branch coverage:1.3% (2 of 148)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-88.89%50%
CreateCreateOrUpdateRequest(...)-0%100%
CreateOrUpdateAsync()-0%0%
CreateOrUpdate(...)-0%0%
CreateUpdateRequest(...)-0%100%
UpdateAsync()-0%0%
Update(...)-0%0%
CreateGetRequest(...)-0%100%
GetAsync()-0%0%
Get(...)-0%0%
CreateDeleteRequest(...)-0%100%
DeleteAsync()-0%0%
Delete(...)-0%0%
CreateListByGalleryApplicationRequest(...)-0%100%
ListByGalleryApplicationAsync()-0%0%
ListByGalleryApplication(...)-0%0%
CreateListByGalleryApplicationNextPageRequest(...)-0%100%
ListByGalleryApplicationNextPageAsync()-0%0%
ListByGalleryApplicationNextPage(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryApplicationVersionsRestOperations.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 GalleryApplicationVersionsRestOperations
 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 GalleryApplicationVersionsRestOperations. </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 GalleryApplicationVersionsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, stri
 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        {
 048            var message = _pipeline.CreateMessage();
 049            var request = message.Request;
 050            request.Method = RequestMethod.Put;
 051            var uri = new RawRequestUriBuilder();
 052            uri.Reset(endpoint);
 053            uri.AppendPath("/subscriptions/", false);
 054            uri.AppendPath(subscriptionId, true);
 055            uri.AppendPath("/resourceGroups/", false);
 056            uri.AppendPath(resourceGroupName, true);
 057            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 058            uri.AppendPath(galleryName, true);
 059            uri.AppendPath("/applications/", false);
 060            uri.AppendPath(galleryApplicationName, true);
 061            uri.AppendPath("/versions/", false);
 062            uri.AppendPath(galleryApplicationVersionName, true);
 063            uri.AppendQuery("api-version", "2019-12-01", true);
 064            request.Uri = uri;
 065            request.Headers.Add("Content-Type", "application/json");
 066            var content = new Utf8JsonRequestContent();
 067            content.JsonWriter.WriteObjectValue(galleryApplicationVersion);
 068            request.Content = content;
 069            return message;
 70        }
 71
 72        /// <summary> Create or update a gallery Application Version. </summary>
 73        /// <param name="resourceGroupName"> The name of the resource group. </param>
 74        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 75        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 76        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be created. Need
 77        /// <param name="galleryApplicationVersion"> Parameters supplied to the create or update gallery Application Ver
 78        /// <param name="cancellationToken"> The cancellation token to use. </param>
 79        public async Task<Response> CreateOrUpdateAsync(string resourceGroupName, string galleryName, string galleryAppl
 80        {
 081            if (resourceGroupName == null)
 82            {
 083                throw new ArgumentNullException(nameof(resourceGroupName));
 84            }
 085            if (galleryName == null)
 86            {
 087                throw new ArgumentNullException(nameof(galleryName));
 88            }
 089            if (galleryApplicationName == null)
 90            {
 091                throw new ArgumentNullException(nameof(galleryApplicationName));
 92            }
 093            if (galleryApplicationVersionName == null)
 94            {
 095                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 96            }
 097            if (galleryApplicationVersion == null)
 98            {
 099                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 100            }
 101
 0102            using var message = CreateCreateOrUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, gall
 0103            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0104            switch (message.Response.Status)
 105            {
 106                case 200:
 107                case 201:
 108                case 202:
 0109                    return message.Response;
 110                default:
 0111                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 112            }
 0113        }
 114
 115        /// <summary> Create or update a gallery Application Version. </summary>
 116        /// <param name="resourceGroupName"> The name of the resource group. </param>
 117        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 118        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 119        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be created. Need
 120        /// <param name="galleryApplicationVersion"> Parameters supplied to the create or update gallery Application Ver
 121        /// <param name="cancellationToken"> The cancellation token to use. </param>
 122        public Response CreateOrUpdate(string resourceGroupName, string galleryName, string galleryApplicationName, stri
 123        {
 0124            if (resourceGroupName == null)
 125            {
 0126                throw new ArgumentNullException(nameof(resourceGroupName));
 127            }
 0128            if (galleryName == null)
 129            {
 0130                throw new ArgumentNullException(nameof(galleryName));
 131            }
 0132            if (galleryApplicationName == null)
 133            {
 0134                throw new ArgumentNullException(nameof(galleryApplicationName));
 135            }
 0136            if (galleryApplicationVersionName == null)
 137            {
 0138                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 139            }
 0140            if (galleryApplicationVersion == null)
 141            {
 0142                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 143            }
 144
 0145            using var message = CreateCreateOrUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, gall
 0146            _pipeline.Send(message, cancellationToken);
 0147            switch (message.Response.Status)
 148            {
 149                case 200:
 150                case 201:
 151                case 202:
 0152                    return message.Response;
 153                default:
 0154                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 155            }
 0156        }
 157
 158        internal HttpMessage CreateUpdateRequest(string resourceGroupName, string galleryName, string galleryApplication
 159        {
 0160            var message = _pipeline.CreateMessage();
 0161            var request = message.Request;
 0162            request.Method = RequestMethod.Patch;
 0163            var uri = new RawRequestUriBuilder();
 0164            uri.Reset(endpoint);
 0165            uri.AppendPath("/subscriptions/", false);
 0166            uri.AppendPath(subscriptionId, true);
 0167            uri.AppendPath("/resourceGroups/", false);
 0168            uri.AppendPath(resourceGroupName, true);
 0169            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 0170            uri.AppendPath(galleryName, true);
 0171            uri.AppendPath("/applications/", false);
 0172            uri.AppendPath(galleryApplicationName, true);
 0173            uri.AppendPath("/versions/", false);
 0174            uri.AppendPath(galleryApplicationVersionName, true);
 0175            uri.AppendQuery("api-version", "2019-12-01", true);
 0176            request.Uri = uri;
 0177            request.Headers.Add("Content-Type", "application/json");
 0178            var content = new Utf8JsonRequestContent();
 0179            content.JsonWriter.WriteObjectValue(galleryApplicationVersion);
 0180            request.Content = content;
 0181            return message;
 182        }
 183
 184        /// <summary> Update a gallery Application Version. </summary>
 185        /// <param name="resourceGroupName"> The name of the resource group. </param>
 186        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 187        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 188        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be updated. Need
 189        /// <param name="galleryApplicationVersion"> Parameters supplied to the update gallery Application Version opera
 190        /// <param name="cancellationToken"> The cancellation token to use. </param>
 191        public async Task<Response> UpdateAsync(string resourceGroupName, string galleryName, string galleryApplicationN
 192        {
 0193            if (resourceGroupName == null)
 194            {
 0195                throw new ArgumentNullException(nameof(resourceGroupName));
 196            }
 0197            if (galleryName == null)
 198            {
 0199                throw new ArgumentNullException(nameof(galleryName));
 200            }
 0201            if (galleryApplicationName == null)
 202            {
 0203                throw new ArgumentNullException(nameof(galleryApplicationName));
 204            }
 0205            if (galleryApplicationVersionName == null)
 206            {
 0207                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 208            }
 0209            if (galleryApplicationVersion == null)
 210            {
 0211                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 212            }
 213
 0214            using var message = CreateUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, galleryAppli
 0215            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0216            switch (message.Response.Status)
 217            {
 218                case 200:
 0219                    return message.Response;
 220                default:
 0221                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 222            }
 0223        }
 224
 225        /// <summary> Update a gallery Application Version. </summary>
 226        /// <param name="resourceGroupName"> The name of the resource group. </param>
 227        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 228        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 229        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be updated. Need
 230        /// <param name="galleryApplicationVersion"> Parameters supplied to the update gallery Application Version opera
 231        /// <param name="cancellationToken"> The cancellation token to use. </param>
 232        public Response Update(string resourceGroupName, string galleryName, string galleryApplicationName, string galle
 233        {
 0234            if (resourceGroupName == null)
 235            {
 0236                throw new ArgumentNullException(nameof(resourceGroupName));
 237            }
 0238            if (galleryName == null)
 239            {
 0240                throw new ArgumentNullException(nameof(galleryName));
 241            }
 0242            if (galleryApplicationName == null)
 243            {
 0244                throw new ArgumentNullException(nameof(galleryApplicationName));
 245            }
 0246            if (galleryApplicationVersionName == null)
 247            {
 0248                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 249            }
 0250            if (galleryApplicationVersion == null)
 251            {
 0252                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 253            }
 254
 0255            using var message = CreateUpdateRequest(resourceGroupName, galleryName, galleryApplicationName, galleryAppli
 0256            _pipeline.Send(message, cancellationToken);
 0257            switch (message.Response.Status)
 258            {
 259                case 200:
 0260                    return message.Response;
 261                default:
 0262                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 263            }
 0264        }
 265
 266        internal HttpMessage CreateGetRequest(string resourceGroupName, string galleryName, string galleryApplicationNam
 267        {
 0268            var message = _pipeline.CreateMessage();
 0269            var request = message.Request;
 0270            request.Method = RequestMethod.Get;
 0271            var uri = new RawRequestUriBuilder();
 0272            uri.Reset(endpoint);
 0273            uri.AppendPath("/subscriptions/", false);
 0274            uri.AppendPath(subscriptionId, true);
 0275            uri.AppendPath("/resourceGroups/", false);
 0276            uri.AppendPath(resourceGroupName, true);
 0277            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 0278            uri.AppendPath(galleryName, true);
 0279            uri.AppendPath("/applications/", false);
 0280            uri.AppendPath(galleryApplicationName, true);
 0281            uri.AppendPath("/versions/", false);
 0282            uri.AppendPath(galleryApplicationVersionName, true);
 0283            uri.AppendQuery("$expand", "ReplicationStatus", true);
 0284            uri.AppendQuery("api-version", "2019-12-01", true);
 0285            request.Uri = uri;
 0286            return message;
 287        }
 288
 289        /// <summary> Retrieves information about a gallery Application Version. </summary>
 290        /// <param name="resourceGroupName"> The name of the resource group. </param>
 291        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 292        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 293        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be retrieved. </
 294        /// <param name="cancellationToken"> The cancellation token to use. </param>
 295        public async Task<Response<GalleryApplicationVersion>> GetAsync(string resourceGroupName, string galleryName, st
 296        {
 0297            if (resourceGroupName == null)
 298            {
 0299                throw new ArgumentNullException(nameof(resourceGroupName));
 300            }
 0301            if (galleryName == null)
 302            {
 0303                throw new ArgumentNullException(nameof(galleryName));
 304            }
 0305            if (galleryApplicationName == null)
 306            {
 0307                throw new ArgumentNullException(nameof(galleryApplicationName));
 308            }
 0309            if (galleryApplicationVersionName == null)
 310            {
 0311                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 312            }
 313
 0314            using var message = CreateGetRequest(resourceGroupName, galleryName, galleryApplicationName, galleryApplicat
 0315            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0316            switch (message.Response.Status)
 317            {
 318                case 200:
 319                    {
 0320                        GalleryApplicationVersion value = default;
 0321                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0322                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 323                        {
 0324                            value = null;
 325                        }
 326                        else
 327                        {
 0328                            value = GalleryApplicationVersion.DeserializeGalleryApplicationVersion(document.RootElement)
 329                        }
 0330                        return Response.FromValue(value, message.Response);
 331                    }
 332                default:
 0333                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 334            }
 0335        }
 336
 337        /// <summary> Retrieves information about a gallery Application Version. </summary>
 338        /// <param name="resourceGroupName"> The name of the resource group. </param>
 339        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 340        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 341        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be retrieved. </
 342        /// <param name="cancellationToken"> The cancellation token to use. </param>
 343        public Response<GalleryApplicationVersion> Get(string resourceGroupName, string galleryName, string galleryAppli
 344        {
 0345            if (resourceGroupName == null)
 346            {
 0347                throw new ArgumentNullException(nameof(resourceGroupName));
 348            }
 0349            if (galleryName == null)
 350            {
 0351                throw new ArgumentNullException(nameof(galleryName));
 352            }
 0353            if (galleryApplicationName == null)
 354            {
 0355                throw new ArgumentNullException(nameof(galleryApplicationName));
 356            }
 0357            if (galleryApplicationVersionName == null)
 358            {
 0359                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 360            }
 361
 0362            using var message = CreateGetRequest(resourceGroupName, galleryName, galleryApplicationName, galleryApplicat
 0363            _pipeline.Send(message, cancellationToken);
 0364            switch (message.Response.Status)
 365            {
 366                case 200:
 367                    {
 0368                        GalleryApplicationVersion value = default;
 0369                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0370                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 371                        {
 0372                            value = null;
 373                        }
 374                        else
 375                        {
 0376                            value = GalleryApplicationVersion.DeserializeGalleryApplicationVersion(document.RootElement)
 377                        }
 0378                        return Response.FromValue(value, message.Response);
 379                    }
 380                default:
 0381                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 382            }
 0383        }
 384
 385        internal HttpMessage CreateDeleteRequest(string resourceGroupName, string galleryName, string galleryApplication
 386        {
 0387            var message = _pipeline.CreateMessage();
 0388            var request = message.Request;
 0389            request.Method = RequestMethod.Delete;
 0390            var uri = new RawRequestUriBuilder();
 0391            uri.Reset(endpoint);
 0392            uri.AppendPath("/subscriptions/", false);
 0393            uri.AppendPath(subscriptionId, true);
 0394            uri.AppendPath("/resourceGroups/", false);
 0395            uri.AppendPath(resourceGroupName, true);
 0396            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 0397            uri.AppendPath(galleryName, true);
 0398            uri.AppendPath("/applications/", false);
 0399            uri.AppendPath(galleryApplicationName, true);
 0400            uri.AppendPath("/versions/", false);
 0401            uri.AppendPath(galleryApplicationVersionName, true);
 0402            uri.AppendQuery("api-version", "2019-12-01", true);
 0403            request.Uri = uri;
 0404            return message;
 405        }
 406
 407        /// <summary> Delete a gallery Application Version. </summary>
 408        /// <param name="resourceGroupName"> The name of the resource group. </param>
 409        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 410        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 411        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be deleted. </pa
 412        /// <param name="cancellationToken"> The cancellation token to use. </param>
 413        public async Task<Response> DeleteAsync(string resourceGroupName, string galleryName, string galleryApplicationN
 414        {
 0415            if (resourceGroupName == null)
 416            {
 0417                throw new ArgumentNullException(nameof(resourceGroupName));
 418            }
 0419            if (galleryName == null)
 420            {
 0421                throw new ArgumentNullException(nameof(galleryName));
 422            }
 0423            if (galleryApplicationName == null)
 424            {
 0425                throw new ArgumentNullException(nameof(galleryApplicationName));
 426            }
 0427            if (galleryApplicationVersionName == null)
 428            {
 0429                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 430            }
 431
 0432            using var message = CreateDeleteRequest(resourceGroupName, galleryName, galleryApplicationName, galleryAppli
 0433            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0434            switch (message.Response.Status)
 435            {
 436                case 200:
 437                case 202:
 438                case 204:
 0439                    return message.Response;
 440                default:
 0441                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 442            }
 0443        }
 444
 445        /// <summary> Delete a gallery Application Version. </summary>
 446        /// <param name="resourceGroupName"> The name of the resource group. </param>
 447        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 448        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 449        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be deleted. </pa
 450        /// <param name="cancellationToken"> The cancellation token to use. </param>
 451        public Response Delete(string resourceGroupName, string galleryName, string galleryApplicationName, string galle
 452        {
 0453            if (resourceGroupName == null)
 454            {
 0455                throw new ArgumentNullException(nameof(resourceGroupName));
 456            }
 0457            if (galleryName == null)
 458            {
 0459                throw new ArgumentNullException(nameof(galleryName));
 460            }
 0461            if (galleryApplicationName == null)
 462            {
 0463                throw new ArgumentNullException(nameof(galleryApplicationName));
 464            }
 0465            if (galleryApplicationVersionName == null)
 466            {
 0467                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 468            }
 469
 0470            using var message = CreateDeleteRequest(resourceGroupName, galleryName, galleryApplicationName, galleryAppli
 0471            _pipeline.Send(message, cancellationToken);
 0472            switch (message.Response.Status)
 473            {
 474                case 200:
 475                case 202:
 476                case 204:
 0477                    return message.Response;
 478                default:
 0479                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 480            }
 0481        }
 482
 483        internal HttpMessage CreateListByGalleryApplicationRequest(string resourceGroupName, string galleryName, string 
 484        {
 0485            var message = _pipeline.CreateMessage();
 0486            var request = message.Request;
 0487            request.Method = RequestMethod.Get;
 0488            var uri = new RawRequestUriBuilder();
 0489            uri.Reset(endpoint);
 0490            uri.AppendPath("/subscriptions/", false);
 0491            uri.AppendPath(subscriptionId, true);
 0492            uri.AppendPath("/resourceGroups/", false);
 0493            uri.AppendPath(resourceGroupName, true);
 0494            uri.AppendPath("/providers/Microsoft.Compute/galleries/", false);
 0495            uri.AppendPath(galleryName, true);
 0496            uri.AppendPath("/applications/", false);
 0497            uri.AppendPath(galleryApplicationName, true);
 0498            uri.AppendPath("/versions", false);
 0499            uri.AppendQuery("api-version", "2019-12-01", true);
 0500            request.Uri = uri;
 0501            return message;
 502        }
 503
 504        /// <summary> List gallery Application Versions in a gallery Application Definition. </summary>
 505        /// <param name="resourceGroupName"> The name of the resource group. </param>
 506        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 507        /// <param name="galleryApplicationName"> The name of the Shared Application Gallery Application Definition from
 508        /// <param name="cancellationToken"> The cancellation token to use. </param>
 509        public async Task<Response<GalleryApplicationVersionList>> ListByGalleryApplicationAsync(string resourceGroupNam
 510        {
 0511            if (resourceGroupName == null)
 512            {
 0513                throw new ArgumentNullException(nameof(resourceGroupName));
 514            }
 0515            if (galleryName == null)
 516            {
 0517                throw new ArgumentNullException(nameof(galleryName));
 518            }
 0519            if (galleryApplicationName == null)
 520            {
 0521                throw new ArgumentNullException(nameof(galleryApplicationName));
 522            }
 523
 0524            using var message = CreateListByGalleryApplicationRequest(resourceGroupName, galleryName, galleryApplication
 0525            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0526            switch (message.Response.Status)
 527            {
 528                case 200:
 529                    {
 0530                        GalleryApplicationVersionList value = default;
 0531                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0532                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 533                        {
 0534                            value = null;
 535                        }
 536                        else
 537                        {
 0538                            value = GalleryApplicationVersionList.DeserializeGalleryApplicationVersionList(document.Root
 539                        }
 0540                        return Response.FromValue(value, message.Response);
 541                    }
 542                default:
 0543                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 544            }
 0545        }
 546
 547        /// <summary> List gallery Application Versions in a gallery Application Definition. </summary>
 548        /// <param name="resourceGroupName"> The name of the resource group. </param>
 549        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 550        /// <param name="galleryApplicationName"> The name of the Shared Application Gallery Application Definition from
 551        /// <param name="cancellationToken"> The cancellation token to use. </param>
 552        public Response<GalleryApplicationVersionList> ListByGalleryApplication(string resourceGroupName, string gallery
 553        {
 0554            if (resourceGroupName == null)
 555            {
 0556                throw new ArgumentNullException(nameof(resourceGroupName));
 557            }
 0558            if (galleryName == null)
 559            {
 0560                throw new ArgumentNullException(nameof(galleryName));
 561            }
 0562            if (galleryApplicationName == null)
 563            {
 0564                throw new ArgumentNullException(nameof(galleryApplicationName));
 565            }
 566
 0567            using var message = CreateListByGalleryApplicationRequest(resourceGroupName, galleryName, galleryApplication
 0568            _pipeline.Send(message, cancellationToken);
 0569            switch (message.Response.Status)
 570            {
 571                case 200:
 572                    {
 0573                        GalleryApplicationVersionList value = default;
 0574                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0575                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 576                        {
 0577                            value = null;
 578                        }
 579                        else
 580                        {
 0581                            value = GalleryApplicationVersionList.DeserializeGalleryApplicationVersionList(document.Root
 582                        }
 0583                        return Response.FromValue(value, message.Response);
 584                    }
 585                default:
 0586                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 587            }
 0588        }
 589
 590        internal HttpMessage CreateListByGalleryApplicationNextPageRequest(string nextLink, string resourceGroupName, st
 591        {
 0592            var message = _pipeline.CreateMessage();
 0593            var request = message.Request;
 0594            request.Method = RequestMethod.Get;
 0595            var uri = new RawRequestUriBuilder();
 0596            uri.Reset(endpoint);
 0597            uri.AppendRawNextLink(nextLink, false);
 0598            request.Uri = uri;
 0599            return message;
 600        }
 601
 602        /// <summary> List gallery Application Versions in a gallery Application Definition. </summary>
 603        /// <param name="nextLink"> The URL to the next page of results. </param>
 604        /// <param name="resourceGroupName"> The name of the resource group. </param>
 605        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 606        /// <param name="galleryApplicationName"> The name of the Shared Application Gallery Application Definition from
 607        /// <param name="cancellationToken"> The cancellation token to use. </param>
 608        public async Task<Response<GalleryApplicationVersionList>> ListByGalleryApplicationNextPageAsync(string nextLink
 609        {
 0610            if (nextLink == null)
 611            {
 0612                throw new ArgumentNullException(nameof(nextLink));
 613            }
 0614            if (resourceGroupName == null)
 615            {
 0616                throw new ArgumentNullException(nameof(resourceGroupName));
 617            }
 0618            if (galleryName == null)
 619            {
 0620                throw new ArgumentNullException(nameof(galleryName));
 621            }
 0622            if (galleryApplicationName == null)
 623            {
 0624                throw new ArgumentNullException(nameof(galleryApplicationName));
 625            }
 626
 0627            using var message = CreateListByGalleryApplicationNextPageRequest(nextLink, resourceGroupName, galleryName, 
 0628            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
 0629            switch (message.Response.Status)
 630            {
 631                case 200:
 632                    {
 0633                        GalleryApplicationVersionList value = default;
 0634                        using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, canc
 0635                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 636                        {
 0637                            value = null;
 638                        }
 639                        else
 640                        {
 0641                            value = GalleryApplicationVersionList.DeserializeGalleryApplicationVersionList(document.Root
 642                        }
 0643                        return Response.FromValue(value, message.Response);
 644                    }
 645                default:
 0646                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(fa
 647            }
 0648        }
 649
 650        /// <summary> List gallery Application Versions in a gallery Application Definition. </summary>
 651        /// <param name="nextLink"> The URL to the next page of results. </param>
 652        /// <param name="resourceGroupName"> The name of the resource group. </param>
 653        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 654        /// <param name="galleryApplicationName"> The name of the Shared Application Gallery Application Definition from
 655        /// <param name="cancellationToken"> The cancellation token to use. </param>
 656        public Response<GalleryApplicationVersionList> ListByGalleryApplicationNextPage(string nextLink, string resource
 657        {
 0658            if (nextLink == null)
 659            {
 0660                throw new ArgumentNullException(nameof(nextLink));
 661            }
 0662            if (resourceGroupName == null)
 663            {
 0664                throw new ArgumentNullException(nameof(resourceGroupName));
 665            }
 0666            if (galleryName == null)
 667            {
 0668                throw new ArgumentNullException(nameof(galleryName));
 669            }
 0670            if (galleryApplicationName == null)
 671            {
 0672                throw new ArgumentNullException(nameof(galleryApplicationName));
 673            }
 674
 0675            using var message = CreateListByGalleryApplicationNextPageRequest(nextLink, resourceGroupName, galleryName, 
 0676            _pipeline.Send(message, cancellationToken);
 0677            switch (message.Response.Status)
 678            {
 679                case 200:
 680                    {
 0681                        GalleryApplicationVersionList value = default;
 0682                        using var document = JsonDocument.Parse(message.Response.ContentStream);
 0683                        if (document.RootElement.ValueKind == JsonValueKind.Null)
 684                        {
 0685                            value = null;
 686                        }
 687                        else
 688                        {
 0689                            value = GalleryApplicationVersionList.DeserializeGalleryApplicationVersionList(document.Root
 690                        }
 0691                        return Response.FromValue(value, message.Response);
 692                    }
 693                default:
 0694                    throw _clientDiagnostics.CreateRequestFailedException(message.Response);
 695            }
 0696        }
 697    }
 698}