aws-sdk-emrserverless 1.109.0

AWS SDK for EMR Serverless
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetSessionEndpointOutput {
    /// <p>The output contains the ID of the application.</p>
    pub application_id: ::std::string::String,
    /// <p>The output contains the ID of the session.</p>
    pub session_id: ::std::string::String,
    /// The endpoint URL for connecting to the session.
    pub endpoint: ::std::string::String,
    /// Authentication token for accessing the session endpoint.
    pub auth_token: ::std::string::String,
    /// The expiration time of the authentication token.
    pub auth_token_expires_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl GetSessionEndpointOutput {
    /// <p>The output contains the ID of the application.</p>
    pub fn application_id(&self) -> &str {
        use std::ops::Deref;
        self.application_id.deref()
    }
    /// <p>The output contains the ID of the session.</p>
    pub fn session_id(&self) -> &str {
        use std::ops::Deref;
        self.session_id.deref()
    }
    /// The endpoint URL for connecting to the session.
    pub fn endpoint(&self) -> &str {
        use std::ops::Deref;
        self.endpoint.deref()
    }
    /// Authentication token for accessing the session endpoint.
    pub fn auth_token(&self) -> &str {
        use std::ops::Deref;
        self.auth_token.deref()
    }
    /// The expiration time of the authentication token.
    pub fn auth_token_expires_at(&self) -> &::aws_smithy_types::DateTime {
        &self.auth_token_expires_at
    }
}
impl ::std::fmt::Debug for GetSessionEndpointOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetSessionEndpointOutput");
        formatter.field("application_id", &self.application_id);
        formatter.field("session_id", &self.session_id);
        formatter.field("endpoint", &self.endpoint);
        formatter.field("auth_token", &"*** Sensitive Data Redacted ***");
        formatter.field("auth_token_expires_at", &self.auth_token_expires_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetSessionEndpointOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetSessionEndpointOutput {
    /// Creates a new builder-style object to manufacture [`GetSessionEndpointOutput`](crate::operation::get_session_endpoint::GetSessionEndpointOutput).
    pub fn builder() -> crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder {
        crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::default()
    }
}

/// A builder for [`GetSessionEndpointOutput`](crate::operation::get_session_endpoint::GetSessionEndpointOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetSessionEndpointOutputBuilder {
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) endpoint: ::std::option::Option<::std::string::String>,
    pub(crate) auth_token: ::std::option::Option<::std::string::String>,
    pub(crate) auth_token_expires_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetSessionEndpointOutputBuilder {
    /// <p>The output contains the ID of the application.</p>
    /// This field is required.
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The output contains the ID of the application.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The output contains the ID of the application.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// <p>The output contains the ID of the session.</p>
    /// This field is required.
    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 output contains the ID of the session.</p>
    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.session_id = input;
        self
    }
    /// <p>The output contains the ID of the session.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// The endpoint URL for connecting to the session.
    /// This field is required.
    pub fn endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.endpoint = ::std::option::Option::Some(input.into());
        self
    }
    /// The endpoint URL for connecting to the session.
    pub fn set_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.endpoint = input;
        self
    }
    /// The endpoint URL for connecting to the session.
    pub fn get_endpoint(&self) -> &::std::option::Option<::std::string::String> {
        &self.endpoint
    }
    /// Authentication token for accessing the session endpoint.
    /// This field is required.
    pub fn auth_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.auth_token = ::std::option::Option::Some(input.into());
        self
    }
    /// Authentication token for accessing the session endpoint.
    pub fn set_auth_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.auth_token = input;
        self
    }
    /// Authentication token for accessing the session endpoint.
    pub fn get_auth_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.auth_token
    }
    /// The expiration time of the authentication token.
    /// This field is required.
    pub fn auth_token_expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.auth_token_expires_at = ::std::option::Option::Some(input);
        self
    }
    /// The expiration time of the authentication token.
    pub fn set_auth_token_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.auth_token_expires_at = input;
        self
    }
    /// The expiration time of the authentication token.
    pub fn get_auth_token_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.auth_token_expires_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetSessionEndpointOutput`](crate::operation::get_session_endpoint::GetSessionEndpointOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`application_id`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::application_id)
    /// - [`session_id`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::session_id)
    /// - [`endpoint`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::endpoint)
    /// - [`auth_token`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::auth_token)
    /// - [`auth_token_expires_at`](crate::operation::get_session_endpoint::builders::GetSessionEndpointOutputBuilder::auth_token_expires_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_session_endpoint::GetSessionEndpointOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::get_session_endpoint::GetSessionEndpointOutput {
            application_id: self.application_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "application_id",
                    "application_id was not specified but it is required when building GetSessionEndpointOutput",
                )
            })?,
            session_id: self.session_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "session_id",
                    "session_id was not specified but it is required when building GetSessionEndpointOutput",
                )
            })?,
            endpoint: self.endpoint.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "endpoint",
                    "endpoint was not specified but it is required when building GetSessionEndpointOutput",
                )
            })?,
            auth_token: self.auth_token.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "auth_token",
                    "auth_token was not specified but it is required when building GetSessionEndpointOutput",
                )
            })?,
            auth_token_expires_at: self.auth_token_expires_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "auth_token_expires_at",
                    "auth_token_expires_at was not specified but it is required when building GetSessionEndpointOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetSessionEndpointOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetSessionEndpointOutputBuilder");
        formatter.field("application_id", &self.application_id);
        formatter.field("session_id", &self.session_id);
        formatter.field("endpoint", &self.endpoint);
        formatter.field("auth_token", &"*** Sensitive Data Redacted ***");
        formatter.field("auth_token_expires_at", &self.auth_token_expires_at);
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}