aws-sdk-sagemaker 1.196.0

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

/// <p>The properties of an experiment as returned by the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API. For information about experiments, see the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateExperiment.html">CreateExperiment</a> API.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Experiment {
    /// <p>The name of the experiment.</p>
    pub experiment_name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the experiment.</p>
    pub experiment_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the experiment as displayed. If <code>DisplayName</code> isn't specified, <code>ExperimentName</code> is displayed.</p>
    pub display_name: ::std::option::Option<::std::string::String>,
    /// <p>The source of the experiment.</p>
    pub source: ::std::option::Option<crate::types::ExperimentSource>,
    /// <p>The description of the experiment.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>When the experiment was created.</p>
    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Who created the experiment.</p>
    pub created_by: ::std::option::Option<crate::types::UserContext>,
    /// <p>When the experiment was last modified.</p>
    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>Information about the user who created or modified a SageMaker resource.</p>
    pub last_modified_by: ::std::option::Option<crate::types::UserContext>,
    /// <p>The list of tags that are associated with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl Experiment {
    /// <p>The name of the experiment.</p>
    pub fn experiment_name(&self) -> ::std::option::Option<&str> {
        self.experiment_name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the experiment.</p>
    pub fn experiment_arn(&self) -> ::std::option::Option<&str> {
        self.experiment_arn.as_deref()
    }
    /// <p>The name of the experiment as displayed. If <code>DisplayName</code> isn't specified, <code>ExperimentName</code> is displayed.</p>
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// <p>The source of the experiment.</p>
    pub fn source(&self) -> ::std::option::Option<&crate::types::ExperimentSource> {
        self.source.as_ref()
    }
    /// <p>The description of the experiment.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>When the experiment was created.</p>
    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.creation_time.as_ref()
    }
    /// <p>Who created the experiment.</p>
    pub fn created_by(&self) -> ::std::option::Option<&crate::types::UserContext> {
        self.created_by.as_ref()
    }
    /// <p>When the experiment was last modified.</p>
    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_modified_time.as_ref()
    }
    /// <p>Information about the user who created or modified a SageMaker resource.</p>
    pub fn last_modified_by(&self) -> ::std::option::Option<&crate::types::UserContext> {
        self.last_modified_by.as_ref()
    }
    /// <p>The list of tags that are associated with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</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 Experiment {
    /// Creates a new builder-style object to manufacture [`Experiment`](crate::types::Experiment).
    pub fn builder() -> crate::types::builders::ExperimentBuilder {
        crate::types::builders::ExperimentBuilder::default()
    }
}

/// A builder for [`Experiment`](crate::types::Experiment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ExperimentBuilder {
    pub(crate) experiment_name: ::std::option::Option<::std::string::String>,
    pub(crate) experiment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) source: ::std::option::Option<crate::types::ExperimentSource>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) created_by: ::std::option::Option<crate::types::UserContext>,
    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_modified_by: ::std::option::Option<crate::types::UserContext>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl ExperimentBuilder {
    /// <p>The name of the experiment.</p>
    pub fn experiment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.experiment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the experiment.</p>
    pub fn set_experiment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.experiment_name = input;
        self
    }
    /// <p>The name of the experiment.</p>
    pub fn get_experiment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.experiment_name
    }
    /// <p>The Amazon Resource Name (ARN) of the experiment.</p>
    pub fn experiment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.experiment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the experiment.</p>
    pub fn set_experiment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.experiment_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the experiment.</p>
    pub fn get_experiment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.experiment_arn
    }
    /// <p>The name of the experiment as displayed. If <code>DisplayName</code> isn't specified, <code>ExperimentName</code> is displayed.</p>
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the experiment as displayed. If <code>DisplayName</code> isn't specified, <code>ExperimentName</code> is displayed.</p>
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// <p>The name of the experiment as displayed. If <code>DisplayName</code> isn't specified, <code>ExperimentName</code> is displayed.</p>
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// <p>The source of the experiment.</p>
    pub fn source(mut self, input: crate::types::ExperimentSource) -> Self {
        self.source = ::std::option::Option::Some(input);
        self
    }
    /// <p>The source of the experiment.</p>
    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ExperimentSource>) -> Self {
        self.source = input;
        self
    }
    /// <p>The source of the experiment.</p>
    pub fn get_source(&self) -> &::std::option::Option<crate::types::ExperimentSource> {
        &self.source
    }
    /// <p>The description of the experiment.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the experiment.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the experiment.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>When the experiment 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>When the experiment 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>When the experiment was created.</p>
    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_time
    }
    /// <p>Who created the experiment.</p>
    pub fn created_by(mut self, input: crate::types::UserContext) -> Self {
        self.created_by = ::std::option::Option::Some(input);
        self
    }
    /// <p>Who created the experiment.</p>
    pub fn set_created_by(mut self, input: ::std::option::Option<crate::types::UserContext>) -> Self {
        self.created_by = input;
        self
    }
    /// <p>Who created the experiment.</p>
    pub fn get_created_by(&self) -> &::std::option::Option<crate::types::UserContext> {
        &self.created_by
    }
    /// <p>When the experiment 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>When the experiment 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>When the experiment was last modified.</p>
    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_modified_time
    }
    /// <p>Information about the user who created or modified a SageMaker resource.</p>
    pub fn last_modified_by(mut self, input: crate::types::UserContext) -> Self {
        self.last_modified_by = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the user who created or modified a SageMaker resource.</p>
    pub fn set_last_modified_by(mut self, input: ::std::option::Option<crate::types::UserContext>) -> Self {
        self.last_modified_by = input;
        self
    }
    /// <p>Information about the user who created or modified a SageMaker resource.</p>
    pub fn get_last_modified_by(&self) -> &::std::option::Option<crate::types::UserContext> {
        &self.last_modified_by
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The list of tags that are associated with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</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 list of tags that are associated with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The list of tags that are associated with the experiment. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`Experiment`](crate::types::Experiment).
    pub fn build(self) -> crate::types::Experiment {
        crate::types::Experiment {
            experiment_name: self.experiment_name,
            experiment_arn: self.experiment_arn,
            display_name: self.display_name,
            source: self.source,
            description: self.description,
            creation_time: self.creation_time,
            created_by: self.created_by,
            last_modified_time: self.last_modified_time,
            last_modified_by: self.last_modified_by,
            tags: self.tags,
        }
    }
}