< Summary

Class:Azure.ResourceManager.Compute.VirtualMachineImagesOperations
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineImagesOperations.cs
Covered lines:48
Uncovered lines:30
Coverable lines:78
Total lines:246
Line coverage:61.5% (48 of 78)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-100%100%
.ctor()-100%100%
.ctor(...)-100%100%
GetAsync()-57.14%100%
Get(...)-57.14%100%
ListAsync()-57.14%100%
List(...)-57.14%100%
ListOffersAsync()-57.14%100%
ListOffers(...)-57.14%100%
ListPublishersAsync()-57.14%100%
ListPublishers(...)-57.14%100%
ListSkusAsync()-57.14%100%
ListSkus(...)-57.14%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\VirtualMachineImagesOperations.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.Collections.Generic;
 10using System.Threading;
 11using System.Threading.Tasks;
 12using Azure;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Compute.Models;
 15
 16namespace Azure.ResourceManager.Compute
 17{
 18    /// <summary> The VirtualMachineImages service client. </summary>
 19    public partial class VirtualMachineImagesOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 36823        internal VirtualMachineImagesRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of VirtualMachineImagesOperations for mocking. </summary>
 39625        protected VirtualMachineImagesOperations()
 26        {
 39627        }
 28        /// <summary> Initializes a new instance of VirtualMachineImagesOperations. </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 VirtualMachineImagesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc
 34        {
 39635            RestClient = new VirtualMachineImagesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 39636            _clientDiagnostics = clientDiagnostics;
 39637            _pipeline = pipeline;
 39638        }
 39
 40        /// <summary> Gets a virtual machine image. </summary>
 41        /// <param name="location"> The name of a supported Azure region. </param>
 42        /// <param name="publisherName"> A valid image publisher. </param>
 43        /// <param name="offer"> A valid image publisher offer. </param>
 44        /// <param name="skus"> A valid image SKU. </param>
 45        /// <param name="version"> A valid image SKU version. </param>
 46        /// <param name="cancellationToken"> The cancellation token to use. </param>
 47        public virtual async Task<Response<VirtualMachineImage>> GetAsync(string location, string publisherName, string 
 48        {
 1649            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.Get");
 1650            scope.Start();
 51            try
 52            {
 1653                return await RestClient.GetAsync(location, publisherName, offer, skus, version, cancellationToken).Confi
 54            }
 055            catch (Exception e)
 56            {
 057                scope.Failed(e);
 058                throw;
 59            }
 1660        }
 61
 62        /// <summary> Gets a virtual machine image. </summary>
 63        /// <param name="location"> The name of a supported Azure region. </param>
 64        /// <param name="publisherName"> A valid image publisher. </param>
 65        /// <param name="offer"> A valid image publisher offer. </param>
 66        /// <param name="skus"> A valid image SKU. </param>
 67        /// <param name="version"> A valid image SKU version. </param>
 68        /// <param name="cancellationToken"> The cancellation token to use. </param>
 69        public virtual Response<VirtualMachineImage> Get(string location, string publisherName, string offer, string sku
 70        {
 1671            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.Get");
 1672            scope.Start();
 73            try
 74            {
 1675                return RestClient.Get(location, publisherName, offer, skus, version, cancellationToken);
 76            }
 077            catch (Exception e)
 78            {
 079                scope.Failed(e);
 080                throw;
 81            }
 1682        }
 83
 84        /// <summary> Gets a list of all virtual machine image versions for the specified location, publisher, offer, an
 85        /// <param name="location"> The name of a supported Azure region. </param>
 86        /// <param name="publisherName"> A valid image publisher. </param>
 87        /// <param name="offer"> A valid image publisher offer. </param>
 88        /// <param name="skus"> A valid image SKU. </param>
 89        /// <param name="expand"> The expand expression to apply on the operation. </param>
 90        /// <param name="top"> The Integer to use. </param>
 91        /// <param name="orderby"> The String to use. </param>
 92        /// <param name="cancellationToken"> The cancellation token to use. </param>
 93        public virtual async Task<Response<IReadOnlyList<VirtualMachineImageResource>>> ListAsync(string location, strin
 94        {
 16095            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.List");
 16096            scope.Start();
 97            try
 98            {
 16099                return await RestClient.ListAsync(location, publisherName, offer, skus, expand, top, orderby, cancellati
 100            }
 0101            catch (Exception e)
 102            {
 0103                scope.Failed(e);
 0104                throw;
 105            }
 160106        }
 107
 108        /// <summary> Gets a list of all virtual machine image versions for the specified location, publisher, offer, an
 109        /// <param name="location"> The name of a supported Azure region. </param>
 110        /// <param name="publisherName"> A valid image publisher. </param>
 111        /// <param name="offer"> A valid image publisher offer. </param>
 112        /// <param name="skus"> A valid image SKU. </param>
 113        /// <param name="expand"> The expand expression to apply on the operation. </param>
 114        /// <param name="top"> The Integer to use. </param>
 115        /// <param name="orderby"> The String to use. </param>
 116        /// <param name="cancellationToken"> The cancellation token to use. </param>
 117        public virtual Response<IReadOnlyList<VirtualMachineImageResource>> List(string location, string publisherName, 
 118        {
 160119            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.List");
 160120            scope.Start();
 121            try
 122            {
 160123                return RestClient.List(location, publisherName, offer, skus, expand, top, orderby, cancellationToken);
 124            }
 0125            catch (Exception e)
 126            {
 0127                scope.Failed(e);
 0128                throw;
 129            }
 160130        }
 131
 132        /// <summary> Gets a list of virtual machine image offers for the specified location and publisher. </summary>
 133        /// <param name="location"> The name of a supported Azure region. </param>
 134        /// <param name="publisherName"> A valid image publisher. </param>
 135        /// <param name="cancellationToken"> The cancellation token to use. </param>
 136        public virtual async Task<Response<IReadOnlyList<VirtualMachineImageResource>>> ListOffersAsync(string location,
 137        {
 2138            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListOffers");
 2139            scope.Start();
 140            try
 141            {
 2142                return await RestClient.ListOffersAsync(location, publisherName, cancellationToken).ConfigureAwait(false
 143            }
 0144            catch (Exception e)
 145            {
 0146                scope.Failed(e);
 0147                throw;
 148            }
 2149        }
 150
 151        /// <summary> Gets a list of virtual machine image offers for the specified location and publisher. </summary>
 152        /// <param name="location"> The name of a supported Azure region. </param>
 153        /// <param name="publisherName"> A valid image publisher. </param>
 154        /// <param name="cancellationToken"> The cancellation token to use. </param>
 155        public virtual Response<IReadOnlyList<VirtualMachineImageResource>> ListOffers(string location, string publisher
 156        {
 2157            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListOffers");
 2158            scope.Start();
 159            try
 160            {
 2161                return RestClient.ListOffers(location, publisherName, cancellationToken);
 162            }
 0163            catch (Exception e)
 164            {
 0165                scope.Failed(e);
 0166                throw;
 167            }
 2168        }
 169
 170        /// <summary> Gets a list of virtual machine image publishers for the specified Azure location. </summary>
 171        /// <param name="location"> The name of a supported Azure region. </param>
 172        /// <param name="cancellationToken"> The cancellation token to use. </param>
 173        public virtual async Task<Response<IReadOnlyList<VirtualMachineImageResource>>> ListPublishersAsync(string locat
 174        {
 2175            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListPublishers");
 2176            scope.Start();
 177            try
 178            {
 2179                return await RestClient.ListPublishersAsync(location, cancellationToken).ConfigureAwait(false);
 180            }
 0181            catch (Exception e)
 182            {
 0183                scope.Failed(e);
 0184                throw;
 185            }
 2186        }
 187
 188        /// <summary> Gets a list of virtual machine image publishers for the specified Azure location. </summary>
 189        /// <param name="location"> The name of a supported Azure region. </param>
 190        /// <param name="cancellationToken"> The cancellation token to use. </param>
 191        public virtual Response<IReadOnlyList<VirtualMachineImageResource>> ListPublishers(string location, Cancellation
 192        {
 2193            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListPublishers");
 2194            scope.Start();
 195            try
 196            {
 2197                return RestClient.ListPublishers(location, cancellationToken);
 198            }
 0199            catch (Exception e)
 200            {
 0201                scope.Failed(e);
 0202                throw;
 203            }
 2204        }
 205
 206        /// <summary> Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. </summ
 207        /// <param name="location"> The name of a supported Azure region. </param>
 208        /// <param name="publisherName"> A valid image publisher. </param>
 209        /// <param name="offer"> A valid image publisher offer. </param>
 210        /// <param name="cancellationToken"> The cancellation token to use. </param>
 211        public virtual async Task<Response<IReadOnlyList<VirtualMachineImageResource>>> ListSkusAsync(string location, s
 212        {
 4213            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListSkus");
 4214            scope.Start();
 215            try
 216            {
 4217                return await RestClient.ListSkusAsync(location, publisherName, offer, cancellationToken).ConfigureAwait(
 218            }
 0219            catch (Exception e)
 220            {
 0221                scope.Failed(e);
 0222                throw;
 223            }
 4224        }
 225
 226        /// <summary> Gets a list of virtual machine image SKUs for the specified location, publisher, and offer. </summ
 227        /// <param name="location"> The name of a supported Azure region. </param>
 228        /// <param name="publisherName"> A valid image publisher. </param>
 229        /// <param name="offer"> A valid image publisher offer. </param>
 230        /// <param name="cancellationToken"> The cancellation token to use. </param>
 231        public virtual Response<IReadOnlyList<VirtualMachineImageResource>> ListSkus(string location, string publisherNa
 232        {
 4233            using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListSkus");
 4234            scope.Start();
 235            try
 236            {
 4237                return RestClient.ListSkus(location, publisherName, offer, cancellationToken);
 238            }
 0239            catch (Exception e)
 240            {
 0241                scope.Failed(e);
 0242                throw;
 243            }
 4244        }
 245    }
 246}