| | 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 ApplicationGatewayAuthenticationCertificate : 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 (ProvisioningState != null) |
| | 46 | | { |
| 0 | 47 | | writer.WritePropertyName("provisioningState"); |
| 0 | 48 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 49 | | } |
| 0 | 50 | | writer.WriteEndObject(); |
| 0 | 51 | | writer.WriteEndObject(); |
| 0 | 52 | | } |
| | 53 | |
|
| | 54 | | internal static ApplicationGatewayAuthenticationCertificate DeserializeApplicationGatewayAuthenticationCertifica |
| | 55 | | { |
| 0 | 56 | | string name = default; |
| 0 | 57 | | string etag = default; |
| 0 | 58 | | string type = default; |
| 0 | 59 | | string id = default; |
| 0 | 60 | | string data = default; |
| 0 | 61 | | ProvisioningState? provisioningState = default; |
| 0 | 62 | | foreach (var property in element.EnumerateObject()) |
| | 63 | | { |
| 0 | 64 | | if (property.NameEquals("name")) |
| | 65 | | { |
| 0 | 66 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 67 | | { |
| | 68 | | continue; |
| | 69 | | } |
| 0 | 70 | | name = property.Value.GetString(); |
| 0 | 71 | | continue; |
| | 72 | | } |
| 0 | 73 | | if (property.NameEquals("etag")) |
| | 74 | | { |
| 0 | 75 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 76 | | { |
| | 77 | | continue; |
| | 78 | | } |
| 0 | 79 | | etag = property.Value.GetString(); |
| 0 | 80 | | continue; |
| | 81 | | } |
| 0 | 82 | | if (property.NameEquals("type")) |
| | 83 | | { |
| 0 | 84 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 85 | | { |
| | 86 | | continue; |
| | 87 | | } |
| 0 | 88 | | type = property.Value.GetString(); |
| 0 | 89 | | continue; |
| | 90 | | } |
| 0 | 91 | | if (property.NameEquals("id")) |
| | 92 | | { |
| 0 | 93 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 94 | | { |
| | 95 | | continue; |
| | 96 | | } |
| 0 | 97 | | id = property.Value.GetString(); |
| 0 | 98 | | continue; |
| | 99 | | } |
| 0 | 100 | | if (property.NameEquals("properties")) |
| | 101 | | { |
| 0 | 102 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 103 | | { |
| 0 | 104 | | if (property0.NameEquals("data")) |
| | 105 | | { |
| 0 | 106 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 107 | | { |
| | 108 | | continue; |
| | 109 | | } |
| 0 | 110 | | data = property0.Value.GetString(); |
| 0 | 111 | | continue; |
| | 112 | | } |
| 0 | 113 | | if (property0.NameEquals("provisioningState")) |
| | 114 | | { |
| 0 | 115 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 116 | | { |
| | 117 | | continue; |
| | 118 | | } |
| 0 | 119 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | 120 | | continue; |
| | 121 | | } |
| | 122 | | } |
| | 123 | | continue; |
| | 124 | | } |
| | 125 | | } |
| 0 | 126 | | return new ApplicationGatewayAuthenticationCertificate(id, name, etag, type, data, provisioningState); |
| | 127 | | } |
| | 128 | | } |
| | 129 | | } |