Class AdRule (0.54.0)

public final class AdRule extends GeneratedMessage implements AdRuleOrBuilder

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

Protobuf type google.ads.admanager.v1.AdRule

Implements

AdRuleOrBuilder

Static Fields

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

END_TIME_FIELD_NUMBER

public static final int END_TIME_FIELD_NUMBER
Field Value
Type Description
int

END_TIME_UNLIMITED_FIELD_NUMBER

public static final int END_TIME_UNLIMITED_FIELD_NUMBER
Field Value
Type Description
int

FREQUENCY_CAP_BEHAVIOR_FIELD_NUMBER

public static final int FREQUENCY_CAP_BEHAVIOR_FIELD_NUMBER
Field Value
Type Description
int

MAX_IMPRESSIONS_PER_LINE_ITEM_PER_POD_FIELD_NUMBER

public static final int MAX_IMPRESSIONS_PER_LINE_ITEM_PER_POD_FIELD_NUMBER
Field Value
Type Description
int

MAX_IMPRESSIONS_PER_LINE_ITEM_PER_STREAM_FIELD_NUMBER

public static final int MAX_IMPRESSIONS_PER_LINE_ITEM_PER_STREAM_FIELD_NUMBER
Field Value
Type Description
int

MIDROLLS_FIELD_NUMBER

public static final int MIDROLLS_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

POSTROLL_FIELD_NUMBER

public static final int POSTROLL_FIELD_NUMBER
Field Value
Type Description
int

PREROLL_FIELD_NUMBER

public static final int PREROLL_FIELD_NUMBER
Field Value
Type Description
int

PRIORITY_FIELD_NUMBER

public static final int PRIORITY_FIELD_NUMBER
Field Value
Type Description
int

START_TIME_FIELD_NUMBER

public static final int START_TIME_FIELD_NUMBER
Field Value
Type Description
int

STATUS_FIELD_NUMBER

public static final int STATUS_FIELD_NUMBER
Field Value
Type Description
int

TARGETING_FIELD_NUMBER

public static final int TARGETING_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static AdRule getDefaultInstance()
Returns
Type Description
AdRule

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static AdRule.Builder newBuilder()
Returns
Type Description
AdRule.Builder

newBuilder(AdRule prototype)

public static AdRule.Builder newBuilder(AdRule prototype)
Parameter
Name Description
prototype AdRule
Returns
Type Description
AdRule.Builder

parseDelimitedFrom(InputStream input)

public static AdRule parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
AdRule
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AdRule parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdRule
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static AdRule parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
AdRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static AdRule parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static AdRule parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
AdRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static AdRule parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static AdRule parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
AdRule
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static AdRule parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdRule
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static AdRule parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
AdRule
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AdRule parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdRule
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static AdRule parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
AdRule
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static AdRule parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AdRule
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<AdRule> parser()
Returns
Type Description
Parser<AdRule>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public AdRule getDefaultInstanceForType()
Returns
Type Description
AdRule

getDisplayName()

public String getDisplayName()

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

optional string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

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

optional string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getEndTime()

public Timestamp getEndTime()

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

optional .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Timestamp

The endTime.

getEndTimeOrBuilder()

public TimestampOrBuilder getEndTimeOrBuilder()

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

optional .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
TimestampOrBuilder

getEndTimeUnlimited()

public boolean getEndTimeUnlimited()

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

optional bool end_time_unlimited = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

The endTimeUnlimited.

getFrequencyCapBehavior()

public AdRuleFrequencyCapBehaviorEnum.AdRuleFrequencyCapBehavior getFrequencyCapBehavior()

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

optional .google.ads.admanager.v1.AdRuleFrequencyCapBehaviorEnum.AdRuleFrequencyCapBehavior frequency_cap_behavior = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AdRuleFrequencyCapBehaviorEnum.AdRuleFrequencyCapBehavior

The frequencyCapBehavior.

getFrequencyCapBehaviorValue()

public int getFrequencyCapBehaviorValue()

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

optional .google.ads.admanager.v1.AdRuleFrequencyCapBehaviorEnum.AdRuleFrequencyCapBehavior frequency_cap_behavior = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for frequencyCapBehavior.

getMaxImpressionsPerLineItemPerPod()

public int getMaxImpressionsPerLineItemPerPod()

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

optional int32 max_impressions_per_line_item_per_pod = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The maxImpressionsPerLineItemPerPod.

getMaxImpressionsPerLineItemPerStream()

public int getMaxImpressionsPerLineItemPerStream()

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

optional int32 max_impressions_per_line_item_per_stream = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The maxImpressionsPerLineItemPerStream.

getMidrolls(int index)

public AdRuleSlot getMidrolls(int index)

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

repeated .google.ads.admanager.v1.AdRuleSlot midrolls = 9 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
AdRuleSlot

getMidrollsCount()

public int getMidrollsCount()

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

repeated .google.ads.admanager.v1.AdRuleSlot midrolls = 9 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

getMidrollsList()

public List<AdRuleSlot> getMidrollsList()

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

repeated .google.ads.admanager.v1.AdRuleSlot midrolls = 9 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<AdRuleSlot>

getMidrollsOrBuilder(int index)

public AdRuleSlotOrBuilder getMidrollsOrBuilder(int index)

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

repeated .google.ads.admanager.v1.AdRuleSlot midrolls = 9 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
index int
Returns
Type Description
AdRuleSlotOrBuilder

getMidrollsOrBuilderList()

public List<? extends AdRuleSlotOrBuilder> getMidrollsOrBuilderList()

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

repeated .google.ads.admanager.v1.AdRuleSlot midrolls = 9 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
List<? extends com.google.ads.admanager.v1.AdRuleSlotOrBuilder>

getName()

public String getName()

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

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

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

string name = 1 [(.google.api.field_behavior) = IDENTIFIER];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<AdRule> getParserForType()
Returns
Type Description
Parser<AdRule>
Overrides

getPostroll()

public AdRuleSlot getPostroll()

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

optional .google.ads.admanager.v1.AdRuleSlot postroll = 10 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdRuleSlot

The postroll.

getPostrollOrBuilder()

public AdRuleSlotOrBuilder getPostrollOrBuilder()

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

optional .google.ads.admanager.v1.AdRuleSlot postroll = 10 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdRuleSlotOrBuilder

getPreroll()

public AdRuleSlot getPreroll()

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

optional .google.ads.admanager.v1.AdRuleSlot preroll = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdRuleSlot

The preroll.

getPrerollOrBuilder()

public AdRuleSlotOrBuilder getPrerollOrBuilder()

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

optional .google.ads.admanager.v1.AdRuleSlot preroll = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
AdRuleSlotOrBuilder

getPriority()

public int getPriority()

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.

optional int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The priority.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getStartTime()

public Timestamp getStartTime()

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

optional .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Timestamp

The startTime.

getStartTimeOrBuilder()

public TimestampOrBuilder getStartTimeOrBuilder()

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

optional .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
TimestampOrBuilder

getStatus()

public AdRuleStatusEnum.AdRuleStatus getStatus()

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

optional .google.ads.admanager.v1.AdRuleStatusEnum.AdRuleStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
AdRuleStatusEnum.AdRuleStatus

The status.

getStatusValue()

public int getStatusValue()

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

optional .google.ads.admanager.v1.AdRuleStatusEnum.AdRuleStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for status.

getTargeting()

public Targeting getTargeting()

Required. The targeting of the AdRule.

optional .google.ads.admanager.v1.Targeting targeting = 11 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Targeting

The targeting.

getTargetingOrBuilder()

public TargetingOrBuilder getTargetingOrBuilder()

Required. The targeting of the AdRule.

optional .google.ads.admanager.v1.Targeting targeting = 11 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
TargetingOrBuilder

hasDisplayName()

public boolean hasDisplayName()

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

optional string display_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the displayName field is set.

hasEndTime()

public boolean hasEndTime()

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

optional .google.protobuf.Timestamp end_time = 14 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the endTime field is set.

hasEndTimeUnlimited()

public boolean hasEndTimeUnlimited()

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

optional bool end_time_unlimited = 15 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the endTimeUnlimited field is set.

hasFrequencyCapBehavior()

public boolean hasFrequencyCapBehavior()

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

optional .google.ads.admanager.v1.AdRuleFrequencyCapBehaviorEnum.AdRuleFrequencyCapBehavior frequency_cap_behavior = 5 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the frequencyCapBehavior field is set.

hasMaxImpressionsPerLineItemPerPod()

public boolean hasMaxImpressionsPerLineItemPerPod()

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

optional int32 max_impressions_per_line_item_per_pod = 7 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the maxImpressionsPerLineItemPerPod field is set.

hasMaxImpressionsPerLineItemPerStream()

public boolean hasMaxImpressionsPerLineItemPerStream()

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

optional int32 max_impressions_per_line_item_per_stream = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the maxImpressionsPerLineItemPerStream field is set.

hasPostroll()

public boolean hasPostroll()

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

optional .google.ads.admanager.v1.AdRuleSlot postroll = 10 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the postroll field is set.

hasPreroll()

public boolean hasPreroll()

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

optional .google.ads.admanager.v1.AdRuleSlot preroll = 8 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the preroll field is set.

hasPriority()

public boolean hasPriority()

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.

optional int32 priority = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the priority field is set.

hasStartTime()

public boolean hasStartTime()

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

optional .google.protobuf.Timestamp start_time = 13 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the startTime field is set.

hasStatus()

public boolean hasStatus()

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

optional .google.ads.admanager.v1.AdRuleStatusEnum.AdRuleStatus status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the status field is set.

hasTargeting()

public boolean hasTargeting()

Required. The targeting of the AdRule.

optional .google.ads.admanager.v1.Targeting targeting = 11 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the targeting field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public AdRule.Builder newBuilderForType()
Returns
Type Description
AdRule.Builder

newBuilderForType(AbstractMessage.BuilderParent parent)

protected AdRule.Builder newBuilderForType(AbstractMessage.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
AdRule.Builder
Overrides

toBuilder()

public AdRule.Builder toBuilder()
Returns
Type Description
AdRule.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException