| | | 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.Resources.Models |
| | | 12 | | { |
| | | 13 | | public partial class AliasPattern |
| | | 14 | | { |
| | | 15 | | internal static AliasPattern DeserializeAliasPattern(JsonElement element) |
| | | 16 | | { |
| | 64 | 17 | | string phrase = default; |
| | 64 | 18 | | string variable = default; |
| | 64 | 19 | | AliasPatternType? type = default; |
| | 512 | 20 | | foreach (var property in element.EnumerateObject()) |
| | | 21 | | { |
| | 192 | 22 | | if (property.NameEquals("phrase")) |
| | | 23 | | { |
| | 64 | 24 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 25 | | { |
| | | 26 | | continue; |
| | | 27 | | } |
| | 64 | 28 | | phrase = property.Value.GetString(); |
| | 64 | 29 | | continue; |
| | | 30 | | } |
| | 128 | 31 | | if (property.NameEquals("variable")) |
| | | 32 | | { |
| | 64 | 33 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 34 | | { |
| | | 35 | | continue; |
| | | 36 | | } |
| | 64 | 37 | | variable = property.Value.GetString(); |
| | 64 | 38 | | continue; |
| | | 39 | | } |
| | 64 | 40 | | if (property.NameEquals("type")) |
| | | 41 | | { |
| | 64 | 42 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 43 | | { |
| | | 44 | | continue; |
| | | 45 | | } |
| | 64 | 46 | | type = property.Value.GetString().ToAliasPatternType(); |
| | | 47 | | continue; |
| | | 48 | | } |
| | | 49 | | } |
| | 64 | 50 | | return new AliasPattern(phrase, variable, type); |
| | | 51 | | } |
| | | 52 | | } |
| | | 53 | | } |