| | 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 ExpressRouteCircuitConnection : 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 (Etag != null) |
| | 24 | | { |
| 0 | 25 | | writer.WritePropertyName("etag"); |
| 0 | 26 | | writer.WriteStringValue(Etag); |
| | 27 | | } |
| 0 | 28 | | if (Type != null) |
| | 29 | | { |
| 0 | 30 | | writer.WritePropertyName("type"); |
| 0 | 31 | | writer.WriteStringValue(Type); |
| | 32 | | } |
| 0 | 33 | | if (Id != null) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("id"); |
| 0 | 36 | | writer.WriteStringValue(Id); |
| | 37 | | } |
| 0 | 38 | | writer.WritePropertyName("properties"); |
| 0 | 39 | | writer.WriteStartObject(); |
| 0 | 40 | | if (ExpressRouteCircuitPeering != null) |
| | 41 | | { |
| 0 | 42 | | writer.WritePropertyName("expressRouteCircuitPeering"); |
| 0 | 43 | | writer.WriteObjectValue(ExpressRouteCircuitPeering); |
| | 44 | | } |
| 0 | 45 | | if (PeerExpressRouteCircuitPeering != null) |
| | 46 | | { |
| 0 | 47 | | writer.WritePropertyName("peerExpressRouteCircuitPeering"); |
| 0 | 48 | | writer.WriteObjectValue(PeerExpressRouteCircuitPeering); |
| | 49 | | } |
| 0 | 50 | | if (AddressPrefix != null) |
| | 51 | | { |
| 0 | 52 | | writer.WritePropertyName("addressPrefix"); |
| 0 | 53 | | writer.WriteStringValue(AddressPrefix); |
| | 54 | | } |
| 0 | 55 | | if (AuthorizationKey != null) |
| | 56 | | { |
| 0 | 57 | | writer.WritePropertyName("authorizationKey"); |
| 0 | 58 | | writer.WriteStringValue(AuthorizationKey); |
| | 59 | | } |
| 0 | 60 | | if (Ipv6CircuitConnectionConfig != null) |
| | 61 | | { |
| 0 | 62 | | writer.WritePropertyName("ipv6CircuitConnectionConfig"); |
| 0 | 63 | | writer.WriteObjectValue(Ipv6CircuitConnectionConfig); |
| | 64 | | } |
| 0 | 65 | | if (CircuitConnectionStatus != null) |
| | 66 | | { |
| 0 | 67 | | writer.WritePropertyName("circuitConnectionStatus"); |
| 0 | 68 | | writer.WriteStringValue(CircuitConnectionStatus.Value.ToString()); |
| | 69 | | } |
| 0 | 70 | | if (ProvisioningState != null) |
| | 71 | | { |
| 0 | 72 | | writer.WritePropertyName("provisioningState"); |
| 0 | 73 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 74 | | } |
| 0 | 75 | | writer.WriteEndObject(); |
| 0 | 76 | | writer.WriteEndObject(); |
| 0 | 77 | | } |
| | 78 | |
|
| | 79 | | internal static ExpressRouteCircuitConnection DeserializeExpressRouteCircuitConnection(JsonElement element) |
| | 80 | | { |
| 0 | 81 | | string name = default; |
| 0 | 82 | | string etag = default; |
| 0 | 83 | | string type = default; |
| 0 | 84 | | string id = default; |
| 0 | 85 | | SubResource expressRouteCircuitPeering = default; |
| 0 | 86 | | SubResource peerExpressRouteCircuitPeering = default; |
| 0 | 87 | | string addressPrefix = default; |
| 0 | 88 | | string authorizationKey = default; |
| 0 | 89 | | Ipv6CircuitConnectionConfig ipv6CircuitConnectionConfig = default; |
| 0 | 90 | | CircuitConnectionStatus? circuitConnectionStatus = default; |
| 0 | 91 | | ProvisioningState? provisioningState = default; |
| 0 | 92 | | foreach (var property in element.EnumerateObject()) |
| | 93 | | { |
| 0 | 94 | | if (property.NameEquals("name")) |
| | 95 | | { |
| 0 | 96 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 97 | | { |
| | 98 | | continue; |
| | 99 | | } |
| 0 | 100 | | name = property.Value.GetString(); |
| 0 | 101 | | continue; |
| | 102 | | } |
| 0 | 103 | | if (property.NameEquals("etag")) |
| | 104 | | { |
| 0 | 105 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 106 | | { |
| | 107 | | continue; |
| | 108 | | } |
| 0 | 109 | | etag = property.Value.GetString(); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property.NameEquals("type")) |
| | 113 | | { |
| 0 | 114 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 115 | | { |
| | 116 | | continue; |
| | 117 | | } |
| 0 | 118 | | type = property.Value.GetString(); |
| 0 | 119 | | continue; |
| | 120 | | } |
| 0 | 121 | | if (property.NameEquals("id")) |
| | 122 | | { |
| 0 | 123 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 124 | | { |
| | 125 | | continue; |
| | 126 | | } |
| 0 | 127 | | id = property.Value.GetString(); |
| 0 | 128 | | continue; |
| | 129 | | } |
| 0 | 130 | | if (property.NameEquals("properties")) |
| | 131 | | { |
| 0 | 132 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 133 | | { |
| 0 | 134 | | if (property0.NameEquals("expressRouteCircuitPeering")) |
| | 135 | | { |
| 0 | 136 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 137 | | { |
| | 138 | | continue; |
| | 139 | | } |
| 0 | 140 | | expressRouteCircuitPeering = DeserializeSubResource(property0.Value); |
| 0 | 141 | | continue; |
| | 142 | | } |
| 0 | 143 | | if (property0.NameEquals("peerExpressRouteCircuitPeering")) |
| | 144 | | { |
| 0 | 145 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 146 | | { |
| | 147 | | continue; |
| | 148 | | } |
| 0 | 149 | | peerExpressRouteCircuitPeering = DeserializeSubResource(property0.Value); |
| 0 | 150 | | continue; |
| | 151 | | } |
| 0 | 152 | | if (property0.NameEquals("addressPrefix")) |
| | 153 | | { |
| 0 | 154 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 155 | | { |
| | 156 | | continue; |
| | 157 | | } |
| 0 | 158 | | addressPrefix = property0.Value.GetString(); |
| 0 | 159 | | continue; |
| | 160 | | } |
| 0 | 161 | | if (property0.NameEquals("authorizationKey")) |
| | 162 | | { |
| 0 | 163 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 164 | | { |
| | 165 | | continue; |
| | 166 | | } |
| 0 | 167 | | authorizationKey = property0.Value.GetString(); |
| 0 | 168 | | continue; |
| | 169 | | } |
| 0 | 170 | | if (property0.NameEquals("ipv6CircuitConnectionConfig")) |
| | 171 | | { |
| 0 | 172 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 173 | | { |
| | 174 | | continue; |
| | 175 | | } |
| 0 | 176 | | ipv6CircuitConnectionConfig = Ipv6CircuitConnectionConfig.DeserializeIpv6CircuitConnectionCo |
| 0 | 177 | | continue; |
| | 178 | | } |
| 0 | 179 | | if (property0.NameEquals("circuitConnectionStatus")) |
| | 180 | | { |
| 0 | 181 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 182 | | { |
| | 183 | | continue; |
| | 184 | | } |
| 0 | 185 | | circuitConnectionStatus = new CircuitConnectionStatus(property0.Value.GetString()); |
| 0 | 186 | | continue; |
| | 187 | | } |
| 0 | 188 | | if (property0.NameEquals("provisioningState")) |
| | 189 | | { |
| 0 | 190 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 191 | | { |
| | 192 | | continue; |
| | 193 | | } |
| 0 | 194 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| | 195 | | continue; |
| | 196 | | } |
| | 197 | | } |
| | 198 | | continue; |
| | 199 | | } |
| | 200 | | } |
| 0 | 201 | | return new ExpressRouteCircuitConnection(id, name, etag, type, expressRouteCircuitPeering, peerExpressRouteC |
| | 202 | | } |
| | 203 | | } |
| | 204 | | } |