Class CatalogService.CatalogServiceBase (2.1.0)

[BindServiceMethod(typeof(CatalogService), "BindService")]
public abstract class CatalogServiceBase

Base class for server-side implementations of CatalogService

Inheritance

Object > CatalogService.CatalogServiceBase

Namespace

Google.Cloud.Retail.V2

Assembly

Google.Cloud.Retail.V2.dll

Methods

GetDefaultBranch(GetDefaultBranchRequest, ServerCallContext)

public virtual Task<GetDefaultBranchResponse> GetDefaultBranch(GetDefaultBranchRequest request, ServerCallContext context)

Get which branch is currently default branch set by [CatalogService.SetDefaultBranch][google.cloud.retail.v2.CatalogService.SetDefaultBranch] method under a specified parent catalog.

Parameters
NameDescription
requestGetDefaultBranchRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
Task<GetDefaultBranchResponse>

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

ListCatalogs(ListCatalogsRequest, ServerCallContext)

public virtual Task<ListCatalogsResponse> ListCatalogs(ListCatalogsRequest request, ServerCallContext context)

Lists all the [Catalog][google.cloud.retail.v2.Catalog]s associated with the project.

Parameters
NameDescription
requestListCatalogsRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
Task<ListCatalogsResponse>

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

SetDefaultBranch(SetDefaultBranchRequest, ServerCallContext)

public virtual Task<Empty> SetDefaultBranch(SetDefaultBranchRequest request, ServerCallContext context)

Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2.ProductService.ListProducts] will treat requests using "default_branch" to the actual branch id set as default.

For example, if projects/*/locations/*/catalogs/*/branches/1 is set as default, setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to projects/*/locations/*/catalogs/*/branches/default_branch is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to projects/*/locations/*/catalogs/*/branches/1.

Using multiple branches can be useful when developers would like to have a staging branch to test and verify for future usage. When it becomes ready, developers switch on the staging branch using this API while keeping using projects/*/locations/*/catalogs/*/branches/default_branch as [SearchRequest.branch][google.cloud.retail.v2.SearchRequest.branch] to route the traffic to this staging branch.

CAUTION: If you have live predict/search traffic, switching the default branch could potentially cause outages if the ID space of the new branch is very different from the old one.

More specifically:

  • PredictionService will only return product IDs from branch {newBranch}.
  • SearchService will only return product IDs from branch {newBranch} (if branch is not explicitly set).
  • UserEventService will only join events with products from branch {newBranch}.
Parameters
NameDescription
requestSetDefaultBranchRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
Task<Empty>

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

UpdateCatalog(UpdateCatalogRequest, ServerCallContext)

public virtual Task<Catalog> UpdateCatalog(UpdateCatalogRequest request, ServerCallContext context)

Updates the [Catalog][google.cloud.retail.v2.Catalog]s.

Parameters
NameDescription
requestUpdateCatalogRequest

The request received from the client.

contextServerCallContext

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

Returns
TypeDescription
Task<Catalog>

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