PolicyRule

This object represents a policy rule, which specifies a set of conditions that must be met and the action that YouTube should take when those conditions are met. For a rule to be valid, all of the rule's conditions must be satisfied.

JSON representation
{
  "action": string,
  "conditions": {
    object (Conditions)
  },
  "subaction": [
    string
  ]
}
Fields
action

string

The policy that YouTube should enforce if the rule's conditions are all valid for an asset or for an attempt to view that asset on YouTube.

conditions

object (Conditions)

A set of conditions that must be met for the rule's action (and subactions) to be enforced. For a rule to be valid, all of its conditions must be met.

subaction[]

string

A list of additional actions that YouTube should take if the conditions in the rule are met.

Conditions

Represents conditions for a policy rule. YouTube enforces a rights policy if any of the rules specified for the policy are valid. For a rule to be valid, all of the rule's conditions must be satisfied, and a condition is true when all set parts are satisfied. Unset conditions are disregarded (or always satisfied) for a rule. For example, if a rule does not specify a

MatchDuration

, then the length of the actual match duration could not cause the rule to not be satisfied. If no conditions are set, the condition as a whole is always true.

JSON representation
{
  "requiredTerritories": {
    object (TerritoryCondition)
  },
  "matchDuration": [
    {
      object (IntervalCondition)
    }
  ],
  "matchPercent": [
    {
      object (IntervalCondition)
    }
  ],
  "referenceDuration": [
    {
      object (IntervalCondition)
    }
  ],
  "referencePercent": [
    {
      object (IntervalCondition)
    }
  ],
  "contentMatchType": [
    string
  ]
}
Fields
requiredTerritories

object (TerritoryCondition)

This watch condition specifies where users are (or or not) allowed to watch (or listen to) an asset. YouTube determines whether the condition is satisfied based on the user's location.

matchDuration[]

object (IntervalCondition)

This match condition specifies an amount of time that the user- or partner- uploaded content needs to match a reference file for the rule to apply.

matchPercent[]

object (IntervalCondition)

This match condition specifies a percentage of the user- or partner-uploaded content that needs to match a reference file for the rule to apply.

referenceDuration[]

object (IntervalCondition)

This match condition indicates that the reference must be a certain duration for the rule to apply.

referencePercent[]

object (IntervalCondition)

This match condition indicates that the specified percentage of a reference file must match the user- or partner-uploaded content for the rule to apply.

contentMatchType[]

string

This match condition specifies whether the user- or partner-uploaded content needs to match the audio, video or audiovisual content of a reference file for the rule to apply.

TerritoryCondition

Territory condition used by policy rule's conditions.

JSON representation
{
  "type": string,
  "territories": [
    string
  ]
}
Fields
type

string

This field indicates whether the associated policy rule is or is not valid in the specified territories.

territories[]

string

A list of territories. Each territory is an ISO 3166 two-letter country code..

IntervalCondition

Identifies the minimum and maximum values associated with a match condition. If a potential match falls within the specified range, then the condition is satisfied.

JSON representation
{
  "low": number,
  "high": number
}
Fields
low

number

The minimum (inclusive) allowed value for the condition to be satisfied. The default value is -∞.

high

number

The maximum (inclusive) allowed value for the condition to be satisfied. The default value is ∞.