internal static Ipv6CircuitConnectionConfig DeserializeIpv6CircuitConnectionConfig(JsonElement element)
        {
            string addressPrefix = default;
            CircuitConnectionStatus?circuitConnectionStatus = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("addressPrefix"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    addressPrefix = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("circuitConnectionStatus"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    circuitConnectionStatus = new CircuitConnectionStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new Ipv6CircuitConnectionConfig(addressPrefix, circuitConnectionStatus));
        }
Exemplo n.º 2
0
        internal static Ipv6CircuitConnectionConfig DeserializeIpv6CircuitConnectionConfig(JsonElement element)
        {
            Optional <string> addressPrefix = default;
            Optional <CircuitConnectionStatus> circuitConnectionStatus = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("addressPrefix"))
                {
                    addressPrefix = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("circuitConnectionStatus"))
                {
                    circuitConnectionStatus = new CircuitConnectionStatus(property.Value.GetString());
                    continue;
                }
            }
            return(new Ipv6CircuitConnectionConfig(addressPrefix.Value, Optional.ToNullable(circuitConnectionStatus)));
        }
Exemplo n.º 3
0
        internal static PeerExpressRouteCircuitConnection DeserializePeerExpressRouteCircuitConnection(JsonElement element)
        {
            Optional <string>                  name = default;
            Optional <string>                  etag = default;
            Optional <string>                  type = default;
            Optional <string>                  id   = default;
            Optional <SubResource>             expressRouteCircuitPeering     = default;
            Optional <SubResource>             peerExpressRouteCircuitPeering = default;
            Optional <string>                  addressPrefix           = default;
            Optional <CircuitConnectionStatus> circuitConnectionStatus = default;
            Optional <string>                  connectionName          = default;
            Optional <string>                  authResourceGuid        = default;
            Optional <ProvisioningState>       provisioningState       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("expressRouteCircuitPeering"))
                        {
                            expressRouteCircuitPeering = DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("peerExpressRouteCircuitPeering"))
                        {
                            peerExpressRouteCircuitPeering = DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("addressPrefix"))
                        {
                            addressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("circuitConnectionStatus"))
                        {
                            circuitConnectionStatus = new CircuitConnectionStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("connectionName"))
                        {
                            connectionName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("authResourceGuid"))
                        {
                            authResourceGuid = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new PeerExpressRouteCircuitConnection(id.Value, name.Value, etag.Value, type.Value, expressRouteCircuitPeering.Value, peerExpressRouteCircuitPeering.Value, addressPrefix.Value, Optional.ToNullable(circuitConnectionStatus), connectionName.Value, authResourceGuid.Value, Optional.ToNullable(provisioningState)));
        }
Exemplo n.º 4
0
        internal static PeerExpressRouteCircuitConnection DeserializePeerExpressRouteCircuitConnection(JsonElement element)
        {
            string                  name = default;
            string                  etag = default;
            string                  type = default;
            string                  id   = default;
            SubResource             expressRouteCircuitPeering     = default;
            SubResource             peerExpressRouteCircuitPeering = default;
            string                  addressPrefix           = default;
            CircuitConnectionStatus?circuitConnectionStatus = default;
            string                  connectionName          = default;
            string                  authResourceGuid        = default;
            ProvisioningState?      provisioningState       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("expressRouteCircuitPeering"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            expressRouteCircuitPeering = DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("peerExpressRouteCircuitPeering"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            peerExpressRouteCircuitPeering = DeserializeSubResource(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("addressPrefix"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            addressPrefix = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("circuitConnectionStatus"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            circuitConnectionStatus = new CircuitConnectionStatus(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("connectionName"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            connectionName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("authResourceGuid"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            authResourceGuid = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new PeerExpressRouteCircuitConnection(id, name, etag, type, expressRouteCircuitPeering, peerExpressRouteCircuitPeering, addressPrefix, circuitConnectionStatus, connectionName, authResourceGuid, provisioningState));
        }