| | 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.Network.Models |
| | 12 | | { |
| | 13 | | public partial class FirewallPolicyCertificateAuthority : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Name != null) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("name"); |
| 0 | 21 | | writer.WriteStringValue(Name); |
| | 22 | | } |
| 0 | 23 | | writer.WritePropertyName("properties"); |
| 0 | 24 | | writer.WriteStartObject(); |
| 0 | 25 | | if (KeyVaultSecretId != null) |
| | 26 | | { |
| 0 | 27 | | writer.WritePropertyName("keyVaultSecretId"); |
| 0 | 28 | | writer.WriteStringValue(KeyVaultSecretId); |
| | 29 | | } |
| 0 | 30 | | writer.WriteEndObject(); |
| 0 | 31 | | writer.WriteEndObject(); |
| 0 | 32 | | } |
| | 33 | |
|
| | 34 | | internal static FirewallPolicyCertificateAuthority DeserializeFirewallPolicyCertificateAuthority(JsonElement ele |
| | 35 | | { |
| 0 | 36 | | string name = default; |
| 0 | 37 | | string keyVaultSecretId = default; |
| 0 | 38 | | foreach (var property in element.EnumerateObject()) |
| | 39 | | { |
| 0 | 40 | | if (property.NameEquals("name")) |
| | 41 | | { |
| 0 | 42 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 43 | | { |
| | 44 | | continue; |
| | 45 | | } |
| 0 | 46 | | name = property.Value.GetString(); |
| 0 | 47 | | continue; |
| | 48 | | } |
| 0 | 49 | | if (property.NameEquals("properties")) |
| | 50 | | { |
| 0 | 51 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 52 | | { |
| 0 | 53 | | if (property0.NameEquals("keyVaultSecretId")) |
| | 54 | | { |
| 0 | 55 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 56 | | { |
| | 57 | | continue; |
| | 58 | | } |
| 0 | 59 | | keyVaultSecretId = property0.Value.GetString(); |
| | 60 | | continue; |
| | 61 | | } |
| | 62 | | } |
| | 63 | | continue; |
| | 64 | | } |
| | 65 | | } |
| 0 | 66 | | return new FirewallPolicyCertificateAuthority(name, keyVaultSecretId); |
| | 67 | | } |
| | 68 | | } |
| | 69 | | } |