Ejemplo n.º 1
0
        public DeliveryRuleRequestBodyCondition(RequestBodyMatchConditionDefinition parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Parameters = parameters;
            Name       = MatchVariable.RequestBody;
        }
        internal static DeliveryRuleRequestBodyCondition DeserializeDeliveryRuleRequestBodyCondition(JsonElement element)
        {
            RequestBodyMatchConditionDefinition parameters = default;
            MatchVariable name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("parameters"))
                {
                    parameters = RequestBodyMatchConditionDefinition.DeserializeRequestBodyMatchConditionDefinition(property.Value);
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = new MatchVariable(property.Value.GetString());
                    continue;
                }
            }
            return(new DeliveryRuleRequestBodyCondition(name, parameters));
        }
Ejemplo n.º 3
0
 internal DeliveryRuleRequestBodyCondition(MatchVariable name, RequestBodyMatchConditionDefinition parameters) : base(name)
 {
     Parameters = parameters;
     Name       = name;
 }