aws_sdk_deadline/operation/search_tasks/
_search_tasks_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SearchTasksOutput {
6 pub tasks: ::std::vec::Vec<crate::types::TaskSearchSummary>,
8 pub next_item_offset: ::std::option::Option<i32>,
10 pub total_results: i32,
12 _request_id: Option<String>,
13}
14impl SearchTasksOutput {
15 pub fn tasks(&self) -> &[crate::types::TaskSearchSummary] {
17 use std::ops::Deref;
18 self.tasks.deref()
19 }
20 pub fn next_item_offset(&self) -> ::std::option::Option<i32> {
22 self.next_item_offset
23 }
24 pub fn total_results(&self) -> i32 {
26 self.total_results
27 }
28}
29impl ::aws_types::request_id::RequestId for SearchTasksOutput {
30 fn request_id(&self) -> Option<&str> {
31 self._request_id.as_deref()
32 }
33}
34impl SearchTasksOutput {
35 pub fn builder() -> crate::operation::search_tasks::builders::SearchTasksOutputBuilder {
37 crate::operation::search_tasks::builders::SearchTasksOutputBuilder::default()
38 }
39}
40
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct SearchTasksOutputBuilder {
45 pub(crate) tasks: ::std::option::Option<::std::vec::Vec<crate::types::TaskSearchSummary>>,
46 pub(crate) next_item_offset: ::std::option::Option<i32>,
47 pub(crate) total_results: ::std::option::Option<i32>,
48 _request_id: Option<String>,
49}
50impl SearchTasksOutputBuilder {
51 pub fn tasks(mut self, input: crate::types::TaskSearchSummary) -> Self {
57 let mut v = self.tasks.unwrap_or_default();
58 v.push(input);
59 self.tasks = ::std::option::Option::Some(v);
60 self
61 }
62 pub fn set_tasks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TaskSearchSummary>>) -> Self {
64 self.tasks = input;
65 self
66 }
67 pub fn get_tasks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TaskSearchSummary>> {
69 &self.tasks
70 }
71 pub fn next_item_offset(mut self, input: i32) -> Self {
73 self.next_item_offset = ::std::option::Option::Some(input);
74 self
75 }
76 pub fn set_next_item_offset(mut self, input: ::std::option::Option<i32>) -> Self {
78 self.next_item_offset = input;
79 self
80 }
81 pub fn get_next_item_offset(&self) -> &::std::option::Option<i32> {
83 &self.next_item_offset
84 }
85 pub fn total_results(mut self, input: i32) -> Self {
88 self.total_results = ::std::option::Option::Some(input);
89 self
90 }
91 pub fn set_total_results(mut self, input: ::std::option::Option<i32>) -> Self {
93 self.total_results = input;
94 self
95 }
96 pub fn get_total_results(&self) -> &::std::option::Option<i32> {
98 &self.total_results
99 }
100 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
101 self._request_id = Some(request_id.into());
102 self
103 }
104
105 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
106 self._request_id = request_id;
107 self
108 }
109 pub fn build(self) -> ::std::result::Result<crate::operation::search_tasks::SearchTasksOutput, ::aws_smithy_types::error::operation::BuildError> {
114 ::std::result::Result::Ok(crate::operation::search_tasks::SearchTasksOutput {
115 tasks: self.tasks.ok_or_else(|| {
116 ::aws_smithy_types::error::operation::BuildError::missing_field(
117 "tasks",
118 "tasks was not specified but it is required when building SearchTasksOutput",
119 )
120 })?,
121 next_item_offset: self.next_item_offset,
122 total_results: self.total_results.ok_or_else(|| {
123 ::aws_smithy_types::error::operation::BuildError::missing_field(
124 "total_results",
125 "total_results was not specified but it is required when building SearchTasksOutput",
126 )
127 })?,
128 _request_id: self._request_id,
129 })
130 }
131}