| | 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.Resources.Models |
| | 13 | | { |
| | 14 | | public partial class Provider |
| | 15 | | { |
| | 16 | | internal static Provider DeserializeProvider(JsonElement element) |
| | 17 | | { |
| 1616 | 18 | | string id = default; |
| 1616 | 19 | | string @namespace = default; |
| 1616 | 20 | | string registrationState = default; |
| 1616 | 21 | | string registrationPolicy = default; |
| 1616 | 22 | | IReadOnlyList<ProviderResourceType> resourceTypes = default; |
| 20440 | 23 | | foreach (var property in element.EnumerateObject()) |
| | 24 | | { |
| 8604 | 25 | | if (property.NameEquals("id")) |
| | 26 | | { |
| 1452 | 27 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 28 | | { |
| | 29 | | continue; |
| | 30 | | } |
| 1452 | 31 | | id = property.Value.GetString(); |
| 1452 | 32 | | continue; |
| | 33 | | } |
| 7152 | 34 | | if (property.NameEquals("namespace")) |
| | 35 | | { |
| 1608 | 36 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 37 | | { |
| | 38 | | continue; |
| | 39 | | } |
| 1608 | 40 | | @namespace = property.Value.GetString(); |
| 1608 | 41 | | continue; |
| | 42 | | } |
| 5544 | 43 | | if (property.NameEquals("registrationState")) |
| | 44 | | { |
| 1460 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 1460 | 49 | | registrationState = property.Value.GetString(); |
| 1460 | 50 | | continue; |
| | 51 | | } |
| 4084 | 52 | | if (property.NameEquals("registrationPolicy")) |
| | 53 | | { |
| 1452 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 1452 | 58 | | registrationPolicy = property.Value.GetString(); |
| 1452 | 59 | | continue; |
| | 60 | | } |
| 2632 | 61 | | if (property.NameEquals("resourceTypes")) |
| | 62 | | { |
| 1608 | 63 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| | 65 | | continue; |
| | 66 | | } |
| 1608 | 67 | | List<ProviderResourceType> array = new List<ProviderResourceType>(); |
| 36136 | 68 | | foreach (var item in property.Value.EnumerateArray()) |
| | 69 | | { |
| 16460 | 70 | | if (item.ValueKind == JsonValueKind.Null) |
| | 71 | | { |
| 0 | 72 | | array.Add(null); |
| | 73 | | } |
| | 74 | | else |
| | 75 | | { |
| 16460 | 76 | | array.Add(ProviderResourceType.DeserializeProviderResourceType(item)); |
| | 77 | | } |
| | 78 | | } |
| 1608 | 79 | | resourceTypes = array; |
| | 80 | | continue; |
| | 81 | | } |
| | 82 | | } |
| 1616 | 83 | | return new Provider(id, @namespace, registrationState, registrationPolicy, resourceTypes); |
| | 84 | | } |
| | 85 | | } |
| | 86 | | } |