aws_sdk_mturk/operation/approve_assignment/
_approve_assignment_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 ApproveAssignmentInput {
6    /// <p>The ID of the assignment. The assignment must correspond to a HIT created by the Requester.</p>
7    pub assignment_id: ::std::option::Option<::std::string::String>,
8    /// <p>A message for the Worker, which the Worker can see in the Status section of the web site.</p>
9    pub requester_feedback: ::std::option::Option<::std::string::String>,
10    /// <p>A flag indicating that an assignment should be approved even if it was previously rejected. Defaults to <code>False</code>.</p>
11    pub override_rejection: ::std::option::Option<bool>,
12}
13impl ApproveAssignmentInput {
14    /// <p>The ID of the assignment. The assignment must correspond to a HIT created by the Requester.</p>
15    pub fn assignment_id(&self) -> ::std::option::Option<&str> {
16        self.assignment_id.as_deref()
17    }
18    /// <p>A message for the Worker, which the Worker can see in the Status section of the web site.</p>
19    pub fn requester_feedback(&self) -> ::std::option::Option<&str> {
20        self.requester_feedback.as_deref()
21    }
22    /// <p>A flag indicating that an assignment should be approved even if it was previously rejected. Defaults to <code>False</code>.</p>
23    pub fn override_rejection(&self) -> ::std::option::Option<bool> {
24        self.override_rejection
25    }
26}
27impl ApproveAssignmentInput {
28    /// Creates a new builder-style object to manufacture [`ApproveAssignmentInput`](crate::operation::approve_assignment::ApproveAssignmentInput).
29    pub fn builder() -> crate::operation::approve_assignment::builders::ApproveAssignmentInputBuilder {
30        crate::operation::approve_assignment::builders::ApproveAssignmentInputBuilder::default()
31    }
32}
33
34/// A builder for [`ApproveAssignmentInput`](crate::operation::approve_assignment::ApproveAssignmentInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct ApproveAssignmentInputBuilder {
38    pub(crate) assignment_id: ::std::option::Option<::std::string::String>,
39    pub(crate) requester_feedback: ::std::option::Option<::std::string::String>,
40    pub(crate) override_rejection: ::std::option::Option<bool>,
41}
42impl ApproveAssignmentInputBuilder {
43    /// <p>The ID of the assignment. The assignment must correspond to a HIT created by the Requester.</p>
44    /// This field is required.
45    pub fn assignment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46        self.assignment_id = ::std::option::Option::Some(input.into());
47        self
48    }
49    /// <p>The ID of the assignment. The assignment must correspond to a HIT created by the Requester.</p>
50    pub fn set_assignment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51        self.assignment_id = input;
52        self
53    }
54    /// <p>The ID of the assignment. The assignment must correspond to a HIT created by the Requester.</p>
55    pub fn get_assignment_id(&self) -> &::std::option::Option<::std::string::String> {
56        &self.assignment_id
57    }
58    /// <p>A message for the Worker, which the Worker can see in the Status section of the web site.</p>
59    pub fn requester_feedback(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.requester_feedback = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>A message for the Worker, which the Worker can see in the Status section of the web site.</p>
64    pub fn set_requester_feedback(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.requester_feedback = input;
66        self
67    }
68    /// <p>A message for the Worker, which the Worker can see in the Status section of the web site.</p>
69    pub fn get_requester_feedback(&self) -> &::std::option::Option<::std::string::String> {
70        &self.requester_feedback
71    }
72    /// <p>A flag indicating that an assignment should be approved even if it was previously rejected. Defaults to <code>False</code>.</p>
73    pub fn override_rejection(mut self, input: bool) -> Self {
74        self.override_rejection = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>A flag indicating that an assignment should be approved even if it was previously rejected. Defaults to <code>False</code>.</p>
78    pub fn set_override_rejection(mut self, input: ::std::option::Option<bool>) -> Self {
79        self.override_rejection = input;
80        self
81    }
82    /// <p>A flag indicating that an assignment should be approved even if it was previously rejected. Defaults to <code>False</code>.</p>
83    pub fn get_override_rejection(&self) -> &::std::option::Option<bool> {
84        &self.override_rejection
85    }
86    /// Consumes the builder and constructs a [`ApproveAssignmentInput`](crate::operation::approve_assignment::ApproveAssignmentInput).
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::approve_assignment::ApproveAssignmentInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::approve_assignment::ApproveAssignmentInput {
91            assignment_id: self.assignment_id,
92            requester_feedback: self.requester_feedback,
93            override_rejection: self.override_rejection,
94        })
95    }
96}