aws_sdk_sagemaker/operation/create_action/
_create_action_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 CreateActionInput {
6    /// <p>The name of the action. Must be unique to your account in an Amazon Web Services Region.</p>
7    pub action_name: ::std::option::Option<::std::string::String>,
8    /// <p>The source type, ID, and URI.</p>
9    pub source: ::std::option::Option<crate::types::ActionSource>,
10    /// <p>The action type.</p>
11    pub action_type: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the action.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The status of the action.</p>
15    pub status: ::std::option::Option<crate::types::ActionStatus>,
16    /// <p>A list of properties to add to the action.</p>
17    pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
19    pub metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
20    /// <p>A list of tags to apply to the action.</p>
21    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
22}
23impl CreateActionInput {
24    /// <p>The name of the action. Must be unique to your account in an Amazon Web Services Region.</p>
25    pub fn action_name(&self) -> ::std::option::Option<&str> {
26        self.action_name.as_deref()
27    }
28    /// <p>The source type, ID, and URI.</p>
29    pub fn source(&self) -> ::std::option::Option<&crate::types::ActionSource> {
30        self.source.as_ref()
31    }
32    /// <p>The action type.</p>
33    pub fn action_type(&self) -> ::std::option::Option<&str> {
34        self.action_type.as_deref()
35    }
36    /// <p>The description of the action.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>The status of the action.</p>
41    pub fn status(&self) -> ::std::option::Option<&crate::types::ActionStatus> {
42        self.status.as_ref()
43    }
44    /// <p>A list of properties to add to the action.</p>
45    pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
46        self.properties.as_ref()
47    }
48    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
49    pub fn metadata_properties(&self) -> ::std::option::Option<&crate::types::MetadataProperties> {
50        self.metadata_properties.as_ref()
51    }
52    /// <p>A list of tags to apply to the action.</p>
53    ///
54    /// 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()`.
55    pub fn tags(&self) -> &[crate::types::Tag] {
56        self.tags.as_deref().unwrap_or_default()
57    }
58}
59impl CreateActionInput {
60    /// Creates a new builder-style object to manufacture [`CreateActionInput`](crate::operation::create_action::CreateActionInput).
61    pub fn builder() -> crate::operation::create_action::builders::CreateActionInputBuilder {
62        crate::operation::create_action::builders::CreateActionInputBuilder::default()
63    }
64}
65
66/// A builder for [`CreateActionInput`](crate::operation::create_action::CreateActionInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct CreateActionInputBuilder {
70    pub(crate) action_name: ::std::option::Option<::std::string::String>,
71    pub(crate) source: ::std::option::Option<crate::types::ActionSource>,
72    pub(crate) action_type: ::std::option::Option<::std::string::String>,
73    pub(crate) description: ::std::option::Option<::std::string::String>,
74    pub(crate) status: ::std::option::Option<crate::types::ActionStatus>,
75    pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
76    pub(crate) metadata_properties: ::std::option::Option<crate::types::MetadataProperties>,
77    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
78}
79impl CreateActionInputBuilder {
80    /// <p>The name of the action. Must be unique to your account in an Amazon Web Services Region.</p>
81    /// This field is required.
82    pub fn action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.action_name = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The name of the action. Must be unique to your account in an Amazon Web Services Region.</p>
87    pub fn set_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.action_name = input;
89        self
90    }
91    /// <p>The name of the action. Must be unique to your account in an Amazon Web Services Region.</p>
92    pub fn get_action_name(&self) -> &::std::option::Option<::std::string::String> {
93        &self.action_name
94    }
95    /// <p>The source type, ID, and URI.</p>
96    /// This field is required.
97    pub fn source(mut self, input: crate::types::ActionSource) -> Self {
98        self.source = ::std::option::Option::Some(input);
99        self
100    }
101    /// <p>The source type, ID, and URI.</p>
102    pub fn set_source(mut self, input: ::std::option::Option<crate::types::ActionSource>) -> Self {
103        self.source = input;
104        self
105    }
106    /// <p>The source type, ID, and URI.</p>
107    pub fn get_source(&self) -> &::std::option::Option<crate::types::ActionSource> {
108        &self.source
109    }
110    /// <p>The action type.</p>
111    /// This field is required.
112    pub fn action_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.action_type = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The action type.</p>
117    pub fn set_action_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.action_type = input;
119        self
120    }
121    /// <p>The action type.</p>
122    pub fn get_action_type(&self) -> &::std::option::Option<::std::string::String> {
123        &self.action_type
124    }
125    /// <p>The description of the action.</p>
126    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.description = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The description of the action.</p>
131    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.description = input;
133        self
134    }
135    /// <p>The description of the action.</p>
136    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137        &self.description
138    }
139    /// <p>The status of the action.</p>
140    pub fn status(mut self, input: crate::types::ActionStatus) -> Self {
141        self.status = ::std::option::Option::Some(input);
142        self
143    }
144    /// <p>The status of the action.</p>
145    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ActionStatus>) -> Self {
146        self.status = input;
147        self
148    }
149    /// <p>The status of the action.</p>
150    pub fn get_status(&self) -> &::std::option::Option<crate::types::ActionStatus> {
151        &self.status
152    }
153    /// Adds a key-value pair to `properties`.
154    ///
155    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
156    ///
157    /// <p>A list of properties to add to the action.</p>
158    pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
159        let mut hash_map = self.properties.unwrap_or_default();
160        hash_map.insert(k.into(), v.into());
161        self.properties = ::std::option::Option::Some(hash_map);
162        self
163    }
164    /// <p>A list of properties to add to the action.</p>
165    pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
166        self.properties = input;
167        self
168    }
169    /// <p>A list of properties to add to the action.</p>
170    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
171        &self.properties
172    }
173    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
174    pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
175        self.metadata_properties = ::std::option::Option::Some(input);
176        self
177    }
178    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
179    pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
180        self.metadata_properties = input;
181        self
182    }
183    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
184    pub fn get_metadata_properties(&self) -> &::std::option::Option<crate::types::MetadataProperties> {
185        &self.metadata_properties
186    }
187    /// Appends an item to `tags`.
188    ///
189    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
190    ///
191    /// <p>A list of tags to apply to the action.</p>
192    pub fn tags(mut self, input: crate::types::Tag) -> Self {
193        let mut v = self.tags.unwrap_or_default();
194        v.push(input);
195        self.tags = ::std::option::Option::Some(v);
196        self
197    }
198    /// <p>A list of tags to apply to the action.</p>
199    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
200        self.tags = input;
201        self
202    }
203    /// <p>A list of tags to apply to the action.</p>
204    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
205        &self.tags
206    }
207    /// Consumes the builder and constructs a [`CreateActionInput`](crate::operation::create_action::CreateActionInput).
208    pub fn build(
209        self,
210    ) -> ::std::result::Result<crate::operation::create_action::CreateActionInput, ::aws_smithy_types::error::operation::BuildError> {
211        ::std::result::Result::Ok(crate::operation::create_action::CreateActionInput {
212            action_name: self.action_name,
213            source: self.source,
214            action_type: self.action_type,
215            description: self.description,
216            status: self.status,
217            properties: self.properties,
218            metadata_properties: self.metadata_properties,
219            tags: self.tags,
220        })
221    }
222}