| | 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.Text.Json; |
| | 10 | | using System.Threading; |
| | 11 | | using System.Threading.Tasks; |
| | 12 | | using Azure; |
| | 13 | | using Azure.Core; |
| | 14 | | using Azure.Core.Pipeline; |
| | 15 | | using Azure.ResourceManager.Compute.Models; |
| | 16 | |
|
| | 17 | | namespace Azure.ResourceManager.Compute |
| | 18 | | { |
| | 19 | | /// <summary> The operation to create or update the extension. </summary> |
| | 20 | | public partial class VirtualMachineExtensionsCreateOrUpdateOperation : Operation<VirtualMachineExtension>, IOperatio |
| | 21 | | { |
| | 22 | | private readonly ArmOperationHelpers<VirtualMachineExtension> _operation; |
| 0 | 23 | | internal VirtualMachineExtensionsCreateOrUpdateOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipel |
| | 24 | | { |
| 0 | 25 | | _operation = new ArmOperationHelpers<VirtualMachineExtension>(this, clientDiagnostics, pipeline, request, re |
| 0 | 26 | | } |
| | 27 | | /// <inheritdoc /> |
| 0 | 28 | | public override string Id => _operation.Id; |
| | 29 | |
|
| | 30 | | /// <inheritdoc /> |
| 0 | 31 | | public override VirtualMachineExtension Value => _operation.Value; |
| | 32 | |
|
| | 33 | | /// <inheritdoc /> |
| 0 | 34 | | public override bool HasCompleted => _operation.HasCompleted; |
| | 35 | |
|
| | 36 | | /// <inheritdoc /> |
| 0 | 37 | | public override bool HasValue => _operation.HasValue; |
| | 38 | |
|
| | 39 | | /// <inheritdoc /> |
| 0 | 40 | | public override Response GetRawResponse() => _operation.GetRawResponse(); |
| | 41 | |
|
| | 42 | | /// <inheritdoc /> |
| 0 | 43 | | public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus( |
| | 44 | |
|
| | 45 | | /// <inheritdoc /> |
| 0 | 46 | | public override ValueTask<Response> UpdateStatusAsync(CancellationToken cancellationToken = default) => _operati |
| | 47 | |
|
| | 48 | | /// <inheritdoc /> |
| 0 | 49 | | public override ValueTask<Response<VirtualMachineExtension>> WaitForCompletionAsync(CancellationToken cancellati |
| | 50 | |
|
| | 51 | | /// <inheritdoc /> |
| 0 | 52 | | public override ValueTask<Response<VirtualMachineExtension>> WaitForCompletionAsync(TimeSpan pollingInterval, Ca |
| | 53 | |
|
| | 54 | | VirtualMachineExtension IOperationSource<VirtualMachineExtension>.CreateResult(Response response, CancellationTo |
| | 55 | | { |
| 0 | 56 | | using var document = JsonDocument.Parse(response.ContentStream); |
| 0 | 57 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 58 | | { |
| 0 | 59 | | return null; |
| | 60 | | } |
| | 61 | | else |
| | 62 | | { |
| 0 | 63 | | return VirtualMachineExtension.DeserializeVirtualMachineExtension(document.RootElement); |
| | 64 | | } |
| 0 | 65 | | } |
| | 66 | |
|
| | 67 | | async ValueTask<VirtualMachineExtension> IOperationSource<VirtualMachineExtension>.CreateResultAsync(Response re |
| | 68 | | { |
| 0 | 69 | | using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).Confi |
| 0 | 70 | | if (document.RootElement.ValueKind == JsonValueKind.Null) |
| | 71 | | { |
| 0 | 72 | | return null; |
| | 73 | | } |
| | 74 | | else |
| | 75 | | { |
| 0 | 76 | | return VirtualMachineExtension.DeserializeVirtualMachineExtension(document.RootElement); |
| | 77 | | } |
| 0 | 78 | | } |
| | 79 | | } |
| | 80 | | } |