Ejemplo n.º 1
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)));
        }
Ejemplo n.º 2
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));
        }