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>StartSession</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartSessionInput {
    /// <p>An optional name for the session.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the cluster on which to start the session.</p>
    pub cluster_id: ::std::option::Option<::std::string::String>,
    /// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
    pub execution_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
    pub engine_configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
    /// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
    pub monitoring_configuration: ::std::option::Option<crate::types::SessionMonitoringConfiguration>,
    /// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
    pub session_idle_timeout_in_minutes: ::std::option::Option<i64>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
    pub client_request_token: ::std::option::Option<::std::string::String>,
    /// <p>The tags to assign to the session.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl StartSessionInput {
    /// <p>An optional name for the session.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The ID of the cluster on which to start the session.</p>
    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
        self.cluster_id.as_deref()
    }
    /// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
    pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
        self.execution_role_arn.as_deref()
    }
    /// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</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 `.engine_configurations.is_none()`.
    pub fn engine_configurations(&self) -> &[crate::types::Configuration] {
        self.engine_configurations.as_deref().unwrap_or_default()
    }
    /// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
    pub fn monitoring_configuration(&self) -> ::std::option::Option<&crate::types::SessionMonitoringConfiguration> {
        self.monitoring_configuration.as_ref()
    }
    /// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
    pub fn session_idle_timeout_in_minutes(&self) -> ::std::option::Option<i64> {
        self.session_idle_timeout_in_minutes
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
        self.client_request_token.as_deref()
    }
    /// <p>The tags to assign to the session.</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()
    }
}
impl StartSessionInput {
    /// Creates a new builder-style object to manufacture [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
    pub fn builder() -> crate::operation::start_session::builders::StartSessionInputBuilder {
        crate::operation::start_session::builders::StartSessionInputBuilder::default()
    }
}

/// A builder for [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartSessionInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
    pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) engine_configurations: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>,
    pub(crate) monitoring_configuration: ::std::option::Option<crate::types::SessionMonitoringConfiguration>,
    pub(crate) session_idle_timeout_in_minutes: ::std::option::Option<i64>,
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl StartSessionInputBuilder {
    /// <p>An optional name for the session.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>An optional name for the session.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>An optional name for the session.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The ID of the cluster on which to start the session.</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 on which to start the session.</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 on which to start the session.</p>
    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_id
    }
    /// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
    pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.execution_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
    pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.execution_role_arn = input;
        self
    }
    /// <p>The execution role ARN for the session. Amazon EMR uses this role to access Amazon Web Services resources on your behalf during session execution.</p>
    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_role_arn
    }
    /// Appends an item to `engine_configurations`.
    ///
    /// To override the contents of this collection use [`set_engine_configurations`](Self::set_engine_configurations).
    ///
    /// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
    pub fn engine_configurations(mut self, input: crate::types::Configuration) -> Self {
        let mut v = self.engine_configurations.unwrap_or_default();
        v.push(input);
        self.engine_configurations = ::std::option::Option::Some(v);
        self
    }
    /// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
    pub fn set_engine_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>) -> Self {
        self.engine_configurations = input;
        self
    }
    /// <p>The configuration overrides for the session. Only runtime configuration overrides are supported.</p>
    pub fn get_engine_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Configuration>> {
        &self.engine_configurations
    }
    /// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
    pub fn monitoring_configuration(mut self, input: crate::types::SessionMonitoringConfiguration) -> Self {
        self.monitoring_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
    pub fn set_monitoring_configuration(mut self, input: ::std::option::Option<crate::types::SessionMonitoringConfiguration>) -> Self {
        self.monitoring_configuration = input;
        self
    }
    /// <p>The monitoring configuration that controls where session logs are published, such as Amazon S3, CloudWatch, or managed logging.</p>
    pub fn get_monitoring_configuration(&self) -> &::std::option::Option<crate::types::SessionMonitoringConfiguration> {
        &self.monitoring_configuration
    }
    /// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
    pub fn session_idle_timeout_in_minutes(mut self, input: i64) -> Self {
        self.session_idle_timeout_in_minutes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
    pub fn set_session_idle_timeout_in_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
        self.session_idle_timeout_in_minutes = input;
        self
    }
    /// <p>The idle timeout, in minutes. If the session is idle for this duration, Amazon EMR EC2 automatically terminates it.</p>
    pub fn get_session_idle_timeout_in_minutes(&self) -> &::std::option::Option<i64> {
        &self.session_idle_timeout_in_minutes
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_request_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_request_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request that completed successfully using the same client request token, the service returns the original response without performing the operation again.</p>
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_request_token
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to assign to the session.</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>The tags to assign to the session.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags to assign to the session.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`StartSessionInput`](crate::operation::start_session::StartSessionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_session::StartSessionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_session::StartSessionInput {
            name: self.name,
            cluster_id: self.cluster_id,
            execution_role_arn: self.execution_role_arn,
            engine_configurations: self.engine_configurations,
            monitoring_configuration: self.monitoring_configuration,
            session_idle_timeout_in_minutes: self.session_idle_timeout_in_minutes,
            client_request_token: self.client_request_token,
            tags: self.tags,
        })
    }
}