aws_sdk_sagemaker/operation/create_trial/_create_trial_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 CreateTrialInput {
6 /// <p>The name of the trial. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
7 pub trial_name: ::std::option::Option<::std::string::String>,
8 /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
9 pub display_name: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the experiment to associate the trial with.</p>
11 pub experiment_name: ::std::option::Option<::std::string::String>,
12 /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
13 pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
14 /// <p>A list of tags to associate with the trial. 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>
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateTrialInput {
18 /// <p>The name of the trial. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
19 pub fn trial_name(&self) -> ::std::option::Option<&str> {
20 self.trial_name.as_deref()
21 }
22 /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
23 pub fn display_name(&self) -> ::std::option::Option<&str> {
24 self.display_name.as_deref()
25 }
26 /// <p>The name of the experiment to associate the trial with.</p>
27 pub fn experiment_name(&self) -> ::std::option::Option<&str> {
28 self.experiment_name.as_deref()
29 }
30 /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
31 pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
32 self.metadata_properties.as_ref()
33 }
34 /// <p>A list of tags to associate with the trial. 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>
35 ///
36 /// 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()`.
37 pub fn tags(&self) -> &[crate::types::Tag] {
38 self.tags.as_deref().unwrap_or_default()
39 }
40}
41impl CreateTrialInput {
42 /// Creates a new builder-style object to manufacture [`CreateTrialInput`](crate::operation::create_trial::CreateTrialInput).
43 pub fn builder() -> crate::operation::create_trial::builders::CreateTrialInputBuilder {
44 crate::operation::create_trial::builders::CreateTrialInputBuilder::default()
45 }
46}
47
48/// A builder for [`CreateTrialInput`](crate::operation::create_trial::CreateTrialInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateTrialInputBuilder {
52 pub(crate) trial_name: ::std::option::Option<::std::string::String>,
53 pub(crate) display_name: ::std::option::Option<::std::string::String>,
54 pub(crate) experiment_name: ::std::option::Option<::std::string::String>,
55 pub(crate) metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
56 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
57}
58impl CreateTrialInputBuilder {
59 /// <p>The name of the trial. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
60 /// This field is required.
61 pub fn trial_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.trial_name = ::std::option::Option::Some(input.into());
63 self
64 }
65 /// <p>The name of the trial. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
66 pub fn set_trial_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.trial_name = input;
68 self
69 }
70 /// <p>The name of the trial. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
71 pub fn get_trial_name(&self) -> &::std::option::Option<::std::string::String> {
72 &self.trial_name
73 }
74 /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
75 pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.display_name = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
80 pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.display_name = input;
82 self
83 }
84 /// <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>
85 pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
86 &self.display_name
87 }
88 /// <p>The name of the experiment to associate the trial with.</p>
89 /// This field is required.
90 pub fn experiment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.experiment_name = ::std::option::Option::Some(input.into());
92 self
93 }
94 /// <p>The name of the experiment to associate the trial with.</p>
95 pub fn set_experiment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.experiment_name = input;
97 self
98 }
99 /// <p>The name of the experiment to associate the trial with.</p>
100 pub fn get_experiment_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.experiment_name
102 }
103 /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
104 pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
105 self.metadata_properties = ::std::option::Option::Some(input);
106 self
107 }
108 /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
109 pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
110 self.metadata_properties = input;
111 self
112 }
113 /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
114 pub fn get_metadata_properties(&self) -> &::std::option::Option<crate::types::MetadataProperties> {
115 &self.metadata_properties
116 }
117 /// Appends an item to `tags`.
118 ///
119 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
120 ///
121 /// <p>A list of tags to associate with the trial. 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>
122 pub fn tags(mut self, input: crate::types::Tag) -> Self {
123 let mut v = self.tags.unwrap_or_default();
124 v.push(input);
125 self.tags = ::std::option::Option::Some(v);
126 self
127 }
128 /// <p>A list of tags to associate with the trial. 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>
129 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
130 self.tags = input;
131 self
132 }
133 /// <p>A list of tags to associate with the trial. 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>
134 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
135 &self.tags
136 }
137 /// Consumes the builder and constructs a [`CreateTrialInput`](crate::operation::create_trial::CreateTrialInput).
138 pub fn build(self) -> ::std::result::Result<crate::operation::create_trial::CreateTrialInput, ::aws_smithy_types::error::operation::BuildError> {
139 ::std::result::Result::Ok(crate::operation::create_trial::CreateTrialInput {
140 trial_name: self.trial_name,
141 display_name: self.display_name,
142 experiment_name: self.experiment_name,
143 metadata_properties: self.metadata_properties,
144 tags: self.tags,
145 })
146 }
147}