aws-sdk-sagemaker 1.210.0

AWS SDK for Amazon SageMaker Service
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 CreateJobInput {
    /// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
    pub job_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The category of the job. The category determines the type of workload that the job runs.</p>
    pub job_category: ::std::option::Option<crate::types::JobCategory>,
    /// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
    pub job_config_schema_version: ::std::option::Option<::std::string::String>,
    /// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
    pub job_config_document: ::std::option::Option<::std::string::String>,
    /// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateJobInput {
    /// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
    pub fn job_name(&self) -> ::std::option::Option<&str> {
        self.job_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>The category of the job. The category determines the type of workload that the job runs.</p>
    pub fn job_category(&self) -> ::std::option::Option<&crate::types::JobCategory> {
        self.job_category.as_ref()
    }
    /// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
    pub fn job_config_schema_version(&self) -> ::std::option::Option<&str> {
        self.job_config_schema_version.as_deref()
    }
    /// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
    pub fn job_config_document(&self) -> ::std::option::Option<&str> {
        self.job_config_document.as_deref()
    }
    /// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</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 CreateJobInput {
    /// Creates a new builder-style object to manufacture [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
    pub fn builder() -> crate::operation::create_job::builders::CreateJobInputBuilder {
        crate::operation::create_job::builders::CreateJobInputBuilder::default()
    }
}

/// A builder for [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateJobInputBuilder {
    pub(crate) job_name: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) job_category: ::std::option::Option<crate::types::JobCategory>,
    pub(crate) job_config_schema_version: ::std::option::Option<::std::string::String>,
    pub(crate) job_config_document: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateJobInputBuilder {
    /// <p>The name of the job. The name must be unique within your account and Amazon Web Services Region.</p>
    /// This field is required.
    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 the job. The name must be unique within your account and Amazon Web Services Region.</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 the job. The name must be unique within your account and Amazon Web Services Region.</p>
    pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_name
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
    /// This field is required.
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker assumes to perform the job. The role must have the necessary permissions to access the resources required by the job configuration.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>The category of the job. The category determines the type of workload that the job runs.</p>
    /// This field is required.
    pub fn job_category(mut self, input: crate::types::JobCategory) -> Self {
        self.job_category = ::std::option::Option::Some(input);
        self
    }
    /// <p>The category of the job. The category determines the type of workload that the job runs.</p>
    pub fn set_job_category(mut self, input: ::std::option::Option<crate::types::JobCategory>) -> Self {
        self.job_category = input;
        self
    }
    /// <p>The category of the job. The category determines the type of workload that the job runs.</p>
    pub fn get_job_category(&self) -> &::std::option::Option<crate::types::JobCategory> {
        &self.job_category
    }
    /// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
    /// This field is required.
    pub fn job_config_schema_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_config_schema_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
    pub fn set_job_config_schema_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_config_schema_version = input;
        self
    }
    /// <p>The version of the configuration schema to use for the job configuration document. Use <code>ListJobSchemaVersions</code> to get available schema versions for a job category.</p>
    pub fn get_job_config_schema_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_config_schema_version
    }
    /// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
    /// This field is required.
    pub fn job_config_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_config_document = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
    pub fn set_job_config_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_config_document = input;
        self
    }
    /// <p>The JSON configuration document for the job. The document must conform to the schema specified by <code>JobConfigSchemaVersion</code>. Use <code>DescribeJobSchemaVersion</code> to retrieve the schema for validation.</p>
    pub fn get_job_config_document(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_config_document
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</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>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An array of key-value pairs to apply to the job as tags. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateJobInput`](crate::operation::create_job::CreateJobInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_job::CreateJobInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_job::CreateJobInput {
            job_name: self.job_name,
            role_arn: self.role_arn,
            job_category: self.job_category,
            job_config_schema_version: self.job_config_schema_version,
            job_config_document: self.job_config_document,
            tags: self.tags,
        })
    }
}