pub struct CatalogServiceClient<T> { /* private fields */ }
Expand description

Service for managing catalog configuration.

Implementations§

source§

impl<T> CatalogServiceClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

pub fn with_interceptor<F>( inner: T, interceptor: F ) -> CatalogServiceClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

pub async fn list_catalogs( &mut self, request: impl IntoRequest<ListCatalogsRequest> ) -> Result<Response<ListCatalogsResponse>, Status>

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

source

pub async fn update_catalog( &mut self, request: impl IntoRequest<UpdateCatalogRequest> ) -> Result<Response<Catalog>, Status>

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

source

pub async fn set_default_branch( &mut self, request: impl IntoRequest<SetDefaultBranchRequest> ) -> Result<Response<()>, Status>

Set a specified branch id as default branch. API methods such as [SearchService.Search][google.cloud.retail.v2beta.SearchService.Search], [ProductService.GetProduct][google.cloud.retail.v2beta.ProductService.GetProduct], [ProductService.ListProducts][google.cloud.retail.v2beta.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.v2beta.SearchRequest.branch] to projects/*/locations/*/catalogs/*/branches/default_branch is equivalent to setting [SearchRequest.branch][google.cloud.retail.v2beta.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.v2beta.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}.
source

pub async fn get_default_branch( &mut self, request: impl IntoRequest<GetDefaultBranchRequest> ) -> Result<Response<GetDefaultBranchResponse>, Status>

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

source

pub async fn get_completion_config( &mut self, request: impl IntoRequest<GetCompletionConfigRequest> ) -> Result<Response<CompletionConfig>, Status>

Gets a [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig].

source

pub async fn update_completion_config( &mut self, request: impl IntoRequest<UpdateCompletionConfigRequest> ) -> Result<Response<CompletionConfig>, Status>

Updates the [CompletionConfig][google.cloud.retail.v2beta.CompletionConfig]s.

source

pub async fn get_attributes_config( &mut self, request: impl IntoRequest<GetAttributesConfigRequest> ) -> Result<Response<AttributesConfig>, Status>

Gets an [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].

source

pub async fn update_attributes_config( &mut self, request: impl IntoRequest<UpdateAttributesConfigRequest> ) -> Result<Response<AttributesConfig>, Status>

Updates the [AttributesConfig][google.cloud.retail.v2beta.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.

source

pub async fn add_catalog_attribute( &mut self, request: impl IntoRequest<AddCatalogAttributeRequest> ) -> Result<Response<AttributesConfig>, Status>

Adds the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].

If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to add already exists, an ALREADY_EXISTS error is returned.

source

pub async fn remove_catalog_attribute( &mut self, request: impl IntoRequest<RemoveCatalogAttributeRequest> ) -> Result<Response<AttributesConfig>, Status>

Removes the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] from the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].

If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to remove does not exist, a NOT_FOUND error is returned.

source

pub async fn batch_remove_catalog_attributes( &mut self, request: impl IntoRequest<BatchRemoveCatalogAttributesRequest> ) -> Result<Response<BatchRemoveCatalogAttributesResponse>, Status>

Removes all specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute]s from the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig].

source

pub async fn replace_catalog_attribute( &mut self, request: impl IntoRequest<ReplaceCatalogAttributeRequest> ) -> Result<Response<AttributesConfig>, Status>

Replaces the specified [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] in the [AttributesConfig][google.cloud.retail.v2beta.AttributesConfig] by updating the catalog attribute with the same [CatalogAttribute.key][google.cloud.retail.v2beta.CatalogAttribute.key].

If the [CatalogAttribute][google.cloud.retail.v2beta.CatalogAttribute] to replace does not exist, a NOT_FOUND error is returned.

Trait Implementations§

source§

impl<T: Clone> Clone for CatalogServiceClient<T>

source§

fn clone(&self) -> CatalogServiceClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for CatalogServiceClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for CatalogServiceClient<T>

§

impl<T> RefUnwindSafe for CatalogServiceClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for CatalogServiceClient<T>
where T: Send,

§

impl<T> Sync for CatalogServiceClient<T>
where T: Sync,

§

impl<T> Unpin for CatalogServiceClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for CatalogServiceClient<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more