| | 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.Collections.Generic; |
| | 9 | | using System.Text.Json; |
| | 10 | | using Azure.Core; |
| | 11 | |
|
| | 12 | | namespace Azure.ResourceManager.Network.Models |
| | 13 | | { |
| | 14 | | public partial class NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (GroupId != null) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("groupId"); |
| 0 | 22 | | writer.WriteStringValue(GroupId); |
| | 23 | | } |
| 0 | 24 | | if (RequiredMemberName != null) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("requiredMemberName"); |
| 0 | 27 | | writer.WriteStringValue(RequiredMemberName); |
| | 28 | | } |
| 0 | 29 | | if (Fqdns != null) |
| | 30 | | { |
| 0 | 31 | | writer.WritePropertyName("fqdns"); |
| 0 | 32 | | writer.WriteStartArray(); |
| 0 | 33 | | foreach (var item in Fqdns) |
| | 34 | | { |
| 0 | 35 | | writer.WriteStringValue(item); |
| | 36 | | } |
| 0 | 37 | | writer.WriteEndArray(); |
| | 38 | | } |
| 0 | 39 | | writer.WriteEndObject(); |
| 0 | 40 | | } |
| | 41 | |
|
| | 42 | | internal static NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties DeserializeNetworkInterfaceIPConf |
| | 43 | | { |
| 0 | 44 | | string groupId = default; |
| 0 | 45 | | string requiredMemberName = default; |
| 0 | 46 | | IList<string> fqdns = default; |
| 0 | 47 | | foreach (var property in element.EnumerateObject()) |
| | 48 | | { |
| 0 | 49 | | if (property.NameEquals("groupId")) |
| | 50 | | { |
| 0 | 51 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 52 | | { |
| | 53 | | continue; |
| | 54 | | } |
| 0 | 55 | | groupId = property.Value.GetString(); |
| 0 | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | if (property.NameEquals("requiredMemberName")) |
| | 59 | | { |
| 0 | 60 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 61 | | { |
| | 62 | | continue; |
| | 63 | | } |
| 0 | 64 | | requiredMemberName = property.Value.GetString(); |
| 0 | 65 | | continue; |
| | 66 | | } |
| 0 | 67 | | if (property.NameEquals("fqdns")) |
| | 68 | | { |
| 0 | 69 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 70 | | { |
| | 71 | | continue; |
| | 72 | | } |
| 0 | 73 | | List<string> array = new List<string>(); |
| 0 | 74 | | foreach (var item in property.Value.EnumerateArray()) |
| | 75 | | { |
| 0 | 76 | | if (item.ValueKind == JsonValueKind.Null) |
| | 77 | | { |
| 0 | 78 | | array.Add(null); |
| | 79 | | } |
| | 80 | | else |
| | 81 | | { |
| 0 | 82 | | array.Add(item.GetString()); |
| | 83 | | } |
| | 84 | | } |
| 0 | 85 | | fqdns = array; |
| | 86 | | continue; |
| | 87 | | } |
| | 88 | | } |
| 0 | 89 | | return new NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties(groupId, requiredMemberName, fqdns |
| | 90 | | } |
| | 91 | | } |
| | 92 | | } |