aws-sdk-emrserverless 1.103.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, ::std::fmt::Debug)]
pub struct StartJobRunInput {
    /// <p>The ID of the application on which to run the job.</p>
    pub application_id: ::std::option::Option<::std::string::String>,
    /// <p>The client idempotency token of the job run to start. Its value must be unique for each request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The execution role ARN for the job run.</p>
    pub execution_role_arn: ::std::option::Option<::std::string::String>,
    /// <p>You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.</p>
    pub execution_iam_policy: ::std::option::Option<crate::types::JobRunExecutionIamPolicy>,
    /// <p>The job driver for the job run.</p>
    pub job_driver: ::std::option::Option<crate::types::JobDriver>,
    /// <p>The configuration overrides for the job run.</p>
    pub configuration_overrides: ::std::option::Option<crate::types::ConfigurationOverrides>,
    /// <p>The tags assigned to the job run.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.</p>
    pub execution_timeout_minutes: ::std::option::Option<i64>,
    /// <p>The optional job run name. This doesn't have to be unique.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The mode of the job run when it starts.</p>
    pub mode: ::std::option::Option<crate::types::JobRunMode>,
    /// <p>The retry policy when job run starts.</p>
    pub retry_policy: ::std::option::Option<crate::types::RetryPolicy>,
}
impl StartJobRunInput {
    /// <p>The ID of the application on which to run the job.</p>
    pub fn application_id(&self) -> ::std::option::Option<&str> {
        self.application_id.as_deref()
    }
    /// <p>The client idempotency token of the job run to start. Its value must be unique for each request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The execution role ARN for the job run.</p>
    pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
        self.execution_role_arn.as_deref()
    }
    /// <p>You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.</p>
    pub fn execution_iam_policy(&self) -> ::std::option::Option<&crate::types::JobRunExecutionIamPolicy> {
        self.execution_iam_policy.as_ref()
    }
    /// <p>The job driver for the job run.</p>
    pub fn job_driver(&self) -> ::std::option::Option<&crate::types::JobDriver> {
        self.job_driver.as_ref()
    }
    /// <p>The configuration overrides for the job run.</p>
    pub fn configuration_overrides(&self) -> ::std::option::Option<&crate::types::ConfigurationOverrides> {
        self.configuration_overrides.as_ref()
    }
    /// <p>The tags assigned to the job run.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.</p>
    pub fn execution_timeout_minutes(&self) -> ::std::option::Option<i64> {
        self.execution_timeout_minutes
    }
    /// <p>The optional job run name. This doesn't have to be unique.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The mode of the job run when it starts.</p>
    pub fn mode(&self) -> ::std::option::Option<&crate::types::JobRunMode> {
        self.mode.as_ref()
    }
    /// <p>The retry policy when job run starts.</p>
    pub fn retry_policy(&self) -> ::std::option::Option<&crate::types::RetryPolicy> {
        self.retry_policy.as_ref()
    }
}
impl StartJobRunInput {
    /// Creates a new builder-style object to manufacture [`StartJobRunInput`](crate::operation::start_job_run::StartJobRunInput).
    pub fn builder() -> crate::operation::start_job_run::builders::StartJobRunInputBuilder {
        crate::operation::start_job_run::builders::StartJobRunInputBuilder::default()
    }
}

/// A builder for [`StartJobRunInput`](crate::operation::start_job_run::StartJobRunInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartJobRunInputBuilder {
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) execution_iam_policy: ::std::option::Option<crate::types::JobRunExecutionIamPolicy>,
    pub(crate) job_driver: ::std::option::Option<crate::types::JobDriver>,
    pub(crate) configuration_overrides: ::std::option::Option<crate::types::ConfigurationOverrides>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) execution_timeout_minutes: ::std::option::Option<i64>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) mode: ::std::option::Option<crate::types::JobRunMode>,
    pub(crate) retry_policy: ::std::option::Option<crate::types::RetryPolicy>,
}
impl StartJobRunInputBuilder {
    /// <p>The ID of the application on which to run the job.</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 ID of the application on which to run the job.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The ID of the application on which to run the job.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// <p>The client idempotency token of the job run to start. Its value must be unique for each request.</p>
    /// This field is required.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The client idempotency token of the job run to start. Its value must be unique for each request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The client idempotency token of the job run to start. Its value must be unique for each request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The execution role ARN for the job run.</p>
    /// This field is required.
    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 job run.</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 job run.</p>
    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.execution_role_arn
    }
    /// <p>You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.</p>
    pub fn execution_iam_policy(mut self, input: crate::types::JobRunExecutionIamPolicy) -> Self {
        self.execution_iam_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.</p>
    pub fn set_execution_iam_policy(mut self, input: ::std::option::Option<crate::types::JobRunExecutionIamPolicy>) -> Self {
        self.execution_iam_policy = input;
        self
    }
    /// <p>You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.</p>
    pub fn get_execution_iam_policy(&self) -> &::std::option::Option<crate::types::JobRunExecutionIamPolicy> {
        &self.execution_iam_policy
    }
    /// <p>The job driver for the job run.</p>
    pub fn job_driver(mut self, input: crate::types::JobDriver) -> Self {
        self.job_driver = ::std::option::Option::Some(input);
        self
    }
    /// <p>The job driver for the job run.</p>
    pub fn set_job_driver(mut self, input: ::std::option::Option<crate::types::JobDriver>) -> Self {
        self.job_driver = input;
        self
    }
    /// <p>The job driver for the job run.</p>
    pub fn get_job_driver(&self) -> &::std::option::Option<crate::types::JobDriver> {
        &self.job_driver
    }
    /// <p>The configuration overrides for the job run.</p>
    pub fn configuration_overrides(mut self, input: crate::types::ConfigurationOverrides) -> Self {
        self.configuration_overrides = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration overrides for the job run.</p>
    pub fn set_configuration_overrides(mut self, input: ::std::option::Option<crate::types::ConfigurationOverrides>) -> Self {
        self.configuration_overrides = input;
        self
    }
    /// <p>The configuration overrides for the job run.</p>
    pub fn get_configuration_overrides(&self) -> &::std::option::Option<crate::types::ConfigurationOverrides> {
        &self.configuration_overrides
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags assigned to the job run.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags assigned to the job run.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags assigned to the job run.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.</p>
    pub fn execution_timeout_minutes(mut self, input: i64) -> Self {
        self.execution_timeout_minutes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.</p>
    pub fn set_execution_timeout_minutes(mut self, input: ::std::option::Option<i64>) -> Self {
        self.execution_timeout_minutes = input;
        self
    }
    /// <p>The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.</p>
    pub fn get_execution_timeout_minutes(&self) -> &::std::option::Option<i64> {
        &self.execution_timeout_minutes
    }
    /// <p>The optional job run name. This doesn't have to be unique.</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>The optional job run name. This doesn't have to be unique.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The optional job run name. This doesn't have to be unique.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The mode of the job run when it starts.</p>
    pub fn mode(mut self, input: crate::types::JobRunMode) -> Self {
        self.mode = ::std::option::Option::Some(input);
        self
    }
    /// <p>The mode of the job run when it starts.</p>
    pub fn set_mode(mut self, input: ::std::option::Option<crate::types::JobRunMode>) -> Self {
        self.mode = input;
        self
    }
    /// <p>The mode of the job run when it starts.</p>
    pub fn get_mode(&self) -> &::std::option::Option<crate::types::JobRunMode> {
        &self.mode
    }
    /// <p>The retry policy when job run starts.</p>
    pub fn retry_policy(mut self, input: crate::types::RetryPolicy) -> Self {
        self.retry_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>The retry policy when job run starts.</p>
    pub fn set_retry_policy(mut self, input: ::std::option::Option<crate::types::RetryPolicy>) -> Self {
        self.retry_policy = input;
        self
    }
    /// <p>The retry policy when job run starts.</p>
    pub fn get_retry_policy(&self) -> &::std::option::Option<crate::types::RetryPolicy> {
        &self.retry_policy
    }
    /// Consumes the builder and constructs a [`StartJobRunInput`](crate::operation::start_job_run::StartJobRunInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::start_job_run::StartJobRunInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_job_run::StartJobRunInput {
            application_id: self.application_id,
            client_token: self.client_token,
            execution_role_arn: self.execution_role_arn,
            execution_iam_policy: self.execution_iam_policy,
            job_driver: self.job_driver,
            configuration_overrides: self.configuration_overrides,
            tags: self.tags,
            execution_timeout_minutes: self.execution_timeout_minutes,
            name: self.name,
            mode: self.mode,
            retry_policy: self.retry_policy,
        })
    }
}