aws_sdk_mturk/operation/notify_workers/
_notify_workers_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 NotifyWorkersInput {
6    /// <p>The subject line of the email message to send. Can include up to 200 characters.</p>
7    pub subject: ::std::option::Option<::std::string::String>,
8    /// <p>The text of the email message to send. Can include up to 4,096 characters</p>
9    pub message_text: ::std::option::Option<::std::string::String>,
10    /// <p>A list of Worker IDs you wish to notify. You can notify upto 100 Workers at a time.</p>
11    pub worker_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12}
13impl NotifyWorkersInput {
14    /// <p>The subject line of the email message to send. Can include up to 200 characters.</p>
15    pub fn subject(&self) -> ::std::option::Option<&str> {
16        self.subject.as_deref()
17    }
18    /// <p>The text of the email message to send. Can include up to 4,096 characters</p>
19    pub fn message_text(&self) -> ::std::option::Option<&str> {
20        self.message_text.as_deref()
21    }
22    /// <p>A list of Worker IDs you wish to notify. You can notify upto 100 Workers at a time.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.worker_ids.is_none()`.
25    pub fn worker_ids(&self) -> &[::std::string::String] {
26        self.worker_ids.as_deref().unwrap_or_default()
27    }
28}
29impl NotifyWorkersInput {
30    /// Creates a new builder-style object to manufacture [`NotifyWorkersInput`](crate::operation::notify_workers::NotifyWorkersInput).
31    pub fn builder() -> crate::operation::notify_workers::builders::NotifyWorkersInputBuilder {
32        crate::operation::notify_workers::builders::NotifyWorkersInputBuilder::default()
33    }
34}
35
36/// A builder for [`NotifyWorkersInput`](crate::operation::notify_workers::NotifyWorkersInput).
37#[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    /// <p>The subject line of the email message to send. Can include up to 200 characters.</p>
46    /// This field is required.
47    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    /// <p>The subject line of the email message to send. Can include up to 200 characters.</p>
52    pub fn set_subject(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.subject = input;
54        self
55    }
56    /// <p>The subject line of the email message to send. Can include up to 200 characters.</p>
57    pub fn get_subject(&self) -> &::std::option::Option<::std::string::String> {
58        &self.subject
59    }
60    /// <p>The text of the email message to send. Can include up to 4,096 characters</p>
61    /// This field is required.
62    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    /// <p>The text of the email message to send. Can include up to 4,096 characters</p>
67    pub fn set_message_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.message_text = input;
69        self
70    }
71    /// <p>The text of the email message to send. Can include up to 4,096 characters</p>
72    pub fn get_message_text(&self) -> &::std::option::Option<::std::string::String> {
73        &self.message_text
74    }
75    /// Appends an item to `worker_ids`.
76    ///
77    /// To override the contents of this collection use [`set_worker_ids`](Self::set_worker_ids).
78    ///
79    /// <p>A list of Worker IDs you wish to notify. You can notify upto 100 Workers at a time.</p>
80    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    /// <p>A list of Worker IDs you wish to notify. You can notify upto 100 Workers at a time.</p>
87    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    /// <p>A list of Worker IDs you wish to notify. You can notify upto 100 Workers at a time.</p>
92    pub fn get_worker_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
93        &self.worker_ids
94    }
95    /// Consumes the builder and constructs a [`NotifyWorkersInput`](crate::operation::notify_workers::NotifyWorkersInput).
96    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}