aws_sdk_sagemaker/operation/update_context/
_update_context_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateContextInput {
6 pub context_name: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12 pub properties_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14}
15impl UpdateContextInput {
16 pub fn context_name(&self) -> ::std::option::Option<&str> {
18 self.context_name.as_deref()
19 }
20 pub fn description(&self) -> ::std::option::Option<&str> {
22 self.description.as_deref()
23 }
24 pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
26 self.properties.as_ref()
27 }
28 pub fn properties_to_remove(&self) -> &[::std::string::String] {
32 self.properties_to_remove.as_deref().unwrap_or_default()
33 }
34}
35impl UpdateContextInput {
36 pub fn builder() -> crate::operation::update_context::builders::UpdateContextInputBuilder {
38 crate::operation::update_context::builders::UpdateContextInputBuilder::default()
39 }
40}
41
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct UpdateContextInputBuilder {
46 pub(crate) context_name: ::std::option::Option<::std::string::String>,
47 pub(crate) description: ::std::option::Option<::std::string::String>,
48 pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
49 pub(crate) properties_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
50}
51impl UpdateContextInputBuilder {
52 pub fn context_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.context_name = ::std::option::Option::Some(input.into());
56 self
57 }
58 pub fn set_context_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.context_name = input;
61 self
62 }
63 pub fn get_context_name(&self) -> &::std::option::Option<::std::string::String> {
65 &self.context_name
66 }
67 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.description = ::std::option::Option::Some(input.into());
70 self
71 }
72 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.description = input;
75 self
76 }
77 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
79 &self.description
80 }
81 pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
87 let mut hash_map = self.properties.unwrap_or_default();
88 hash_map.insert(k.into(), v.into());
89 self.properties = ::std::option::Option::Some(hash_map);
90 self
91 }
92 pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
94 self.properties = input;
95 self
96 }
97 pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
99 &self.properties
100 }
101 pub fn properties_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 let mut v = self.properties_to_remove.unwrap_or_default();
108 v.push(input.into());
109 self.properties_to_remove = ::std::option::Option::Some(v);
110 self
111 }
112 pub fn set_properties_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
114 self.properties_to_remove = input;
115 self
116 }
117 pub fn get_properties_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
119 &self.properties_to_remove
120 }
121 pub fn build(
123 self,
124 ) -> ::std::result::Result<crate::operation::update_context::UpdateContextInput, ::aws_smithy_types::error::operation::BuildError> {
125 ::std::result::Result::Ok(crate::operation::update_context::UpdateContextInput {
126 context_name: self.context_name,
127 description: self.description,
128 properties: self.properties,
129 properties_to_remove: self.properties_to_remove,
130 })
131 }
132}