| | 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 ApplicationGatewayTrustedRootCertificate : 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 | | if (Etag != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("etag"); |
| 0 | 26 | | writer.WriteStringValue(Etag); |
| | 27 | | } |
| 0 | 28 | | if (Type != null) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("type"); |
| 0 | 31 | | writer.WriteStringValue(Type); |
| | 32 | | } |
| 0 | 33 | | if (Id != null) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("id"); |
| 0 | 36 | | writer.WriteStringValue(Id); |
| | 37 | | } |
| 0 | 38 | | writer.WritePropertyName("properties"); |
| 0 | 39 | | writer.WriteStartObject(); |
| 0 | 40 | | if (Data != null) |
| | 41 | | { |
| 0 | 42 | | writer.WritePropertyName("data"); |
| 0 | 43 | | writer.WriteStringValue(Data); |
| | 44 | | } |
| 0 | 45 | | if (KeyVaultSecretId != null) |
| | 46 | | { |
| 0 | 47 | | writer.WritePropertyName("keyVaultSecretId"); |
| 0 | 48 | | writer.WriteStringValue(KeyVaultSecretId); |
| | 49 | | } |
| 0 | 50 | | if (ProvisioningState != null) |
| | 51 | | { |
| 0 | 52 | | writer.WritePropertyName("provisioningState"); |
| 0 | 53 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 54 | | } |
| 0 | 55 | | writer.WriteEndObject(); |
| 0 | 56 | | writer.WriteEndObject(); |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | internal static ApplicationGatewayTrustedRootCertificate DeserializeApplicationGatewayTrustedRootCertificate(Jso |
| | 60 | | { |
| 0 | 61 | | string name = default; |
| 0 | 62 | | string etag = default; |
| 0 | 63 | | string type = default; |
| 0 | 64 | | string id = default; |
| 0 | 65 | | string data = default; |
| 0 | 66 | | string keyVaultSecretId = default; |
| 0 | 67 | | ProvisioningState? provisioningState = default; |
| 0 | 68 | | foreach (var property in element.EnumerateObject()) |
| | 69 | | { |
| 0 | 70 | | if (property.NameEquals("name")) |
| | 71 | | { |
| 0 | 72 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 73 | | { |
| | 74 | | continue; |
| | 75 | | } |
| 0 | 76 | | name = property.Value.GetString(); |
| 0 | 77 | | continue; |
| | 78 | | } |
| 0 | 79 | | if (property.NameEquals("etag")) |
| | 80 | | { |
| 0 | 81 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 82 | | { |
| | 83 | | continue; |
| | 84 | | } |
| 0 | 85 | | etag = property.Value.GetString(); |
| 0 | 86 | | continue; |
| | 87 | | } |
| 0 | 88 | | if (property.NameEquals("type")) |
| | 89 | | { |
| 0 | 90 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 91 | | { |
| | 92 | | continue; |
| | 93 | | } |
| 0 | 94 | | type = property.Value.GetString(); |
| 0 | 95 | | continue; |
| | 96 | | } |
| 0 | 97 | | if (property.NameEquals("id")) |
| | 98 | | { |
| 0 | 99 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 100 | | { |
| | 101 | | continue; |
| | 102 | | } |
| 0 | 103 | | id = property.Value.GetString(); |
| 0 | 104 | | continue; |
| | 105 | | } |
| 0 | 106 | | if (property.NameEquals("properties")) |
| | 107 | | { |
| 0 | 108 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 109 | | { |
| 0 | 110 | | if (property0.NameEquals("data")) |
| | 111 | | { |
| 0 | 112 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 113 | | { |
| | 114 | | continue; |
| | 115 | | } |
| 0 | 116 | | data = property0.Value.GetString(); |
| 0 | 117 | | continue; |
| | 118 | | } |
| 0 | 119 | | if (property0.NameEquals("keyVaultSecretId")) |
| | 120 | | { |
| 0 | 121 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 122 | | { |
| | 123 | | continue; |
| | 124 | | } |
| 0 | 125 | | keyVaultSecretId = property0.Value.GetString(); |
| 0 | 126 | | continue; |
| | 127 | | } |
| 0 | 128 | | if (property0.NameEquals("provisioningState")) |
| | 129 | | { |
| 0 | 130 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 131 | | { |
| | 132 | | continue; |
| | 133 | | } |
| 0 | 134 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | 135 | | continue; |
| | 136 | | } |
| | 137 | | } |
| | 138 | | continue; |
| | 139 | | } |
| | 140 | | } |
| 0 | 141 | | return new ApplicationGatewayTrustedRootCertificate(id, name, etag, type, data, keyVaultSecretId, provisioni |
| | 142 | | } |
| | 143 | | } |
| | 144 | | } |