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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Unit of work sent to an activity worker.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PollForActivityTaskOutput {
    /// <p>The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.</p>
    pub task_token: ::std::string::String,
    /// <p>The unique ID of the task.</p>
    pub activity_id: ::std::string::String,
    /// <p>The ID of the <code>ActivityTaskStarted</code> event recorded in the history.</p>
    pub started_event_id: i64,
    /// <p>The workflow execution that started this activity task.</p>
    pub workflow_execution: ::std::option::Option<crate::types::WorkflowExecution>,
    /// <p>The type of this activity task.</p>
    pub activity_type: ::std::option::Option<crate::types::ActivityType>,
    /// <p>The inputs provided when the activity task was scheduled. The form of the input is user defined and should be meaningful to the activity implementation.</p>
    pub input: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl PollForActivityTaskOutput {
    /// <p>The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.</p>
    pub fn task_token(&self) -> &str {
        use std::ops::Deref;
        self.task_token.deref()
    }
    /// <p>The unique ID of the task.</p>
    pub fn activity_id(&self) -> &str {
        use std::ops::Deref;
        self.activity_id.deref()
    }
    /// <p>The ID of the <code>ActivityTaskStarted</code> event recorded in the history.</p>
    pub fn started_event_id(&self) -> i64 {
        self.started_event_id
    }
    /// <p>The workflow execution that started this activity task.</p>
    pub fn workflow_execution(&self) -> ::std::option::Option<&crate::types::WorkflowExecution> {
        self.workflow_execution.as_ref()
    }
    /// <p>The type of this activity task.</p>
    pub fn activity_type(&self) -> ::std::option::Option<&crate::types::ActivityType> {
        self.activity_type.as_ref()
    }
    /// <p>The inputs provided when the activity task was scheduled. The form of the input is user defined and should be meaningful to the activity implementation.</p>
    pub fn input(&self) -> ::std::option::Option<&str> {
        self.input.as_deref()
    }
}
impl ::aws_http::request_id::RequestId for PollForActivityTaskOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl PollForActivityTaskOutput {
    /// Creates a new builder-style object to manufacture [`PollForActivityTaskOutput`](crate::operation::poll_for_activity_task::PollForActivityTaskOutput).
    pub fn builder() -> crate::operation::poll_for_activity_task::builders::PollForActivityTaskOutputBuilder {
        crate::operation::poll_for_activity_task::builders::PollForActivityTaskOutputBuilder::default()
    }
}

/// A builder for [`PollForActivityTaskOutput`](crate::operation::poll_for_activity_task::PollForActivityTaskOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct PollForActivityTaskOutputBuilder {
    pub(crate) task_token: ::std::option::Option<::std::string::String>,
    pub(crate) activity_id: ::std::option::Option<::std::string::String>,
    pub(crate) started_event_id: ::std::option::Option<i64>,
    pub(crate) workflow_execution: ::std::option::Option<crate::types::WorkflowExecution>,
    pub(crate) activity_type: ::std::option::Option<crate::types::ActivityType>,
    pub(crate) input: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl PollForActivityTaskOutputBuilder {
    /// <p>The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.</p>
    /// This field is required.
    pub fn task_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.task_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.</p>
    pub fn set_task_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_token = input;
        self
    }
    /// <p>The opaque string used as a handle on the task. This token is used by workers to communicate progress and response information back to the system about the task.</p>
    pub fn get_task_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_token
    }
    /// <p>The unique ID of the task.</p>
    /// This field is required.
    pub fn activity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.activity_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique ID of the task.</p>
    pub fn set_activity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.activity_id = input;
        self
    }
    /// <p>The unique ID of the task.</p>
    pub fn get_activity_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.activity_id
    }
    /// <p>The ID of the <code>ActivityTaskStarted</code> event recorded in the history.</p>
    /// This field is required.
    pub fn started_event_id(mut self, input: i64) -> Self {
        self.started_event_id = ::std::option::Option::Some(input);
        self
    }
    /// <p>The ID of the <code>ActivityTaskStarted</code> event recorded in the history.</p>
    pub fn set_started_event_id(mut self, input: ::std::option::Option<i64>) -> Self {
        self.started_event_id = input;
        self
    }
    /// <p>The ID of the <code>ActivityTaskStarted</code> event recorded in the history.</p>
    pub fn get_started_event_id(&self) -> &::std::option::Option<i64> {
        &self.started_event_id
    }
    /// <p>The workflow execution that started this activity task.</p>
    /// This field is required.
    pub fn workflow_execution(mut self, input: crate::types::WorkflowExecution) -> Self {
        self.workflow_execution = ::std::option::Option::Some(input);
        self
    }
    /// <p>The workflow execution that started this activity task.</p>
    pub fn set_workflow_execution(mut self, input: ::std::option::Option<crate::types::WorkflowExecution>) -> Self {
        self.workflow_execution = input;
        self
    }
    /// <p>The workflow execution that started this activity task.</p>
    pub fn get_workflow_execution(&self) -> &::std::option::Option<crate::types::WorkflowExecution> {
        &self.workflow_execution
    }
    /// <p>The type of this activity task.</p>
    /// This field is required.
    pub fn activity_type(mut self, input: crate::types::ActivityType) -> Self {
        self.activity_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of this activity task.</p>
    pub fn set_activity_type(mut self, input: ::std::option::Option<crate::types::ActivityType>) -> Self {
        self.activity_type = input;
        self
    }
    /// <p>The type of this activity task.</p>
    pub fn get_activity_type(&self) -> &::std::option::Option<crate::types::ActivityType> {
        &self.activity_type
    }
    /// <p>The inputs provided when the activity task was scheduled. The form of the input is user defined and should be meaningful to the activity implementation.</p>
    pub fn input(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.input = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The inputs provided when the activity task was scheduled. The form of the input is user defined and should be meaningful to the activity implementation.</p>
    pub fn set_input(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.input = input;
        self
    }
    /// <p>The inputs provided when the activity task was scheduled. The form of the input is user defined and should be meaningful to the activity implementation.</p>
    pub fn get_input(&self) -> &::std::option::Option<::std::string::String> {
        &self.input
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`PollForActivityTaskOutput`](crate::operation::poll_for_activity_task::PollForActivityTaskOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`task_token`](crate::operation::poll_for_activity_task::builders::PollForActivityTaskOutputBuilder::task_token)
    /// - [`activity_id`](crate::operation::poll_for_activity_task::builders::PollForActivityTaskOutputBuilder::activity_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::poll_for_activity_task::PollForActivityTaskOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::poll_for_activity_task::PollForActivityTaskOutput {
            task_token: self.task_token.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "task_token",
                    "task_token was not specified but it is required when building PollForActivityTaskOutput",
                )
            })?,
            activity_id: self.activity_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "activity_id",
                    "activity_id was not specified but it is required when building PollForActivityTaskOutput",
                )
            })?,
            started_event_id: self.started_event_id.unwrap_or_default(),
            workflow_execution: self.workflow_execution,
            activity_type: self.activity_type,
            input: self.input,
            _request_id: self._request_id,
        })
    }
}