aws-sdk-iotsecuretunneling 1.78.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>
    pub tunnel_id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of a tunnel.</p>
    pub tunnel_arn: ::std::option::Option<::std::string::String>,
    /// <p>The status of a tunnel. Valid values are: Open and Closed.</p>
    pub status: ::std::option::Option<crate::types::TunnelStatus>,
    /// <p>The connection state of the source application.</p>
    pub source_connection_state: ::std::option::Option<crate::types::ConnectionState>,
    /// <p>The connection state of the destination application.</p>
    pub destination_connection_state: ::std::option::Option<crate::types::ConnectionState>,
    /// <p>A description of the tunnel.</p>
    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>
    pub destination_config: ::std::option::Option<crate::types::DestinationConfig>,
    /// <p>Timeout configuration for the tunnel.</p>
    pub timeout_config: ::std::option::Option<crate::types::TimeoutConfig>,
    /// <p>A list of tag metadata associated with the secure tunnel.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The time when the tunnel was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The last time the tunnel was updated.</p>
    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>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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 ::std::convert::Into<::std::string::String>) -> Self {
        self.tunnel_id = ::std::option::Option::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>A unique alpha-numeric ID that identifies a tunnel.</p>
    pub fn get_tunnel_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.tunnel_id
    }
    /// <p>The Amazon Resource Name (ARN) of a tunnel.</p>
    pub fn tunnel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.tunnel_arn = ::std::option::Option::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 Amazon Resource Name (ARN) of a tunnel.</p>
    pub fn get_tunnel_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.tunnel_arn
    }
    /// <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 = ::std::option::Option::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 status of a tunnel. Valid values are: Open and Closed.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::TunnelStatus> {
        &self.status
    }
    /// <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 = ::std::option::Option::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 source application.</p>
    pub fn get_source_connection_state(&self) -> &::std::option::Option<crate::types::ConnectionState> {
        &self.source_connection_state
    }
    /// <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 = ::std::option::Option::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>The connection state of the destination application.</p>
    pub fn get_destination_connection_state(&self) -> &::std::option::Option<crate::types::ConnectionState> {
        &self.destination_connection_state
    }
    /// <p>A description of the tunnel.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::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>A description of the tunnel.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <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 = ::std::option::Option::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>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 get_destination_config(&self) -> &::std::option::Option<crate::types::DestinationConfig> {
        &self.destination_config
    }
    /// <p>Timeout configuration for the tunnel.</p>
    pub fn timeout_config(mut self, input: crate::types::TimeoutConfig) -> Self {
        self.timeout_config = ::std::option::Option::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
    }
    /// <p>Timeout configuration for the tunnel.</p>
    pub fn get_timeout_config(&self) -> &::std::option::Option<crate::types::TimeoutConfig> {
        &self.timeout_config
    }
    /// 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 = ::std::option::Option::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>A list of tag metadata associated with the secure tunnel.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The time when the tunnel was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::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 time when the tunnel was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <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 = ::std::option::Option::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
    }
    /// <p>The last time the tunnel was updated.</p>
    pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_at
    }
    /// 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,
        }
    }
}