[BindServiceMethod(typeof(CatalogService), "BindService")]
public abstract class CatalogService.CatalogServiceBase
Reference documentation and code samples for the Retail v2 API class CatalogService.CatalogServiceBase.
Base class for server-side implementations of CatalogService
Namespace
Google.Cloud.Retail.V2Assembly
Google.Cloud.Retail.V2.dll
Methods
AddCatalogAttribute(AddCatalogAttributeRequest, ServerCallContext)
public virtual Task<AttributesConfig> AddCatalogAttribute(AddCatalogAttributeRequest request, ServerCallContext context)
Adds the specified [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to the [AttributesConfig][google.cloud.retail.v2.AttributesConfig].
If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to add already exists, an ALREADY_EXISTS error is returned.
Parameters | |
---|---|
Name | Description |
request | AddCatalogAttributeRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttributesConfig | The response to send back to the client (wrapped by a task). |
GetAttributesConfig(GetAttributesConfigRequest, ServerCallContext)
public virtual Task<AttributesConfig> GetAttributesConfig(GetAttributesConfigRequest request, ServerCallContext context)
Gets an [AttributesConfig][google.cloud.retail.v2.AttributesConfig].
Parameters | |
---|---|
Name | Description |
request | GetAttributesConfigRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttributesConfig | The response to send back to the client (wrapped by a task). |
GetCompletionConfig(GetCompletionConfigRequest, ServerCallContext)
public virtual Task<CompletionConfig> GetCompletionConfig(GetCompletionConfigRequest request, ServerCallContext context)
Gets a [CompletionConfig][google.cloud.retail.v2.CompletionConfig].
Parameters | |
---|---|
Name | Description |
request | GetCompletionConfigRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskCompletionConfig | The response to send back to the client (wrapped by a task). |
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 | |
---|---|
Name | Description |
request | GetDefaultBranchRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskGetDefaultBranchResponse | 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 | |
---|---|
Name | Description |
request | ListCatalogsRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskListCatalogsResponse | The response to send back to the client (wrapped by a task). |
RemoveCatalogAttribute(RemoveCatalogAttributeRequest, ServerCallContext)
public virtual Task<AttributesConfig> RemoveCatalogAttribute(RemoveCatalogAttributeRequest request, ServerCallContext context)
Removes the specified [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] from the [AttributesConfig][google.cloud.retail.v2.AttributesConfig].
If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to remove does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request | RemoveCatalogAttributeRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttributesConfig | The response to send back to the client (wrapped by a task). |
ReplaceCatalogAttribute(ReplaceCatalogAttributeRequest, ServerCallContext)
public virtual Task<AttributesConfig> ReplaceCatalogAttribute(ReplaceCatalogAttributeRequest request, ServerCallContext context)
Replaces the specified [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] in the [AttributesConfig][google.cloud.retail.v2.AttributesConfig] by updating the catalog attribute with the same [CatalogAttribute.key][google.cloud.retail.v2.CatalogAttribute.key].
If the [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] to replace does not exist, a NOT_FOUND error is returned.
Parameters | |
---|---|
Name | Description |
request | ReplaceCatalogAttributeRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttributesConfig | 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 | |
---|---|
Name | Description |
request | SetDefaultBranchRequest 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). |
UpdateAttributesConfig(UpdateAttributesConfigRequest, ServerCallContext)
public virtual Task<AttributesConfig> UpdateAttributesConfig(UpdateAttributesConfigRequest request, ServerCallContext context)
Updates the [AttributesConfig][google.cloud.retail.v2.AttributesConfig].
The catalog attributes in the request will be updated in the catalog, or inserted if they do not exist. Existing catalog attributes not included in the request will remain unchanged. Attributes that are assigned to products, but do not exist at the catalog level, are always included in the response. The product attribute is assigned default values for missing catalog attribute fields, e.g., searchable and dynamic facetable options.
Parameters | |
---|---|
Name | Description |
request | UpdateAttributesConfigRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskAttributesConfig | 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 | |
---|---|
Name | Description |
request | UpdateCatalogRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskCatalog | The response to send back to the client (wrapped by a task). |
UpdateCompletionConfig(UpdateCompletionConfigRequest, ServerCallContext)
public virtual Task<CompletionConfig> UpdateCompletionConfig(UpdateCompletionConfigRequest request, ServerCallContext context)
Updates the [CompletionConfig][google.cloud.retail.v2.CompletionConfig]s.
Parameters | |
---|---|
Name | Description |
request | UpdateCompletionConfigRequest The request received from the client. |
context | ServerCallContext The context of the server-side call handler being invoked. |
Returns | |
---|---|
Type | Description |
TaskCompletionConfig | The response to send back to the client (wrapped by a task). |