public DeliveryRuleIsDeviceCondition(IsDeviceMatchConditionDefinition parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Parameters = parameters;
            Name       = MatchVariable.IsDevice;
        }
Example #2
0
        internal static DeliveryRuleIsDeviceCondition DeserializeDeliveryRuleIsDeviceCondition(JsonElement element)
        {
            IsDeviceMatchConditionDefinition parameters = default;
            MatchVariable name = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("parameters"))
                {
                    parameters = IsDeviceMatchConditionDefinition.DeserializeIsDeviceMatchConditionDefinition(property.Value);
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = new MatchVariable(property.Value.GetString());
                    continue;
                }
            }
            return(new DeliveryRuleIsDeviceCondition(name, parameters));
        }
 internal DeliveryRuleIsDeviceCondition(MatchVariable name, IsDeviceMatchConditionDefinition parameters) : base(name)
 {
     Parameters = parameters;
     Name       = name;
 }