| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Compute.Models |
| | 12 | | { |
| | 13 | | public partial class ComputeOperationValue |
| | 14 | | { |
| | 15 | | internal static ComputeOperationValue DeserializeComputeOperationValue(JsonElement element) |
| | 16 | | { |
| 728 | 17 | | string origin = default; |
| 728 | 18 | | string name = default; |
| 728 | 19 | | string operation = default; |
| 728 | 20 | | string resource = default; |
| 728 | 21 | | string description = default; |
| 728 | 22 | | string provider = default; |
| 7312 | 23 | | foreach (var property in element.EnumerateObject()) |
| | 24 | | { |
| 2928 | 25 | | if (property.NameEquals("origin")) |
| | 26 | | { |
| 728 | 27 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 28 | | { |
| | 29 | | continue; |
| | 30 | | } |
| 728 | 31 | | origin = property.Value.GetString(); |
| 728 | 32 | | continue; |
| | 33 | | } |
| 2200 | 34 | | if (property.NameEquals("name")) |
| | 35 | | { |
| 728 | 36 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 37 | | { |
| | 38 | | continue; |
| | 39 | | } |
| 728 | 40 | | name = property.Value.GetString(); |
| 728 | 41 | | continue; |
| | 42 | | } |
| 1472 | 43 | | if (property.NameEquals("display")) |
| | 44 | | { |
| 7280 | 45 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 46 | | { |
| 2912 | 47 | | if (property0.NameEquals("operation")) |
| | 48 | | { |
| 728 | 49 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 50 | | { |
| | 51 | | continue; |
| | 52 | | } |
| 728 | 53 | | operation = property0.Value.GetString(); |
| 728 | 54 | | continue; |
| | 55 | | } |
| 2184 | 56 | | if (property0.NameEquals("resource")) |
| | 57 | | { |
| 728 | 58 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 59 | | { |
| | 60 | | continue; |
| | 61 | | } |
| 728 | 62 | | resource = property0.Value.GetString(); |
| 728 | 63 | | continue; |
| | 64 | | } |
| 1456 | 65 | | if (property0.NameEquals("description")) |
| | 66 | | { |
| 728 | 67 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 68 | | { |
| | 69 | | continue; |
| | 70 | | } |
| 728 | 71 | | description = property0.Value.GetString(); |
| 728 | 72 | | continue; |
| | 73 | | } |
| 728 | 74 | | if (property0.NameEquals("provider")) |
| | 75 | | { |
| 728 | 76 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 77 | | { |
| | 78 | | continue; |
| | 79 | | } |
| 728 | 80 | | provider = property0.Value.GetString(); |
| | 81 | | continue; |
| | 82 | | } |
| | 83 | | } |
| | 84 | | continue; |
| | 85 | | } |
| | 86 | | } |
| 728 | 87 | | return new ComputeOperationValue(origin, name, operation, resource, description, provider); |
| | 88 | | } |
| | 89 | | } |
| | 90 | | } |