pub struct Attribute {
pub name: String,
pub display_name: String,
pub description: String,
pub definition_type: i32,
pub scope: i32,
pub data_type: i32,
pub allowed_values: Vec<AllowedValue>,
pub cardinality: i32,
pub mandatory: bool,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
}
Expand description
An attribute in the API Hub. An attribute is a name value pair which can be attached to different resources in the API hub based on the scope of the attribute. Attributes can either be pre-defined by the API Hub or created by users.
Fields§
§name: String
Identifier. The name of the attribute in the API Hub.
Format:
projects/{project}/locations/{location}/attributes/{attribute}
display_name: String
Required. The display name of the attribute.
description: String
Optional. The description of the attribute.
definition_type: i32
Output only. The definition type of the attribute.
scope: i32
Required. The scope of the attribute. It represents the resource in the API Hub to which the attribute can be linked.
data_type: i32
Required. The type of the data of the attribute.
allowed_values: Vec<AllowedValue>
Optional. The list of allowed values when the attribute value is of type enum. This is required when the data_type of the attribute is ENUM. The maximum number of allowed values of an attribute will be 1000.
cardinality: i32
Optional. The maximum number of values that the attribute can have when associated with an API Hub resource. Cardinality 1 would represent a single-valued attribute. It must not be less than 1 or greater than 20. If not specified, the cardinality would be set to 1 by default and represent a single-valued attribute.
mandatory: bool
Output only. When mandatory is true, the attribute is mandatory for the resource specified in the scope. Only System defined attributes can be mandatory.
create_time: Option<Timestamp>
Output only. The time at which the attribute was created.
update_time: Option<Timestamp>
Output only. The time at which the attribute was last updated.
Implementations§
source§impl Attribute
impl Attribute
sourcepub fn definition_type(&self) -> DefinitionType
pub fn definition_type(&self) -> DefinitionType
Returns the enum value of definition_type
, or the default if the field is set to an invalid enum value.
sourcepub fn set_definition_type(&mut self, value: DefinitionType)
pub fn set_definition_type(&mut self, value: DefinitionType)
Sets definition_type
to the provided enum value.
sourcepub fn scope(&self) -> Scope
pub fn scope(&self) -> Scope
Returns the enum value of scope
, or the default if the field is set to an invalid enum value.
sourcepub fn data_type(&self) -> DataType
pub fn data_type(&self) -> DataType
Returns the enum value of data_type
, or the default if the field is set to an invalid enum value.
sourcepub fn set_data_type(&mut self, value: DataType)
pub fn set_data_type(&mut self, value: DataType)
Sets data_type
to the provided enum value.
Trait Implementations§
source§impl Message for Attribute
impl Message for Attribute
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for Attribute
impl PartialEq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnwindSafe for Attribute
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request