class ProjectsLocationsCatalogsBranchesProducts extends Resource (View source)

The "products" collection of methods.

Typical usage is:

 $retailService = new Google\Service\CloudRetail(...);
 $products = $retailService->projects_locations_catalogs_branches_products;

Methods

addFulfillmentPlaces(string $product, GoogleCloudRetailV2AddFulfillmentPlacesRequest $postBody, array $optParams = [])

We recommend that you use the ProductService.AddLocalInventories method instead of the ProductService.AddFulfillmentPlaces method.

addLocalInventories(string $product, GoogleCloudRetailV2AddLocalInventoriesRequest $postBody, array $optParams = [])

Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method.

create(string $parent, GoogleCloudRetailV2Product $postBody, array $optParams = [])

Creates a Product. (products.create)

delete(string $name, array $optParams = [])

Deletes a Product. (products.delete)

get(string $name, array $optParams = [])

Gets a Product. (products.get)

import(string $parent, GoogleCloudRetailV2ImportProductsRequest $postBody, array $optParams = [])

Bulk import of multiple Products. Request processing may be synchronous. Non- existing items are created. Note that it is possible for a subset of the Products to be successfully updated. (products.import)

listProjectsLocationsCatalogsBranchesProducts(string $parent, array $optParams = [])

Gets a list of Products.

patch(string $name, GoogleCloudRetailV2Product $postBody, array $optParams = [])

Updates a Product. (products.patch)

purge(string $parent, GoogleCloudRetailV2PurgeProductsRequest $postBody, array $optParams = [])

Permanently deletes all selected Products under a branch. This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of Products, this operation could take hours to complete. Before the operation completes, some Products may still be returned by ProductService.GetProduct or ProductService.ListProducts. Depending on the number of Products, this operation could take hours to complete. To get a sample of Products that would be deleted, set PurgeProductsRequest.force to false. (products.purge)

removeFulfillmentPlaces(string $product, GoogleCloudRetailV2RemoveFulfillmentPlacesRequest $postBody, array $optParams = [])

We recommend that you use the ProductService.RemoveLocalInventories method instead of the ProductService.RemoveFulfillmentPlaces method.

removeLocalInventories(string $product, GoogleCloudRetailV2RemoveLocalInventoriesRequest $postBody, array $optParams = [])

Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method.

setInventory(string $name, GoogleCloudRetailV2SetInventoryRequest $postBody, array $optParams = [])

Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre- existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete.

Details

GoogleLongrunningOperation addFulfillmentPlaces(string $product, GoogleCloudRetailV2AddFulfillmentPlacesRequest $postBody, array $optParams = [])

We recommend that you use the ProductService.AddLocalInventories method instead of the ProductService.AddFulfillmentPlaces method.

ProductService.AddLocalInventories achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally adds place IDs to Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the added place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. (products.addFulfillmentPlaces)

Parameters

string $product

Required. Full resource name of Product, such as proj ects/locations/global/catalogs/default_catalog/branches/default_branch/produc ts/some_product_id. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

GoogleCloudRetailV2AddFulfillmentPlacesRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception

GoogleLongrunningOperation addLocalInventories(string $product, GoogleCloudRetailV2AddLocalInventoriesRequest $postBody, array $optParams = [])

Updates local inventory information for a Product at a list of places, while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating inventory information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be modified using this method.

ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. (products.addLocalInventories)

Parameters

string $product

Required. Full resource name of Product, such as proj ects/locations/global/catalogs/default_catalog/branches/default_branch/produc ts/some_product_id. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

GoogleCloudRetailV2AddLocalInventoriesRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception

GoogleCloudRetailV2Product create(string $parent, GoogleCloudRetailV2Product $postBody, array $optParams = [])

Creates a Product. (products.create)

Parameters

string $parent

Required. The parent catalog resource name, such as projects/locations/global/catalogs/default_catalog/branches/default_branch.

GoogleCloudRetailV2Product $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2Product

Exceptions

Exception

GoogleProtobufEmpty delete(string $name, array $optParams = [])

Deletes a Product. (products.delete)

Parameters

string $name

Required. Full resource name of Product, such as project s/locations/global/catalogs/default_catalog/branches/default_branch/products/ some_product_id. If the caller does not have permission to delete the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the Product to delete does not exist, a NOT_FOUND error is returned. The Product to delete can neither be a Product.Type.COLLECTION Product member nor a Product.Type.PRIMARY Product with more than one variants. Otherwise, an INVALID_ARGUMENT error is returned. All inventory information for the named Product will be deleted.

array $optParams

Optional parameters.

Return Value

GoogleProtobufEmpty

Exceptions

Exception

GoogleCloudRetailV2Product get(string $name, array $optParams = [])

Gets a Product. (products.get)

Parameters

string $name

Required. Full resource name of Product, such as project s/locations/global/catalogs/default_catalog/branches/default_branch/products/ some_product_id. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned. If the requested Product does not exist, a NOT_FOUND error is returned.

array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2Product

Exceptions

Exception

GoogleLongrunningOperation import(string $parent, GoogleCloudRetailV2ImportProductsRequest $postBody, array $optParams = [])

Bulk import of multiple Products. Request processing may be synchronous. Non- existing items are created. Note that it is possible for a subset of the Products to be successfully updated. (products.import)

Parameters

string $parent

Required. projects/1234/locations/global/catalogs/defa ult_catalog/branches/default_branch If no updateMask is specified, requires products.create permission. If updateMask is specified, requires products.update permission.

GoogleCloudRetailV2ImportProductsRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception

GoogleCloudRetailV2ListProductsResponse listProjectsLocationsCatalogsBranchesProducts(string $parent, array $optParams = [])

Gets a list of Products.

(products.listProjectsLocationsCatalogsBranchesProducts)

Parameters

string $parent

Required. The parent branch resource name, such as projects/locations/global/catalogs/default_catalog/branches/0. Use default_branch as the branch ID, to list products under the default branch. If the caller does not have permission to list Products under this branch, regardless of whether or not this branch exists, a PERMISSION_DENIED error is returned.

array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2ListProductsResponse

Exceptions

Exception

GoogleCloudRetailV2Product patch(string $name, GoogleCloudRetailV2Product $postBody, array $optParams = [])

Updates a Product. (products.patch)

Parameters

string $name

Immutable. Full resource name of the product, such as pr ojects/locations/global/catalogs/default_catalog/branches/default_branch/prod ucts/product_id.

GoogleCloudRetailV2Product $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudRetailV2Product

Exceptions

Exception

GoogleLongrunningOperation purge(string $parent, GoogleCloudRetailV2PurgeProductsRequest $postBody, array $optParams = [])

Permanently deletes all selected Products under a branch. This process is asynchronous. If the request is valid, the removal will be enqueued and processed offline. Depending on the number of Products, this operation could take hours to complete. Before the operation completes, some Products may still be returned by ProductService.GetProduct or ProductService.ListProducts. Depending on the number of Products, this operation could take hours to complete. To get a sample of Products that would be deleted, set PurgeProductsRequest.force to false. (products.purge)

Parameters

string $parent

Required. The resource name of the branch under which the products are created. The format is projects/${projectId}/locations/glob al/catalogs/${catalogId}/branches/${branchId}

GoogleCloudRetailV2PurgeProductsRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception

GoogleLongrunningOperation removeFulfillmentPlaces(string $product, GoogleCloudRetailV2RemoveFulfillmentPlacesRequest $postBody, array $optParams = [])

We recommend that you use the ProductService.RemoveLocalInventories method instead of the ProductService.RemoveFulfillmentPlaces method.

ProductService.RemoveLocalInventories achieves the same results but provides more fine-grained control over ingesting local inventory data. Incrementally removes place IDs from a Product.fulfillment_info.place_ids. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update will be enqueued and processed downstream. As a consequence, when a response is returned, the removed place IDs are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. (products.removeFulfillmentPlaces)

Parameters

string $product

Required. Full resource name of Product, such as proj ects/locations/global/catalogs/default_catalog/branches/default_branch/produc ts/some_product_id. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

GoogleCloudRetailV2RemoveFulfillmentPlacesRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception

GoogleLongrunningOperation removeLocalInventories(string $product, GoogleCloudRetailV2RemoveLocalInventoriesRequest $postBody, array $optParams = [])

Remove local inventory information for a Product at a list of places at a removal timestamp. This process is asynchronous. If the request is valid, the removal will be enqueued and processed downstream. As a consequence, when a response is returned, removals are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. Local inventory information can only be removed using this method.

ProductService.CreateProduct and ProductService.UpdateProduct has no effect on local inventories. The returned Operations will be obsolete after 1 day, and GetOperation API will return NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates will not be marked as done until being obsolete. (products.removeLocalInventories)

Parameters

string $product

Required. Full resource name of Product, such as proj ects/locations/global/catalogs/default_catalog/branches/default_branch/produc ts/some_product_id. If the caller does not have permission to access the Product, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

GoogleCloudRetailV2RemoveLocalInventoriesRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception

GoogleLongrunningOperation setInventory(string $name, GoogleCloudRetailV2SetInventoryRequest $postBody, array $optParams = [])

Updates inventory information for a Product while respecting the last update timestamps of each inventory field. This process is asynchronous and does not require the Product to exist before updating fulfillment information. If the request is valid, the update is enqueued and processed downstream. As a consequence, when a response is returned, updates are not immediately manifested in the Product queried by ProductService.GetProduct or ProductService.ListProducts. When inventory is updated with ProductService.CreateProduct and ProductService.UpdateProduct, the specified inventory field value(s) overwrite any existing value(s) while ignoring the last update time for this field. Furthermore, the last update times for the specified inventory fields are overwritten by the times of the ProductService.CreateProduct or ProductService.UpdateProduct request. If no inventory fields are set in CreateProductRequest.product, then any pre- existing inventory information for this product is used. If no inventory fields are set in SetInventoryRequest.set_mask, then any existing inventory information is preserved. Pre-existing inventory information can only be updated with ProductService.SetInventory, ProductService.AddFulfillmentPlaces, and ProductService.RemoveFulfillmentPlaces. The returned Operations is obsolete after one day, and the GetOperation API returns NOT_FOUND afterwards. If conflicting updates are issued, the Operations associated with the stale updates are not marked as done until they are obsolete.

(products.setInventory)

Parameters

string $name

Immutable. Full resource name of the product, such as pr ojects/locations/global/catalogs/default_catalog/branches/default_branch/prod ucts/product_id.

GoogleCloudRetailV2SetInventoryRequest $postBody
array $optParams

Optional parameters.

Return Value

GoogleLongrunningOperation

Exceptions

Exception