aws_sdk_sagemaker/operation/update_action/
_update_action_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateActionInput {
6 pub action_name: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub status: ::std::option::Option<crate::types::ActionStatus>,
12 pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14 pub properties_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16}
17impl UpdateActionInput {
18 pub fn action_name(&self) -> ::std::option::Option<&str> {
20 self.action_name.as_deref()
21 }
22 pub fn description(&self) -> ::std::option::Option<&str> {
24 self.description.as_deref()
25 }
26 pub fn status(&self) -> ::std::option::Option<&crate::types::ActionStatus> {
28 self.status.as_ref()
29 }
30 pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
32 self.properties.as_ref()
33 }
34 pub fn properties_to_remove(&self) -> &[::std::string::String] {
38 self.properties_to_remove.as_deref().unwrap_or_default()
39 }
40}
41impl UpdateActionInput {
42 pub fn builder() -> crate::operation::update_action::builders::UpdateActionInputBuilder {
44 crate::operation::update_action::builders::UpdateActionInputBuilder::default()
45 }
46}
47
48#[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 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 pub fn set_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.action_name = input;
68 self
69 }
70 pub fn get_action_name(&self) -> &::std::option::Option<::std::string::String> {
72 &self.action_name
73 }
74 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.description = input;
82 self
83 }
84 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
86 &self.description
87 }
88 pub fn status(mut self, input: crate::types::ActionStatus) -> Self {
90 self.status = ::std::option::Option::Some(input);
91 self
92 }
93 pub fn set_status(mut self, input: ::std::option::Option<crate::types::ActionStatus>) -> Self {
95 self.status = input;
96 self
97 }
98 pub fn get_status(&self) -> &::std::option::Option<crate::types::ActionStatus> {
100 &self.status
101 }
102 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 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 pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
120 &self.properties
121 }
122 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 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 pub fn get_properties_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
140 &self.properties_to_remove
141 }
142 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}