aws-sdk-glue 1.149.0

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

/// <p>Defines an action to be initiated by a trigger.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Action {
    /// <p>The name of a job to be run.</p>
    pub job_name: ::std::option::Option<::std::string::String>,
    /// <p>The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the job definition itself.</p>
    /// <p>You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.</p>
    /// <p>For information about how to specify and consume your own Job arguments, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html">Calling Glue APIs in Python</a> topic in the developer guide.</p>
    /// <p>For information about the key-value pairs that Glue consumes to set up your job, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html">Special Parameters Used by Glue</a> topic in the developer guide.</p>
    pub arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The <code>JobRun</code> timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. This overrides the timeout value set in the parent job.</p>
    /// <p>Jobs must have timeout values less than 7 days or 10080 minutes. Otherwise, the jobs will throw an exception.</p>
    /// <p>When the value is left blank, the timeout is defaulted to 2,880 minutes for Glue version 4.0 and earlier, or 480 minutes for Glue version 5.0 and later.</p>
    /// <p>Any existing Glue jobs that had a timeout value greater than 7 days will be defaulted to 7 days. For instance if you have specified a timeout of 20 days for a batch job, it will be stopped on the 7th day.</p>
    /// <p>For streaming jobs, if you have set up a maintenance window, it will be restarted during the maintenance window after 7 days.</p>
    pub timeout: ::std::option::Option<i32>,
    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used with this action.</p>
    pub security_configuration: ::std::option::Option<::std::string::String>,
    /// <p>Specifies configuration properties of a job run notification.</p>
    pub notification_property: ::std::option::Option<crate::types::NotificationProperty>,
    /// <p>The name of the crawler to be used with this action.</p>
    pub crawler_name: ::std::option::Option<::std::string::String>,
}
impl Action {
    /// <p>The name of a job to be run.</p>
    pub fn job_name(&self) -> ::std::option::Option<&str> {
        self.job_name.as_deref()
    }
    /// <p>The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the job definition itself.</p>
    /// <p>You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.</p>
    /// <p>For information about how to specify and consume your own Job arguments, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html">Calling Glue APIs in Python</a> topic in the developer guide.</p>
    /// <p>For information about the key-value pairs that Glue consumes to set up your job, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html">Special Parameters Used by Glue</a> topic in the developer guide.</p>
    pub fn arguments(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.arguments.as_ref()
    }
    /// <p>The <code>JobRun</code> timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. This overrides the timeout value set in the parent job.</p>
    /// <p>Jobs must have timeout values less than 7 days or 10080 minutes. Otherwise, the jobs will throw an exception.</p>
    /// <p>When the value is left blank, the timeout is defaulted to 2,880 minutes for Glue version 4.0 and earlier, or 480 minutes for Glue version 5.0 and later.</p>
    /// <p>Any existing Glue jobs that had a timeout value greater than 7 days will be defaulted to 7 days. For instance if you have specified a timeout of 20 days for a batch job, it will be stopped on the 7th day.</p>
    /// <p>For streaming jobs, if you have set up a maintenance window, it will be restarted during the maintenance window after 7 days.</p>
    pub fn timeout(&self) -> ::std::option::Option<i32> {
        self.timeout
    }
    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used with this action.</p>
    pub fn security_configuration(&self) -> ::std::option::Option<&str> {
        self.security_configuration.as_deref()
    }
    /// <p>Specifies configuration properties of a job run notification.</p>
    pub fn notification_property(&self) -> ::std::option::Option<&crate::types::NotificationProperty> {
        self.notification_property.as_ref()
    }
    /// <p>The name of the crawler to be used with this action.</p>
    pub fn crawler_name(&self) -> ::std::option::Option<&str> {
        self.crawler_name.as_deref()
    }
}
impl Action {
    /// Creates a new builder-style object to manufacture [`Action`](crate::types::Action).
    pub fn builder() -> crate::types::builders::ActionBuilder {
        crate::types::builders::ActionBuilder::default()
    }
}

/// A builder for [`Action`](crate::types::Action).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ActionBuilder {
    pub(crate) job_name: ::std::option::Option<::std::string::String>,
    pub(crate) arguments: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) timeout: ::std::option::Option<i32>,
    pub(crate) security_configuration: ::std::option::Option<::std::string::String>,
    pub(crate) notification_property: ::std::option::Option<crate::types::NotificationProperty>,
    pub(crate) crawler_name: ::std::option::Option<::std::string::String>,
}
impl ActionBuilder {
    /// <p>The name of a job to be run.</p>
    pub fn job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of a job to be run.</p>
    pub fn set_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_name = input;
        self
    }
    /// <p>The name of a job to be run.</p>
    pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_name
    }
    /// Adds a key-value pair to `arguments`.
    ///
    /// To override the contents of this collection use [`set_arguments`](Self::set_arguments).
    ///
    /// <p>The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the job definition itself.</p>
    /// <p>You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.</p>
    /// <p>For information about how to specify and consume your own Job arguments, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html">Calling Glue APIs in Python</a> topic in the developer guide.</p>
    /// <p>For information about the key-value pairs that Glue consumes to set up your job, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html">Special Parameters Used by Glue</a> topic in the developer guide.</p>
    pub fn arguments(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.arguments.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.arguments = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the job definition itself.</p>
    /// <p>You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.</p>
    /// <p>For information about how to specify and consume your own Job arguments, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html">Calling Glue APIs in Python</a> topic in the developer guide.</p>
    /// <p>For information about the key-value pairs that Glue consumes to set up your job, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html">Special Parameters Used by Glue</a> topic in the developer guide.</p>
    pub fn set_arguments(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.arguments = input;
        self
    }
    /// <p>The job arguments used when this trigger fires. For this job run, they replace the default arguments set in the job definition itself.</p>
    /// <p>You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.</p>
    /// <p>For information about how to specify and consume your own Job arguments, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-python-calling.html">Calling Glue APIs in Python</a> topic in the developer guide.</p>
    /// <p>For information about the key-value pairs that Glue consumes to set up your job, see the <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html">Special Parameters Used by Glue</a> topic in the developer guide.</p>
    pub fn get_arguments(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.arguments
    }
    /// <p>The <code>JobRun</code> timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. This overrides the timeout value set in the parent job.</p>
    /// <p>Jobs must have timeout values less than 7 days or 10080 minutes. Otherwise, the jobs will throw an exception.</p>
    /// <p>When the value is left blank, the timeout is defaulted to 2,880 minutes for Glue version 4.0 and earlier, or 480 minutes for Glue version 5.0 and later.</p>
    /// <p>Any existing Glue jobs that had a timeout value greater than 7 days will be defaulted to 7 days. For instance if you have specified a timeout of 20 days for a batch job, it will be stopped on the 7th day.</p>
    /// <p>For streaming jobs, if you have set up a maintenance window, it will be restarted during the maintenance window after 7 days.</p>
    pub fn timeout(mut self, input: i32) -> Self {
        self.timeout = ::std::option::Option::Some(input);
        self
    }
    /// <p>The <code>JobRun</code> timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. This overrides the timeout value set in the parent job.</p>
    /// <p>Jobs must have timeout values less than 7 days or 10080 minutes. Otherwise, the jobs will throw an exception.</p>
    /// <p>When the value is left blank, the timeout is defaulted to 2,880 minutes for Glue version 4.0 and earlier, or 480 minutes for Glue version 5.0 and later.</p>
    /// <p>Any existing Glue jobs that had a timeout value greater than 7 days will be defaulted to 7 days. For instance if you have specified a timeout of 20 days for a batch job, it will be stopped on the 7th day.</p>
    /// <p>For streaming jobs, if you have set up a maintenance window, it will be restarted during the maintenance window after 7 days.</p>
    pub fn set_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
        self.timeout = input;
        self
    }
    /// <p>The <code>JobRun</code> timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters <code>TIMEOUT</code> status. This overrides the timeout value set in the parent job.</p>
    /// <p>Jobs must have timeout values less than 7 days or 10080 minutes. Otherwise, the jobs will throw an exception.</p>
    /// <p>When the value is left blank, the timeout is defaulted to 2,880 minutes for Glue version 4.0 and earlier, or 480 minutes for Glue version 5.0 and later.</p>
    /// <p>Any existing Glue jobs that had a timeout value greater than 7 days will be defaulted to 7 days. For instance if you have specified a timeout of 20 days for a batch job, it will be stopped on the 7th day.</p>
    /// <p>For streaming jobs, if you have set up a maintenance window, it will be restarted during the maintenance window after 7 days.</p>
    pub fn get_timeout(&self) -> &::std::option::Option<i32> {
        &self.timeout
    }
    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used with this action.</p>
    pub fn security_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.security_configuration = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used with this action.</p>
    pub fn set_security_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.security_configuration = input;
        self
    }
    /// <p>The name of the <code>SecurityConfiguration</code> structure to be used with this action.</p>
    pub fn get_security_configuration(&self) -> &::std::option::Option<::std::string::String> {
        &self.security_configuration
    }
    /// <p>Specifies configuration properties of a job run notification.</p>
    pub fn notification_property(mut self, input: crate::types::NotificationProperty) -> Self {
        self.notification_property = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies configuration properties of a job run notification.</p>
    pub fn set_notification_property(mut self, input: ::std::option::Option<crate::types::NotificationProperty>) -> Self {
        self.notification_property = input;
        self
    }
    /// <p>Specifies configuration properties of a job run notification.</p>
    pub fn get_notification_property(&self) -> &::std::option::Option<crate::types::NotificationProperty> {
        &self.notification_property
    }
    /// <p>The name of the crawler to be used with this action.</p>
    pub fn crawler_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.crawler_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the crawler to be used with this action.</p>
    pub fn set_crawler_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.crawler_name = input;
        self
    }
    /// <p>The name of the crawler to be used with this action.</p>
    pub fn get_crawler_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.crawler_name
    }
    /// Consumes the builder and constructs a [`Action`](crate::types::Action).
    pub fn build(self) -> crate::types::Action {
        crate::types::Action {
            job_name: self.job_name,
            arguments: self.arguments,
            timeout: self.timeout,
            security_configuration: self.security_configuration,
            notification_property: self.notification_property,
            crawler_name: self.crawler_name,
        }
    }
}