/// A tag input contains tag key and tag value information that can apply
/// to a channel's compute tree. Applies the tag to both the tag filter
/// and tag group by fields of the series node in the compute tree.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct Tag {
    #[builder(custom(type = super::TagString, convert = Box::new))]
    #[serde(rename = "key")]
    key: Box<super::TagString>,
    #[builder(default, list(item(type = super::TagString)))]
    #[serde(rename = "values", skip_serializing_if = "Vec::is_empty", default)]
    values: Vec<super::TagString>,
}
impl Tag {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(key: super::TagString) -> Self {
        Self::builder().key(key).build()
    }
    /// The key of the tag for the filter and group by compute arguments.
    #[inline]
    pub fn key(&self) -> &super::TagString {
        &*self.key
    }
    /// The values of the tag to filter against.
    /// An empty list will treat the tag as a wildcard, including all values in the compute
    #[inline]
    pub fn values(&self) -> &[super::TagString] {
        &*self.values
    }
}
