< Summary

Class:Azure.ResourceManager.Compute.GalleryApplicationVersionsOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryApplicationVersionsOperations.cs
Covered lines:7
Uncovered lines:165
Coverable lines:172
Total lines:442
Line coverage:4% (7 of 172)
Covered branches:0
Total branches:68
Branch coverage:0% (0 of 68)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-0%100%
Get(...)-0%100%
ListByGalleryApplicationAsync(...)-0%0%
<ListByGalleryApplicationAsync()-0%100%
<ListByGalleryApplicationAsync()-0%100%
ListByGalleryApplication(...)-0%0%
StartCreateOrUpdateAsync()-0%0%
StartCreateOrUpdate(...)-0%0%
StartUpdateAsync()-0%0%
StartUpdate(...)-0%0%
StartDeleteAsync()-0%0%
StartDelete(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\GalleryApplicationVersionsOperations.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.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Compute.Models;
 15
 16namespace Azure.ResourceManager.Compute
 17{
 18    /// <summary> The GalleryApplicationVersions service client. </summary>
 19    public partial class GalleryApplicationVersionsOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal GalleryApplicationVersionsRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of GalleryApplicationVersionsOperations for mocking. </summary>
 39625        protected GalleryApplicationVersionsOperations()
 26        {
 39627        }
 28        /// <summary> Initializes a new instance of GalleryApplicationVersionsOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> Subscription credentials which uniquely identify Microsoft Azure subscription.
 32        /// <param name="endpoint"> server parameter. </param>
 39633        internal GalleryApplicationVersionsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string
 34        {
 39635            RestClient = new GalleryApplicationVersionsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpo
 39636            _clientDiagnostics = clientDiagnostics;
 39637            _pipeline = pipeline;
 39638        }
 39
 40        /// <summary> Retrieves information about a gallery Application Version. </summary>
 41        /// <param name="resourceGroupName"> The name of the resource group. </param>
 42        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 43        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 44        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be retrieved. </
 45        /// <param name="cancellationToken"> The cancellation token to use. </param>
 46        public virtual async Task<Response<GalleryApplicationVersion>> GetAsync(string resourceGroupName, string gallery
 47        {
 048            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.Get");
 049            scope.Start();
 50            try
 51            {
 052                return await RestClient.GetAsync(resourceGroupName, galleryName, galleryApplicationName, galleryApplicat
 53            }
 054            catch (Exception e)
 55            {
 056                scope.Failed(e);
 057                throw;
 58            }
 059        }
 60
 61        /// <summary> Retrieves information about a gallery Application Version. </summary>
 62        /// <param name="resourceGroupName"> The name of the resource group. </param>
 63        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 64        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 65        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be retrieved. </
 66        /// <param name="cancellationToken"> The cancellation token to use. </param>
 67        public virtual Response<GalleryApplicationVersion> Get(string resourceGroupName, string galleryName, string gall
 68        {
 069            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.Get");
 070            scope.Start();
 71            try
 72            {
 073                return RestClient.Get(resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionN
 74            }
 075            catch (Exception e)
 76            {
 077                scope.Failed(e);
 078                throw;
 79            }
 080        }
 81
 82        /// <summary> List gallery Application Versions in a gallery Application Definition. </summary>
 83        /// <param name="resourceGroupName"> The name of the resource group. </param>
 84        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 85        /// <param name="galleryApplicationName"> The name of the Shared Application Gallery Application Definition from
 86        /// <param name="cancellationToken"> The cancellation token to use. </param>
 87        public virtual AsyncPageable<GalleryApplicationVersion> ListByGalleryApplicationAsync(string resourceGroupName, 
 88        {
 089            if (resourceGroupName == null)
 90            {
 091                throw new ArgumentNullException(nameof(resourceGroupName));
 92            }
 093            if (galleryName == null)
 94            {
 095                throw new ArgumentNullException(nameof(galleryName));
 96            }
 097            if (galleryApplicationName == null)
 98            {
 099                throw new ArgumentNullException(nameof(galleryApplicationName));
 100            }
 101
 102            async Task<Page<GalleryApplicationVersion>> FirstPageFunc(int? pageSizeHint)
 103            {
 0104                using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.ListByGalleryAppl
 0105                scope.Start();
 106                try
 107                {
 0108                    var response = await RestClient.ListByGalleryApplicationAsync(resourceGroupName, galleryName, galler
 0109                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 110                }
 0111                catch (Exception e)
 112                {
 0113                    scope.Failed(e);
 0114                    throw;
 115                }
 0116            }
 117            async Task<Page<GalleryApplicationVersion>> NextPageFunc(string nextLink, int? pageSizeHint)
 118            {
 0119                using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.ListByGalleryAppl
 0120                scope.Start();
 121                try
 122                {
 0123                    var response = await RestClient.ListByGalleryApplicationNextPageAsync(nextLink, resourceGroupName, g
 0124                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 125                }
 0126                catch (Exception e)
 127                {
 0128                    scope.Failed(e);
 0129                    throw;
 130                }
 0131            }
 0132            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 133        }
 134
 135        /// <summary> List gallery Application Versions in a gallery Application Definition. </summary>
 136        /// <param name="resourceGroupName"> The name of the resource group. </param>
 137        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 138        /// <param name="galleryApplicationName"> The name of the Shared Application Gallery Application Definition from
 139        /// <param name="cancellationToken"> The cancellation token to use. </param>
 140        public virtual Pageable<GalleryApplicationVersion> ListByGalleryApplication(string resourceGroupName, string gal
 141        {
 0142            if (resourceGroupName == null)
 143            {
 0144                throw new ArgumentNullException(nameof(resourceGroupName));
 145            }
 0146            if (galleryName == null)
 147            {
 0148                throw new ArgumentNullException(nameof(galleryName));
 149            }
 0150            if (galleryApplicationName == null)
 151            {
 0152                throw new ArgumentNullException(nameof(galleryApplicationName));
 153            }
 154
 155            Page<GalleryApplicationVersion> FirstPageFunc(int? pageSizeHint)
 156            {
 0157                using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.ListByGalleryAppl
 0158                scope.Start();
 159                try
 160                {
 0161                    var response = RestClient.ListByGalleryApplication(resourceGroupName, galleryName, galleryApplicatio
 0162                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 163                }
 0164                catch (Exception e)
 165                {
 0166                    scope.Failed(e);
 0167                    throw;
 168                }
 0169            }
 170            Page<GalleryApplicationVersion> NextPageFunc(string nextLink, int? pageSizeHint)
 171            {
 0172                using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.ListByGalleryAppl
 0173                scope.Start();
 174                try
 175                {
 0176                    var response = RestClient.ListByGalleryApplicationNextPage(nextLink, resourceGroupName, galleryName,
 0177                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 178                }
 0179                catch (Exception e)
 180                {
 0181                    scope.Failed(e);
 0182                    throw;
 183                }
 0184            }
 0185            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 186        }
 187
 188        /// <summary> Create or update a gallery Application Version. </summary>
 189        /// <param name="resourceGroupName"> The name of the resource group. </param>
 190        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 191        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 192        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be created. Need
 193        /// <param name="galleryApplicationVersion"> Parameters supplied to the create or update gallery Application Ver
 194        /// <param name="cancellationToken"> The cancellation token to use. </param>
 195        public virtual async Task<GalleryApplicationVersionsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string res
 196        {
 0197            if (resourceGroupName == null)
 198            {
 0199                throw new ArgumentNullException(nameof(resourceGroupName));
 200            }
 0201            if (galleryName == null)
 202            {
 0203                throw new ArgumentNullException(nameof(galleryName));
 204            }
 0205            if (galleryApplicationName == null)
 206            {
 0207                throw new ArgumentNullException(nameof(galleryApplicationName));
 208            }
 0209            if (galleryApplicationVersionName == null)
 210            {
 0211                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 212            }
 0213            if (galleryApplicationVersion == null)
 214            {
 0215                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 216            }
 217
 0218            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.StartCreateOrUpdate")
 0219            scope.Start();
 220            try
 221            {
 0222                var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, galleryName, galleryAppli
 0223                return new GalleryApplicationVersionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C
 224            }
 0225            catch (Exception e)
 226            {
 0227                scope.Failed(e);
 0228                throw;
 229            }
 0230        }
 231
 232        /// <summary> Create or update a gallery Application Version. </summary>
 233        /// <param name="resourceGroupName"> The name of the resource group. </param>
 234        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 235        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 236        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be created. Need
 237        /// <param name="galleryApplicationVersion"> Parameters supplied to the create or update gallery Application Ver
 238        /// <param name="cancellationToken"> The cancellation token to use. </param>
 239        public virtual GalleryApplicationVersionsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, s
 240        {
 0241            if (resourceGroupName == null)
 242            {
 0243                throw new ArgumentNullException(nameof(resourceGroupName));
 244            }
 0245            if (galleryName == null)
 246            {
 0247                throw new ArgumentNullException(nameof(galleryName));
 248            }
 0249            if (galleryApplicationName == null)
 250            {
 0251                throw new ArgumentNullException(nameof(galleryApplicationName));
 252            }
 0253            if (galleryApplicationVersionName == null)
 254            {
 0255                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 256            }
 0257            if (galleryApplicationVersion == null)
 258            {
 0259                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 260            }
 261
 0262            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.StartCreateOrUpdate")
 0263            scope.Start();
 264            try
 265            {
 0266                var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, galleryName, galleryApplicationName,
 0267                return new GalleryApplicationVersionsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.C
 268            }
 0269            catch (Exception e)
 270            {
 0271                scope.Failed(e);
 0272                throw;
 273            }
 0274        }
 275
 276        /// <summary> Update a gallery Application Version. </summary>
 277        /// <param name="resourceGroupName"> The name of the resource group. </param>
 278        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 279        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 280        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be updated. Need
 281        /// <param name="galleryApplicationVersion"> Parameters supplied to the update gallery Application Version opera
 282        /// <param name="cancellationToken"> The cancellation token to use. </param>
 283        public virtual async Task<GalleryApplicationVersionsUpdateOperation> StartUpdateAsync(string resourceGroupName, 
 284        {
 0285            if (resourceGroupName == null)
 286            {
 0287                throw new ArgumentNullException(nameof(resourceGroupName));
 288            }
 0289            if (galleryName == null)
 290            {
 0291                throw new ArgumentNullException(nameof(galleryName));
 292            }
 0293            if (galleryApplicationName == null)
 294            {
 0295                throw new ArgumentNullException(nameof(galleryApplicationName));
 296            }
 0297            if (galleryApplicationVersionName == null)
 298            {
 0299                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 300            }
 0301            if (galleryApplicationVersion == null)
 302            {
 0303                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 304            }
 305
 0306            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.StartUpdate");
 0307            scope.Start();
 308            try
 309            {
 0310                var originalResponse = await RestClient.UpdateAsync(resourceGroupName, galleryName, galleryApplicationNa
 0311                return new GalleryApplicationVersionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpd
 312            }
 0313            catch (Exception e)
 314            {
 0315                scope.Failed(e);
 0316                throw;
 317            }
 0318        }
 319
 320        /// <summary> Update a gallery Application Version. </summary>
 321        /// <param name="resourceGroupName"> The name of the resource group. </param>
 322        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 323        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 324        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be updated. Need
 325        /// <param name="galleryApplicationVersion"> Parameters supplied to the update gallery Application Version opera
 326        /// <param name="cancellationToken"> The cancellation token to use. </param>
 327        public virtual GalleryApplicationVersionsUpdateOperation StartUpdate(string resourceGroupName, string galleryNam
 328        {
 0329            if (resourceGroupName == null)
 330            {
 0331                throw new ArgumentNullException(nameof(resourceGroupName));
 332            }
 0333            if (galleryName == null)
 334            {
 0335                throw new ArgumentNullException(nameof(galleryName));
 336            }
 0337            if (galleryApplicationName == null)
 338            {
 0339                throw new ArgumentNullException(nameof(galleryApplicationName));
 340            }
 0341            if (galleryApplicationVersionName == null)
 342            {
 0343                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 344            }
 0345            if (galleryApplicationVersion == null)
 346            {
 0347                throw new ArgumentNullException(nameof(galleryApplicationVersion));
 348            }
 349
 0350            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.StartUpdate");
 0351            scope.Start();
 352            try
 353            {
 0354                var originalResponse = RestClient.Update(resourceGroupName, galleryName, galleryApplicationName, gallery
 0355                return new GalleryApplicationVersionsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpd
 356            }
 0357            catch (Exception e)
 358            {
 0359                scope.Failed(e);
 0360                throw;
 361            }
 0362        }
 363
 364        /// <summary> Delete a gallery Application Version. </summary>
 365        /// <param name="resourceGroupName"> The name of the resource group. </param>
 366        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 367        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 368        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be deleted. </pa
 369        /// <param name="cancellationToken"> The cancellation token to use. </param>
 370        public virtual async Task<GalleryApplicationVersionsDeleteOperation> StartDeleteAsync(string resourceGroupName, 
 371        {
 0372            if (resourceGroupName == null)
 373            {
 0374                throw new ArgumentNullException(nameof(resourceGroupName));
 375            }
 0376            if (galleryName == null)
 377            {
 0378                throw new ArgumentNullException(nameof(galleryName));
 379            }
 0380            if (galleryApplicationName == null)
 381            {
 0382                throw new ArgumentNullException(nameof(galleryApplicationName));
 383            }
 0384            if (galleryApplicationVersionName == null)
 385            {
 0386                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 387            }
 388
 0389            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.StartDelete");
 0390            scope.Start();
 391            try
 392            {
 0393                var originalResponse = await RestClient.DeleteAsync(resourceGroupName, galleryName, galleryApplicationNa
 0394                return new GalleryApplicationVersionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 395            }
 0396            catch (Exception e)
 397            {
 0398                scope.Failed(e);
 0399                throw;
 400            }
 0401        }
 402
 403        /// <summary> Delete a gallery Application Version. </summary>
 404        /// <param name="resourceGroupName"> The name of the resource group. </param>
 405        /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition re
 406        /// <param name="galleryApplicationName"> The name of the gallery Application Definition in which the Applicatio
 407        /// <param name="galleryApplicationVersionName"> The name of the gallery Application Version to be deleted. </pa
 408        /// <param name="cancellationToken"> The cancellation token to use. </param>
 409        public virtual GalleryApplicationVersionsDeleteOperation StartDelete(string resourceGroupName, string galleryNam
 410        {
 0411            if (resourceGroupName == null)
 412            {
 0413                throw new ArgumentNullException(nameof(resourceGroupName));
 414            }
 0415            if (galleryName == null)
 416            {
 0417                throw new ArgumentNullException(nameof(galleryName));
 418            }
 0419            if (galleryApplicationName == null)
 420            {
 0421                throw new ArgumentNullException(nameof(galleryApplicationName));
 422            }
 0423            if (galleryApplicationVersionName == null)
 424            {
 0425                throw new ArgumentNullException(nameof(galleryApplicationVersionName));
 426            }
 427
 0428            using var scope = _clientDiagnostics.CreateScope("GalleryApplicationVersionsOperations.StartDelete");
 0429            scope.Start();
 430            try
 431            {
 0432                var originalResponse = RestClient.Delete(resourceGroupName, galleryName, galleryApplicationName, gallery
 0433                return new GalleryApplicationVersionsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDel
 434            }
 0435            catch (Exception e)
 436            {
 0437                scope.Failed(e);
 0438                throw;
 439            }
 0440        }
 441    }
 442}