aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Descriptive information about a context graph node or edge, as opposed to its identity and structure. Returned only when the request sets includeMetadata.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Metadata {
    /// The metrics observed on the element.
    pub metrics: ::std::option::Option<::std::vec::Vec<crate::types::MetricMetadata>>,
    /// Semantic description of the node. Absent on an edge, because semantics describe a service rather than a relationship.
    pub semantics: ::std::option::Option<crate::types::NodeSemantics>,
    /// Per-signal LOGS query selectors: a LIST of blocks the console ORs, each an AND of exact store column -&gt; raw values. Node-level (edges carry only traces). Populated when the request sets includeMetadata; derived labels (logSourceType) are added by the service projection, not stored here.
    pub logs: ::std::option::Option<::std::vec::Vec<crate::types::LogMetadata>>,
    /// Per-signal TRACES query selectors (same block shape as logs). Present on both node and edge metadata. serviceName is derived at the service projection, not stored here.
    pub traces: ::std::option::Option<::std::vec::Vec<crate::types::TraceMetadata>>,
}
impl Metadata {
    /// The metrics observed on the element.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.metrics.is_none()`.
    pub fn metrics(&self) -> &[crate::types::MetricMetadata] {
        self.metrics.as_deref().unwrap_or_default()
    }
    /// Semantic description of the node. Absent on an edge, because semantics describe a service rather than a relationship.
    pub fn semantics(&self) -> ::std::option::Option<&crate::types::NodeSemantics> {
        self.semantics.as_ref()
    }
    /// Per-signal LOGS query selectors: a LIST of blocks the console ORs, each an AND of exact store column -&gt; raw values. Node-level (edges carry only traces). Populated when the request sets includeMetadata; derived labels (logSourceType) are added by the service projection, not stored here.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.logs.is_none()`.
    pub fn logs(&self) -> &[crate::types::LogMetadata] {
        self.logs.as_deref().unwrap_or_default()
    }
    /// Per-signal TRACES query selectors (same block shape as logs). Present on both node and edge metadata. serviceName is derived at the service projection, not stored here.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.traces.is_none()`.
    pub fn traces(&self) -> &[crate::types::TraceMetadata] {
        self.traces.as_deref().unwrap_or_default()
    }
}
impl Metadata {
    /// Creates a new builder-style object to manufacture [`Metadata`](crate::types::Metadata).
    pub fn builder() -> crate::types::builders::MetadataBuilder {
        crate::types::builders::MetadataBuilder::default()
    }
}

/// A builder for [`Metadata`](crate::types::Metadata).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct MetadataBuilder {
    pub(crate) metrics: ::std::option::Option<::std::vec::Vec<crate::types::MetricMetadata>>,
    pub(crate) semantics: ::std::option::Option<crate::types::NodeSemantics>,
    pub(crate) logs: ::std::option::Option<::std::vec::Vec<crate::types::LogMetadata>>,
    pub(crate) traces: ::std::option::Option<::std::vec::Vec<crate::types::TraceMetadata>>,
}
impl MetadataBuilder {
    /// Appends an item to `metrics`.
    ///
    /// To override the contents of this collection use [`set_metrics`](Self::set_metrics).
    ///
    /// The metrics observed on the element.
    pub fn metrics(mut self, input: crate::types::MetricMetadata) -> Self {
        let mut v = self.metrics.unwrap_or_default();
        v.push(input);
        self.metrics = ::std::option::Option::Some(v);
        self
    }
    /// The metrics observed on the element.
    pub fn set_metrics(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricMetadata>>) -> Self {
        self.metrics = input;
        self
    }
    /// The metrics observed on the element.
    pub fn get_metrics(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricMetadata>> {
        &self.metrics
    }
    /// Semantic description of the node. Absent on an edge, because semantics describe a service rather than a relationship.
    pub fn semantics(mut self, input: crate::types::NodeSemantics) -> Self {
        self.semantics = ::std::option::Option::Some(input);
        self
    }
    /// Semantic description of the node. Absent on an edge, because semantics describe a service rather than a relationship.
    pub fn set_semantics(mut self, input: ::std::option::Option<crate::types::NodeSemantics>) -> Self {
        self.semantics = input;
        self
    }
    /// Semantic description of the node. Absent on an edge, because semantics describe a service rather than a relationship.
    pub fn get_semantics(&self) -> &::std::option::Option<crate::types::NodeSemantics> {
        &self.semantics
    }
    /// Appends an item to `logs`.
    ///
    /// To override the contents of this collection use [`set_logs`](Self::set_logs).
    ///
    /// Per-signal LOGS query selectors: a LIST of blocks the console ORs, each an AND of exact store column -&gt; raw values. Node-level (edges carry only traces). Populated when the request sets includeMetadata; derived labels (logSourceType) are added by the service projection, not stored here.
    pub fn logs(mut self, input: crate::types::LogMetadata) -> Self {
        let mut v = self.logs.unwrap_or_default();
        v.push(input);
        self.logs = ::std::option::Option::Some(v);
        self
    }
    /// Per-signal LOGS query selectors: a LIST of blocks the console ORs, each an AND of exact store column -&gt; raw values. Node-level (edges carry only traces). Populated when the request sets includeMetadata; derived labels (logSourceType) are added by the service projection, not stored here.
    pub fn set_logs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogMetadata>>) -> Self {
        self.logs = input;
        self
    }
    /// Per-signal LOGS query selectors: a LIST of blocks the console ORs, each an AND of exact store column -&gt; raw values. Node-level (edges carry only traces). Populated when the request sets includeMetadata; derived labels (logSourceType) are added by the service projection, not stored here.
    pub fn get_logs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogMetadata>> {
        &self.logs
    }
    /// Appends an item to `traces`.
    ///
    /// To override the contents of this collection use [`set_traces`](Self::set_traces).
    ///
    /// Per-signal TRACES query selectors (same block shape as logs). Present on both node and edge metadata. serviceName is derived at the service projection, not stored here.
    pub fn traces(mut self, input: crate::types::TraceMetadata) -> Self {
        let mut v = self.traces.unwrap_or_default();
        v.push(input);
        self.traces = ::std::option::Option::Some(v);
        self
    }
    /// Per-signal TRACES query selectors (same block shape as logs). Present on both node and edge metadata. serviceName is derived at the service projection, not stored here.
    pub fn set_traces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TraceMetadata>>) -> Self {
        self.traces = input;
        self
    }
    /// Per-signal TRACES query selectors (same block shape as logs). Present on both node and edge metadata. serviceName is derived at the service projection, not stored here.
    pub fn get_traces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TraceMetadata>> {
        &self.traces
    }
    /// Consumes the builder and constructs a [`Metadata`](crate::types::Metadata).
    pub fn build(self) -> crate::types::Metadata {
        crate::types::Metadata {
            metrics: self.metrics,
            semantics: self.semantics,
            logs: self.logs,
            traces: self.traces,
        }
    }
}