Googly.CloudVision.Projects.Locations.Products (googly_cloud_vision v0.1.0)

Copy Markdown View Source

Endpoints for the Projects.Locations.Products resource.

Summary

Functions

Creates and returns a new product resource. Possible errors: Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid.

Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

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

Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: Returns NOT_FOUND if the Product does not exist. Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. Returns INVALID_ARGUMENT if product_category is present in update_mask.

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Functions

create(parent, opts \\ [])

@spec create(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Product.t()} | {:error, term()}

Creates and returns a new product resource. Possible errors: Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters. Returns INVALID_ARGUMENT if description is longer than 4096 characters. * Returns INVALID_ARGUMENT if product_category is missing or invalid.

Parameters

  • parent (type: String.t()) - Required. The project in which the Product should be created. Format is projects/PROJECT_ID/locations/LOC_ID.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • product_id (type: String.t()) - A user-supplied resource id for this Product. If set, the server will attempt to use this value as the resource id. If it is already in use, an error is returned with code ALREADY_EXISTS. Must be at most 128 characters long. It cannot contain the character /.
    • body (type: Googly.CloudVision.Model.Product.t()) -

Returns

  • {:ok, %Googly.CloudVision.Model.Product{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

delete(name, opts \\ [])

@spec delete(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Empty.t()} | {:error, term()}

Permanently deletes a product and its reference images. Metadata of the product and all its images will be deleted right away, but search queries against ProductSets containing the product may still work until all related caches are refreshed.

Parameters

  • name (type: String.t()) - Required. Resource name of product to delete. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.

Returns

  • {:ok, %Googly.CloudVision.Model.Empty{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

get(name, opts \\ [])

@spec get(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Product.t()} | {:error, term()}

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

Parameters

  • name (type: String.t()) - Required. Resource name of the Product to get. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.

Returns

  • {:ok, %Googly.CloudVision.Model.Product{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

list(parent, opts \\ [])

@spec list(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.ListProductsResponse.t()} | {:error, term()}

Lists products in an unspecified order. Possible errors: * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.

Parameters

  • parent (type: String.t()) - Required. The project OR ProductSet from which Products should be listed. Format: projects/PROJECT_ID/locations/LOC_ID
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • page_size (type: integer()) - The maximum number of items to return. Default 10, maximum 100.
    • page_token (type: String.t()) - The next_page_token returned from a previous List request, if any.

Returns

  • {:ok, %Googly.CloudVision.Model.ListProductsResponse{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

patch(name, opts \\ [])

@spec patch(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Product.t()} | {:error, term()}

Makes changes to a Product resource. Only the display_name, description, and labels fields can be updated right now. If labels are updated, the change will not be reflected in queries until the next index time. Possible errors: Returns NOT_FOUND if the Product does not exist. Returns INVALID_ARGUMENT if display_name is present in update_mask but is missing from the request or longer than 4096 characters. Returns INVALID_ARGUMENT if description is present in update_mask but is longer than 4096 characters. Returns INVALID_ARGUMENT if product_category is present in update_mask.

Parameters

  • name (type: String.t()) - The resource name of the product. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID. This field is ignored when creating a product.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • update_mask (type: String.t()) - The FieldMask that specifies which fields to update. If update_mask isn't specified, all mutable fields are to be updated. Valid mask paths include product_labels, display_name, and description.
    • body (type: Googly.CloudVision.Model.Product.t()) -

Returns

  • {:ok, %Googly.CloudVision.Model.Product{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure

purge(parent, opts \\ [])

@spec purge(
  String.t(),
  keyword()
) :: {:ok, Googly.CloudVision.Model.Operation.t()} | {:error, term()}

Asynchronous API to delete all Products in a ProductSet or all Products that are in no ProductSet. If a Product is a member of the specified ProductSet in addition to other ProductSets, the Product will still be deleted. It is recommended to not delete the specified ProductSet until after this operation has completed. It is also recommended to not add any of the Products involved in the batch delete to a new ProductSet while this operation is running because those Products may still end up deleted. It's not possible to undo the PurgeProducts operation. Therefore, it is recommended to keep the csv files used in ImportProductSets (if that was how you originally built the Product Set) before starting PurgeProducts, in case you need to re-import the data after deletion. If the plan is to purge all of the Products from a ProductSet and then re-use the empty ProductSet to re-import new Products into the empty ProductSet, you must wait until the PurgeProducts operation has finished for that ProductSet. The google.longrunning.Operation API can be used to keep track of the progress and results of the request. Operation.metadata contains BatchOperationMetadata. (progress)

Parameters

  • parent (type: String.t()) - Required. The project and location in which the Products should be deleted. Format is projects/PROJECT_ID/locations/LOC_ID.
  • opts (type: keyword()) - Query and call options (:token, plus any of the below)
    • access_token (type: String.t()) - OAuth access token.
    • alt (type: String.t()) - Data format for response.
    • callback (type: String.t()) - JSONP
    • fields (type: String.t()) - Selector specifying which fields to include in a partial response.
    • key (type: String.t()) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token (type: String.t()) - OAuth 2.0 token for the current user.
    • pretty_print (type: boolean()) - Returns response with indentations and line breaks.
    • quota_user (type: String.t()) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol (type: String.t()) - Upload protocol for media (e.g. "raw", "multipart").
    • upload_type (type: String.t()) - Legacy upload protocol for media (e.g. "media", "multipart").
    • xgafv (type: String.t()) - V1 error format.
    • body (type: Googly.CloudVision.Model.PurgeProductsRequest.t()) -

Returns

  • {:ok, %Googly.CloudVision.Model.Operation{}} on success
  • {:error, %Googly.CloudVision.Error{}} on failure