Skip to main content

product_sets

Creates, updates, deletes, gets or lists a product_sets resource.

Overview

Nameproduct_sets
TypeResource
Idgoogle.vision.product_sets

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringThe resource name of the ProductSet. Format is: projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID. This field is ignored when creating a ProductSet.
displayNamestringThe user-provided name for this ProductSet. Must not be empty. Must be at most 4096 characters long.
indexErrorobjectOutput only. If there was an error with indexing the product set, the field is populated. This field is ignored when creating a ProductSet. (id: Status)
indexTimestring (google-datetime)Output only. The time at which this ProductSet was last indexed. Query results will reflect all updates before this time. If this ProductSet has never been indexed, this timestamp is the default value "1970-01-01T00:00:00Z". This field is ignored when creating a ProductSet.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_product_sets_getselectprojectsId, locationsId, productSetsIdGets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.
projects_locations_product_sets_listselectprojectsId, locationsIdpageSize, pageTokenLists ProductSets in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100, or less than 1.
projects_locations_product_sets_createinsertprojectsId, locationsIdproductSetIdCreates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.
projects_locations_product_sets_patchupdateprojectsId, locationsId, productSetsIdupdateMaskMakes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.
projects_locations_product_sets_deletedeleteprojectsId, locationsId, productSetsIdPermanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.
projects_locations_product_sets_importexecprojectsId, locationsIdAsynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
productSetsIdstring
projectsIdstring
pageSizeinteger (int32)
pageTokenstring
productSetIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets information associated with a ProductSet. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist.

SELECT
name,
displayName,
indexError,
indexTime
FROM google.vision.product_sets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND productSetsId = '{{ productSetsId }}' -- required;

INSERT examples

Creates and returns a new ProductSet resource. Possible errors: * Returns INVALID_ARGUMENT if display_name is missing, or is longer than 4096 characters.

INSERT INTO google.vision.product_sets (
data__name,
data__displayName,
projectsId,
locationsId,
productSetId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ productSetId }}'
RETURNING
name,
displayName,
indexError,
indexTime
;

UPDATE examples

Makes changes to a ProductSet resource. Only display_name can be updated currently. Possible errors: * Returns NOT_FOUND if the ProductSet does not exist. * Returns INVALID_ARGUMENT if display_name is present in update_mask but missing from the request or longer than 4096 characters.

UPDATE google.vision.product_sets
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND productSetsId = '{{ productSetsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
displayName,
indexError,
indexTime;

DELETE examples

Permanently deletes a ProductSet. Products and ReferenceImages in the ProductSet are not deleted. The actual image files are not deleted from Google Cloud Storage.

DELETE FROM google.vision.product_sets
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND productSetsId = '{{ productSetsId }}' --required;

Lifecycle Methods

Asynchronous API that imports a list of reference images to specified product sets based on a list of image information. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress) Operation.response contains ImportProductSetsResponse. (results) The input source of this method is a csv file on Google Cloud Storage. For the format of the csv file please see ImportProductSetsGcsSource.csv_file_uri.

EXEC google.vision.product_sets.projects_locations_product_sets_import 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required
@@json=
'{
"inputConfig": "{{ inputConfig }}"
}';