| | 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 ResourceSkuLocationInfo |
| | 15 | | { |
| | 16 | | internal static ResourceSkuLocationInfo DeserializeResourceSkuLocationInfo(JsonElement element) |
| | 17 | | { |
| 40800 | 18 | | string location = default; |
| 40800 | 19 | | IReadOnlyList<string> zones = default; |
| 40800 | 20 | | IReadOnlyList<ResourceSkuZoneDetails> zoneDetails = default; |
| 326400 | 21 | | foreach (var property in element.EnumerateObject()) |
| | 22 | | { |
| 122400 | 23 | | if (property.NameEquals("location")) |
| | 24 | | { |
| 40800 | 25 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 26 | | { |
| | 27 | | continue; |
| | 28 | | } |
| 40800 | 29 | | location = property.Value.GetString(); |
| 40800 | 30 | | continue; |
| | 31 | | } |
| 81600 | 32 | | if (property.NameEquals("zones")) |
| | 33 | | { |
| 40800 | 34 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 35 | | { |
| | 36 | | continue; |
| | 37 | | } |
| 40800 | 38 | | List<string> array = new List<string>(); |
| 144692 | 39 | | foreach (var item in property.Value.EnumerateArray()) |
| | 40 | | { |
| 31546 | 41 | | if (item.ValueKind == JsonValueKind.Null) |
| | 42 | | { |
| 0 | 43 | | array.Add(null); |
| | 44 | | } |
| | 45 | | else |
| | 46 | | { |
| 31546 | 47 | | array.Add(item.GetString()); |
| | 48 | | } |
| | 49 | | } |
| 40800 | 50 | | zones = array; |
| 40800 | 51 | | continue; |
| | 52 | | } |
| 40800 | 53 | | if (property.NameEquals("zoneDetails")) |
| | 54 | | { |
| 40800 | 55 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 56 | | { |
| | 57 | | continue; |
| | 58 | | } |
| 40800 | 59 | | List<ResourceSkuZoneDetails> array = new List<ResourceSkuZoneDetails>(); |
| 89360 | 60 | | foreach (var item in property.Value.EnumerateArray()) |
| | 61 | | { |
| 3880 | 62 | | if (item.ValueKind == JsonValueKind.Null) |
| | 63 | | { |
| 0 | 64 | | array.Add(null); |
| | 65 | | } |
| | 66 | | else |
| | 67 | | { |
| 3880 | 68 | | array.Add(ResourceSkuZoneDetails.DeserializeResourceSkuZoneDetails(item)); |
| | 69 | | } |
| | 70 | | } |
| 40800 | 71 | | zoneDetails = array; |
| | 72 | | continue; |
| | 73 | | } |
| | 74 | | } |
| 40800 | 75 | | return new ResourceSkuLocationInfo(location, zones, zoneDetails); |
| | 76 | | } |
| | 77 | | } |
| | 78 | | } |