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>Output of the <code>TerminateSession</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TerminateSessionOutput {
    /// <p>The ID of the cluster that the session belonged to.</p>
    pub cluster_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the terminated session.</p>
    pub session_id: ::std::option::Option<::std::string::String>,
    /// <p>The state of the session after the terminate request has been accepted.</p>
    pub state: ::std::option::Option<crate::types::SessionState>,
    _request_id: Option<String>,
}
impl TerminateSessionOutput {
    /// <p>The ID of the cluster that the session belonged to.</p>
    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
        self.cluster_id.as_deref()
    }
    /// <p>The ID of the terminated session.</p>
    pub fn session_id(&self) -> ::std::option::Option<&str> {
        self.session_id.as_deref()
    }
    /// <p>The state of the session after the terminate request has been accepted.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::SessionState> {
        self.state.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for TerminateSessionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl TerminateSessionOutput {
    /// Creates a new builder-style object to manufacture [`TerminateSessionOutput`](crate::operation::terminate_session::TerminateSessionOutput).
    pub fn builder() -> crate::operation::terminate_session::builders::TerminateSessionOutputBuilder {
        crate::operation::terminate_session::builders::TerminateSessionOutputBuilder::default()
    }
}

/// A builder for [`TerminateSessionOutput`](crate::operation::terminate_session::TerminateSessionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TerminateSessionOutputBuilder {
    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
    pub(crate) session_id: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::SessionState>,
    _request_id: Option<String>,
}
impl TerminateSessionOutputBuilder {
    /// <p>The ID of the cluster that the session belonged 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 belonged 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 belonged to.</p>
    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_id
    }
    /// <p>The ID of the terminated 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 ID of the terminated 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 terminated session.</p>
    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.session_id
    }
    /// <p>The state of the session after the terminate request has been accepted.</p>
    /// This field is required.
    pub fn state(mut self, input: crate::types::SessionState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the session after the terminate request has been accepted.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::SessionState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the session after the terminate request has been accepted.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::SessionState> {
        &self.state
    }
    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 [`TerminateSessionOutput`](crate::operation::terminate_session::TerminateSessionOutput).
    pub fn build(self) -> crate::operation::terminate_session::TerminateSessionOutput {
        crate::operation::terminate_session::TerminateSessionOutput {
            cluster_id: self.cluster_id,
            session_id: self.session_id,
            state: self.state,
            _request_id: self._request_id,
        }
    }
}