aws-sdk-applicationsignals 1.89.0

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

/// <p>A structure that represents a connection between two nodes in a dependency graph, showing the relationship and characteristics of the connection.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Edge {
    /// <p>The identifier of the source node in this edge connection.</p>
    pub source_node_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the destination node in this edge connection.</p>
    pub destination_node_id: ::std::option::Option<::std::string::String>,
    /// <p>The duration or latency associated with this connection, if applicable.</p>
    pub duration: ::std::option::Option<f64>,
    /// <p>The type of connection between the nodes, indicating the nature of the relationship.</p>
    pub connection_type: ::std::option::Option<crate::types::ConnectionType>,
}
impl Edge {
    /// <p>The identifier of the source node in this edge connection.</p>
    pub fn source_node_id(&self) -> ::std::option::Option<&str> {
        self.source_node_id.as_deref()
    }
    /// <p>The identifier of the destination node in this edge connection.</p>
    pub fn destination_node_id(&self) -> ::std::option::Option<&str> {
        self.destination_node_id.as_deref()
    }
    /// <p>The duration or latency associated with this connection, if applicable.</p>
    pub fn duration(&self) -> ::std::option::Option<f64> {
        self.duration
    }
    /// <p>The type of connection between the nodes, indicating the nature of the relationship.</p>
    pub fn connection_type(&self) -> ::std::option::Option<&crate::types::ConnectionType> {
        self.connection_type.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) source_node_id: ::std::option::Option<::std::string::String>,
    pub(crate) destination_node_id: ::std::option::Option<::std::string::String>,
    pub(crate) duration: ::std::option::Option<f64>,
    pub(crate) connection_type: ::std::option::Option<crate::types::ConnectionType>,
}
impl EdgeBuilder {
    /// <p>The identifier of the source node in this edge connection.</p>
    pub fn source_node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_node_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the source node in this edge connection.</p>
    pub fn set_source_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_node_id = input;
        self
    }
    /// <p>The identifier of the source node in this edge connection.</p>
    pub fn get_source_node_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_node_id
    }
    /// <p>The identifier of the destination node in this edge connection.</p>
    pub fn destination_node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.destination_node_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the destination node in this edge connection.</p>
    pub fn set_destination_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.destination_node_id = input;
        self
    }
    /// <p>The identifier of the destination node in this edge connection.</p>
    pub fn get_destination_node_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.destination_node_id
    }
    /// <p>The duration or latency associated with this connection, if applicable.</p>
    pub fn duration(mut self, input: f64) -> Self {
        self.duration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The duration or latency associated with this connection, if applicable.</p>
    pub fn set_duration(mut self, input: ::std::option::Option<f64>) -> Self {
        self.duration = input;
        self
    }
    /// <p>The duration or latency associated with this connection, if applicable.</p>
    pub fn get_duration(&self) -> &::std::option::Option<f64> {
        &self.duration
    }
    /// <p>The type of connection between the nodes, indicating the nature of the relationship.</p>
    pub fn connection_type(mut self, input: crate::types::ConnectionType) -> Self {
        self.connection_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of connection between the nodes, indicating the nature of the relationship.</p>
    pub fn set_connection_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
        self.connection_type = input;
        self
    }
    /// <p>The type of connection between the nodes, indicating the nature of the relationship.</p>
    pub fn get_connection_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
        &self.connection_type
    }
    /// Consumes the builder and constructs a [`Edge`](crate::types::Edge).
    pub fn build(self) -> crate::types::Edge {
        crate::types::Edge {
            source_node_id: self.source_node_id,
            destination_node_id: self.destination_node_id,
            duration: self.duration,
            connection_type: self.connection_type,
        }
    }
}