| | | 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 VpnClientRevokedCertificate : 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 (Id != null) |
| | | 29 | | { |
| | 0 | 30 | | writer.WritePropertyName("id"); |
| | 0 | 31 | | writer.WriteStringValue(Id); |
| | | 32 | | } |
| | 0 | 33 | | writer.WritePropertyName("properties"); |
| | 0 | 34 | | writer.WriteStartObject(); |
| | 0 | 35 | | if (Thumbprint != null) |
| | | 36 | | { |
| | 0 | 37 | | writer.WritePropertyName("thumbprint"); |
| | 0 | 38 | | writer.WriteStringValue(Thumbprint); |
| | | 39 | | } |
| | 0 | 40 | | if (ProvisioningState != null) |
| | | 41 | | { |
| | 0 | 42 | | writer.WritePropertyName("provisioningState"); |
| | 0 | 43 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | | 44 | | } |
| | 0 | 45 | | writer.WriteEndObject(); |
| | 0 | 46 | | writer.WriteEndObject(); |
| | 0 | 47 | | } |
| | | 48 | | |
| | | 49 | | internal static VpnClientRevokedCertificate DeserializeVpnClientRevokedCertificate(JsonElement element) |
| | | 50 | | { |
| | 0 | 51 | | string name = default; |
| | 0 | 52 | | string etag = default; |
| | 0 | 53 | | string id = default; |
| | 0 | 54 | | string thumbprint = default; |
| | 0 | 55 | | ProvisioningState? provisioningState = default; |
| | 0 | 56 | | foreach (var property in element.EnumerateObject()) |
| | | 57 | | { |
| | 0 | 58 | | if (property.NameEquals("name")) |
| | | 59 | | { |
| | 0 | 60 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 61 | | { |
| | | 62 | | continue; |
| | | 63 | | } |
| | 0 | 64 | | name = property.Value.GetString(); |
| | 0 | 65 | | continue; |
| | | 66 | | } |
| | 0 | 67 | | if (property.NameEquals("etag")) |
| | | 68 | | { |
| | 0 | 69 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 70 | | { |
| | | 71 | | continue; |
| | | 72 | | } |
| | 0 | 73 | | etag = property.Value.GetString(); |
| | 0 | 74 | | continue; |
| | | 75 | | } |
| | 0 | 76 | | if (property.NameEquals("id")) |
| | | 77 | | { |
| | 0 | 78 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | | 79 | | { |
| | | 80 | | continue; |
| | | 81 | | } |
| | 0 | 82 | | id = property.Value.GetString(); |
| | 0 | 83 | | continue; |
| | | 84 | | } |
| | 0 | 85 | | if (property.NameEquals("properties")) |
| | | 86 | | { |
| | 0 | 87 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | | 88 | | { |
| | 0 | 89 | | if (property0.NameEquals("thumbprint")) |
| | | 90 | | { |
| | 0 | 91 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 92 | | { |
| | | 93 | | continue; |
| | | 94 | | } |
| | 0 | 95 | | thumbprint = property0.Value.GetString(); |
| | 0 | 96 | | continue; |
| | | 97 | | } |
| | 0 | 98 | | if (property0.NameEquals("provisioningState")) |
| | | 99 | | { |
| | 0 | 100 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | | 101 | | { |
| | | 102 | | continue; |
| | | 103 | | } |
| | 0 | 104 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | | 105 | | continue; |
| | | 106 | | } |
| | | 107 | | } |
| | | 108 | | continue; |
| | | 109 | | } |
| | | 110 | | } |
| | 0 | 111 | | return new VpnClientRevokedCertificate(id, name, etag, thumbprint, provisioningState); |
| | | 112 | | } |
| | | 113 | | } |
| | | 114 | | } |