aws-sdk-iotsecuretunneling 0.26.0

AWS SDK for AWS IoT Secure Tunneling
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A connection between a source computer and a destination device.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Tunnel {
    /// <p>A unique alpha-numeric ID that identifies a tunnel.</p>
    #[doc(hidden)]
    pub tunnel_id: std::option::Option<std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of a tunnel.</p>
    #[doc(hidden)]
    pub tunnel_arn: std::option::Option<std::string::String>,
    /// <p>The status of a tunnel. Valid values are: Open and Closed.</p>
    #[doc(hidden)]
    pub status: std::option::Option<crate::types::TunnelStatus>,
    /// <p>The connection state of the source application.</p>
    #[doc(hidden)]
    pub source_connection_state: std::option::Option<crate::types::ConnectionState>,
    /// <p>The connection state of the destination application.</p>
    #[doc(hidden)]
    pub destination_connection_state: std::option::Option<crate::types::ConnectionState>,
    /// <p>A description of the tunnel.</p>
    #[doc(hidden)]
    pub description: std::option::Option<std::string::String>,
    /// <p>The destination configuration that specifies the thing name of the destination device and a service name that the local proxy uses to connect to the destination application.</p>
    #[doc(hidden)]
    pub destination_config: std::option::Option<crate::types::DestinationConfig>,
    /// <p>Timeout configuration for the tunnel.</p>
    #[doc(hidden)]
    pub timeout_config: std::option::Option<crate::types::TimeoutConfig>,
    /// <p>A list of tag metadata associated with the secure tunnel.</p>
    #[doc(hidden)]
    pub tags: std::option::Option<std::vec::Vec<crate::types::Tag>>,
    /// <p>The time when the tunnel was created.</p>
    #[doc(hidden)]
    pub created_at: std::option::Option<aws_smithy_types::DateTime>,
    /// <p>The last time the tunnel was updated.</p>
    #[doc(hidden)]
    pub last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
}
impl Tunnel {
    /// <p>A unique alpha-numeric ID that identifies a tunnel.</p>
    pub fn tunnel_id(&self) -> std::option::Option<&str> {
        self.tunnel_id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of a tunnel.</p>
    pub fn tunnel_arn(&self) -> std::option::Option<&str> {
        self.tunnel_arn.as_deref()
    }
    /// <p>The status of a tunnel. Valid values are: Open and Closed.</p>
    pub fn status(&self) -> std::option::Option<&crate::types::TunnelStatus> {
        self.status.as_ref()
    }
    /// <p>The connection state of the source application.</p>
    pub fn source_connection_state(&self) -> std::option::Option<&crate::types::ConnectionState> {
        self.source_connection_state.as_ref()
    }
    /// <p>The connection state of the destination application.</p>
    pub fn destination_connection_state(
        &self,
    ) -> std::option::Option<&crate::types::ConnectionState> {
        self.destination_connection_state.as_ref()
    }
    /// <p>A description of the tunnel.</p>
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The destination configuration that specifies the thing name of the destination device and a service name that the local proxy uses to connect to the destination application.</p>
    pub fn destination_config(&self) -> std::option::Option<&crate::types::DestinationConfig> {
        self.destination_config.as_ref()
    }
    /// <p>Timeout configuration for the tunnel.</p>
    pub fn timeout_config(&self) -> std::option::Option<&crate::types::TimeoutConfig> {
        self.timeout_config.as_ref()
    }
    /// <p>A list of tag metadata associated with the secure tunnel.</p>
    pub fn tags(&self) -> std::option::Option<&[crate::types::Tag]> {
        self.tags.as_deref()
    }
    /// <p>The time when the tunnel was created.</p>
    pub fn created_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The last time the tunnel was updated.</p>
    pub fn last_updated_at(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
        self.last_updated_at.as_ref()
    }
}
impl Tunnel {
    /// Creates a new builder-style object to manufacture [`Tunnel`](crate::types::Tunnel).
    pub fn builder() -> crate::types::builders::TunnelBuilder {
        crate::types::builders::TunnelBuilder::default()
    }
}

/// A builder for [`Tunnel`](crate::types::Tunnel).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct TunnelBuilder {
    pub(crate) tunnel_id: std::option::Option<std::string::String>,
    pub(crate) tunnel_arn: std::option::Option<std::string::String>,
    pub(crate) status: std::option::Option<crate::types::TunnelStatus>,
    pub(crate) source_connection_state: std::option::Option<crate::types::ConnectionState>,
    pub(crate) destination_connection_state: std::option::Option<crate::types::ConnectionState>,
    pub(crate) description: std::option::Option<std::string::String>,
    pub(crate) destination_config: std::option::Option<crate::types::DestinationConfig>,
    pub(crate) timeout_config: std::option::Option<crate::types::TimeoutConfig>,
    pub(crate) tags: std::option::Option<std::vec::Vec<crate::types::Tag>>,
    pub(crate) created_at: std::option::Option<aws_smithy_types::DateTime>,
    pub(crate) last_updated_at: std::option::Option<aws_smithy_types::DateTime>,
}
impl TunnelBuilder {
    /// <p>A unique alpha-numeric ID that identifies a tunnel.</p>
    pub fn tunnel_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.tunnel_id = Some(input.into());
        self
    }
    /// <p>A unique alpha-numeric ID that identifies a tunnel.</p>
    pub fn set_tunnel_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.tunnel_id = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of a tunnel.</p>
    pub fn tunnel_arn(mut self, input: impl Into<std::string::String>) -> Self {
        self.tunnel_arn = Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of a tunnel.</p>
    pub fn set_tunnel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.tunnel_arn = input;
        self
    }
    /// <p>The status of a tunnel. Valid values are: Open and Closed.</p>
    pub fn status(mut self, input: crate::types::TunnelStatus) -> Self {
        self.status = Some(input);
        self
    }
    /// <p>The status of a tunnel. Valid values are: Open and Closed.</p>
    pub fn set_status(mut self, input: std::option::Option<crate::types::TunnelStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The connection state of the source application.</p>
    pub fn source_connection_state(mut self, input: crate::types::ConnectionState) -> Self {
        self.source_connection_state = Some(input);
        self
    }
    /// <p>The connection state of the source application.</p>
    pub fn set_source_connection_state(
        mut self,
        input: std::option::Option<crate::types::ConnectionState>,
    ) -> Self {
        self.source_connection_state = input;
        self
    }
    /// <p>The connection state of the destination application.</p>
    pub fn destination_connection_state(mut self, input: crate::types::ConnectionState) -> Self {
        self.destination_connection_state = Some(input);
        self
    }
    /// <p>The connection state of the destination application.</p>
    pub fn set_destination_connection_state(
        mut self,
        input: std::option::Option<crate::types::ConnectionState>,
    ) -> Self {
        self.destination_connection_state = input;
        self
    }
    /// <p>A description of the tunnel.</p>
    pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
        self.description = Some(input.into());
        self
    }
    /// <p>A description of the tunnel.</p>
    pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The destination configuration that specifies the thing name of the destination device and a service name that the local proxy uses to connect to the destination application.</p>
    pub fn destination_config(mut self, input: crate::types::DestinationConfig) -> Self {
        self.destination_config = Some(input);
        self
    }
    /// <p>The destination configuration that specifies the thing name of the destination device and a service name that the local proxy uses to connect to the destination application.</p>
    pub fn set_destination_config(
        mut self,
        input: std::option::Option<crate::types::DestinationConfig>,
    ) -> Self {
        self.destination_config = input;
        self
    }
    /// <p>Timeout configuration for the tunnel.</p>
    pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
        self.timeout_config = Some(input);
        self
    }
    /// <p>Timeout configuration for the tunnel.</p>
    pub fn set_timeout_config(
        mut self,
        input: std::option::Option<crate::types::TimeoutConfig>,
    ) -> Self {
        self.timeout_config = input;
        self
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A list of tag metadata associated with the secure tunnel.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = Some(v);
        self
    }
    /// <p>A list of tag metadata associated with the secure tunnel.</p>
    pub fn set_tags(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::Tag>>,
    ) -> Self {
        self.tags = input;
        self
    }
    /// <p>The time when the tunnel was created.</p>
    pub fn created_at(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.created_at = Some(input);
        self
    }
    /// <p>The time when the tunnel was created.</p>
    pub fn set_created_at(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The last time the tunnel was updated.</p>
    pub fn last_updated_at(mut self, input: aws_smithy_types::DateTime) -> Self {
        self.last_updated_at = Some(input);
        self
    }
    /// <p>The last time the tunnel was updated.</p>
    pub fn set_last_updated_at(
        mut self,
        input: std::option::Option<aws_smithy_types::DateTime>,
    ) -> Self {
        self.last_updated_at = input;
        self
    }
    /// Consumes the builder and constructs a [`Tunnel`](crate::types::Tunnel).
    pub fn build(self) -> crate::types::Tunnel {
        crate::types::Tunnel {
            tunnel_id: self.tunnel_id,
            tunnel_arn: self.tunnel_arn,
            status: self.status,
            source_connection_state: self.source_connection_state,
            destination_connection_state: self.destination_connection_state,
            description: self.description,
            destination_config: self.destination_config,
            timeout_config: self.timeout_config,
            tags: self.tags,
            created_at: self.created_at,
            last_updated_at: self.last_updated_at,
        }
    }
}