aws-sdk-ecs 1.128.0

AWS SDK for Amazon EC2 Container Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The details for the execute command session.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct Session {
    /// <p>The ID of the execute command session.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>A URL to the managed agent on the container that the SSM Session Manager client uses to send commands and receive output from the container.</p>
    pub stream_url: ::std::option::Option<::std::string::String>,
    /// <p>An encrypted token value containing session and caller information. It's used to authenticate the connection to the container.</p>
    pub token_value: ::std::option::Option<::std::string::String>,
}
impl Session {
    /// <p>The ID of the execute command session.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>A URL to the managed agent on the container that the SSM Session Manager client uses to send commands and receive output from the container.</p>
    pub fn stream_url(&self) -> ::std::option::Option<&str> {
        self.stream_url.as_deref()
    }
    /// <p>An encrypted token value containing session and caller information. It's used to authenticate the connection to the container.</p>
    pub fn token_value(&self) -> ::std::option::Option<&str> {
        self.token_value.as_deref()
    }
}
impl ::std::fmt::Debug for Session {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("Session");
        formatter.field("session_id", &self.session_id);
        formatter.field("stream_url", &self.stream_url);
        formatter.field("token_value", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}
impl Session {
    /// Creates a new builder-style object to manufacture [`Session`](crate::types::Session).
    pub fn builder() -> crate::types::builders::SessionBuilder {
        crate::types::builders::SessionBuilder::default()
    }
}

/// A builder for [`Session`](crate::types::Session).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct SessionBuilder {
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) stream_url: ::std::option::Option<::std::string::String>,
    pub(crate) token_value: ::std::option::Option<::std::string::String>,
}
impl SessionBuilder {
    /// <p>The ID of the execute command session.</p>
    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.session_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the execute command session.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The ID of the execute command session.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>A URL to the managed agent on the container that the SSM Session Manager client uses to send commands and receive output from the container.</p>
    pub fn stream_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.stream_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A URL to the managed agent on the container that the SSM Session Manager client uses to send commands and receive output from the container.</p>
    pub fn set_stream_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.stream_url = input;
        self
    }
    /// <p>A URL to the managed agent on the container that the SSM Session Manager client uses to send commands and receive output from the container.</p>
    pub fn get_stream_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.stream_url
    }
    /// <p>An encrypted token value containing session and caller information. It's used to authenticate the connection to the container.</p>
    pub fn token_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.token_value = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An encrypted token value containing session and caller information. It's used to authenticate the connection to the container.</p>
    pub fn set_token_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.token_value = input;
        self
    }
    /// <p>An encrypted token value containing session and caller information. It's used to authenticate the connection to the container.</p>
    pub fn get_token_value(&self) -> &::std::option::Option<::std::string::String> {
        &self.token_value
    }
    /// Consumes the builder and constructs a [`Session`](crate::types::Session).
    pub fn build(self) -> crate::types::Session {
        crate::types::Session {
            session_id: self.session_id,
            stream_url: self.stream_url,
            token_value: self.token_value,
        }
    }
}
impl ::std::fmt::Debug for SessionBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SessionBuilder");
        formatter.field("session_id", &self.session_id);
        formatter.field("stream_url", &self.stream_url);
        formatter.field("token_value", &"*** Sensitive Data Redacted ***");
        formatter.finish()
    }
}