aws-sdk-xray 1.94.0

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

/// <p>Information about a connection between two services. An edge can be a synchronous connection, such as typical call between client and service, or an asynchronous link, such as a Lambda function which retrieves an event from an SNS queue.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Edge {
    /// <p>Identifier of the edge. Unique within a service map.</p>
    pub reference_id: ::std::option::Option<i32>,
    /// <p>The start time of the first segment on the edge.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The end time of the last segment on the edge.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Response statistics for segments on the edge.</p>
    pub summary_statistics: ::std::option::Option<crate::types::EdgeStatistics>,
    /// <p>A histogram that maps the spread of client response times on an edge. Only populated for synchronous edges.</p>
    pub response_time_histogram: ::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>>,
    /// <p>Aliases for the edge.</p>
    pub aliases: ::std::option::Option<::std::vec::Vec<crate::types::Alias>>,
    /// <p>Describes an asynchronous connection, with a value of <code>link</code>.</p>
    pub edge_type: ::std::option::Option<::std::string::String>,
    /// <p>A histogram that maps the spread of event age when received by consumers. Age is calculated each time an event is received. Only populated when <i>EdgeType</i> is <code>link</code>.</p>
    pub received_event_age_histogram: ::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>>,
}
impl Edge {
    /// <p>Identifier of the edge. Unique within a service map.</p>
    pub fn reference_id(&self) -> ::std::option::Option<i32> {
        self.reference_id
    }
    /// <p>The start time of the first segment on the edge.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>The end time of the last segment on the edge.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
    /// <p>Response statistics for segments on the edge.</p>
    pub fn summary_statistics(&self) -> ::std::option::Option<&crate::types::EdgeStatistics> {
        self.summary_statistics.as_ref()
    }
    /// <p>A histogram that maps the spread of client response times on an edge. Only populated for synchronous edges.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.response_time_histogram.is_none()`.
    pub fn response_time_histogram(&self) -> &[crate::types::HistogramEntry] {
        self.response_time_histogram.as_deref().unwrap_or_default()
    }
    /// <p>Aliases for the edge.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.aliases.is_none()`.
    pub fn aliases(&self) -> &[crate::types::Alias] {
        self.aliases.as_deref().unwrap_or_default()
    }
    /// <p>Describes an asynchronous connection, with a value of <code>link</code>.</p>
    pub fn edge_type(&self) -> ::std::option::Option<&str> {
        self.edge_type.as_deref()
    }
    /// <p>A histogram that maps the spread of event age when received by consumers. Age is calculated each time an event is received. Only populated when <i>EdgeType</i> is <code>link</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.received_event_age_histogram.is_none()`.
    pub fn received_event_age_histogram(&self) -> &[crate::types::HistogramEntry] {
        self.received_event_age_histogram.as_deref().unwrap_or_default()
    }
}
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) reference_id: ::std::option::Option<i32>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) summary_statistics: ::std::option::Option<crate::types::EdgeStatistics>,
    pub(crate) response_time_histogram: ::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>>,
    pub(crate) aliases: ::std::option::Option<::std::vec::Vec<crate::types::Alias>>,
    pub(crate) edge_type: ::std::option::Option<::std::string::String>,
    pub(crate) received_event_age_histogram: ::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>>,
}
impl EdgeBuilder {
    /// <p>Identifier of the edge. Unique within a service map.</p>
    pub fn reference_id(mut self, input: i32) -> Self {
        self.reference_id = ::std::option::Option::Some(input);
        self
    }
    /// <p>Identifier of the edge. Unique within a service map.</p>
    pub fn set_reference_id(mut self, input: ::std::option::Option<i32>) -> Self {
        self.reference_id = input;
        self
    }
    /// <p>Identifier of the edge. Unique within a service map.</p>
    pub fn get_reference_id(&self) -> &::std::option::Option<i32> {
        &self.reference_id
    }
    /// <p>The start time of the first segment on the edge.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start time of the first segment on the edge.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The start time of the first segment on the edge.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The end time of the last segment on the edge.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end time of the last segment on the edge.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>The end time of the last segment on the edge.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// <p>Response statistics for segments on the edge.</p>
    pub fn summary_statistics(mut self, input: crate::types::EdgeStatistics) -> Self {
        self.summary_statistics = ::std::option::Option::Some(input);
        self
    }
    /// <p>Response statistics for segments on the edge.</p>
    pub fn set_summary_statistics(mut self, input: ::std::option::Option<crate::types::EdgeStatistics>) -> Self {
        self.summary_statistics = input;
        self
    }
    /// <p>Response statistics for segments on the edge.</p>
    pub fn get_summary_statistics(&self) -> &::std::option::Option<crate::types::EdgeStatistics> {
        &self.summary_statistics
    }
    /// Appends an item to `response_time_histogram`.
    ///
    /// To override the contents of this collection use [`set_response_time_histogram`](Self::set_response_time_histogram).
    ///
    /// <p>A histogram that maps the spread of client response times on an edge. Only populated for synchronous edges.</p>
    pub fn response_time_histogram(mut self, input: crate::types::HistogramEntry) -> Self {
        let mut v = self.response_time_histogram.unwrap_or_default();
        v.push(input);
        self.response_time_histogram = ::std::option::Option::Some(v);
        self
    }
    /// <p>A histogram that maps the spread of client response times on an edge. Only populated for synchronous edges.</p>
    pub fn set_response_time_histogram(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>>) -> Self {
        self.response_time_histogram = input;
        self
    }
    /// <p>A histogram that maps the spread of client response times on an edge. Only populated for synchronous edges.</p>
    pub fn get_response_time_histogram(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>> {
        &self.response_time_histogram
    }
    /// Appends an item to `aliases`.
    ///
    /// To override the contents of this collection use [`set_aliases`](Self::set_aliases).
    ///
    /// <p>Aliases for the edge.</p>
    pub fn aliases(mut self, input: crate::types::Alias) -> Self {
        let mut v = self.aliases.unwrap_or_default();
        v.push(input);
        self.aliases = ::std::option::Option::Some(v);
        self
    }
    /// <p>Aliases for the edge.</p>
    pub fn set_aliases(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Alias>>) -> Self {
        self.aliases = input;
        self
    }
    /// <p>Aliases for the edge.</p>
    pub fn get_aliases(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Alias>> {
        &self.aliases
    }
    /// <p>Describes an asynchronous connection, with a value of <code>link</code>.</p>
    pub fn edge_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.edge_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Describes an asynchronous connection, with a value of <code>link</code>.</p>
    pub fn set_edge_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.edge_type = input;
        self
    }
    /// <p>Describes an asynchronous connection, with a value of <code>link</code>.</p>
    pub fn get_edge_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.edge_type
    }
    /// Appends an item to `received_event_age_histogram`.
    ///
    /// To override the contents of this collection use [`set_received_event_age_histogram`](Self::set_received_event_age_histogram).
    ///
    /// <p>A histogram that maps the spread of event age when received by consumers. Age is calculated each time an event is received. Only populated when <i>EdgeType</i> is <code>link</code>.</p>
    pub fn received_event_age_histogram(mut self, input: crate::types::HistogramEntry) -> Self {
        let mut v = self.received_event_age_histogram.unwrap_or_default();
        v.push(input);
        self.received_event_age_histogram = ::std::option::Option::Some(v);
        self
    }
    /// <p>A histogram that maps the spread of event age when received by consumers. Age is calculated each time an event is received. Only populated when <i>EdgeType</i> is <code>link</code>.</p>
    pub fn set_received_event_age_histogram(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>>) -> Self {
        self.received_event_age_histogram = input;
        self
    }
    /// <p>A histogram that maps the spread of event age when received by consumers. Age is calculated each time an event is received. Only populated when <i>EdgeType</i> is <code>link</code>.</p>
    pub fn get_received_event_age_histogram(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::HistogramEntry>> {
        &self.received_event_age_histogram
    }
    /// Consumes the builder and constructs a [`Edge`](crate::types::Edge).
    pub fn build(self) -> crate::types::Edge {
        crate::types::Edge {
            reference_id: self.reference_id,
            start_time: self.start_time,
            end_time: self.end_time,
            summary_statistics: self.summary_statistics,
            response_time_histogram: self.response_time_histogram,
            aliases: self.aliases,
            edge_type: self.edge_type,
            received_event_age_histogram: self.received_event_age_histogram,
        }
    }
}