| | 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.AppConfiguration.Models |
| | 12 | | { |
| | 13 | | public partial class PrivateLinkServiceConnectionState : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 8 | 17 | | writer.WriteStartObject(); |
| 8 | 18 | | if (Status != null) |
| | 19 | | { |
| 8 | 20 | | writer.WritePropertyName("status"); |
| 8 | 21 | | writer.WriteStringValue(Status.Value.ToString()); |
| | 22 | | } |
| 8 | 23 | | if (Description != null) |
| | 24 | | { |
| 8 | 25 | | writer.WritePropertyName("description"); |
| 8 | 26 | | writer.WriteStringValue(Description); |
| | 27 | | } |
| 8 | 28 | | if (ActionsRequired != null) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("actionsRequired"); |
| 0 | 31 | | writer.WriteStringValue(ActionsRequired.Value.ToString()); |
| | 32 | | } |
| 8 | 33 | | writer.WriteEndObject(); |
| 8 | 34 | | } |
| | 35 | |
|
| | 36 | | internal static PrivateLinkServiceConnectionState DeserializePrivateLinkServiceConnectionState(JsonElement eleme |
| | 37 | | { |
| 28 | 38 | | ConnectionStatus? status = default; |
| 28 | 39 | | string description = default; |
| 28 | 40 | | ActionsRequired? actionsRequired = default; |
| 200 | 41 | | foreach (var property in element.EnumerateObject()) |
| | 42 | | { |
| 72 | 43 | | if (property.NameEquals("status")) |
| | 44 | | { |
| 28 | 45 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 46 | | { |
| | 47 | | continue; |
| | 48 | | } |
| 28 | 49 | | status = new ConnectionStatus(property.Value.GetString()); |
| 28 | 50 | | continue; |
| | 51 | | } |
| 44 | 52 | | if (property.NameEquals("description")) |
| | 53 | | { |
| 28 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 28 | 58 | | description = property.Value.GetString(); |
| 28 | 59 | | continue; |
| | 60 | | } |
| 16 | 61 | | if (property.NameEquals("actionsRequired")) |
| | 62 | | { |
| 16 | 63 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| | 65 | | continue; |
| | 66 | | } |
| 16 | 67 | | actionsRequired = new ActionsRequired(property.Value.GetString()); |
| | 68 | | continue; |
| | 69 | | } |
| | 70 | | } |
| 28 | 71 | | return new PrivateLinkServiceConnectionState(status, description, actionsRequired); |
| | 72 | | } |
| | 73 | | } |
| | 74 | | } |