Beispiel #1
0
        internal static ApplicationGatewaySslPredefinedPolicy DeserializeApplicationGatewaySslPredefinedPolicy(JsonElement element)
        {
            string name = default;
            string id   = default;
            IList <ApplicationGatewaySslCipherSuite> cipherSuites       = default;
            ApplicationGatewaySslProtocol?           minProtocolVersion = 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("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("cipherSuites"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationGatewaySslCipherSuite> array = new List <ApplicationGatewaySslCipherSuite>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(new ApplicationGatewaySslCipherSuite(item.GetString()));
                            }
                            cipherSuites = array;
                            continue;
                        }
                        if (property0.NameEquals("minProtocolVersion"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            minProtocolVersion = new ApplicationGatewaySslProtocol(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationGatewaySslPredefinedPolicy(id, name, cipherSuites, minProtocolVersion));
        }
        internal static ApplicationGatewaySslPredefinedPolicy DeserializeApplicationGatewaySslPredefinedPolicy(JsonElement element)
        {
            Optional <string>  name = default;
            ResourceIdentifier id   = default;
            Optional <IList <ApplicationGatewaySslCipherSuite> > cipherSuites       = default;
            Optional <ApplicationGatewaySslProtocol>             minProtocolVersion = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("cipherSuites"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ApplicationGatewaySslCipherSuite> array = new List <ApplicationGatewaySslCipherSuite>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(new ApplicationGatewaySslCipherSuite(item.GetString()));
                            }
                            cipherSuites = array;
                            continue;
                        }
                        if (property0.NameEquals("minProtocolVersion"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            minProtocolVersion = new ApplicationGatewaySslProtocol(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationGatewaySslPredefinedPolicy(id, name.Value, Optional.ToList(cipherSuites), Optional.ToNullable(minProtocolVersion)));
        }
Beispiel #3
0
        internal static ApplicationGatewaySslPolicy DeserializeApplicationGatewaySslPolicy(JsonElement element)
        {
            Optional <IList <ApplicationGatewaySslProtocol> >    disabledSslProtocols = default;
            Optional <ApplicationGatewaySslPolicyType>           policyType           = default;
            Optional <ApplicationGatewaySslPolicyName>           policyName           = default;
            Optional <IList <ApplicationGatewaySslCipherSuite> > cipherSuites         = default;
            Optional <ApplicationGatewaySslProtocol>             minProtocolVersion   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("disabledSslProtocols"))
                {
                    List <ApplicationGatewaySslProtocol> array = new List <ApplicationGatewaySslProtocol>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new ApplicationGatewaySslProtocol(item.GetString()));
                    }
                    disabledSslProtocols = array;
                    continue;
                }
                if (property.NameEquals("policyType"))
                {
                    policyType = new ApplicationGatewaySslPolicyType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("policyName"))
                {
                    policyName = new ApplicationGatewaySslPolicyName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("cipherSuites"))
                {
                    List <ApplicationGatewaySslCipherSuite> array = new List <ApplicationGatewaySslCipherSuite>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new ApplicationGatewaySslCipherSuite(item.GetString()));
                    }
                    cipherSuites = array;
                    continue;
                }
                if (property.NameEquals("minProtocolVersion"))
                {
                    minProtocolVersion = new ApplicationGatewaySslProtocol(property.Value.GetString());
                    continue;
                }
            }
            return(new ApplicationGatewaySslPolicy(Optional.ToList(disabledSslProtocols), Optional.ToNullable(policyType), Optional.ToNullable(policyName), Optional.ToList(cipherSuites), Optional.ToNullable(minProtocolVersion)));
        }
Beispiel #4
0
        internal static ApplicationGatewaySslPolicy DeserializeApplicationGatewaySslPolicy(JsonElement element)
        {
            IList <ApplicationGatewaySslProtocol>    disabledSslProtocols = default;
            ApplicationGatewaySslPolicyType?         policyType           = default;
            ApplicationGatewaySslPolicyName?         policyName           = default;
            IList <ApplicationGatewaySslCipherSuite> cipherSuites         = default;
            ApplicationGatewaySslProtocol?           minProtocolVersion   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("disabledSslProtocols"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ApplicationGatewaySslProtocol> array = new List <ApplicationGatewaySslProtocol>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new ApplicationGatewaySslProtocol(item.GetString()));
                    }
                    disabledSslProtocols = array;
                    continue;
                }
                if (property.NameEquals("policyType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    policyType = new ApplicationGatewaySslPolicyType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("policyName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    policyName = new ApplicationGatewaySslPolicyName(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("cipherSuites"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <ApplicationGatewaySslCipherSuite> array = new List <ApplicationGatewaySslCipherSuite>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(new ApplicationGatewaySslCipherSuite(item.GetString()));
                    }
                    cipherSuites = array;
                    continue;
                }
                if (property.NameEquals("minProtocolVersion"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    minProtocolVersion = new ApplicationGatewaySslProtocol(property.Value.GetString());
                    continue;
                }
            }
            return(new ApplicationGatewaySslPolicy(disabledSslProtocols, policyType, policyName, cipherSuites, minProtocolVersion));
        }