#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SearchWorkersOutput {
pub workers: ::std::vec::Vec<crate::types::WorkerSearchSummary>,
pub next_item_offset: ::std::option::Option<i32>,
pub total_results: i32,
_request_id: Option<String>,
}
impl SearchWorkersOutput {
pub fn workers(&self) -> &[crate::types::WorkerSearchSummary] {
use std::ops::Deref;
self.workers.deref()
}
pub fn next_item_offset(&self) -> ::std::option::Option<i32> {
self.next_item_offset
}
pub fn total_results(&self) -> i32 {
self.total_results
}
}
impl ::aws_types::request_id::RequestId for SearchWorkersOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl SearchWorkersOutput {
pub fn builder() -> crate::operation::search_workers::builders::SearchWorkersOutputBuilder {
crate::operation::search_workers::builders::SearchWorkersOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SearchWorkersOutputBuilder {
pub(crate) workers: ::std::option::Option<::std::vec::Vec<crate::types::WorkerSearchSummary>>,
pub(crate) next_item_offset: ::std::option::Option<i32>,
pub(crate) total_results: ::std::option::Option<i32>,
_request_id: Option<String>,
}
impl SearchWorkersOutputBuilder {
pub fn workers(mut self, input: crate::types::WorkerSearchSummary) -> Self {
let mut v = self.workers.unwrap_or_default();
v.push(input);
self.workers = ::std::option::Option::Some(v);
self
}
pub fn set_workers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::WorkerSearchSummary>>) -> Self {
self.workers = input;
self
}
pub fn get_workers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::WorkerSearchSummary>> {
&self.workers
}
pub fn next_item_offset(mut self, input: i32) -> Self {
self.next_item_offset = ::std::option::Option::Some(input);
self
}
pub fn set_next_item_offset(mut self, input: ::std::option::Option<i32>) -> Self {
self.next_item_offset = input;
self
}
pub fn get_next_item_offset(&self) -> &::std::option::Option<i32> {
&self.next_item_offset
}
pub fn total_results(mut self, input: i32) -> Self {
self.total_results = ::std::option::Option::Some(input);
self
}
pub fn set_total_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.total_results = input;
self
}
pub fn get_total_results(&self) -> &::std::option::Option<i32> {
&self.total_results
}
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
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::search_workers::SearchWorkersOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::search_workers::SearchWorkersOutput {
workers: self.workers.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"workers",
"workers was not specified but it is required when building SearchWorkersOutput",
)
})?,
next_item_offset: self.next_item_offset,
total_results: self.total_results.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"total_results",
"total_results was not specified but it is required when building SearchWorkersOutput",
)
})?,
_request_id: self._request_id,
})
}
}