| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Collections.Generic; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core.Pipeline; |
| | 14 | | using Azure.ResourceManager.Compute.Models; |
| | 15 | |
|
| | 16 | | namespace 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; |
| 368 | 23 | | internal VirtualMachineImagesRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of VirtualMachineImagesOperations for mocking. </summary> |
| 396 | 25 | | protected VirtualMachineImagesOperations() |
| | 26 | | { |
| 396 | 27 | | } |
| | 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> |
| 396 | 33 | | internal VirtualMachineImagesOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subsc |
| | 34 | | { |
| 396 | 35 | | RestClient = new VirtualMachineImagesRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 396 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 396 | 37 | | _pipeline = pipeline; |
| 396 | 38 | | } |
| | 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 | | { |
| 16 | 49 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.Get"); |
| 16 | 50 | | scope.Start(); |
| | 51 | | try |
| | 52 | | { |
| 16 | 53 | | return await RestClient.GetAsync(location, publisherName, offer, skus, version, cancellationToken).Confi |
| | 54 | | } |
| 0 | 55 | | catch (Exception e) |
| | 56 | | { |
| 0 | 57 | | scope.Failed(e); |
| 0 | 58 | | throw; |
| | 59 | | } |
| 16 | 60 | | } |
| | 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 | | { |
| 16 | 71 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.Get"); |
| 16 | 72 | | scope.Start(); |
| | 73 | | try |
| | 74 | | { |
| 16 | 75 | | return RestClient.Get(location, publisherName, offer, skus, version, cancellationToken); |
| | 76 | | } |
| 0 | 77 | | catch (Exception e) |
| | 78 | | { |
| 0 | 79 | | scope.Failed(e); |
| 0 | 80 | | throw; |
| | 81 | | } |
| 16 | 82 | | } |
| | 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 | | { |
| 160 | 95 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.List"); |
| 160 | 96 | | scope.Start(); |
| | 97 | | try |
| | 98 | | { |
| 160 | 99 | | return await RestClient.ListAsync(location, publisherName, offer, skus, expand, top, orderby, cancellati |
| | 100 | | } |
| 0 | 101 | | catch (Exception e) |
| | 102 | | { |
| 0 | 103 | | scope.Failed(e); |
| 0 | 104 | | throw; |
| | 105 | | } |
| 160 | 106 | | } |
| | 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 | | { |
| 160 | 119 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.List"); |
| 160 | 120 | | scope.Start(); |
| | 121 | | try |
| | 122 | | { |
| 160 | 123 | | return RestClient.List(location, publisherName, offer, skus, expand, top, orderby, cancellationToken); |
| | 124 | | } |
| 0 | 125 | | catch (Exception e) |
| | 126 | | { |
| 0 | 127 | | scope.Failed(e); |
| 0 | 128 | | throw; |
| | 129 | | } |
| 160 | 130 | | } |
| | 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 | | { |
| 2 | 138 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListOffers"); |
| 2 | 139 | | scope.Start(); |
| | 140 | | try |
| | 141 | | { |
| 2 | 142 | | return await RestClient.ListOffersAsync(location, publisherName, cancellationToken).ConfigureAwait(false |
| | 143 | | } |
| 0 | 144 | | catch (Exception e) |
| | 145 | | { |
| 0 | 146 | | scope.Failed(e); |
| 0 | 147 | | throw; |
| | 148 | | } |
| 2 | 149 | | } |
| | 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 | | { |
| 2 | 157 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListOffers"); |
| 2 | 158 | | scope.Start(); |
| | 159 | | try |
| | 160 | | { |
| 2 | 161 | | return RestClient.ListOffers(location, publisherName, cancellationToken); |
| | 162 | | } |
| 0 | 163 | | catch (Exception e) |
| | 164 | | { |
| 0 | 165 | | scope.Failed(e); |
| 0 | 166 | | throw; |
| | 167 | | } |
| 2 | 168 | | } |
| | 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 | | { |
| 2 | 175 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListPublishers"); |
| 2 | 176 | | scope.Start(); |
| | 177 | | try |
| | 178 | | { |
| 2 | 179 | | return await RestClient.ListPublishersAsync(location, cancellationToken).ConfigureAwait(false); |
| | 180 | | } |
| 0 | 181 | | catch (Exception e) |
| | 182 | | { |
| 0 | 183 | | scope.Failed(e); |
| 0 | 184 | | throw; |
| | 185 | | } |
| 2 | 186 | | } |
| | 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 | | { |
| 2 | 193 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListPublishers"); |
| 2 | 194 | | scope.Start(); |
| | 195 | | try |
| | 196 | | { |
| 2 | 197 | | return RestClient.ListPublishers(location, cancellationToken); |
| | 198 | | } |
| 0 | 199 | | catch (Exception e) |
| | 200 | | { |
| 0 | 201 | | scope.Failed(e); |
| 0 | 202 | | throw; |
| | 203 | | } |
| 2 | 204 | | } |
| | 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 | | { |
| 4 | 213 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListSkus"); |
| 4 | 214 | | scope.Start(); |
| | 215 | | try |
| | 216 | | { |
| 4 | 217 | | return await RestClient.ListSkusAsync(location, publisherName, offer, cancellationToken).ConfigureAwait( |
| | 218 | | } |
| 0 | 219 | | catch (Exception e) |
| | 220 | | { |
| 0 | 221 | | scope.Failed(e); |
| 0 | 222 | | throw; |
| | 223 | | } |
| 4 | 224 | | } |
| | 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 | | { |
| 4 | 233 | | using var scope = _clientDiagnostics.CreateScope("VirtualMachineImagesOperations.ListSkus"); |
| 4 | 234 | | scope.Start(); |
| | 235 | | try |
| | 236 | | { |
| 4 | 237 | | return RestClient.ListSkus(location, publisherName, offer, cancellationToken); |
| | 238 | | } |
| 0 | 239 | | catch (Exception e) |
| | 240 | | { |
| 0 | 241 | | scope.Failed(e); |
| 0 | 242 | | throw; |
| | 243 | | } |
| 4 | 244 | | } |
| | 245 | | } |
| | 246 | | } |