aws_sdk_snowdevicemanagement/operation/create_task/
_create_task_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateTaskInput {
6 pub targets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 pub command: ::std::option::Option<crate::types::Command>,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
14 pub client_token: ::std::option::Option<::std::string::String>,
16}
17impl CreateTaskInput {
18 pub fn targets(&self) -> &[::std::string::String] {
22 self.targets.as_deref().unwrap_or_default()
23 }
24 pub fn command(&self) -> ::std::option::Option<&crate::types::Command> {
26 self.command.as_ref()
27 }
28 pub fn description(&self) -> ::std::option::Option<&str> {
30 self.description.as_deref()
31 }
32 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
34 self.tags.as_ref()
35 }
36 pub fn client_token(&self) -> ::std::option::Option<&str> {
38 self.client_token.as_deref()
39 }
40}
41impl CreateTaskInput {
42 pub fn builder() -> crate::operation::create_task::builders::CreateTaskInputBuilder {
44 crate::operation::create_task::builders::CreateTaskInputBuilder::default()
45 }
46}
47
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateTaskInputBuilder {
52 pub(crate) targets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
53 pub(crate) command: ::std::option::Option<crate::types::Command>,
54 pub(crate) description: ::std::option::Option<::std::string::String>,
55 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
56 pub(crate) client_token: ::std::option::Option<::std::string::String>,
57}
58impl CreateTaskInputBuilder {
59 pub fn targets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65 let mut v = self.targets.unwrap_or_default();
66 v.push(input.into());
67 self.targets = ::std::option::Option::Some(v);
68 self
69 }
70 pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
72 self.targets = input;
73 self
74 }
75 pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
77 &self.targets
78 }
79 pub fn command(mut self, input: crate::types::Command) -> Self {
82 self.command = ::std::option::Option::Some(input);
83 self
84 }
85 pub fn set_command(mut self, input: ::std::option::Option<crate::types::Command>) -> Self {
87 self.command = input;
88 self
89 }
90 pub fn get_command(&self) -> &::std::option::Option<crate::types::Command> {
92 &self.command
93 }
94 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.description = ::std::option::Option::Some(input.into());
97 self
98 }
99 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.description = input;
102 self
103 }
104 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
106 &self.description
107 }
108 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
114 let mut hash_map = self.tags.unwrap_or_default();
115 hash_map.insert(k.into(), v.into());
116 self.tags = ::std::option::Option::Some(hash_map);
117 self
118 }
119 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
121 self.tags = input;
122 self
123 }
124 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
126 &self.tags
127 }
128 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.client_token = ::std::option::Option::Some(input.into());
131 self
132 }
133 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.client_token = input;
136 self
137 }
138 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
140 &self.client_token
141 }
142 pub fn build(self) -> ::std::result::Result<crate::operation::create_task::CreateTaskInput, ::aws_smithy_types::error::operation::BuildError> {
144 ::std::result::Result::Ok(crate::operation::create_task::CreateTaskInput {
145 targets: self.targets,
146 command: self.command,
147 description: self.description,
148 tags: self.tags,
149 client_token: self.client_token,
150 })
151 }
152}