Class ProductSearchParams.Builder (3.34.0)

public static final class ProductSearchParams.Builder extends GeneratedMessageV3.Builder<ProductSearchParams.Builder> implements ProductSearchParamsOrBuilder

Parameters for a product search request.

Protobuf type google.cloud.vision.v1p4beta1.ProductSearchParams

Static Methods

getDescriptor()

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

Methods

addAllProductCategories(Iterable<String> values)

public ProductSearchParams.Builder addAllProductCategories(Iterable<String> values)

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Parameter
NameDescription
valuesIterable<String>

The productCategories to add.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

addProductCategories(String value)

public ProductSearchParams.Builder addProductCategories(String value)

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Parameter
NameDescription
valueString

The productCategories to add.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

addProductCategoriesBytes(ByteString value)

public ProductSearchParams.Builder addProductCategoriesBytes(ByteString value)

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Parameter
NameDescription
valueByteString

The bytes of the productCategories to add.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public ProductSearchParams build()
Returns
TypeDescription
ProductSearchParams

buildPartial()

public ProductSearchParams buildPartial()
Returns
TypeDescription
ProductSearchParams

clear()

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

clearBoundingPoly()

public ProductSearchParams.Builder clearBoundingPoly()

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Returns
TypeDescription
ProductSearchParams.Builder

clearField(Descriptors.FieldDescriptor field)

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

clearFilter()

public ProductSearchParams.Builder clearFilter()

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.

string filter = 8;

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearProductCategories()

public ProductSearchParams.Builder clearProductCategories()

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

clearProductSet()

public ProductSearchParams.Builder clearProductSet()

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID.

string product_set = 6 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

clone()

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

getBoundingPoly()

public BoundingPoly getBoundingPoly()

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Returns
TypeDescription
BoundingPoly

The boundingPoly.

getBoundingPolyBuilder()

public BoundingPoly.Builder getBoundingPolyBuilder()

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Returns
TypeDescription
BoundingPoly.Builder

getBoundingPolyOrBuilder()

public BoundingPolyOrBuilder getBoundingPolyOrBuilder()

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Returns
TypeDescription
BoundingPolyOrBuilder

getDefaultInstanceForType()

public ProductSearchParams getDefaultInstanceForType()
Returns
TypeDescription
ProductSearchParams

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getFilter()

public String getFilter()

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.

string filter = 8;

Returns
TypeDescription
String

The filter.

getFilterBytes()

public ByteString getFilterBytes()

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.

string filter = 8;

Returns
TypeDescription
ByteString

The bytes for filter.

getProductCategories(int index)

public String getProductCategories(int index)

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The productCategories at the given index.

getProductCategoriesBytes(int index)

public ByteString getProductCategoriesBytes(int index)

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the productCategories at the given index.

getProductCategoriesCount()

public int getProductCategoriesCount()

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Returns
TypeDescription
int

The count of productCategories.

getProductCategoriesList()

public ProtocolStringList getProductCategoriesList()

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Returns
TypeDescription
ProtocolStringList

A list containing the productCategories.

getProductSet()

public String getProductSet()

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID.

string product_set = 6 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The productSet.

getProductSetBytes()

public ByteString getProductSetBytes()

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID.

string product_set = 6 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for productSet.

hasBoundingPoly()

public boolean hasBoundingPoly()

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Returns
TypeDescription
boolean

Whether the boundingPoly field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeBoundingPoly(BoundingPoly value)

public ProductSearchParams.Builder mergeBoundingPoly(BoundingPoly value)

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Parameter
NameDescription
valueBoundingPoly
Returns
TypeDescription
ProductSearchParams.Builder

mergeFrom(ProductSearchParams other)

public ProductSearchParams.Builder mergeFrom(ProductSearchParams other)
Parameter
NameDescription
otherProductSearchParams
Returns
TypeDescription
ProductSearchParams.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setBoundingPoly(BoundingPoly value)

public ProductSearchParams.Builder setBoundingPoly(BoundingPoly value)

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Parameter
NameDescription
valueBoundingPoly
Returns
TypeDescription
ProductSearchParams.Builder

setBoundingPoly(BoundingPoly.Builder builderForValue)

public ProductSearchParams.Builder setBoundingPoly(BoundingPoly.Builder builderForValue)

The bounding polygon around the area of interest in the image. If it is not specified, system discretion will be applied.

.google.cloud.vision.v1p4beta1.BoundingPoly bounding_poly = 9;

Parameter
NameDescription
builderForValueBoundingPoly.Builder
Returns
TypeDescription
ProductSearchParams.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setFilter(String value)

public ProductSearchParams.Builder setFilter(String value)

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.

string filter = 8;

Parameter
NameDescription
valueString

The filter to set.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

setFilterBytes(ByteString value)

public ProductSearchParams.Builder setFilterBytes(ByteString value)

The filtering expression. This can be used to restrict search results based on Product labels. We currently support an AND of OR of key-value expressions, where each expression within an OR must have the same key. An '=' should be used to connect the key and value.

For example, "(color = red OR color = blue) AND brand = Google" is acceptable, but "(color = red OR brand = Google)" is not acceptable. "color: red" is not acceptable because it uses a ':' instead of an '='.

string filter = 8;

Parameter
NameDescription
valueByteString

The bytes for filter to set.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

setProductCategories(int index, String value)

public ProductSearchParams.Builder setProductCategories(int index, String value)

The list of product categories to search in. Currently, we only consider the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" should be specified. The legacy categories "homegoods", "apparel", and "toys" are still supported but will be deprecated. For new products, please use "homegoods-v2", "apparel-v2", or "toys-v2" for better product search accuracy. It is recommended to migrate existing products to these categories as well.

repeated string product_categories = 7;

Parameters
NameDescription
indexint

The index to set the value at.

valueString

The productCategories to set.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

setProductSet(String value)

public ProductSearchParams.Builder setProductSet(String value)

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID.

string product_set = 6 [(.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The productSet to set.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

setProductSetBytes(ByteString value)

public ProductSearchParams.Builder setProductSetBytes(ByteString value)

The resource name of a ProductSet to be searched for similar images.

Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID.

string product_set = 6 [(.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for productSet to set.

Returns
TypeDescription
ProductSearchParams.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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