Exemplo n.º 1
0
        internal static RoutingPreference DeserializeRoutingPreference(JsonElement element)
        {
            Optional <RoutingChoice> routingChoice             = default;
            Optional <bool>          publishMicrosoftEndpoints = default;
            Optional <bool>          publishInternetEndpoints  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("routingChoice"))
                {
                    routingChoice = new RoutingChoice(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("publishMicrosoftEndpoints"))
                {
                    publishMicrosoftEndpoints = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("publishInternetEndpoints"))
                {
                    publishInternetEndpoints = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new RoutingPreference(Optional.ToNullable(routingChoice), Optional.ToNullable(publishMicrosoftEndpoints), Optional.ToNullable(publishInternetEndpoints)));
        }
Exemplo n.º 2
0
        internal static RoutingPreference DeserializeRoutingPreference(JsonElement element)
        {
            RoutingChoice?routingChoice             = default;
            bool?         publishMicrosoftEndpoints = default;
            bool?         publishInternetEndpoints  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("routingChoice"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    routingChoice = new RoutingChoice(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("publishMicrosoftEndpoints"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    publishMicrosoftEndpoints = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("publishInternetEndpoints"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    publishInternetEndpoints = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new RoutingPreference(routingChoice, publishMicrosoftEndpoints, publishInternetEndpoints));
        }