aws-sdk-emr 1.121.0

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

/// <p>Input to the <code>TerminateSession</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TerminateSessionInput {
    /// <p>The ID of the cluster that the session belongs to.</p>
    pub cluster_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the session to terminate.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
}
impl TerminateSessionInput {
    /// <p>The ID of the cluster that the session belongs to.</p>
    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
        self.cluster_id.as_deref()
    }
    /// <p>The ID of the session to terminate.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
}
impl TerminateSessionInput {
    /// Creates a new builder-style object to manufacture [`TerminateSessionInput`](crate::operation::terminate_session::TerminateSessionInput).
    pub fn builder() -> crate::operation::terminate_session::builders::TerminateSessionInputBuilder {
        crate::operation::terminate_session::builders::TerminateSessionInputBuilder::default()
    }
}

/// A builder for [`TerminateSessionInput`](crate::operation::terminate_session::TerminateSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TerminateSessionInputBuilder {
    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
}
impl TerminateSessionInputBuilder {
    /// <p>The ID of the cluster that the session belongs to.</p>
    /// This field is required.
    pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the cluster that the session belongs to.</p>
    pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_id = input;
        self
    }
    /// <p>The ID of the cluster that the session belongs to.</p>
    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_id
    }
    /// <p>The ID of the session to terminate.</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 ID of the session to terminate.</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 session to terminate.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// Consumes the builder and constructs a [`TerminateSessionInput`](crate::operation::terminate_session::TerminateSessionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::terminate_session::TerminateSessionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::terminate_session::TerminateSessionInput {
            cluster_id: self.cluster_id,
            session_id: self.session_id,
        })
    }
}