aws_sdk_datazone/operation/search/_search_output.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 SearchOutput {
6 /// <p>The results of the <code>Search</code> action.</p>
7 pub items: ::std::option::Option<::std::vec::Vec<crate::types::SearchInventoryResultItem>>,
8 /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
9 pub next_token: ::std::option::Option<::std::string::String>,
10 /// <p>Total number of search results.</p>
11 pub total_match_count: ::std::option::Option<i32>,
12 _request_id: Option<String>,
13}
14impl SearchOutput {
15 /// <p>The results of the <code>Search</code> action.</p>
16 ///
17 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.items.is_none()`.
18 pub fn items(&self) -> &[crate::types::SearchInventoryResultItem] {
19 self.items.as_deref().unwrap_or_default()
20 }
21 /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
22 pub fn next_token(&self) -> ::std::option::Option<&str> {
23 self.next_token.as_deref()
24 }
25 /// <p>Total number of search results.</p>
26 pub fn total_match_count(&self) -> ::std::option::Option<i32> {
27 self.total_match_count
28 }
29}
30impl ::aws_types::request_id::RequestId for SearchOutput {
31 fn request_id(&self) -> Option<&str> {
32 self._request_id.as_deref()
33 }
34}
35impl SearchOutput {
36 /// Creates a new builder-style object to manufacture [`SearchOutput`](crate::operation::search::SearchOutput).
37 pub fn builder() -> crate::operation::search::builders::SearchOutputBuilder {
38 crate::operation::search::builders::SearchOutputBuilder::default()
39 }
40}
41
42/// A builder for [`SearchOutput`](crate::operation::search::SearchOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct SearchOutputBuilder {
46 pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::SearchInventoryResultItem>>,
47 pub(crate) next_token: ::std::option::Option<::std::string::String>,
48 pub(crate) total_match_count: ::std::option::Option<i32>,
49 _request_id: Option<String>,
50}
51impl SearchOutputBuilder {
52 /// Appends an item to `items`.
53 ///
54 /// To override the contents of this collection use [`set_items`](Self::set_items).
55 ///
56 /// <p>The results of the <code>Search</code> action.</p>
57 pub fn items(mut self, input: crate::types::SearchInventoryResultItem) -> Self {
58 let mut v = self.items.unwrap_or_default();
59 v.push(input);
60 self.items = ::std::option::Option::Some(v);
61 self
62 }
63 /// <p>The results of the <code>Search</code> action.</p>
64 pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchInventoryResultItem>>) -> Self {
65 self.items = input;
66 self
67 }
68 /// <p>The results of the <code>Search</code> action.</p>
69 pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchInventoryResultItem>> {
70 &self.items
71 }
72 /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
73 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74 self.next_token = ::std::option::Option::Some(input.into());
75 self
76 }
77 /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
78 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79 self.next_token = input;
80 self
81 }
82 /// <p>When the number of results is greater than the default value for the <code>MaxResults</code> parameter, or if you explicitly specify a value for <code>MaxResults</code> that is less than the number of results, the response includes a pagination token named <code>NextToken</code>. You can specify this <code>NextToken</code> value in a subsequent call to <code>Search</code> to list the next set of results.</p>
83 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
84 &self.next_token
85 }
86 /// <p>Total number of search results.</p>
87 pub fn total_match_count(mut self, input: i32) -> Self {
88 self.total_match_count = ::std::option::Option::Some(input);
89 self
90 }
91 /// <p>Total number of search results.</p>
92 pub fn set_total_match_count(mut self, input: ::std::option::Option<i32>) -> Self {
93 self.total_match_count = input;
94 self
95 }
96 /// <p>Total number of search results.</p>
97 pub fn get_total_match_count(&self) -> &::std::option::Option<i32> {
98 &self.total_match_count
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 /// Consumes the builder and constructs a [`SearchOutput`](crate::operation::search::SearchOutput).
110 pub fn build(self) -> crate::operation::search::SearchOutput {
111 crate::operation::search::SearchOutput {
112 items: self.items,
113 next_token: self.next_token,
114 total_match_count: self.total_match_count,
115 _request_id: self._request_id,
116 }
117 }
118}