|   |  | 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 Ipv6ExpressRouteCircuitPeeringConfig : IUtf8JsonSerializable | 
|   |  | 14 |  |     { | 
|   |  | 15 |  |         void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) | 
|   |  | 16 |  |         { | 
|   | 0 | 17 |  |             writer.WriteStartObject(); | 
|   | 0 | 18 |  |             if (PrimaryPeerAddressPrefix != null) | 
|   |  | 19 |  |             { | 
|   | 0 | 20 |  |                 writer.WritePropertyName("primaryPeerAddressPrefix"); | 
|   | 0 | 21 |  |                 writer.WriteStringValue(PrimaryPeerAddressPrefix); | 
|   |  | 22 |  |             } | 
|   | 0 | 23 |  |             if (SecondaryPeerAddressPrefix != null) | 
|   |  | 24 |  |             { | 
|   | 0 | 25 |  |                 writer.WritePropertyName("secondaryPeerAddressPrefix"); | 
|   | 0 | 26 |  |                 writer.WriteStringValue(SecondaryPeerAddressPrefix); | 
|   |  | 27 |  |             } | 
|   | 0 | 28 |  |             if (MicrosoftPeeringConfig != null) | 
|   |  | 29 |  |             { | 
|   | 0 | 30 |  |                 writer.WritePropertyName("microsoftPeeringConfig"); | 
|   | 0 | 31 |  |                 writer.WriteObjectValue(MicrosoftPeeringConfig); | 
|   |  | 32 |  |             } | 
|   | 0 | 33 |  |             if (RouteFilter != null) | 
|   |  | 34 |  |             { | 
|   | 0 | 35 |  |                 writer.WritePropertyName("routeFilter"); | 
|   | 0 | 36 |  |                 writer.WriteObjectValue(RouteFilter); | 
|   |  | 37 |  |             } | 
|   | 0 | 38 |  |             if (State != null) | 
|   |  | 39 |  |             { | 
|   | 0 | 40 |  |                 writer.WritePropertyName("state"); | 
|   | 0 | 41 |  |                 writer.WriteStringValue(State.Value.ToString()); | 
|   |  | 42 |  |             } | 
|   | 0 | 43 |  |             writer.WriteEndObject(); | 
|   | 0 | 44 |  |         } | 
|   |  | 45 |  |  | 
|   |  | 46 |  |         internal static Ipv6ExpressRouteCircuitPeeringConfig DeserializeIpv6ExpressRouteCircuitPeeringConfig(JsonElement | 
|   |  | 47 |  |         { | 
|   | 0 | 48 |  |             string primaryPeerAddressPrefix = default; | 
|   | 0 | 49 |  |             string secondaryPeerAddressPrefix = default; | 
|   | 0 | 50 |  |             ExpressRouteCircuitPeeringConfig microsoftPeeringConfig = default; | 
|   | 0 | 51 |  |             SubResource routeFilter = default; | 
|   | 0 | 52 |  |             ExpressRouteCircuitPeeringState? state = default; | 
|   | 0 | 53 |  |             foreach (var property in element.EnumerateObject()) | 
|   |  | 54 |  |             { | 
|   | 0 | 55 |  |                 if (property.NameEquals("primaryPeerAddressPrefix")) | 
|   |  | 56 |  |                 { | 
|   | 0 | 57 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|   |  | 58 |  |                     { | 
|   |  | 59 |  |                         continue; | 
|   |  | 60 |  |                     } | 
|   | 0 | 61 |  |                     primaryPeerAddressPrefix = property.Value.GetString(); | 
|   | 0 | 62 |  |                     continue; | 
|   |  | 63 |  |                 } | 
|   | 0 | 64 |  |                 if (property.NameEquals("secondaryPeerAddressPrefix")) | 
|   |  | 65 |  |                 { | 
|   | 0 | 66 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|   |  | 67 |  |                     { | 
|   |  | 68 |  |                         continue; | 
|   |  | 69 |  |                     } | 
|   | 0 | 70 |  |                     secondaryPeerAddressPrefix = property.Value.GetString(); | 
|   | 0 | 71 |  |                     continue; | 
|   |  | 72 |  |                 } | 
|   | 0 | 73 |  |                 if (property.NameEquals("microsoftPeeringConfig")) | 
|   |  | 74 |  |                 { | 
|   | 0 | 75 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|   |  | 76 |  |                     { | 
|   |  | 77 |  |                         continue; | 
|   |  | 78 |  |                     } | 
|   | 0 | 79 |  |                     microsoftPeeringConfig = ExpressRouteCircuitPeeringConfig.DeserializeExpressRouteCircuitPeeringConfi | 
|   | 0 | 80 |  |                     continue; | 
|   |  | 81 |  |                 } | 
|   | 0 | 82 |  |                 if (property.NameEquals("routeFilter")) | 
|   |  | 83 |  |                 { | 
|   | 0 | 84 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|   |  | 85 |  |                     { | 
|   |  | 86 |  |                         continue; | 
|   |  | 87 |  |                     } | 
|   | 0 | 88 |  |                     routeFilter = SubResource.DeserializeSubResource(property.Value); | 
|   | 0 | 89 |  |                     continue; | 
|   |  | 90 |  |                 } | 
|   | 0 | 91 |  |                 if (property.NameEquals("state")) | 
|   |  | 92 |  |                 { | 
|   | 0 | 93 |  |                     if (property.Value.ValueKind == JsonValueKind.Null) | 
|   |  | 94 |  |                     { | 
|   |  | 95 |  |                         continue; | 
|   |  | 96 |  |                     } | 
|   | 0 | 97 |  |                     state = new ExpressRouteCircuitPeeringState(property.Value.GetString()); | 
|   |  | 98 |  |                     continue; | 
|   |  | 99 |  |                 } | 
|   |  | 100 |  |             } | 
|   | 0 | 101 |  |             return new Ipv6ExpressRouteCircuitPeeringConfig(primaryPeerAddressPrefix, secondaryPeerAddressPrefix, micros | 
|   |  | 102 |  |         } | 
|   |  | 103 |  |     } | 
|   |  | 104 |  | } |