aws-sdk-sagemaker 1.207.0

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

/// Search shape for Job. Mirrors DescribeJobResponse fields. If you update DescribeJobResponse, update this structure as well.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Job {
    /// <p>The name of the job.</p>
    pub job_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the job.</p>
    pub job_arn: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the IAM role associated with the job.</p>
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// <p>The category of the job.</p>
    pub job_category: ::std::option::Option<crate::types::JobCategory>,
    /// <p>The schema version used for the job configuration document.</p>
    pub job_config_schema_version: ::std::option::Option<::std::string::String>,
    /// <p>The JSON configuration document for the job.</p>
    pub job_config_document: ::std::option::Option<::std::string::String>,
    /// <p>The date and time that the job was created.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time that the job was last modified.</p>
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The date and time that the job ended.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The current status of the job.</p>
    pub job_status: ::std::option::Option<crate::types::JobStatus>,
    /// <p>The detailed secondary status of the job, providing more granular information about the job's progress.</p>
    pub secondary_status: ::std::option::Option<crate::types::JobSecondaryStatus>,
    /// <p>A list of secondary status transitions for the job, with timestamps and optional status messages.</p>
    pub secondary_status_transitions: ::std::option::Option<::std::vec::Vec<crate::types::JobSecondaryStatusTransition>>,
    /// <p>If the job failed, the reason it failed.</p>
    pub failure_reason: ::std::option::Option<::std::string::String>,
    /// <p>The tags associated with the job.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl Job {
    /// <p>The name of the job.</p>
    pub fn job_name(&self) -> ::std::option::Option<&str> {
        self.job_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the job.</p>
    pub fn job_arn(&self) -> ::std::option::Option<&str> {
        self.job_arn.as_deref()
    }
    /// <p>The ARN of the IAM role associated with the job.</p>
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// <p>The category of the job.</p>
    pub fn job_category(&self) -> ::std::option::Option<&crate::types::JobCategory> {
        self.job_category.as_ref()
    }
    /// <p>The schema version used for the job configuration document.</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.</p>
    pub fn job_config_document(&self) -> ::std::option::Option<&str> {
        self.job_config_document.as_deref()
    }
    /// <p>The date and time that the job was created.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>The date and time that the job was last modified.</p>
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_time.as_ref()
    }
    /// <p>The date and time that the job ended.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
    /// <p>The current status of the job.</p>
    pub fn job_status(&self) -> ::std::option::Option<&crate::types::JobStatus> {
        self.job_status.as_ref()
    }
    /// <p>The detailed secondary status of the job, providing more granular information about the job's progress.</p>
    pub fn secondary_status(&self) -> ::std::option::Option<&crate::types::JobSecondaryStatus> {
        self.secondary_status.as_ref()
    }
    /// <p>A list of secondary status transitions for the job, with timestamps and optional status messages.</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 `.secondary_status_transitions.is_none()`.
    pub fn secondary_status_transitions(&self) -> &[crate::types::JobSecondaryStatusTransition] {
        self.secondary_status_transitions.as_deref().unwrap_or_default()
    }
    /// <p>If the job failed, the reason it failed.</p>
    pub fn failure_reason(&self) -> ::std::option::Option<&str> {
        self.failure_reason.as_deref()
    }
    /// <p>The tags associated with the job.</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 Job {
    /// Creates a new builder-style object to manufacture [`Job`](crate::types::Job).
    pub fn builder() -> crate::types::builders::JobBuilder {
        crate::types::builders::JobBuilder::default()
    }
}

/// A builder for [`Job`](crate::types::Job).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct JobBuilder {
    pub(crate) job_name: ::std::option::Option<::std::string::String>,
    pub(crate) job_arn: ::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) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) job_status: ::std::option::Option<crate::types::JobStatus>,
    pub(crate) secondary_status: ::std::option::Option<crate::types::JobSecondaryStatus>,
    pub(crate) secondary_status_transitions: ::std::option::Option<::std::vec::Vec<crate::types::JobSecondaryStatusTransition>>,
    pub(crate) failure_reason: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl JobBuilder {
    /// <p>The name of the job.</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 the job.</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.</p>
    pub fn get_job_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_name
    }
    /// <p>The Amazon Resource Name (ARN) of the job.</p>
    pub fn job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.job_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the job.</p>
    pub fn set_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.job_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the job.</p>
    pub fn get_job_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_arn
    }
    /// <p>The ARN of the IAM role associated with the job.</p>
    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 ARN of the IAM role associated with the job.</p>
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// <p>The ARN of the IAM role associated with the job.</p>
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// <p>The category of the job.</p>
    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.</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.</p>
    pub fn get_job_category(&self) -> &::std::option::Option<crate::types::JobCategory> {
        &self.job_category
    }
    /// <p>The schema version used for the job configuration document.</p>
    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 schema version used for the job configuration document.</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 schema version used for the job configuration document.</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.</p>
    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.</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.</p>
    pub fn get_job_config_document(&self) -> &::std::option::Option<::std::string::String> {
        &self.job_config_document
    }
    /// <p>The date and time that the job was created.</p>
    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the job was created.</p>
    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_time = input;
        self
    }
    /// <p>The date and time that the job was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>The date and time that the job was last modified.</p>
    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_modified_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the job was last modified.</p>
    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_modified_time = input;
        self
    }
    /// <p>The date and time that the job was last modified.</p>
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_time
    }
    /// <p>The date and time that the job ended.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time that the job ended.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>The date and time that the job ended.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// <p>The current status of the job.</p>
    pub fn job_status(mut self, input: crate::types::JobStatus) -> Self {
        self.job_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the job.</p>
    pub fn set_job_status(mut self, input: ::std::option::Option<crate::types::JobStatus>) -> Self {
        self.job_status = input;
        self
    }
    /// <p>The current status of the job.</p>
    pub fn get_job_status(&self) -> &::std::option::Option<crate::types::JobStatus> {
        &self.job_status
    }
    /// <p>The detailed secondary status of the job, providing more granular information about the job's progress.</p>
    pub fn secondary_status(mut self, input: crate::types::JobSecondaryStatus) -> Self {
        self.secondary_status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The detailed secondary status of the job, providing more granular information about the job's progress.</p>
    pub fn set_secondary_status(mut self, input: ::std::option::Option<crate::types::JobSecondaryStatus>) -> Self {
        self.secondary_status = input;
        self
    }
    /// <p>The detailed secondary status of the job, providing more granular information about the job's progress.</p>
    pub fn get_secondary_status(&self) -> &::std::option::Option<crate::types::JobSecondaryStatus> {
        &self.secondary_status
    }
    /// Appends an item to `secondary_status_transitions`.
    ///
    /// To override the contents of this collection use [`set_secondary_status_transitions`](Self::set_secondary_status_transitions).
    ///
    /// <p>A list of secondary status transitions for the job, with timestamps and optional status messages.</p>
    pub fn secondary_status_transitions(mut self, input: crate::types::JobSecondaryStatusTransition) -> Self {
        let mut v = self.secondary_status_transitions.unwrap_or_default();
        v.push(input);
        self.secondary_status_transitions = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of secondary status transitions for the job, with timestamps and optional status messages.</p>
    pub fn set_secondary_status_transitions(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::JobSecondaryStatusTransition>>,
    ) -> Self {
        self.secondary_status_transitions = input;
        self
    }
    /// <p>A list of secondary status transitions for the job, with timestamps and optional status messages.</p>
    pub fn get_secondary_status_transitions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobSecondaryStatusTransition>> {
        &self.secondary_status_transitions
    }
    /// <p>If the job failed, the reason it failed.</p>
    pub fn failure_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.failure_reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>If the job failed, the reason it failed.</p>
    pub fn set_failure_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.failure_reason = input;
        self
    }
    /// <p>If the job failed, the reason it failed.</p>
    pub fn get_failure_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.failure_reason
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags associated with the job.</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 associated with the job.</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 associated with the job.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`Job`](crate::types::Job).
    pub fn build(self) -> crate::types::Job {
        crate::types::Job {
            job_name: self.job_name,
            job_arn: self.job_arn,
            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,
            creation_time: self.creation_time,
            last_modified_time: self.last_modified_time,
            end_time: self.end_time,
            job_status: self.job_status,
            secondary_status: self.secondary_status,
            secondary_status_transitions: self.secondary_status_transitions,
            failure_reason: self.failure_reason,
            tags: self.tags,
        }
    }
}