aws_sdk_mturk/operation/notify_workers/
_notify_workers_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct NotifyWorkersInput {
6 pub subject: ::std::option::Option<::std::string::String>,
8 pub message_text: ::std::option::Option<::std::string::String>,
10 pub worker_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12}
13impl NotifyWorkersInput {
14 pub fn subject(&self) -> ::std::option::Option<&str> {
16 self.subject.as_deref()
17 }
18 pub fn message_text(&self) -> ::std::option::Option<&str> {
20 self.message_text.as_deref()
21 }
22 pub fn worker_ids(&self) -> &[::std::string::String] {
26 self.worker_ids.as_deref().unwrap_or_default()
27 }
28}
29impl NotifyWorkersInput {
30 pub fn builder() -> crate::operation::notify_workers::builders::NotifyWorkersInputBuilder {
32 crate::operation::notify_workers::builders::NotifyWorkersInputBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct NotifyWorkersInputBuilder {
40 pub(crate) subject: ::std::option::Option<::std::string::String>,
41 pub(crate) message_text: ::std::option::Option<::std::string::String>,
42 pub(crate) worker_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43}
44impl NotifyWorkersInputBuilder {
45 pub fn subject(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.subject = ::std::option::Option::Some(input.into());
49 self
50 }
51 pub fn set_subject(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.subject = input;
54 self
55 }
56 pub fn get_subject(&self) -> &::std::option::Option<::std::string::String> {
58 &self.subject
59 }
60 pub fn message_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63 self.message_text = ::std::option::Option::Some(input.into());
64 self
65 }
66 pub fn set_message_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68 self.message_text = input;
69 self
70 }
71 pub fn get_message_text(&self) -> &::std::option::Option<::std::string::String> {
73 &self.message_text
74 }
75 pub fn worker_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 let mut v = self.worker_ids.unwrap_or_default();
82 v.push(input.into());
83 self.worker_ids = ::std::option::Option::Some(v);
84 self
85 }
86 pub fn set_worker_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
88 self.worker_ids = input;
89 self
90 }
91 pub fn get_worker_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
93 &self.worker_ids
94 }
95 pub fn build(
97 self,
98 ) -> ::std::result::Result<crate::operation::notify_workers::NotifyWorkersInput, ::aws_smithy_types::error::operation::BuildError> {
99 ::std::result::Result::Ok(crate::operation::notify_workers::NotifyWorkersInput {
100 subject: self.subject,
101 message_text: self.message_text,
102 worker_ids: self.worker_ids,
103 })
104 }
105}