ConditionValidator

1
2
3
4
5
{
    "Name": "Mopedo.Bidding.ConditionValidator",
    "Kind": "EntityResource",
    "Methods": ["GET", "REPORT", "HEAD"]
}

The ConditionValidator resource is used to download validation data that can be used for validating Condition entities in bidding campaign bid rules, for example in a remote system. Using this resource, clients can enumerate all valid condition keys, see what operators are available for them, and what value types are expected.

Format

Property name Type Description
Key string The key of a valid condition
ValueType string The value type expected for a condition with the given key
ValueCanBeNull bool Are null values accepted for this condition?
AllowedOperators array of string The operators that are allowed for this condition

Wildcards

Some parts of conditions keys, for example property names of dynamic resources like UserExtension, are represented as * in the content of this resource. This is a wildcard character indicating that a range of possible values, not statically determinable, can be used in place of the wildcard. For example, the output from ConditionValidator contains information about conditions for UserExtension properties. These properties are dynamically assigned to UserExtension entities, and there is no way to list all allowed values. Instead the wildcard character is used.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "Key": "User.Extension.*",
  "ValueType": "Dynamic",
  "ValueCanBeNull": true,
  "AllowedOperators": [
    "EQUALS",
    "NOT EQUALS",
    "CONTAINS",
    "NOT CONTAINS",
    "IN",
    "NOT IN",
    "GREATER THAN",
    "LESS THAN",
    "GREATER THAN OR EQUALS",
    "LESS THAN OR EQUALS"
  ]
}

This means that arbitrary valid keys can be constructed by substituting the wildcard character with a property name, for example User.Extension.MySegment.

Wildcards are also used in the AdWinCount() and AdClickCount() methods to indicate the place where to insert the ad id to calculate wins and clicks for.

Example usage

ConditionValidator is useful when an external system is set up to receive and validate bid rules from a system user. Instead of having to ask the DSP application to validate each condition inputted, the external system can simply download the ConditionValidator tree to a local data structure, add additional externally defined condition keys, and validate the inputted conditions on site.