| | 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.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Compute.Models |
| | 13 | | { |
| | 14 | | public partial class ResourceSkuZoneDetails |
| | 15 | | { |
| | 16 | | internal static ResourceSkuZoneDetails DeserializeResourceSkuZoneDetails(JsonElement element) |
| | 17 | | { |
| 3880 | 18 | | IReadOnlyList<string> name = default; |
| 3880 | 19 | | IReadOnlyList<ResourceSkuCapabilities> capabilities = default; |
| 23280 | 20 | | foreach (var property in element.EnumerateObject()) |
| | 21 | | { |
| 7760 | 22 | | if (property.NameEquals("name")) |
| | 23 | | { |
| 0 | 24 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 25 | | { |
| | 26 | | continue; |
| | 27 | | } |
| 0 | 28 | | List<string> array = new List<string>(); |
| 0 | 29 | | foreach (var item in property.Value.EnumerateArray()) |
| | 30 | | { |
| 0 | 31 | | if (item.ValueKind == JsonValueKind.Null) |
| | 32 | | { |
| 0 | 33 | | array.Add(null); |
| | 34 | | } |
| | 35 | | else |
| | 36 | | { |
| 0 | 37 | | array.Add(item.GetString()); |
| | 38 | | } |
| | 39 | | } |
| 0 | 40 | | name = array; |
| 0 | 41 | | continue; |
| | 42 | | } |
| 7760 | 43 | | if (property.NameEquals("capabilities")) |
| | 44 | | { |
| 3880 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 3880 | 49 | | List<ResourceSkuCapabilities> array = new List<ResourceSkuCapabilities>(); |
| 15520 | 50 | | foreach (var item in property.Value.EnumerateArray()) |
| | 51 | | { |
| 3880 | 52 | | if (item.ValueKind == JsonValueKind.Null) |
| | 53 | | { |
| 0 | 54 | | array.Add(null); |
| | 55 | | } |
| | 56 | | else |
| | 57 | | { |
| 3880 | 58 | | array.Add(ResourceSkuCapabilities.DeserializeResourceSkuCapabilities(item)); |
| | 59 | | } |
| | 60 | | } |
| 3880 | 61 | | capabilities = array; |
| | 62 | | continue; |
| | 63 | | } |
| | 64 | | } |
| 3880 | 65 | | return new ResourceSkuZoneDetails(name, capabilities); |
| | 66 | | } |
| | 67 | | } |
| | 68 | | } |