1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
// 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 CreateTrialComponentInput {
/// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
pub trial_component_name: ::std::option::Option<::std::string::String>,
/// <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
pub display_name: ::std::option::Option<::std::string::String>,
/// <p>The status of the component. States include:</p>
/// <ul>
/// <li>
/// <p>InProgress</p></li>
/// <li>
/// <p>Completed</p></li>
/// <li>
/// <p>Failed</p></li>
/// </ul>
pub status: ::std::option::Option<crate::types::TrialComponentStatus>,
/// <p>When the component started.</p>
pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>When the component ended.</p>
pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The hyperparameters for the component.</p>
pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>>,
/// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
pub input_artifacts: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
/// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
pub output_artifacts: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
/// <p>A list of tags to associate with the component. 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 CreateTrialComponentInput {
/// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
pub fn trial_component_name(&self) -> ::std::option::Option<&str> {
self.trial_component_name.as_deref()
}
/// <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
pub fn display_name(&self) -> ::std::option::Option<&str> {
self.display_name.as_deref()
}
/// <p>The status of the component. States include:</p>
/// <ul>
/// <li>
/// <p>InProgress</p></li>
/// <li>
/// <p>Completed</p></li>
/// <li>
/// <p>Failed</p></li>
/// </ul>
pub fn status(&self) -> ::std::option::Option<&crate::types::TrialComponentStatus> {
self.status.as_ref()
}
/// <p>When the component started.</p>
pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.start_time.as_ref()
}
/// <p>When the component ended.</p>
pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.end_time.as_ref()
}
/// <p>The hyperparameters for the component.</p>
pub fn parameters(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>> {
self.parameters.as_ref()
}
/// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
pub fn input_artifacts(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
self.input_artifacts.as_ref()
}
/// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
pub fn output_artifacts(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
self.output_artifacts.as_ref()
}
/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
self.metadata_properties.as_ref()
}
/// <p>A list of tags to associate with the component. 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 CreateTrialComponentInput {
/// Creates a new builder-style object to manufacture [`CreateTrialComponentInput`](crate::operation::create_trial_component::CreateTrialComponentInput).
pub fn builder() -> crate::operation::create_trial_component::builders::CreateTrialComponentInputBuilder {
crate::operation::create_trial_component::builders::CreateTrialComponentInputBuilder::default()
}
}
/// A builder for [`CreateTrialComponentInput`](crate::operation::create_trial_component::CreateTrialComponentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTrialComponentInputBuilder {
pub(crate) trial_component_name: ::std::option::Option<::std::string::String>,
pub(crate) display_name: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::TrialComponentStatus>,
pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>>,
pub(crate) input_artifacts: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
pub(crate) output_artifacts: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
pub(crate) metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateTrialComponentInputBuilder {
/// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
/// This field is required.
pub fn trial_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.trial_component_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
pub fn set_trial_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.trial_component_name = input;
self
}
/// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
pub fn get_trial_component_name(&self) -> &::std::option::Option<::std::string::String> {
&self.trial_component_name
}
/// <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</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 component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</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 component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
&self.display_name
}
/// <p>The status of the component. States include:</p>
/// <ul>
/// <li>
/// <p>InProgress</p></li>
/// <li>
/// <p>Completed</p></li>
/// <li>
/// <p>Failed</p></li>
/// </ul>
pub fn status(mut self, input: crate::types::TrialComponentStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
/// <p>The status of the component. States include:</p>
/// <ul>
/// <li>
/// <p>InProgress</p></li>
/// <li>
/// <p>Completed</p></li>
/// <li>
/// <p>Failed</p></li>
/// </ul>
pub fn set_status(mut self, input: ::std::option::Option<crate::types::TrialComponentStatus>) -> Self {
self.status = input;
self
}
/// <p>The status of the component. States include:</p>
/// <ul>
/// <li>
/// <p>InProgress</p></li>
/// <li>
/// <p>Completed</p></li>
/// <li>
/// <p>Failed</p></li>
/// </ul>
pub fn get_status(&self) -> &::std::option::Option<crate::types::TrialComponentStatus> {
&self.status
}
/// <p>When the component started.</p>
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.start_time = ::std::option::Option::Some(input);
self
}
/// <p>When the component started.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.start_time = input;
self
}
/// <p>When the component started.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.start_time
}
/// <p>When the component ended.</p>
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.end_time = ::std::option::Option::Some(input);
self
}
/// <p>When the component ended.</p>
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.end_time = input;
self
}
/// <p>When the component ended.</p>
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.end_time
}
/// Adds a key-value pair to `parameters`.
///
/// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
///
/// <p>The hyperparameters for the component.</p>
pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentParameterValue) -> Self {
let mut hash_map = self.parameters.unwrap_or_default();
hash_map.insert(k.into(), v);
self.parameters = ::std::option::Option::Some(hash_map);
self
}
/// <p>The hyperparameters for the component.</p>
pub fn set_parameters(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>>,
) -> Self {
self.parameters = input;
self
}
/// <p>The hyperparameters for the component.</p>
pub fn get_parameters(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>> {
&self.parameters
}
/// Adds a key-value pair to `input_artifacts`.
///
/// To override the contents of this collection use [`set_input_artifacts`](Self::set_input_artifacts).
///
/// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
pub fn input_artifacts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentArtifact) -> Self {
let mut hash_map = self.input_artifacts.unwrap_or_default();
hash_map.insert(k.into(), v);
self.input_artifacts = ::std::option::Option::Some(hash_map);
self
}
/// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
pub fn set_input_artifacts(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
) -> Self {
self.input_artifacts = input;
self
}
/// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
pub fn get_input_artifacts(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
&self.input_artifacts
}
/// Adds a key-value pair to `output_artifacts`.
///
/// To override the contents of this collection use [`set_output_artifacts`](Self::set_output_artifacts).
///
/// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
pub fn output_artifacts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentArtifact) -> Self {
let mut hash_map = self.output_artifacts.unwrap_or_default();
hash_map.insert(k.into(), v);
self.output_artifacts = ::std::option::Option::Some(hash_map);
self
}
/// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
pub fn set_output_artifacts(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
) -> Self {
self.output_artifacts = input;
self
}
/// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
pub fn get_output_artifacts(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
&self.output_artifacts
}
/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
self.metadata_properties = ::std::option::Option::Some(input);
self
}
/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
self.metadata_properties = input;
self
}
/// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
pub fn get_metadata_properties(&self) -> &::std::option::Option<crate::types::MetadataProperties> {
&self.metadata_properties
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>A list of tags to associate with the component. 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>A list of tags to associate with the component. 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>A list of tags to associate with the component. 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 [`CreateTrialComponentInput`](crate::operation::create_trial_component::CreateTrialComponentInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_trial_component::CreateTrialComponentInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::create_trial_component::CreateTrialComponentInput {
trial_component_name: self.trial_component_name,
display_name: self.display_name,
status: self.status,
start_time: self.start_time,
end_time: self.end_time,
parameters: self.parameters,
input_artifacts: self.input_artifacts,
output_artifacts: self.output_artifacts,
metadata_properties: self.metadata_properties,
tags: self.tags,
})
}
}