Class UserInfo.Builder (0.29.0)

public static final class UserInfo.Builder extends GeneratedMessageV3.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public UserInfo build()
Returns
TypeDescription
UserInfo

buildPartial()

public UserInfo buildPartial()
Returns
TypeDescription
UserInfo

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

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
TypeDescription
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
TypeDescription
UserInfo.Builder

This builder for chaining.

clone()

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

getDefaultInstanceForType()

public UserInfo getDefaultInstanceForType()
Returns
TypeDescription
UserInfo

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for userId.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(UserInfo other)

public UserInfo.Builder mergeFrom(UserInfo other)
Parameter
NameDescription
otherUserInfo
Returns
TypeDescription
UserInfo.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public UserInfo.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
UserInfo.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public UserInfo.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
UserInfo.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final UserInfo.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
UserInfo.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public UserInfo.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
UserInfo.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final UserInfo.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
UserInfo.Builder
Overrides

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
NameDescription
valueString

The userAgent to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for userAgent to set.

Returns
TypeDescription
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
NameDescription
valueString

The userId to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for userId to set.

Returns
TypeDescription
UserInfo.Builder

This builder for chaining.