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.

/// A directed edge in the context graph connecting two nodes.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Edge {
    /// The unique identifier of the edge within the context graph.
    pub edge_id: ::std::option::Option<::std::string::String>,
    /// The node identifier the edge originates from.
    pub from: ::std::option::Option<::std::string::String>,
    /// The node identifier the edge points to.
    pub to: ::std::option::Option<::std::string::String>,
    /// The kind of relationship the edge represents.
    pub edge_type: ::std::option::Option<crate::types::EdgeType>,
    /// The operations observed on this edge.
    pub operations: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
    pub edge_properties: ::std::option::Option<crate::types::EdgeProperties>,
    /// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` member is removed here, so no value appears twice.
    pub telemetry_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// The kinds of telemetry signal observed on this edge.
    pub signal_types: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>,
    /// The discovery sources that contributed this edge.
    pub sources: ::std::option::Option<::std::vec::Vec<crate::types::Source>>,
    /// Descriptive metadata about the edge. Present only when the request sets includeMetadata.
    pub metadata: ::std::option::Option<crate::types::Metadata>,
    /// When this edge was first observed (UTC), at minute granularity. For an edge that merged across sources, this is the earliest value any source reported.
    pub first_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// When this edge was most recently observed (UTC), at minute granularity. For an edge that merged across sources, this is the latest value any source reported.
    pub last_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Edge {
    /// The unique identifier of the edge within the context graph.
    pub fn edge_id(&self) -> ::std::option::Option<&str> {
        self.edge_id.as_deref()
    }
    /// The node identifier the edge originates from.
    pub fn from(&self) -> ::std::option::Option<&str> {
        self.from.as_deref()
    }
    /// The node identifier the edge points to.
    pub fn to(&self) -> ::std::option::Option<&str> {
        self.to.as_deref()
    }
    /// The kind of relationship the edge represents.
    pub fn edge_type(&self) -> ::std::option::Option<&crate::types::EdgeType> {
        self.edge_type.as_ref()
    }
    /// The operations observed on this edge.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.operations.is_none()`.
    pub fn operations(&self) -> &[::std::string::String] {
        self.operations.as_deref().unwrap_or_default()
    }
    /// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
    pub fn edge_properties(&self) -> ::std::option::Option<&crate::types::EdgeProperties> {
        self.edge_properties.as_ref()
    }
    /// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` member is removed here, so no value appears twice.
    pub fn telemetry_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.telemetry_attributes.as_ref()
    }
    /// The kinds of telemetry signal observed on this edge.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.signal_types.is_none()`.
    pub fn signal_types(&self) -> &[crate::types::Signal] {
        self.signal_types.as_deref().unwrap_or_default()
    }
    /// The discovery sources that contributed this edge.
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sources.is_none()`.
    pub fn sources(&self) -> &[crate::types::Source] {
        self.sources.as_deref().unwrap_or_default()
    }
    /// Descriptive metadata about the edge. Present only when the request sets includeMetadata.
    pub fn metadata(&self) -> ::std::option::Option<&crate::types::Metadata> {
        self.metadata.as_ref()
    }
    /// When this edge was first observed (UTC), at minute granularity. For an edge that merged across sources, this is the earliest value any source reported.
    pub fn first_observed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.first_observed_at.as_ref()
    }
    /// When this edge was most recently observed (UTC), at minute granularity. For an edge that merged across sources, this is the latest value any source reported.
    pub fn last_observed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_observed_at.as_ref()
    }
}
impl Edge {
    /// Creates a new builder-style object to manufacture [`Edge`](crate::types::Edge).
    pub fn builder() -> crate::types::builders::EdgeBuilder {
        crate::types::builders::EdgeBuilder::default()
    }
}

/// A builder for [`Edge`](crate::types::Edge).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EdgeBuilder {
    pub(crate) edge_id: ::std::option::Option<::std::string::String>,
    pub(crate) from: ::std::option::Option<::std::string::String>,
    pub(crate) to: ::std::option::Option<::std::string::String>,
    pub(crate) edge_type: ::std::option::Option<crate::types::EdgeType>,
    pub(crate) operations: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) edge_properties: ::std::option::Option<crate::types::EdgeProperties>,
    pub(crate) telemetry_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) signal_types: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>,
    pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::Source>>,
    pub(crate) metadata: ::std::option::Option<crate::types::Metadata>,
    pub(crate) first_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl EdgeBuilder {
    /// The unique identifier of the edge within the context graph.
    pub fn edge_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.edge_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The unique identifier of the edge within the context graph.
    pub fn set_edge_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.edge_id = input;
        self
    }
    /// The unique identifier of the edge within the context graph.
    pub fn get_edge_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.edge_id
    }
    /// The node identifier the edge originates from.
    pub fn from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.from = ::std::option::Option::Some(input.into());
        self
    }
    /// The node identifier the edge originates from.
    pub fn set_from(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.from = input;
        self
    }
    /// The node identifier the edge originates from.
    pub fn get_from(&self) -> &::std::option::Option<::std::string::String> {
        &self.from
    }
    /// The node identifier the edge points to.
    pub fn to(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.to = ::std::option::Option::Some(input.into());
        self
    }
    /// The node identifier the edge points to.
    pub fn set_to(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.to = input;
        self
    }
    /// The node identifier the edge points to.
    pub fn get_to(&self) -> &::std::option::Option<::std::string::String> {
        &self.to
    }
    /// The kind of relationship the edge represents.
    pub fn edge_type(mut self, input: crate::types::EdgeType) -> Self {
        self.edge_type = ::std::option::Option::Some(input);
        self
    }
    /// The kind of relationship the edge represents.
    pub fn set_edge_type(mut self, input: ::std::option::Option<crate::types::EdgeType>) -> Self {
        self.edge_type = input;
        self
    }
    /// The kind of relationship the edge represents.
    pub fn get_edge_type(&self) -> &::std::option::Option<crate::types::EdgeType> {
        &self.edge_type
    }
    /// Appends an item to `operations`.
    ///
    /// To override the contents of this collection use [`set_operations`](Self::set_operations).
    ///
    /// The operations observed on this edge.
    pub fn operations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.operations.unwrap_or_default();
        v.push(input.into());
        self.operations = ::std::option::Option::Some(v);
        self
    }
    /// The operations observed on this edge.
    pub fn set_operations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.operations = input;
        self
    }
    /// The operations observed on this edge.
    pub fn get_operations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.operations
    }
    /// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
    pub fn edge_properties(mut self, input: crate::types::EdgeProperties) -> Self {
        self.edge_properties = ::std::option::Option::Some(input);
        self
    }
    /// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
    pub fn set_edge_properties(mut self, input: ::std::option::Option<crate::types::EdgeProperties>) -> Self {
        self.edge_properties = input;
        self
    }
    /// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
    pub fn get_edge_properties(&self) -> &::std::option::Option<crate::types::EdgeProperties> {
        &self.edge_properties
    }
    /// Adds a key-value pair to `telemetry_attributes`.
    ///
    /// To override the contents of this collection use [`set_telemetry_attributes`](Self::set_telemetry_attributes).
    ///
    /// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` member is removed here, so no value appears twice.
    pub fn telemetry_attributes(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.telemetry_attributes.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.telemetry_attributes = ::std::option::Option::Some(hash_map);
        self
    }
    /// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` member is removed here, so no value appears twice.
    pub fn set_telemetry_attributes(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.telemetry_attributes = input;
        self
    }
    /// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` member is removed here, so no value appears twice.
    pub fn get_telemetry_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.telemetry_attributes
    }
    /// Appends an item to `signal_types`.
    ///
    /// To override the contents of this collection use [`set_signal_types`](Self::set_signal_types).
    ///
    /// The kinds of telemetry signal observed on this edge.
    pub fn signal_types(mut self, input: crate::types::Signal) -> Self {
        let mut v = self.signal_types.unwrap_or_default();
        v.push(input);
        self.signal_types = ::std::option::Option::Some(v);
        self
    }
    /// The kinds of telemetry signal observed on this edge.
    pub fn set_signal_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>) -> Self {
        self.signal_types = input;
        self
    }
    /// The kinds of telemetry signal observed on this edge.
    pub fn get_signal_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Signal>> {
        &self.signal_types
    }
    /// Appends an item to `sources`.
    ///
    /// To override the contents of this collection use [`set_sources`](Self::set_sources).
    ///
    /// The discovery sources that contributed this edge.
    pub fn sources(mut self, input: crate::types::Source) -> Self {
        let mut v = self.sources.unwrap_or_default();
        v.push(input);
        self.sources = ::std::option::Option::Some(v);
        self
    }
    /// The discovery sources that contributed this edge.
    pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Source>>) -> Self {
        self.sources = input;
        self
    }
    /// The discovery sources that contributed this edge.
    pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Source>> {
        &self.sources
    }
    /// Descriptive metadata about the edge. Present only when the request sets includeMetadata.
    pub fn metadata(mut self, input: crate::types::Metadata) -> Self {
        self.metadata = ::std::option::Option::Some(input);
        self
    }
    /// Descriptive metadata about the edge. Present only when the request sets includeMetadata.
    pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::Metadata>) -> Self {
        self.metadata = input;
        self
    }
    /// Descriptive metadata about the edge. Present only when the request sets includeMetadata.
    pub fn get_metadata(&self) -> &::std::option::Option<crate::types::Metadata> {
        &self.metadata
    }
    /// When this edge was first observed (UTC), at minute granularity. For an edge that merged across sources, this is the earliest value any source reported.
    pub fn first_observed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.first_observed_at = ::std::option::Option::Some(input);
        self
    }
    /// When this edge was first observed (UTC), at minute granularity. For an edge that merged across sources, this is the earliest value any source reported.
    pub fn set_first_observed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.first_observed_at = input;
        self
    }
    /// When this edge was first observed (UTC), at minute granularity. For an edge that merged across sources, this is the earliest value any source reported.
    pub fn get_first_observed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.first_observed_at
    }
    /// When this edge was most recently observed (UTC), at minute granularity. For an edge that merged across sources, this is the latest value any source reported.
    pub fn last_observed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_observed_at = ::std::option::Option::Some(input);
        self
    }
    /// When this edge was most recently observed (UTC), at minute granularity. For an edge that merged across sources, this is the latest value any source reported.
    pub fn set_last_observed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_observed_at = input;
        self
    }
    /// When this edge was most recently observed (UTC), at minute granularity. For an edge that merged across sources, this is the latest value any source reported.
    pub fn get_last_observed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_observed_at
    }
    /// Consumes the builder and constructs a [`Edge`](crate::types::Edge).
    pub fn build(self) -> crate::types::Edge {
        crate::types::Edge {
            edge_id: self.edge_id,
            from: self.from,
            to: self.to,
            edge_type: self.edge_type,
            operations: self.operations,
            edge_properties: self.edge_properties,
            telemetry_attributes: self.telemetry_attributes,
            signal_types: self.signal_types,
            sources: self.sources,
            metadata: self.metadata,
            first_observed_at: self.first_observed_at,
            last_observed_at: self.last_observed_at,
        }
    }
}