Retail v2 API - Class ProductService.ProductServiceBase (2.11.0)

[BindServiceMethod(typeof(ProductService), "BindService")]
public abstract class ProductService.ProductServiceBase

Reference documentation and code samples for the Retail v2 API class ProductService.ProductServiceBase.

Base class for server-side implementations of ProductService

Inheritance

object > ProductService.ProductServiceBase

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Methods

AddFulfillmentPlaces(AddFulfillmentPlacesRequest, ServerCallContext)

public virtual Task<Operation> AddFulfillmentPlaces(AddFulfillmentPlacesRequest request, ServerCallContext context)

We recommend that you use the [ProductService.AddLocalInventories][google.cloud.retail.v2.ProductService.AddLocalInventories] method instead of the [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces] method. [ProductService.AddLocalInventories][google.cloud.retail.v2.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][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddFulfillmentPlacesRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

AddLocalInventories(AddLocalInventoriesRequest, ServerCallContext)

public virtual Task<Operation> AddLocalInventories(AddLocalInventoriesRequest request, ServerCallContext context)

Updates local inventory information for a [Product][google.cloud.retail.v2.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][google.cloud.retail.v2.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][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be modified using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request AddLocalInventoriesRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

CreateProduct(CreateProductRequest, ServerCallContext)

public virtual Task<Product> CreateProduct(CreateProductRequest request, ServerCallContext context)

Creates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request CreateProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProduct

The response to send back to the client (wrapped by a task).

DeleteProduct(DeleteProductRequest, ServerCallContext)

public virtual Task<Empty> DeleteProduct(DeleteProductRequest request, ServerCallContext context)

Deletes a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request DeleteProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskEmpty

The response to send back to the client (wrapped by a task).

GetProduct(GetProductRequest, ServerCallContext)

public virtual Task<Product> GetProduct(GetProductRequest request, ServerCallContext context)

Gets a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request GetProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProduct

The response to send back to the client (wrapped by a task).

ImportProducts(ImportProductsRequest, ServerCallContext)

public virtual Task<Operation> ImportProducts(ImportProductsRequest request, ServerCallContext context)

Bulk import of multiple [Product][google.cloud.retail.v2.Product]s.

Request processing may be synchronous. Non-existing items are created.

Note that it is possible for a subset of the [Product][google.cloud.retail.v2.Product]s to be successfully updated.

Parameters
Name Description
request ImportProductsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

ListProducts(ListProductsRequest, ServerCallContext)

public virtual Task<ListProductsResponse> ListProducts(ListProductsRequest request, ServerCallContext context)

Gets a list of [Product][google.cloud.retail.v2.Product]s.

Parameters
Name Description
request ListProductsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskListProductsResponse

The response to send back to the client (wrapped by a task).

PurgeProducts(PurgeProductsRequest, ServerCallContext)

public virtual Task<Operation> PurgeProducts(PurgeProductsRequest request, ServerCallContext context)

Permanently deletes all selected [Product][google.cloud.retail.v2.Product]s 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 [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. Before the operation completes, some [Product][google.cloud.retail.v2.Product]s may still be returned by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Depending on the number of [Product][google.cloud.retail.v2.Product]s, this operation could take hours to complete. To get a sample of [Product][google.cloud.retail.v2.Product]s that would be deleted, set [PurgeProductsRequest.force][google.cloud.retail.v2.PurgeProductsRequest.force] to false.

Parameters
Name Description
request PurgeProductsRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest, ServerCallContext)

public virtual Task<Operation> RemoveFulfillmentPlaces(RemoveFulfillmentPlacesRequest request, ServerCallContext context)

We recommend that you use the [ProductService.RemoveLocalInventories][google.cloud.retail.v2.ProductService.RemoveLocalInventories] method instead of the [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces] method. [ProductService.RemoveLocalInventories][google.cloud.retail.v2.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][google.cloud.retail.v2.FulfillmentInfo.place_ids].

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveFulfillmentPlacesRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

RemoveLocalInventories(RemoveLocalInventoriesRequest, ServerCallContext)

public virtual Task<Operation> RemoveLocalInventories(RemoveLocalInventoriesRequest request, ServerCallContext context)

Remove local inventory information for a [Product][google.cloud.retail.v2.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][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

Local inventory information can only be removed using this method. [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] has no effect on local inventories.

The returned [Operation][google.longrunning.Operation]s will be obsolete after 1 day, and [GetOperation][google.longrunning.Operations.GetOperation] API will return NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates will not be marked as [done][google.longrunning.Operation.done] until being obsolete.

Parameters
Name Description
request RemoveLocalInventoriesRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

SetInventory(SetInventoryRequest, ServerCallContext)

public virtual Task<Operation> SetInventory(SetInventoryRequest request, ServerCallContext context)

Updates inventory information for a [Product][google.cloud.retail.v2.Product] while respecting the last update timestamps of each inventory field.

This process is asynchronous and does not require the [Product][google.cloud.retail.v2.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][google.cloud.retail.v2.Product] queried by [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct] or [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts].

When inventory is updated with [ProductService.CreateProduct][google.cloud.retail.v2.ProductService.CreateProduct] and [ProductService.UpdateProduct][google.cloud.retail.v2.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][google.cloud.retail.v2.ProductService.CreateProduct] or [ProductService.UpdateProduct][google.cloud.retail.v2.ProductService.UpdateProduct] request.

If no inventory fields are set in [CreateProductRequest.product][google.cloud.retail.v2.CreateProductRequest.product], then any pre-existing inventory information for this product is used.

If no inventory fields are set in [SetInventoryRequest.set_mask][google.cloud.retail.v2.SetInventoryRequest.set_mask], then any existing inventory information is preserved.

Pre-existing inventory information can only be updated with [ProductService.SetInventory][google.cloud.retail.v2.ProductService.SetInventory], [ProductService.AddFulfillmentPlaces][google.cloud.retail.v2.ProductService.AddFulfillmentPlaces], and [ProductService.RemoveFulfillmentPlaces][google.cloud.retail.v2.ProductService.RemoveFulfillmentPlaces].

The returned [Operation][google.longrunning.Operation]s is obsolete after one day, and the [GetOperation][google.longrunning.Operations.GetOperation] API returns NOT_FOUND afterwards.

If conflicting updates are issued, the [Operation][google.longrunning.Operation]s associated with the stale updates are not marked as [done][google.longrunning.Operation.done] until they are obsolete.

Parameters
Name Description
request SetInventoryRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskOperation

The response to send back to the client (wrapped by a task).

UpdateProduct(UpdateProductRequest, ServerCallContext)

public virtual Task<Product> UpdateProduct(UpdateProductRequest request, ServerCallContext context)

Updates a [Product][google.cloud.retail.v2.Product].

Parameters
Name Description
request UpdateProductRequest

The request received from the client.

context ServerCallContext

The context of the server-side call handler being invoked.

Returns
Type Description
TaskProduct

The response to send back to the client (wrapped by a task).