pub struct CatalogAttribute {
    pub key: String,
    pub in_use: bool,
    pub type: i32,
    pub indexable_option: i32,
    pub dynamic_facetable_option: i32,
    pub searchable_option: i32,
    pub exact_searchable_option: i32,
    pub retrievable_option: i32,
}
Expand description

Catalog level attribute config for an attribute. For example, if customers want to enable/disable facet for a specific attribute.

Fields§

§key: String

Required. Attribute name. For example: color, brands, attributes.custom_attribute, such as attributes.xyz. To be indexable, the attribute name can contain only alpha-numeric characters and underscores. For example, an attribute named attributes.abc_xyz can be indexed, but an attribute named attributes.abc-xyz cannot be indexed.

If the attribute key starts with attributes., then the attribute is a custom attribute. Attributes such as brands, patterns, and title are built-in and called system attributes.

§in_use: bool

Output only. Indicates whether this attribute has been used by any products. True if at least one [Product][google.cloud.retail.v2.Product] is using this attribute in [Product.attributes][google.cloud.retail.v2.Product.attributes]. Otherwise, this field is False.

[CatalogAttribute][google.cloud.retail.v2.CatalogAttribute] can be pre-loaded by using [CatalogService.AddCatalogAttribute][google.cloud.retail.v2.CatalogService.AddCatalogAttribute], [CatalogService.ImportCatalogAttributes][], or [CatalogService.UpdateAttributesConfig][google.cloud.retail.v2.CatalogService.UpdateAttributesConfig] APIs. This field is False for pre-loaded [CatalogAttribute][google.cloud.retail.v2.CatalogAttribute]s.

Only pre-loaded [catalog attributes][google.cloud.retail.v2.CatalogAttribute] that are neither in use by products nor predefined can be deleted. [Catalog attributes][google.cloud.retail.v2.CatalogAttribute] that are either in use by products or are predefined attributes cannot be deleted; however, their configuration properties will reset to default values upon removal request.

After catalog changes, it takes about 10 minutes for this field to update.

§type: i32

Output only. The type of this attribute. This is derived from the attribute in [Product.attributes][google.cloud.retail.v2.Product.attributes].

§indexable_option: i32

When [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if INDEXABLE_ENABLED attribute values are indexed so that it can be filtered, faceted, or boosted in [SearchService.Search][google.cloud.retail.v2.SearchService.Search].

Must be specified, otherwise throws INVALID_FORMAT error.

§dynamic_facetable_option: i32

If DYNAMIC_FACETABLE_ENABLED, attribute values are available for dynamic facet. Could only be DYNAMIC_FACETABLE_DISABLED if [CatalogAttribute.indexable_option][google.cloud.retail.v2.CatalogAttribute.indexable_option] is INDEXABLE_DISABLED. Otherwise, an INVALID_ARGUMENT error is returned.

Must be specified, otherwise throws INVALID_FORMAT error.

§searchable_option: i32

When [AttributesConfig.attribute_config_level][google.cloud.retail.v2.AttributesConfig.attribute_config_level] is CATALOG_LEVEL_ATTRIBUTE_CONFIG, if SEARCHABLE_ENABLED, attribute values are searchable by text queries in [SearchService.Search][google.cloud.retail.v2.SearchService.Search].

If SEARCHABLE_ENABLED but attribute type is numerical, attribute values will not be searchable by text queries in [SearchService.Search][google.cloud.retail.v2.SearchService.Search], as there are no text values associated to numerical attributes.

Must be specified, otherwise throws INVALID_FORMAT error.

§exact_searchable_option: i32

If EXACT_SEARCHABLE_ENABLED, attribute values will be exact searchable. This property only applies to textual custom attributes and requires indexable set to enabled to enable exact-searchable. If unset, the server behavior defaults to [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].

§retrievable_option: i32

If RETRIEVABLE_ENABLED, attribute values are retrievable in the search results. If unset, the server behavior defaults to [RETRIEVABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.RetrievableOption.RETRIEVABLE_DISABLED].

Implementations§

source§

impl CatalogAttribute

source

pub fn indexable_option(&self) -> IndexableOption

Returns the enum value of indexable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_indexable_option(&mut self, value: IndexableOption)

Sets indexable_option to the provided enum value.

source

pub fn dynamic_facetable_option(&self) -> DynamicFacetableOption

Returns the enum value of dynamic_facetable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_dynamic_facetable_option(&mut self, value: DynamicFacetableOption)

Sets dynamic_facetable_option to the provided enum value.

source

pub fn searchable_option(&self) -> SearchableOption

Returns the enum value of searchable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_searchable_option(&mut self, value: SearchableOption)

Sets searchable_option to the provided enum value.

source

pub fn type(&self) -> AttributeType

Returns the enum value of type, or the default if the field is set to an invalid enum value.

source

pub fn set_type(&mut self, value: AttributeType)

Sets type to the provided enum value.

source

pub fn exact_searchable_option(&self) -> ExactSearchableOption

Returns the enum value of exact_searchable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_exact_searchable_option(&mut self, value: ExactSearchableOption)

Sets exact_searchable_option to the provided enum value.

source

pub fn retrievable_option(&self) -> RetrievableOption

Returns the enum value of retrievable_option, or the default if the field is set to an invalid enum value.

source

pub fn set_retrievable_option(&mut self, value: RetrievableOption)

Sets retrievable_option to the provided enum value.

Trait Implementations§

source§

impl Clone for CatalogAttribute

source§

fn clone(&self) -> CatalogAttribute

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 Debug for CatalogAttribute

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for CatalogAttribute

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for CatalogAttribute

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for CatalogAttribute

source§

fn eq(&self, other: &CatalogAttribute) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for CatalogAttribute

Auto Trait Implementations§

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