Ejemplo n.º 1
0
        internal static FirewallPolicyIntrusionDetectionSignatureSpecification DeserializeFirewallPolicyIntrusionDetectionSignatureSpecification(JsonElement element)
        {
            Optional <string> id = default;
            Optional <FirewallPolicyIntrusionDetectionStateType> mode = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("mode"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    mode = new FirewallPolicyIntrusionDetectionStateType(property.Value.GetString());
                    continue;
                }
            }
            return(new FirewallPolicyIntrusionDetectionSignatureSpecification(id.Value, Optional.ToNullable(mode)));
        }
Ejemplo n.º 2
0
        internal static FirewallPolicyIntrusionDetection DeserializeFirewallPolicyIntrusionDetection(JsonElement element)
        {
            Optional <FirewallPolicyIntrusionDetectionStateType>     mode          = default;
            Optional <FirewallPolicyIntrusionDetectionConfiguration> configuration = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("mode"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    mode = new FirewallPolicyIntrusionDetectionStateType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("configuration"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    configuration = FirewallPolicyIntrusionDetectionConfiguration.DeserializeFirewallPolicyIntrusionDetectionConfiguration(property.Value);
                    continue;
                }
            }
            return(new FirewallPolicyIntrusionDetection(Optional.ToNullable(mode), configuration.Value));
        }