| | | 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.Network.Models |
| | | 13 | | { |
| | | 14 | | public partial class AvailableProvidersListState |
| | | 15 | | { |
| | | 16 | | internal static AvailableProvidersListState DeserializeAvailableProvidersListState(JsonElement element) |
| | | 17 | | { |
| | 0 | 18 | | string stateName = default; |
| | 0 | 19 | | IReadOnlyList<string> providers = default; |
| | 0 | 20 | | IReadOnlyList<AvailableProvidersListCity> cities = default; |
| | 0 | 21 | | foreach (var property in element.EnumerateObject()) |
| | | 22 | | { |
| | 0 | 23 | | if (property.NameEquals("stateName")) |
| | | 24 | | { |
| | 0 | 25 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 26 | | { |
| | | 27 | | continue; |
| | | 28 | | } |
| | 0 | 29 | | stateName = property.Value.GetString(); |
| | 0 | 30 | | continue; |
| | | 31 | | } |
| | 0 | 32 | | if (property.NameEquals("providers")) |
| | | 33 | | { |
| | 0 | 34 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 35 | | { |
| | | 36 | | continue; |
| | | 37 | | } |
| | 0 | 38 | | List<string> array = new List<string>(); |
| | 0 | 39 | | foreach (var item in property.Value.EnumerateArray()) |
| | | 40 | | { |
| | 0 | 41 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 42 | | { |
| | 0 | 43 | | array.Add(null); |
| | | 44 | | } |
| | | 45 | | else |
| | | 46 | | { |
| | 0 | 47 | | array.Add(item.GetString()); |
| | | 48 | | } |
| | | 49 | | } |
| | 0 | 50 | | providers = array; |
| | 0 | 51 | | continue; |
| | | 52 | | } |
| | 0 | 53 | | if (property.NameEquals("cities")) |
| | | 54 | | { |
| | 0 | 55 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 56 | | { |
| | | 57 | | continue; |
| | | 58 | | } |
| | 0 | 59 | | List<AvailableProvidersListCity> array = new List<AvailableProvidersListCity>(); |
| | 0 | 60 | | foreach (var item in property.Value.EnumerateArray()) |
| | | 61 | | { |
| | 0 | 62 | | if (item.ValueKind == JsonValueKind.Null) |
| | | 63 | | { |
| | 0 | 64 | | array.Add(null); |
| | | 65 | | } |
| | | 66 | | else |
| | | 67 | | { |
| | 0 | 68 | | array.Add(AvailableProvidersListCity.DeserializeAvailableProvidersListCity(item)); |
| | | 69 | | } |
| | | 70 | | } |
| | 0 | 71 | | cities = array; |
| | | 72 | | continue; |
| | | 73 | | } |
| | | 74 | | } |
| | 0 | 75 | | return new AvailableProvidersListState(stateName, providers, cities); |
| | | 76 | | } |
| | | 77 | | } |
| | | 78 | | } |