| | 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 ContainerNetworkInterfaceIpConfiguration : 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 (Type != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("type"); |
| 0 | 26 | | writer.WriteStringValue(Type); |
| | 27 | | } |
| 0 | 28 | | if (Etag != null) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("etag"); |
| 0 | 31 | | writer.WriteStringValue(Etag); |
| | 32 | | } |
| 0 | 33 | | writer.WritePropertyName("properties"); |
| 0 | 34 | | writer.WriteStartObject(); |
| 0 | 35 | | if (ProvisioningState != null) |
| | 36 | | { |
| 0 | 37 | | writer.WritePropertyName("provisioningState"); |
| 0 | 38 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 39 | | } |
| 0 | 40 | | writer.WriteEndObject(); |
| 0 | 41 | | writer.WriteEndObject(); |
| 0 | 42 | | } |
| | 43 | |
|
| | 44 | | internal static ContainerNetworkInterfaceIpConfiguration DeserializeContainerNetworkInterfaceIpConfiguration(Jso |
| | 45 | | { |
| 0 | 46 | | string name = default; |
| 0 | 47 | | string type = default; |
| 0 | 48 | | string etag = default; |
| 0 | 49 | | ProvisioningState? provisioningState = default; |
| 0 | 50 | | foreach (var property in element.EnumerateObject()) |
| | 51 | | { |
| 0 | 52 | | if (property.NameEquals("name")) |
| | 53 | | { |
| 0 | 54 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 55 | | { |
| | 56 | | continue; |
| | 57 | | } |
| 0 | 58 | | name = property.Value.GetString(); |
| 0 | 59 | | continue; |
| | 60 | | } |
| 0 | 61 | | if (property.NameEquals("type")) |
| | 62 | | { |
| 0 | 63 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| | 65 | | continue; |
| | 66 | | } |
| 0 | 67 | | type = property.Value.GetString(); |
| 0 | 68 | | continue; |
| | 69 | | } |
| 0 | 70 | | if (property.NameEquals("etag")) |
| | 71 | | { |
| 0 | 72 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 73 | | { |
| | 74 | | continue; |
| | 75 | | } |
| 0 | 76 | | etag = property.Value.GetString(); |
| 0 | 77 | | continue; |
| | 78 | | } |
| 0 | 79 | | if (property.NameEquals("properties")) |
| | 80 | | { |
| 0 | 81 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 82 | | { |
| 0 | 83 | | if (property0.NameEquals("provisioningState")) |
| | 84 | | { |
| 0 | 85 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 86 | | { |
| | 87 | | continue; |
| | 88 | | } |
| 0 | 89 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | 90 | | continue; |
| | 91 | | } |
| | 92 | | } |
| | 93 | | continue; |
| | 94 | | } |
| | 95 | | } |
| 0 | 96 | | return new ContainerNetworkInterfaceIpConfiguration(name, type, etag, provisioningState); |
| | 97 | | } |
| | 98 | | } |
| | 99 | | } |