aws_sdk_sagemaker/operation/create_experiment/
_create_experiment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateExperimentInput {
6    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
7    pub experiment_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
9    pub display_name: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the experiment.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>A list of tags to associate 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>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateExperimentInput {
16    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
17    pub fn experiment_name(&self) -> ::std::option::Option<&str> {
18        self.experiment_name.as_deref()
19    }
20    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
21    pub fn display_name(&self) -> ::std::option::Option<&str> {
22        self.display_name.as_deref()
23    }
24    /// <p>The description of the experiment.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>A list of tags to associate 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>
29    ///
30    /// 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()`.
31    pub fn tags(&self) -> &[crate::types::Tag] {
32        self.tags.as_deref().unwrap_or_default()
33    }
34}
35impl CreateExperimentInput {
36    /// Creates a new builder-style object to manufacture [`CreateExperimentInput`](crate::operation::create_experiment::CreateExperimentInput).
37    pub fn builder() -> crate::operation::create_experiment::builders::CreateExperimentInputBuilder {
38        crate::operation::create_experiment::builders::CreateExperimentInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateExperimentInput`](crate::operation::create_experiment::CreateExperimentInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateExperimentInputBuilder {
46    pub(crate) experiment_name: ::std::option::Option<::std::string::String>,
47    pub(crate) display_name: ::std::option::Option<::std::string::String>,
48    pub(crate) description: ::std::option::Option<::std::string::String>,
49    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
50}
51impl CreateExperimentInputBuilder {
52    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
53    /// This field is required.
54    pub fn experiment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.experiment_name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
59    pub fn set_experiment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.experiment_name = input;
61        self
62    }
63    /// <p>The name of the experiment. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
64    pub fn get_experiment_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.experiment_name
66    }
67    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
68    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.display_name = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
73    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.display_name = input;
75        self
76    }
77    /// <p>The name of the experiment as displayed. The name doesn't need to be unique. If you don't specify <code>DisplayName</code>, the value in <code>ExperimentName</code> is displayed.</p>
78    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.display_name
80    }
81    /// <p>The description of the experiment.</p>
82    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.description = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The description of the experiment.</p>
87    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.description = input;
89        self
90    }
91    /// <p>The description of the experiment.</p>
92    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
93        &self.description
94    }
95    /// Appends an item to `tags`.
96    ///
97    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
98    ///
99    /// <p>A list of tags to associate 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>
100    pub fn tags(mut self, input: crate::types::Tag) -> Self {
101        let mut v = self.tags.unwrap_or_default();
102        v.push(input);
103        self.tags = ::std::option::Option::Some(v);
104        self
105    }
106    /// <p>A list of tags to associate 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>
107    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
108        self.tags = input;
109        self
110    }
111    /// <p>A list of tags to associate 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>
112    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
113        &self.tags
114    }
115    /// Consumes the builder and constructs a [`CreateExperimentInput`](crate::operation::create_experiment::CreateExperimentInput).
116    pub fn build(
117        self,
118    ) -> ::std::result::Result<crate::operation::create_experiment::CreateExperimentInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::create_experiment::CreateExperimentInput {
120            experiment_name: self.experiment_name,
121            display_name: self.display_name,
122            description: self.description,
123            tags: self.tags,
124        })
125    }
126}