| | 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.Threading; |
| | 10 | | using System.Threading.Tasks; |
| | 11 | | using Azure; |
| | 12 | | using Azure.Core; |
| | 13 | | using Azure.Core.Pipeline; |
| | 14 | | using Azure.ResourceManager.Compute.Models; |
| | 15 | |
|
| | 16 | | namespace Azure.ResourceManager.Compute |
| | 17 | | { |
| | 18 | | /// <summary> The GalleryApplications service client. </summary> |
| | 19 | | public partial class GalleryApplicationsOperations |
| | 20 | | { |
| | 21 | | private readonly ClientDiagnostics _clientDiagnostics; |
| | 22 | | private readonly HttpPipeline _pipeline; |
| 32 | 23 | | internal GalleryApplicationsRestOperations RestClient { get; } |
| | 24 | | /// <summary> Initializes a new instance of GalleryApplicationsOperations for mocking. </summary> |
| 396 | 25 | | protected GalleryApplicationsOperations() |
| | 26 | | { |
| 396 | 27 | | } |
| | 28 | | /// <summary> Initializes a new instance of GalleryApplicationsOperations. </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 GalleryApplicationsOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscr |
| | 34 | | { |
| 396 | 35 | | RestClient = new GalleryApplicationsRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint); |
| 396 | 36 | | _clientDiagnostics = clientDiagnostics; |
| 396 | 37 | | _pipeline = pipeline; |
| 396 | 38 | | } |
| | 39 | |
|
| | 40 | | /// <summary> Retrieves information about a gallery Application Definition. </summary> |
| | 41 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 42 | | /// <param name="galleryName"> The name of the Shared Application Gallery from which the Application Definitions |
| | 43 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be retrieved. </para |
| | 44 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 45 | | public virtual async Task<Response<GalleryApplication>> GetAsync(string resourceGroupName, string galleryName, s |
| | 46 | | { |
| 4 | 47 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.Get"); |
| 4 | 48 | | scope.Start(); |
| | 49 | | try |
| | 50 | | { |
| 4 | 51 | | return await RestClient.GetAsync(resourceGroupName, galleryName, galleryApplicationName, cancellationTok |
| | 52 | | } |
| 0 | 53 | | catch (Exception e) |
| | 54 | | { |
| 0 | 55 | | scope.Failed(e); |
| 0 | 56 | | throw; |
| | 57 | | } |
| 4 | 58 | | } |
| | 59 | |
|
| | 60 | | /// <summary> Retrieves information about a gallery Application Definition. </summary> |
| | 61 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 62 | | /// <param name="galleryName"> The name of the Shared Application Gallery from which the Application Definitions |
| | 63 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be retrieved. </para |
| | 64 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 65 | | public virtual Response<GalleryApplication> Get(string resourceGroupName, string galleryName, string galleryAppl |
| | 66 | | { |
| 4 | 67 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.Get"); |
| 4 | 68 | | scope.Start(); |
| | 69 | | try |
| | 70 | | { |
| 4 | 71 | | return RestClient.Get(resourceGroupName, galleryName, galleryApplicationName, cancellationToken); |
| | 72 | | } |
| 0 | 73 | | catch (Exception e) |
| | 74 | | { |
| 0 | 75 | | scope.Failed(e); |
| 0 | 76 | | throw; |
| | 77 | | } |
| 4 | 78 | | } |
| | 79 | |
|
| | 80 | | /// <summary> List gallery Application Definitions in a gallery. </summary> |
| | 81 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 82 | | /// <param name="galleryName"> The name of the Shared Application Gallery from which Application Definitions are |
| | 83 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 84 | | public virtual AsyncPageable<GalleryApplication> ListByGalleryAsync(string resourceGroupName, string galleryName |
| | 85 | | { |
| 0 | 86 | | if (resourceGroupName == null) |
| | 87 | | { |
| 0 | 88 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 89 | | } |
| 0 | 90 | | if (galleryName == null) |
| | 91 | | { |
| 0 | 92 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 93 | | } |
| | 94 | |
|
| | 95 | | async Task<Page<GalleryApplication>> FirstPageFunc(int? pageSizeHint) |
| | 96 | | { |
| 0 | 97 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.ListByGallery"); |
| 0 | 98 | | scope.Start(); |
| | 99 | | try |
| | 100 | | { |
| 0 | 101 | | var response = await RestClient.ListByGalleryAsync(resourceGroupName, galleryName, cancellationToken |
| 0 | 102 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 103 | | } |
| 0 | 104 | | catch (Exception e) |
| | 105 | | { |
| 0 | 106 | | scope.Failed(e); |
| 0 | 107 | | throw; |
| | 108 | | } |
| 0 | 109 | | } |
| | 110 | | async Task<Page<GalleryApplication>> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 111 | | { |
| 0 | 112 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.ListByGallery"); |
| 0 | 113 | | scope.Start(); |
| | 114 | | try |
| | 115 | | { |
| 0 | 116 | | var response = await RestClient.ListByGalleryNextPageAsync(nextLink, resourceGroupName, galleryName, |
| 0 | 117 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 118 | | } |
| 0 | 119 | | catch (Exception e) |
| | 120 | | { |
| 0 | 121 | | scope.Failed(e); |
| 0 | 122 | | throw; |
| | 123 | | } |
| 0 | 124 | | } |
| 0 | 125 | | return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); |
| | 126 | | } |
| | 127 | |
|
| | 128 | | /// <summary> List gallery Application Definitions in a gallery. </summary> |
| | 129 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 130 | | /// <param name="galleryName"> The name of the Shared Application Gallery from which Application Definitions are |
| | 131 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 132 | | public virtual Pageable<GalleryApplication> ListByGallery(string resourceGroupName, string galleryName, Cancella |
| | 133 | | { |
| 0 | 134 | | if (resourceGroupName == null) |
| | 135 | | { |
| 0 | 136 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 137 | | } |
| 0 | 138 | | if (galleryName == null) |
| | 139 | | { |
| 0 | 140 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 141 | | } |
| | 142 | |
|
| | 143 | | Page<GalleryApplication> FirstPageFunc(int? pageSizeHint) |
| | 144 | | { |
| 0 | 145 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.ListByGallery"); |
| 0 | 146 | | scope.Start(); |
| | 147 | | try |
| | 148 | | { |
| 0 | 149 | | var response = RestClient.ListByGallery(resourceGroupName, galleryName, cancellationToken); |
| 0 | 150 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 151 | | } |
| 0 | 152 | | catch (Exception e) |
| | 153 | | { |
| 0 | 154 | | scope.Failed(e); |
| 0 | 155 | | throw; |
| | 156 | | } |
| 0 | 157 | | } |
| | 158 | | Page<GalleryApplication> NextPageFunc(string nextLink, int? pageSizeHint) |
| | 159 | | { |
| 0 | 160 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.ListByGallery"); |
| 0 | 161 | | scope.Start(); |
| | 162 | | try |
| | 163 | | { |
| 0 | 164 | | var response = RestClient.ListByGalleryNextPage(nextLink, resourceGroupName, galleryName, cancellati |
| 0 | 165 | | return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse()); |
| | 166 | | } |
| 0 | 167 | | catch (Exception e) |
| | 168 | | { |
| 0 | 169 | | scope.Failed(e); |
| 0 | 170 | | throw; |
| | 171 | | } |
| 0 | 172 | | } |
| 0 | 173 | | return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); |
| | 174 | | } |
| | 175 | |
|
| | 176 | | /// <summary> Create or update a gallery Application Definition. </summary> |
| | 177 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 178 | | /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is |
| | 179 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be created or update |
| | 180 | | /// <param name="galleryApplication"> Parameters supplied to the create or update gallery Application operation. |
| | 181 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 182 | | public virtual async Task<GalleryApplicationsCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGr |
| | 183 | | { |
| 4 | 184 | | if (resourceGroupName == null) |
| | 185 | | { |
| 0 | 186 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 187 | | } |
| 4 | 188 | | if (galleryName == null) |
| | 189 | | { |
| 0 | 190 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 191 | | } |
| 4 | 192 | | if (galleryApplicationName == null) |
| | 193 | | { |
| 0 | 194 | | throw new ArgumentNullException(nameof(galleryApplicationName)); |
| | 195 | | } |
| 4 | 196 | | if (galleryApplication == null) |
| | 197 | | { |
| 0 | 198 | | throw new ArgumentNullException(nameof(galleryApplication)); |
| | 199 | | } |
| | 200 | |
|
| 4 | 201 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.StartCreateOrUpdate"); |
| 4 | 202 | | scope.Start(); |
| | 203 | | try |
| | 204 | | { |
| 4 | 205 | | var originalResponse = await RestClient.CreateOrUpdateAsync(resourceGroupName, galleryName, galleryAppli |
| 4 | 206 | | return new GalleryApplicationsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCr |
| | 207 | | } |
| 0 | 208 | | catch (Exception e) |
| | 209 | | { |
| 0 | 210 | | scope.Failed(e); |
| 0 | 211 | | throw; |
| | 212 | | } |
| 4 | 213 | | } |
| | 214 | |
|
| | 215 | | /// <summary> Create or update a gallery Application Definition. </summary> |
| | 216 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 217 | | /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is |
| | 218 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be created or update |
| | 219 | | /// <param name="galleryApplication"> Parameters supplied to the create or update gallery Application operation. |
| | 220 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 221 | | public virtual GalleryApplicationsCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string g |
| | 222 | | { |
| 4 | 223 | | if (resourceGroupName == null) |
| | 224 | | { |
| 0 | 225 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 226 | | } |
| 4 | 227 | | if (galleryName == null) |
| | 228 | | { |
| 0 | 229 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 230 | | } |
| 4 | 231 | | if (galleryApplicationName == null) |
| | 232 | | { |
| 0 | 233 | | throw new ArgumentNullException(nameof(galleryApplicationName)); |
| | 234 | | } |
| 4 | 235 | | if (galleryApplication == null) |
| | 236 | | { |
| 0 | 237 | | throw new ArgumentNullException(nameof(galleryApplication)); |
| | 238 | | } |
| | 239 | |
|
| 4 | 240 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.StartCreateOrUpdate"); |
| 4 | 241 | | scope.Start(); |
| | 242 | | try |
| | 243 | | { |
| 4 | 244 | | var originalResponse = RestClient.CreateOrUpdate(resourceGroupName, galleryName, galleryApplicationName, |
| 4 | 245 | | return new GalleryApplicationsCreateOrUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateCr |
| | 246 | | } |
| 0 | 247 | | catch (Exception e) |
| | 248 | | { |
| 0 | 249 | | scope.Failed(e); |
| 0 | 250 | | throw; |
| | 251 | | } |
| 4 | 252 | | } |
| | 253 | |
|
| | 254 | | /// <summary> Update a gallery Application Definition. </summary> |
| | 255 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 256 | | /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is |
| | 257 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be updated. The allo |
| | 258 | | /// <param name="galleryApplication"> Parameters supplied to the update gallery Application operation. </param> |
| | 259 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 260 | | public virtual async Task<GalleryApplicationsUpdateOperation> StartUpdateAsync(string resourceGroupName, string |
| | 261 | | { |
| 0 | 262 | | if (resourceGroupName == null) |
| | 263 | | { |
| 0 | 264 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 265 | | } |
| 0 | 266 | | if (galleryName == null) |
| | 267 | | { |
| 0 | 268 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 269 | | } |
| 0 | 270 | | if (galleryApplicationName == null) |
| | 271 | | { |
| 0 | 272 | | throw new ArgumentNullException(nameof(galleryApplicationName)); |
| | 273 | | } |
| 0 | 274 | | if (galleryApplication == null) |
| | 275 | | { |
| 0 | 276 | | throw new ArgumentNullException(nameof(galleryApplication)); |
| | 277 | | } |
| | 278 | |
|
| 0 | 279 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.StartUpdate"); |
| 0 | 280 | | scope.Start(); |
| | 281 | | try |
| | 282 | | { |
| 0 | 283 | | var originalResponse = await RestClient.UpdateAsync(resourceGroupName, galleryName, galleryApplicationNa |
| 0 | 284 | | return new GalleryApplicationsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequ |
| | 285 | | } |
| 0 | 286 | | catch (Exception e) |
| | 287 | | { |
| 0 | 288 | | scope.Failed(e); |
| 0 | 289 | | throw; |
| | 290 | | } |
| 0 | 291 | | } |
| | 292 | |
|
| | 293 | | /// <summary> Update a gallery Application Definition. </summary> |
| | 294 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 295 | | /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is |
| | 296 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be updated. The allo |
| | 297 | | /// <param name="galleryApplication"> Parameters supplied to the update gallery Application operation. </param> |
| | 298 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 299 | | public virtual GalleryApplicationsUpdateOperation StartUpdate(string resourceGroupName, string galleryName, stri |
| | 300 | | { |
| 0 | 301 | | if (resourceGroupName == null) |
| | 302 | | { |
| 0 | 303 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 304 | | } |
| 0 | 305 | | if (galleryName == null) |
| | 306 | | { |
| 0 | 307 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 308 | | } |
| 0 | 309 | | if (galleryApplicationName == null) |
| | 310 | | { |
| 0 | 311 | | throw new ArgumentNullException(nameof(galleryApplicationName)); |
| | 312 | | } |
| 0 | 313 | | if (galleryApplication == null) |
| | 314 | | { |
| 0 | 315 | | throw new ArgumentNullException(nameof(galleryApplication)); |
| | 316 | | } |
| | 317 | |
|
| 0 | 318 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.StartUpdate"); |
| 0 | 319 | | scope.Start(); |
| | 320 | | try |
| | 321 | | { |
| 0 | 322 | | var originalResponse = RestClient.Update(resourceGroupName, galleryName, galleryApplicationName, gallery |
| 0 | 323 | | return new GalleryApplicationsUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequ |
| | 324 | | } |
| 0 | 325 | | catch (Exception e) |
| | 326 | | { |
| 0 | 327 | | scope.Failed(e); |
| 0 | 328 | | throw; |
| | 329 | | } |
| 0 | 330 | | } |
| | 331 | |
|
| | 332 | | /// <summary> Delete a gallery Application. </summary> |
| | 333 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 334 | | /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is |
| | 335 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be deleted. </param> |
| | 336 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 337 | | public virtual async Task<GalleryApplicationsDeleteOperation> StartDeleteAsync(string resourceGroupName, string |
| | 338 | | { |
| 2 | 339 | | if (resourceGroupName == null) |
| | 340 | | { |
| 0 | 341 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 342 | | } |
| 2 | 343 | | if (galleryName == null) |
| | 344 | | { |
| 0 | 345 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 346 | | } |
| 2 | 347 | | if (galleryApplicationName == null) |
| | 348 | | { |
| 0 | 349 | | throw new ArgumentNullException(nameof(galleryApplicationName)); |
| | 350 | | } |
| | 351 | |
|
| 2 | 352 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.StartDelete"); |
| 2 | 353 | | scope.Start(); |
| | 354 | | try |
| | 355 | | { |
| 2 | 356 | | var originalResponse = await RestClient.DeleteAsync(resourceGroupName, galleryName, galleryApplicationNa |
| 2 | 357 | | return new GalleryApplicationsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ |
| | 358 | | } |
| 0 | 359 | | catch (Exception e) |
| | 360 | | { |
| 0 | 361 | | scope.Failed(e); |
| 0 | 362 | | throw; |
| | 363 | | } |
| 2 | 364 | | } |
| | 365 | |
|
| | 366 | | /// <summary> Delete a gallery Application. </summary> |
| | 367 | | /// <param name="resourceGroupName"> The name of the resource group. </param> |
| | 368 | | /// <param name="galleryName"> The name of the Shared Application Gallery in which the Application Definition is |
| | 369 | | /// <param name="galleryApplicationName"> The name of the gallery Application Definition to be deleted. </param> |
| | 370 | | /// <param name="cancellationToken"> The cancellation token to use. </param> |
| | 371 | | public virtual GalleryApplicationsDeleteOperation StartDelete(string resourceGroupName, string galleryName, stri |
| | 372 | | { |
| 2 | 373 | | if (resourceGroupName == null) |
| | 374 | | { |
| 0 | 375 | | throw new ArgumentNullException(nameof(resourceGroupName)); |
| | 376 | | } |
| 2 | 377 | | if (galleryName == null) |
| | 378 | | { |
| 0 | 379 | | throw new ArgumentNullException(nameof(galleryName)); |
| | 380 | | } |
| 2 | 381 | | if (galleryApplicationName == null) |
| | 382 | | { |
| 0 | 383 | | throw new ArgumentNullException(nameof(galleryApplicationName)); |
| | 384 | | } |
| | 385 | |
|
| 2 | 386 | | using var scope = _clientDiagnostics.CreateScope("GalleryApplicationsOperations.StartDelete"); |
| 2 | 387 | | scope.Start(); |
| | 388 | | try |
| | 389 | | { |
| 2 | 390 | | var originalResponse = RestClient.Delete(resourceGroupName, galleryName, galleryApplicationName, cancell |
| 2 | 391 | | return new GalleryApplicationsDeleteOperation(_clientDiagnostics, _pipeline, RestClient.CreateDeleteRequ |
| | 392 | | } |
| 0 | 393 | | catch (Exception e) |
| | 394 | | { |
| 0 | 395 | | scope.Failed(e); |
| 0 | 396 | | throw; |
| | 397 | | } |
| 2 | 398 | | } |
| | 399 | | } |
| | 400 | | } |