| | 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.KeyVault.Models |
| | 12 | | { |
| | 13 | | public partial class PrivateLinkServiceConnectionState : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 0 | 17 | | writer.WriteStartObject(); |
| 0 | 18 | | if (Optional.IsDefined(Status)) |
| | 19 | | { |
| 0 | 20 | | writer.WritePropertyName("status"); |
| 0 | 21 | | writer.WriteStringValue(Status.Value.ToString()); |
| | 22 | | } |
| 0 | 23 | | if (Optional.IsDefined(Description)) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("description"); |
| 0 | 26 | | writer.WriteStringValue(Description); |
| | 27 | | } |
| 0 | 28 | | if (Optional.IsDefined(ActionRequired)) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("actionRequired"); |
| 0 | 31 | | writer.WriteStringValue(ActionRequired); |
| | 32 | | } |
| 0 | 33 | | writer.WriteEndObject(); |
| 0 | 34 | | } |
| | 35 | |
|
| | 36 | | internal static PrivateLinkServiceConnectionState DeserializePrivateLinkServiceConnectionState(JsonElement eleme |
| | 37 | | { |
| 0 | 38 | | Optional<PrivateEndpointServiceConnectionStatus> status = default; |
| 0 | 39 | | Optional<string> description = default; |
| 0 | 40 | | Optional<string> actionRequired = default; |
| 0 | 41 | | foreach (var property in element.EnumerateObject()) |
| | 42 | | { |
| 0 | 43 | | if (property.NameEquals("status")) |
| | 44 | | { |
| 0 | 45 | | status = new PrivateEndpointServiceConnectionStatus(property.Value.GetString()); |
| 0 | 46 | | continue; |
| | 47 | | } |
| 0 | 48 | | if (property.NameEquals("description")) |
| | 49 | | { |
| 0 | 50 | | description = property.Value.GetString(); |
| 0 | 51 | | continue; |
| | 52 | | } |
| 0 | 53 | | if (property.NameEquals("actionRequired")) |
| | 54 | | { |
| 0 | 55 | | actionRequired = property.Value.GetString(); |
| | 56 | | continue; |
| | 57 | | } |
| | 58 | | } |
| 0 | 59 | | return new PrivateLinkServiceConnectionState(Optional.ToNullable(status), description.Value, actionRequired. |
| | 60 | | } |
| | 61 | | } |
| | 62 | | } |