Class Audience.Builder (0.21.0)

public static final class Audience.Builder extends GeneratedMessageV3.Builder<Audience.Builder> implements AudienceOrBuilder

A resource message representing a GA4 Audience.

Protobuf type google.analytics.admin.v1alpha.Audience

Implements

AudienceOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllFilterClauses(Iterable<? extends AudienceFilterClause> values)

public Audience.Builder addAllFilterClauses(Iterable<? extends AudienceFilterClause> values)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameter
NameDescription
valuesIterable<? extends com.google.analytics.admin.v1alpha.AudienceFilterClause>
Returns
TypeDescription
Audience.Builder

addFilterClauses(AudienceFilterClause value)

public Audience.Builder addFilterClauses(AudienceFilterClause value)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameter
NameDescription
valueAudienceFilterClause
Returns
TypeDescription
Audience.Builder

addFilterClauses(AudienceFilterClause.Builder builderForValue)

public Audience.Builder addFilterClauses(AudienceFilterClause.Builder builderForValue)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameter
NameDescription
builderForValueAudienceFilterClause.Builder
Returns
TypeDescription
Audience.Builder

addFilterClauses(int index, AudienceFilterClause value)

public Audience.Builder addFilterClauses(int index, AudienceFilterClause value)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameters
NameDescription
indexint
valueAudienceFilterClause
Returns
TypeDescription
Audience.Builder

addFilterClauses(int index, AudienceFilterClause.Builder builderForValue)

public Audience.Builder addFilterClauses(int index, AudienceFilterClause.Builder builderForValue)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameters
NameDescription
indexint
builderForValueAudienceFilterClause.Builder
Returns
TypeDescription
Audience.Builder

addFilterClausesBuilder()

public AudienceFilterClause.Builder addFilterClausesBuilder()

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Returns
TypeDescription
AudienceFilterClause.Builder

addFilterClausesBuilder(int index)

public AudienceFilterClause.Builder addFilterClausesBuilder(int index)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameter
NameDescription
indexint
Returns
TypeDescription
AudienceFilterClause.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Audience.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Audience.Builder
Overrides

build()

public Audience build()
Returns
TypeDescription
Audience

buildPartial()

public Audience buildPartial()
Returns
TypeDescription
Audience

clear()

public Audience.Builder clear()
Returns
TypeDescription
Audience.Builder
Overrides

clearAdsPersonalizationEnabled()

public Audience.Builder clearAdsPersonalizationEnabled()

Output only. It is automatically set by GA to false if this is an NPA Audience and is excluded from ads personalization.

bool ads_personalization_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearDescription()

public Audience.Builder clearDescription()

Required. The description of the Audience.

string description = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearDisplayName()

public Audience.Builder clearDisplayName()

Required. The display name of the Audience.

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

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearEventTrigger()

public Audience.Builder clearEventTrigger()

Optional. Specifies an event to log when a user joins the Audience. If not set, no event is logged when a user joins the Audience.

.google.analytics.admin.v1alpha.AudienceEventTrigger event_trigger = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
Audience.Builder

clearExclusionDurationMode()

public Audience.Builder clearExclusionDurationMode()

Immutable. Specifies how long an exclusion lasts for users that meet the exclusion filter. It is applied to all EXCLUDE filter clauses and is ignored when there is no EXCLUDE filter clause in the Audience.

.google.analytics.admin.v1alpha.Audience.AudienceExclusionDurationMode exclusion_duration_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Audience.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Audience.Builder
Overrides

clearFilterClauses()

public Audience.Builder clearFilterClauses()

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Returns
TypeDescription
Audience.Builder

clearMembershipDurationDays()

public Audience.Builder clearMembershipDurationDays()

Required. Immutable. The duration a user should stay in an Audience. It cannot be set to more than 540 days.

int32 membership_duration_days = 4 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearName()

public Audience.Builder clearName()

Output only. The resource name for this Audience resource. Format: properties/{propertyId}/audiences/{audienceId}

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

Returns
TypeDescription
Audience.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Audience.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Audience.Builder
Overrides

clone()

public Audience.Builder clone()
Returns
TypeDescription
Audience.Builder
Overrides

getAdsPersonalizationEnabled()

public boolean getAdsPersonalizationEnabled()

Output only. It is automatically set by GA to false if this is an NPA Audience and is excluded from ads personalization.

bool ads_personalization_enabled = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

The adsPersonalizationEnabled.

getDefaultInstanceForType()

public Audience getDefaultInstanceForType()
Returns
TypeDescription
Audience

getDescription()

public String getDescription()

Required. The description of the Audience.

string description = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Required. The description of the Audience.

string description = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDisplayName()

public String getDisplayName()

Required. The display name of the Audience.

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

Returns
TypeDescription
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. The display name of the Audience.

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

Returns
TypeDescription
ByteString

The bytes for displayName.

getEventTrigger()

public AudienceEventTrigger getEventTrigger()

Optional. Specifies an event to log when a user joins the Audience. If not set, no event is logged when a user joins the Audience.

.google.analytics.admin.v1alpha.AudienceEventTrigger event_trigger = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudienceEventTrigger

The eventTrigger.

getEventTriggerBuilder()

public AudienceEventTrigger.Builder getEventTriggerBuilder()

Optional. Specifies an event to log when a user joins the Audience. If not set, no event is logged when a user joins the Audience.

.google.analytics.admin.v1alpha.AudienceEventTrigger event_trigger = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudienceEventTrigger.Builder

getEventTriggerOrBuilder()

public AudienceEventTriggerOrBuilder getEventTriggerOrBuilder()

Optional. Specifies an event to log when a user joins the Audience. If not set, no event is logged when a user joins the Audience.

.google.analytics.admin.v1alpha.AudienceEventTrigger event_trigger = 6 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
AudienceEventTriggerOrBuilder

getExclusionDurationMode()

public Audience.AudienceExclusionDurationMode getExclusionDurationMode()

Immutable. Specifies how long an exclusion lasts for users that meet the exclusion filter. It is applied to all EXCLUDE filter clauses and is ignored when there is no EXCLUDE filter clause in the Audience.

.google.analytics.admin.v1alpha.Audience.AudienceExclusionDurationMode exclusion_duration_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Audience.AudienceExclusionDurationMode

The exclusionDurationMode.

getExclusionDurationModeValue()

public int getExclusionDurationModeValue()

Immutable. Specifies how long an exclusion lasts for users that meet the exclusion filter. It is applied to all EXCLUDE filter clauses and is ignored when there is no EXCLUDE filter clause in the Audience.

.google.analytics.admin.v1alpha.Audience.AudienceExclusionDurationMode exclusion_duration_mode = 7 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
int

The enum numeric value on the wire for exclusionDurationMode.

getFilterClauses(int index)

public AudienceFilterClause getFilterClauses(int index)

Required. Immutable. Unordered list. Filter clauses that define the Audience. All clauses will be AND’ed together.

repeated .google.analytics.admin.v1alpha.AudienceFilterClause filter_clauses = 8 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = UNORDERED_LIST];

Parameter
NameDescription
indexint
Returns