Class UserInfo.Builder (0.79.0)

public static final class UserInfo.Builder extends GeneratedMessage.Builder<UserInfo.Builder> implements UserInfoOrBuilder

Information of an end user.

Protobuf type google.cloud.discoveryengine.v1.UserInfo

Implements

UserInfoOrBuilder

Static Methods

getDescriptor()

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

Methods

build()

public UserInfo build()
Returns
Type Description
UserInfo

buildPartial()

public UserInfo buildPartial()
Returns
Type Description
UserInfo

clear()

public UserInfo.Builder clear()
Returns
Type Description
UserInfo.Builder
Overrides

clearTimeZone()

public UserInfo.Builder clearTimeZone()

Optional. IANA time zone, e.g. Europe/Budapest.

string time_zone = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
UserInfo.Builder

This builder for chaining.

clearUserAgent()

public UserInfo.Builder clearUserAgent()

User agent as included in the HTTP header.

The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.

string user_agent = 2;

Returns
Type Description
UserInfo.Builder

This builder for chaining.

clearUserId()

public UserInfo.Builder clearUserId()

Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don't set for anonymous users.

Always use a hashed value for this ID.

Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string user_id = 1;

Returns
Type Description
UserInfo.Builder

This builder for chaining.

getDefaultInstanceForType()

public UserInfo getDefaultInstanceForType()
Returns
Type Description
UserInfo

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getTimeZone()

public String getTimeZone()

Optional. IANA time zone, e.g. Europe/Budapest.

string time_zone = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The timeZone.

getTimeZoneBytes()

public ByteString getTimeZoneBytes()

Optional. IANA time zone, e.g. Europe/Budapest.

string time_zone = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for timeZone.

getUserAgent()

public String getUserAgent()

User agent as included in the HTTP header.

The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.

string user_agent = 2;

Returns
Type Description
String

The userAgent.

getUserAgentBytes()

public ByteString getUserAgentBytes()

User agent as included in the HTTP header.

The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.

string user_agent = 2;

Returns
Type Description
ByteString

The bytes for userAgent.

getUserId()

public String getUserId()

Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don't set for anonymous users.

Always use a hashed value for this ID.

Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string user_id = 1;

Returns
Type Description
String

The userId.

getUserIdBytes()

public ByteString getUserIdBytes()

Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don't set for anonymous users.

Always use a hashed value for this ID.

Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string user_id = 1;

Returns
Type Description
ByteString

The bytes for userId.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(UserInfo other)

public UserInfo.Builder mergeFrom(UserInfo other)
Parameter
Name Description
other UserInfo
Returns
Type Description
UserInfo.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public UserInfo.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
UserInfo.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public UserInfo.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
UserInfo.Builder
Overrides

setTimeZone(String value)

public UserInfo.Builder setTimeZone(String value)

Optional. IANA time zone, e.g. Europe/Budapest.

string time_zone = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The timeZone to set.

Returns
Type Description
UserInfo.Builder

This builder for chaining.

setTimeZoneBytes(ByteString value)

public UserInfo.Builder setTimeZoneBytes(ByteString value)

Optional. IANA time zone, e.g. Europe/Budapest.

string time_zone = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for timeZone to set.

Returns
Type Description
UserInfo.Builder

This builder for chaining.

setUserAgent(String value)

public UserInfo.Builder setUserAgent(String value)

User agent as included in the HTTP header.

The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.

string user_agent = 2;

Parameter
Name Description
value String

The userAgent to set.

Returns
Type Description
UserInfo.Builder

This builder for chaining.

setUserAgentBytes(ByteString value)

public UserInfo.Builder setUserAgentBytes(ByteString value)

User agent as included in the HTTP header.

The field must be a UTF-8 encoded string with a length limit of 1,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.

This should not be set when using the client side event reporting with GTM or JavaScript tag in UserEventService.CollectUserEvent or if UserEvent.direct_user_request is set.

string user_agent = 2;

Parameter
Name Description
value ByteString

The bytes for userAgent to set.

Returns
Type Description
UserInfo.Builder

This builder for chaining.

setUserId(String value)

public UserInfo.Builder setUserId(String value)

Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don't set for anonymous users.

Always use a hashed value for this ID.

Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string user_id = 1;

Parameter
Name Description
value String

The userId to set.

Returns
Type Description
UserInfo.Builder

This builder for chaining.

setUserIdBytes(ByteString value)

public UserInfo.Builder setUserIdBytes(ByteString value)

Highly recommended for logged-in users. Unique identifier for logged-in user, such as a user name. Don't set for anonymous users.

Always use a hashed value for this ID.

Don't set the field to the same fixed ID for different users. This mixes the event history of those users together, which results in degraded model quality.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string user_id = 1;

Parameter
Name Description
value ByteString

The bytes for userId to set.

Returns
Type Description
UserInfo.Builder

This builder for chaining.