REST Resource: networks.adRules

Resource: AdRule

An AdRule contains data that the ad server will use to generate a playlist of video ads.

JSON representation
{
  "name": string,
  "midrolls": [
    {
      object (AdRuleSlot)
    }
  ],
  "displayName": string,
  "priority": integer,
  "startTime": string,
  "endTime": string,
  "endTimeUnlimited": boolean,
  "status": enum (AdRuleStatus),
  "frequencyCapBehavior": enum (AdRuleFrequencyCapBehavior),
  "maxImpressionsPerLineItemPerStream": integer,
  "maxImpressionsPerLineItemPerPod": integer,
  "preroll": {
    object (AdRuleSlot)
  },
  "postroll": {
    object (AdRuleSlot)
  },
  "targeting": {
    object (Targeting)
  }
}
Fields
name

string

Identifier. The resource name of the AdRule. Format: networks/{networkCode}/adRules/{ad_rule_id}

midrolls[]

object (AdRuleSlot)

Required. This AdRule object's video mid-roll slots. This attribute is required, and there must be at least one mid-roll.

displayName

string

Required. The unique name of the AdRule. This attribute is required to create an ad rule and has a maximum length of 255 characters.

priority

integer

Optional. The priority of the AdRule. This attribute is required and can range from 1 to 1000, with 1 being the highest possible priority.

Changing an ad rule's priority can affect the priorities of other ad rules. For example, increasing an ad rule's priority from 5 to 1 will shift the ad rules that were previously in priority positions 1 through 4 down one.

startTime

string (Timestamp format)

Required. The start time of the AdRule. This attribute is required and must be a date in the future for new ad rules.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

endTime

string (Timestamp format)

Optional. This end time of the AdRule. This attribute is required unless endTimeUnlimited is set to true. If specified, it must be after the startTime.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

endTimeUnlimited

boolean

Optional. Specifies whether or not the AdRule has an end time. This attribute is optional and defaults to false.

status

enum (AdRuleStatus)

Output only. The AdRuleStatus of the AdRule. This attribute is read-only and defaults to [AdRuleStatus.INACTIVE][].

frequencyCapBehavior

enum (AdRuleFrequencyCapBehavior)

Optional. The FrequencyCapBehavior of the AdRule. This attribute is optional and defaults to [FrequencyCapBehavior.DEFER][].

maxImpressionsPerLineItemPerStream

integer

Optional. This AdRule object's frequency cap for the maximum impressions per stream. This attribute is optional and defaults to 0.

maxImpressionsPerLineItemPerPod

integer

Optional. This AdRule object's frequency cap for the maximum impressions per pod. This attribute is optional and defaults to 0.

preroll

object (AdRuleSlot)

Required. This AdRule object's pre-roll slot. This attribute is required.

postroll

object (AdRuleSlot)

Required. This AdRule object's post-roll slot. This attribute is required.

targeting

object (Targeting)

Required. The targeting of the AdRule.

AdRuleStatus

Represents the status of ad rules and ad rule slots.

Enums
AD_RULE_STATUS_UNSPECIFIED Default value. This value is unused.
ACTIVE Created and ready to be served. Is user-visible.
DELETED Marked as deleted, not user-visible.
INACTIVE Inactive, not user-visible.

AdRuleFrequencyCapBehavior

Types of behavior for frequency caps within ad rules.

Enums
AD_RULE_FREQUENCY_CAP_BEHAVIOR_UNSPECIFIED Default value. This value is unused.
DEFER Defer frequency cap decisions to the next ad rule in priority order.
TURN_OFF Turn off all frequency caps.
TURN_ON Turn on at least one of the frequency caps.

AdRuleSlot

Simple object representing an ad slot within an AdRule. Ad rule slots contain information about the types/number of ads to display, as well as additional information on how the ad server will generate playlists.

JSON representation
{
  "slotBehavior": enum (AdRuleSlotBehavior),
  "maxVideoAdDuration": string,
  "videoMidrollFrequencyType": enum (AdRuleSlotMidrollFrequencyType),
  "videoMidrollFrequency": string,
  "bumper": enum (AdRuleSlotBumper),
  "maxBumperDuration": string,
  "maxPodDuration": string,
  "podMaxAdCount": integer
}
Fields
slotBehavior

enum (AdRuleSlotBehavior)

Optional. The AdRuleSlotBehavior for video ads for this slot. This attribute is optional and defaults to [AdRuleSlotBehavior.DEFER][]. Indicates whether video ads are allowed for this slot, or if the decision is deferred to alower-priority ad rule.

maxVideoAdDuration

string (Duration format)

Optional. The maximum duration in milliseconds of video ads within this slot. This attribute is optional and defaults to 0.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

videoMidrollFrequencyType

enum (AdRuleSlotMidrollFrequencyType)

Optional. The frequency type for video ads in this ad rule slot. This attribute is required for mid-rolls, but if this is not a mid-roll, the value is set to [AdRuleSlotMidrollFrequencyType.NONE][].

videoMidrollFrequency

string

Optional. The mid-roll frequency of this ad rule slot for video ads. This attribute is required for mid-rolls, but if MidrollFrequencyType is set to [AdRuleSlotMidrollFrequencyType.NONE][], this value should be ignored. For example, if this slot has a frequency type of [AdRuleSlotMidrollFrequencyType.EVERY_N_SECONDS][] and

seconds."

bumper

enum (AdRuleSlotBumper)

Optional. The AdRuleSlotBumper for this slot. This attribute is optional and defaults to [AdRuleSlotBumper.NONE][].

maxBumperDuration

string (Duration format)

Optional. The maximum duration of bumper ads within this slot. This attribute is optional and defaults to 0.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

maxPodDuration

string (Duration format)

Optional. The maximum pod duration for this slot. This attribute is optional and defaults to 0.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

podMaxAdCount

integer

Optional. The maximum number of ads allowed in a pod in this slot. This attribute is optional and defaults to 0.

AdRuleSlotBehavior

The types of behaviors for ads within a BaseAdRuleSlot ad rule slot.

Enums
AD_RULE_SLOT_BEHAVIOR_UNSPECIFIED Default value. This value is unused.
ALWAYS_SHOW This ad rule always includes this slot's ads.
DEFER Defer to lower priority rules. This ad rule doesn't specify guidelines for this slot's ads.
NEVER_SHOW This ad rule never includes this slot's ads.

AdRuleSlotMidrollFrequencyType

Frequency types for mid-roll BaseAdRuleSlot ad rule slots.

Enums
AD_RULE_SLOT_MIDROLL_FREQUENCY_TYPE_UNSPECIFIED Default value. This value is unused.
EVERY_N_CUEPOINTS MidrollFrequency is a cue point interval and is a single integer value, such as "5", which means "play a mid-roll every 5th cue point".
EVERY_N_SECONDS MidrollFrequency is a time interval and mentioned as a single numeric value in seconds. For example, "100" would mean "play a mid-roll every 100 seconds".
FIXED_CUE_POINTS Same as FIXED_TIME, except the values represent the ordinal cue points ("1,3,5", for example).
FIXED_TIME MidrollFrequency is a comma-delimited list of points in time (in seconds) when an ad should play. For example, "100,300" would mean "play an ad at 100 seconds and 300 seconds".
NONE The ad rule slot is not a mid-roll and MidrollFrequency should be ignored.
REVERSE_MIDROLL_INDEX After all other frequency type is applied and the number of midrolls are settled, this slot setting will override the mid-roll defined by ReverseMidrollIndex.

AdRuleSlotBumper

Types of bumper ads on an ad rule slot.

Enums
AD_RULE_SLOT_BUMPER_UNSPECIFIED Default value. This value is unused.
AFTER Show a bumper ad after the slot's other ads.
BEFORE Show a bumper ad before the slot's other ads.
BEFORE_AND_AFTER Show a bumper before and after the slot's other ads.
NONE Do not show a bumper ad.

Methods

batchActivate

Activates a list of AdRule objects.

batchCreate

Batch creates AdRule objects.

batchDeactivate

Deactivates a list of AdRule objects.

batchDelete

Deletes a list of AdRule objects.

batchUpdate

Batch updates AdRule objects.

create

Creates a AdRule object.

get

Retrieves an AdRule object.

list

Lists AdRule objects.

patch

Updates a AdRule object.