1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SendBonusInput {
    /// <p>The ID of the Worker being paid the bonus.</p>
    pub worker_id: ::std::option::Option<::std::string::String>,
    /// <p>The Bonus amount is a US Dollar amount specified using a string (for example, "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include currency symbols or currency codes.</p>
    pub bonus_amount: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the assignment for which this bonus is paid.</p>
    pub assignment_id: ::std::option::Option<::std::string::String>,
    /// <p>A message that explains the reason for the bonus payment. The Worker receiving the bonus can see this message.</p>
    pub reason: ::std::option::Option<::std::string::String>,
    /// <p>A unique identifier for this request, which allows you to retry the call on error without granting multiple bonuses. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the bonus already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return an error with a message containing the request ID.</p>
    pub unique_request_token: ::std::option::Option<::std::string::String>,
}
impl SendBonusInput {
    /// <p>The ID of the Worker being paid the bonus.</p>
    pub fn worker_id(&self) -> ::std::option::Option<&str> {
        self.worker_id.as_deref()
    }
    /// <p>The Bonus amount is a US Dollar amount specified using a string (for example, "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include currency symbols or currency codes.</p>
    pub fn bonus_amount(&self) -> ::std::option::Option<&str> {
        self.bonus_amount.as_deref()
    }
    /// <p>The ID of the assignment for which this bonus is paid.</p>
    pub fn assignment_id(&self) -> ::std::option::Option<&str> {
        self.assignment_id.as_deref()
    }
    /// <p>A message that explains the reason for the bonus payment. The Worker receiving the bonus can see this message.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
    /// <p>A unique identifier for this request, which allows you to retry the call on error without granting multiple bonuses. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the bonus already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return an error with a message containing the request ID.</p>
    pub fn unique_request_token(&self) -> ::std::option::Option<&str> {
        self.unique_request_token.as_deref()
    }
}
impl SendBonusInput {
    /// Creates a new builder-style object to manufacture [`SendBonusInput`](crate::operation::send_bonus::SendBonusInput).
    pub fn builder() -> crate::operation::send_bonus::builders::SendBonusInputBuilder {
        crate::operation::send_bonus::builders::SendBonusInputBuilder::default()
    }
}

/// A builder for [`SendBonusInput`](crate::operation::send_bonus::SendBonusInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SendBonusInputBuilder {
    pub(crate) worker_id: ::std::option::Option<::std::string::String>,
    pub(crate) bonus_amount: ::std::option::Option<::std::string::String>,
    pub(crate) assignment_id: ::std::option::Option<::std::string::String>,
    pub(crate) reason: ::std::option::Option<::std::string::String>,
    pub(crate) unique_request_token: ::std::option::Option<::std::string::String>,
}
impl SendBonusInputBuilder {
    /// <p>The ID of the Worker being paid the bonus.</p>
    /// This field is required.
    pub fn worker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.worker_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Worker being paid the bonus.</p>
    pub fn set_worker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.worker_id = input;
        self
    }
    /// <p>The ID of the Worker being paid the bonus.</p>
    pub fn get_worker_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.worker_id
    }
    /// <p>The Bonus amount is a US Dollar amount specified using a string (for example, "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include currency symbols or currency codes.</p>
    /// This field is required.
    pub fn bonus_amount(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.bonus_amount = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Bonus amount is a US Dollar amount specified using a string (for example, "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include currency symbols or currency codes.</p>
    pub fn set_bonus_amount(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.bonus_amount = input;
        self
    }
    /// <p>The Bonus amount is a US Dollar amount specified using a string (for example, "5" represents $5.00 USD and "101.42" represents $101.42 USD). Do not include currency symbols or currency codes.</p>
    pub fn get_bonus_amount(&self) -> &::std::option::Option<::std::string::String> {
        &self.bonus_amount
    }
    /// <p>The ID of the assignment for which this bonus is paid.</p>
    /// This field is required.
    pub fn assignment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.assignment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the assignment for which this bonus is paid.</p>
    pub fn set_assignment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.assignment_id = input;
        self
    }
    /// <p>The ID of the assignment for which this bonus is paid.</p>
    pub fn get_assignment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.assignment_id
    }
    /// <p>A message that explains the reason for the bonus payment. The Worker receiving the bonus can see this message.</p>
    /// This field is required.
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A message that explains the reason for the bonus payment. The Worker receiving the bonus can see this message.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>A message that explains the reason for the bonus payment. The Worker receiving the bonus can see this message.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// <p>A unique identifier for this request, which allows you to retry the call on error without granting multiple bonuses. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the bonus already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return an error with a message containing the request ID.</p>
    pub fn unique_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.unique_request_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for this request, which allows you to retry the call on error without granting multiple bonuses. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the bonus already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return an error with a message containing the request ID.</p>
    pub fn set_unique_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.unique_request_token = input;
        self
    }
    /// <p>A unique identifier for this request, which allows you to retry the call on error without granting multiple bonuses. This is useful in cases such as network timeouts where it is unclear whether or not the call succeeded on the server. If the bonus already exists in the system from a previous call using the same UniqueRequestToken, subsequent calls will return an error with a message containing the request ID.</p>
    pub fn get_unique_request_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.unique_request_token
    }
    /// Consumes the builder and constructs a [`SendBonusInput`](crate::operation::send_bonus::SendBonusInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::send_bonus::SendBonusInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::send_bonus::SendBonusInput {
            worker_id: self.worker_id,
            bonus_amount: self.bonus_amount,
            assignment_id: self.assignment_id,
            reason: self.reason,
            unique_request_token: self.unique_request_token,
        })
    }
}