Class CompleteQueryRequest.Builder (2.15.0)

public static final class CompleteQueryRequest.Builder extends GeneratedMessageV3.Builder<CompleteQueryRequest.Builder> implements CompleteQueryRequestOrBuilder

Auto-complete parameters.

Protobuf type google.cloud.retail.v2beta.CompleteQueryRequest

Static Methods

getDescriptor()

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

Methods

addAllLanguageCodes(Iterable<String> values)

public CompleteQueryRequest.Builder addAllLanguageCodes(Iterable<String> values)

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Parameter
NameDescription
valuesIterable<String>

The languageCodes to add.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

addLanguageCodes(String value)

public CompleteQueryRequest.Builder addLanguageCodes(String value)

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Parameter
NameDescription
valueString

The languageCodes to add.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

addLanguageCodesBytes(ByteString value)

public CompleteQueryRequest.Builder addLanguageCodesBytes(ByteString value)

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Parameter
NameDescription
valueByteString

The bytes of the languageCodes to add.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public CompleteQueryRequest build()
Returns
TypeDescription
CompleteQueryRequest

buildPartial()

public CompleteQueryRequest buildPartial()
Returns
TypeDescription
CompleteQueryRequest

clear()

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

clearCatalog()

public CompleteQueryRequest.Builder clearCatalog()

Required. Catalog for which the completion is performed. Full resource name of catalog, such as projects/*/locations/global/catalogs/default_catalog.

string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clearDataset()

public CompleteQueryRequest.Builder clearDataset()

Determines which dataset to use for fetching completion. "user-data" will use the imported dataset through CompletionService.ImportCompletionData. "cloud-retail" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the "user-data". Current supported values:

  • user-data
  • cloud-retail: This option requires enabling auto-learning function first. See guidelines.

string dataset = 6;

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clearDeviceType()

public CompleteQueryRequest.Builder clearDeviceType()

The device type context for completion suggestions. We recommend that you leave this field empty. It can apply different suggestions on different device types, e.g. DESKTOP, MOBILE. If it is empty, the suggestions are across all device types. Supported formats:

  • UNKNOWN_DEVICE_TYPE
  • DESKTOP
  • MOBILE
  • A customized string starts with OTHER_, e.g. OTHER_IPHONE.

string device_type = 4;

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearLanguageCodes()

public CompleteQueryRequest.Builder clearLanguageCodes()

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clearMaxSuggestions()

public CompleteQueryRequest.Builder clearMaxSuggestions()

Completion max suggestions. If left unset or set to 0, then will fallback to the configured value CompletionConfig.max_suggestions. The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20.

int32 max_suggestions = 5;

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearQuery()

public CompleteQueryRequest.Builder clearQuery()

Required. The query used to generate suggestions. The maximum number of allowed characters is 255.

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

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clearVisitorId()

public CompleteQueryRequest.Builder clearVisitorId()

Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string visitor_id = 7;

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

clone()

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

getCatalog()

public String getCatalog()

Required. Catalog for which the completion is performed. Full resource name of catalog, such as projects/*/locations/global/catalogs/default_catalog.

string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The catalog.

getCatalogBytes()

public ByteString getCatalogBytes()

Required. Catalog for which the completion is performed. Full resource name of catalog, such as projects/*/locations/global/catalogs/default_catalog.

string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for catalog.

getDataset()

public String getDataset()

Determines which dataset to use for fetching completion. "user-data" will use the imported dataset through CompletionService.ImportCompletionData. "cloud-retail" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the "user-data". Current supported values:

  • user-data
  • cloud-retail: This option requires enabling auto-learning function first. See guidelines.

string dataset = 6;

Returns
TypeDescription
String

The dataset.

getDatasetBytes()

public ByteString getDatasetBytes()

Determines which dataset to use for fetching completion. "user-data" will use the imported dataset through CompletionService.ImportCompletionData. "cloud-retail" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the "user-data". Current supported values:

  • user-data
  • cloud-retail: This option requires enabling auto-learning function first. See guidelines.

string dataset = 6;

Returns
TypeDescription
ByteString

The bytes for dataset.

getDefaultInstanceForType()

public CompleteQueryRequest getDefaultInstanceForType()
Returns
TypeDescription
CompleteQueryRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDeviceType()

public String getDeviceType()

The device type context for completion suggestions. We recommend that you leave this field empty. It can apply different suggestions on different device types, e.g. DESKTOP, MOBILE. If it is empty, the suggestions are across all device types. Supported formats:

  • UNKNOWN_DEVICE_TYPE
  • DESKTOP
  • MOBILE
  • A customized string starts with OTHER_, e.g. OTHER_IPHONE.

string device_type = 4;

Returns
TypeDescription
String

The deviceType.

getDeviceTypeBytes()

public ByteString getDeviceTypeBytes()

The device type context for completion suggestions. We recommend that you leave this field empty. It can apply different suggestions on different device types, e.g. DESKTOP, MOBILE. If it is empty, the suggestions are across all device types. Supported formats:

  • UNKNOWN_DEVICE_TYPE
  • DESKTOP
  • MOBILE
  • A customized string starts with OTHER_, e.g. OTHER_IPHONE.

string device_type = 4;

Returns
TypeDescription
ByteString

The bytes for deviceType.

getLanguageCodes(int index)

public String getLanguageCodes(int index)

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The languageCodes at the given index.

getLanguageCodesBytes(int index)

public ByteString getLanguageCodesBytes(int index)

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the languageCodes at the given index.

getLanguageCodesCount()

public int getLanguageCodesCount()

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Returns
TypeDescription
int

The count of languageCodes.

getLanguageCodesList()

public ProtocolStringList getLanguageCodesList()

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Returns
TypeDescription
ProtocolStringList

A list containing the languageCodes.

getMaxSuggestions()

public int getMaxSuggestions()

Completion max suggestions. If left unset or set to 0, then will fallback to the configured value CompletionConfig.max_suggestions. The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20.

int32 max_suggestions = 5;

Returns
TypeDescription
int

The maxSuggestions.

getQuery()

public String getQuery()

Required. The query used to generate suggestions. The maximum number of allowed characters is 255.

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

Returns
TypeDescription
String

The query.

getQueryBytes()

public ByteString getQueryBytes()

Required. The query used to generate suggestions. The maximum number of allowed characters is 255.

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

Returns
TypeDescription
ByteString

The bytes for query.

getVisitorId()

public String getVisitorId()

Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string visitor_id = 7;

Returns
TypeDescription
String

The visitorId.

getVisitorIdBytes()

public ByteString getVisitorIdBytes()

Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string visitor_id = 7;

Returns
TypeDescription
ByteString

The bytes for visitorId.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CompleteQueryRequest other)

public CompleteQueryRequest.Builder mergeFrom(CompleteQueryRequest other)
Parameter
NameDescription
otherCompleteQueryRequest
Returns
TypeDescription
CompleteQueryRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setCatalog(String value)

public CompleteQueryRequest.Builder setCatalog(String value)

Required. Catalog for which the completion is performed. Full resource name of catalog, such as projects/*/locations/global/catalogs/default_catalog.

string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The catalog to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setCatalogBytes(ByteString value)

public CompleteQueryRequest.Builder setCatalogBytes(ByteString value)

Required. Catalog for which the completion is performed. Full resource name of catalog, such as projects/*/locations/global/catalogs/default_catalog.

string catalog = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for catalog to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setDataset(String value)

public CompleteQueryRequest.Builder setDataset(String value)

Determines which dataset to use for fetching completion. "user-data" will use the imported dataset through CompletionService.ImportCompletionData. "cloud-retail" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the "user-data". Current supported values:

  • user-data
  • cloud-retail: This option requires enabling auto-learning function first. See guidelines.

string dataset = 6;

Parameter
NameDescription
valueString

The dataset to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setDatasetBytes(ByteString value)

public CompleteQueryRequest.Builder setDatasetBytes(ByteString value)

Determines which dataset to use for fetching completion. "user-data" will use the imported dataset through CompletionService.ImportCompletionData. "cloud-retail" will use the dataset generated by cloud retail based on user events. If leave empty, it will use the "user-data". Current supported values:

  • user-data
  • cloud-retail: This option requires enabling auto-learning function first. See guidelines.

string dataset = 6;

Parameter
NameDescription
valueByteString

The bytes for dataset to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setDeviceType(String value)

public CompleteQueryRequest.Builder setDeviceType(String value)

The device type context for completion suggestions. We recommend that you leave this field empty. It can apply different suggestions on different device types, e.g. DESKTOP, MOBILE. If it is empty, the suggestions are across all device types. Supported formats:

  • UNKNOWN_DEVICE_TYPE
  • DESKTOP
  • MOBILE
  • A customized string starts with OTHER_, e.g. OTHER_IPHONE.

string device_type = 4;

Parameter
NameDescription
valueString

The deviceType to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setDeviceTypeBytes(ByteString value)

public CompleteQueryRequest.Builder setDeviceTypeBytes(ByteString value)

The device type context for completion suggestions. We recommend that you leave this field empty. It can apply different suggestions on different device types, e.g. DESKTOP, MOBILE. If it is empty, the suggestions are across all device types. Supported formats:

  • UNKNOWN_DEVICE_TYPE
  • DESKTOP
  • MOBILE
  • A customized string starts with OTHER_, e.g. OTHER_IPHONE.

string device_type = 4;

Parameter
NameDescription
valueByteString

The bytes for deviceType to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setLanguageCodes(int index, String value)

public CompleteQueryRequest.Builder setLanguageCodes(int index, String value)

Note that this field applies for user-data dataset only. For requests with cloud-retail dataset, setting this field has no effect. The language filters applied to the output suggestions. If set, it should contain the language of the query. If not set, suggestions are returned without considering language restrictions. This is the BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Tags for Identifying Languages. The maximum number of language codes is 3.

repeated string language_codes = 3;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The languageCodes to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setMaxSuggestions(int value)

public CompleteQueryRequest.Builder setMaxSuggestions(int value)

Completion max suggestions. If left unset or set to 0, then will fallback to the configured value CompletionConfig.max_suggestions. The maximum allowed max suggestions is 20. If it is set higher, it will be capped by 20.

int32 max_suggestions = 5;

Parameter
NameDescription
valueint

The maxSuggestions to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setQuery(String value)

public CompleteQueryRequest.Builder setQuery(String value)

Required. The query used to generate suggestions. The maximum number of allowed characters is 255.

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

Parameter
NameDescription
valueString

The query to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setQueryBytes(ByteString value)

public CompleteQueryRequest.Builder setQueryBytes(ByteString value)

Required. The query used to generate suggestions. The maximum number of allowed characters is 255.

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

Parameter
NameDescription
valueByteString

The bytes for query to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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

setVisitorId(String value)

public CompleteQueryRequest.Builder setVisitorId(String value)

Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string visitor_id = 7;

Parameter
NameDescription
valueString

The visitorId to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.

setVisitorIdBytes(ByteString value)

public CompleteQueryRequest.Builder setVisitorIdBytes(ByteString value)

Required field. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

string visitor_id = 7;

Parameter
NameDescription
valueByteString

The bytes for visitorId to set.

Returns
TypeDescription
CompleteQueryRequest.Builder

This builder for chaining.