aws_sdk_sagemaker/operation/update_action/
_update_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 UpdateActionInput {
6    /// <p>The name of the action to update.</p>
7    pub action_name: ::std::option::Option<::std::string::String>,
8    /// <p>The new description for the action.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The new status for the action.</p>
11    pub status: ::std::option::Option<crate::types::ActionStatus>,
12    /// <p>The new list of properties. Overwrites the current property list.</p>
13    pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14    /// <p>A list of properties to remove.</p>
15    pub properties_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16}
17impl UpdateActionInput {
18    /// <p>The name of the action to update.</p>
19    pub fn action_name(&self) -> ::std::option::Option<&str> {
20        self.action_name.as_deref()
21    }
22    /// <p>The new description for the action.</p>
23    pub fn description(&self) -> ::std::option::Option<&str> {
24        self.description.as_deref()
25    }
26    /// <p>The new status for the action.</p>
27    pub fn status(&self) -> ::std::option::Option<&crate::types::ActionStatus> {
28        self.status.as_ref()
29    }
30    /// <p>The new list of properties. Overwrites the current property list.</p>
31    pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
32        self.properties.as_ref()
33    }
34    /// <p>A list of properties to remove.</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 `.properties_to_remove.is_none()`.
37    pub fn properties_to_remove(&self) -> &[::std::string::String] {
38        self.properties_to_remove.as_deref().unwrap_or_default()
39    }
40}
41impl UpdateActionInput {
42    /// Creates a new builder-style object to manufacture [`UpdateActionInput`](crate::operation::update_action::UpdateActionInput).
43    pub fn builder() -> crate::operation::update_action::builders::UpdateActionInputBuilder {
44        crate::operation::update_action::builders::UpdateActionInputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateActionInput`](crate::operation::update_action::UpdateActionInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateActionInputBuilder {
52    pub(crate) action_name: ::std::option::Option<::std::string::String>,
53    pub(crate) description: ::std::option::Option<::std::string::String>,
54    pub(crate) status: ::std::option::Option<crate::types::ActionStatus>,
55    pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
56    pub(crate) properties_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
57}
58impl UpdateActionInputBuilder {
59    /// <p>The name of the action to update.</p>
60    /// This field is required.
61    pub fn action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.action_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of the action to update.</p>
66    pub fn set_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.action_name = input;
68        self
69    }
70    /// <p>The name of the action to update.</p>
71    pub fn get_action_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.action_name
73    }
74    /// <p>The new description for the action.</p>
75    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.description = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The new description for the action.</p>
80    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.description = input;
82        self
83    }
84    /// <p>The new description for the action.</p>
85    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
86        &self.description
87    }
88    /// <p>The new status for the action.</p>
89    pub fn status(mut self, input: crate::types::ActionStatus) -> Self {
90        self.status = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The new status for the action.</p>
94    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ActionStatus>) -> Self {
95        self.status = input;
96        self
97    }
98    /// <p>The new status for the action.</p>
99    pub fn get_status(&self) -> &::std::option::Option<crate::types::ActionStatus> {
100        &self.status
101    }
102    /// Adds a key-value pair to `properties`.
103    ///
104    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
105    ///
106    /// <p>The new list of properties. Overwrites the current property list.</p>
107    pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
108        let mut hash_map = self.properties.unwrap_or_default();
109        hash_map.insert(k.into(), v.into());
110        self.properties = ::std::option::Option::Some(hash_map);
111        self
112    }
113    /// <p>The new list of properties. Overwrites the current property list.</p>
114    pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
115        self.properties = input;
116        self
117    }
118    /// <p>The new list of properties. Overwrites the current property list.</p>
119    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
120        &self.properties
121    }
122    /// Appends an item to `properties_to_remove`.
123    ///
124    /// To override the contents of this collection use [`set_properties_to_remove`](Self::set_properties_to_remove).
125    ///
126    /// <p>A list of properties to remove.</p>
127    pub fn properties_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        let mut v = self.properties_to_remove.unwrap_or_default();
129        v.push(input.into());
130        self.properties_to_remove = ::std::option::Option::Some(v);
131        self
132    }
133    /// <p>A list of properties to remove.</p>
134    pub fn set_properties_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
135        self.properties_to_remove = input;
136        self
137    }
138    /// <p>A list of properties to remove.</p>
139    pub fn get_properties_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
140        &self.properties_to_remove
141    }
142    /// Consumes the builder and constructs a [`UpdateActionInput`](crate::operation::update_action::UpdateActionInput).
143    pub fn build(
144        self,
145    ) -> ::std::result::Result<crate::operation::update_action::UpdateActionInput, ::aws_smithy_types::error::operation::BuildError> {
146        ::std::result::Result::Ok(crate::operation::update_action::UpdateActionInput {
147            action_name: self.action_name,
148            description: self.description,
149            status: self.status,
150            properties: self.properties,
151            properties_to_remove: self.properties_to_remove,
152        })
153    }
154}