aws_sdk_resourceexplorer2/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 list of structures that describe the resources that match the query.</p>
7    pub resources: ::std::option::Option<::std::vec::Vec<crate::types::Resource>>,
8    /// <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. The pagination tokens expire after 24 hours.</p>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of the view that this operation used to perform the search.</p>
11    pub view_arn: ::std::option::Option<::std::string::String>,
12    /// <p>The number of resources that match the query.</p>
13    pub count: ::std::option::Option<crate::types::ResourceCount>,
14    _request_id: Option<String>,
15}
16impl SearchOutput {
17    /// <p>The list of structures that describe the resources that match the query.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resources.is_none()`.
20    pub fn resources(&self) -> &[crate::types::Resource] {
21        self.resources.as_deref().unwrap_or_default()
22    }
23    /// <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. The pagination tokens expire after 24 hours.</p>
24    pub fn next_token(&self) -> ::std::option::Option<&str> {
25        self.next_token.as_deref()
26    }
27    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of the view that this operation used to perform the search.</p>
28    pub fn view_arn(&self) -> ::std::option::Option<&str> {
29        self.view_arn.as_deref()
30    }
31    /// <p>The number of resources that match the query.</p>
32    pub fn count(&self) -> ::std::option::Option<&crate::types::ResourceCount> {
33        self.count.as_ref()
34    }
35}
36impl ::aws_types::request_id::RequestId for SearchOutput {
37    fn request_id(&self) -> Option<&str> {
38        self._request_id.as_deref()
39    }
40}
41impl SearchOutput {
42    /// Creates a new builder-style object to manufacture [`SearchOutput`](crate::operation::search::SearchOutput).
43    pub fn builder() -> crate::operation::search::builders::SearchOutputBuilder {
44        crate::operation::search::builders::SearchOutputBuilder::default()
45    }
46}
47
48/// A builder for [`SearchOutput`](crate::operation::search::SearchOutput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct SearchOutputBuilder {
52    pub(crate) resources: ::std::option::Option<::std::vec::Vec<crate::types::Resource>>,
53    pub(crate) next_token: ::std::option::Option<::std::string::String>,
54    pub(crate) view_arn: ::std::option::Option<::std::string::String>,
55    pub(crate) count: ::std::option::Option<crate::types::ResourceCount>,
56    _request_id: Option<String>,
57}
58impl SearchOutputBuilder {
59    /// Appends an item to `resources`.
60    ///
61    /// To override the contents of this collection use [`set_resources`](Self::set_resources).
62    ///
63    /// <p>The list of structures that describe the resources that match the query.</p>
64    pub fn resources(mut self, input: crate::types::Resource) -> Self {
65        let mut v = self.resources.unwrap_or_default();
66        v.push(input);
67        self.resources = ::std::option::Option::Some(v);
68        self
69    }
70    /// <p>The list of structures that describe the resources that match the query.</p>
71    pub fn set_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Resource>>) -> Self {
72        self.resources = input;
73        self
74    }
75    /// <p>The list of structures that describe the resources that match the query.</p>
76    pub fn get_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Resource>> {
77        &self.resources
78    }
79    /// <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. The pagination tokens expire after 24 hours.</p>
80    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.next_token = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. The pagination tokens expire after 24 hours.</p>
85    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.next_token = input;
87        self
88    }
89    /// <p>If present, indicates that more output is available than is included in the current response. Use this value in the <code>NextToken</code> request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the <code>NextToken</code> response element comes back as <code>null</code>. The pagination tokens expire after 24 hours.</p>
90    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
91        &self.next_token
92    }
93    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of the view that this operation used to perform the search.</p>
94    pub fn view_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.view_arn = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of the view that this operation used to perform the search.</p>
99    pub fn set_view_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.view_arn = input;
101        self
102    }
103    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of the view that this operation used to perform the search.</p>
104    pub fn get_view_arn(&self) -> &::std::option::Option<::std::string::String> {
105        &self.view_arn
106    }
107    /// <p>The number of resources that match the query.</p>
108    pub fn count(mut self, input: crate::types::ResourceCount) -> Self {
109        self.count = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>The number of resources that match the query.</p>
113    pub fn set_count(mut self, input: ::std::option::Option<crate::types::ResourceCount>) -> Self {
114        self.count = input;
115        self
116    }
117    /// <p>The number of resources that match the query.</p>
118    pub fn get_count(&self) -> &::std::option::Option<crate::types::ResourceCount> {
119        &self.count
120    }
121    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
122        self._request_id = Some(request_id.into());
123        self
124    }
125
126    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
127        self._request_id = request_id;
128        self
129    }
130    /// Consumes the builder and constructs a [`SearchOutput`](crate::operation::search::SearchOutput).
131    pub fn build(self) -> crate::operation::search::SearchOutput {
132        crate::operation::search::SearchOutput {
133            resources: self.resources,
134            next_token: self.next_token,
135            view_arn: self.view_arn,
136            count: self.count,
137            _request_id: self._request_id,
138        }
139    }
140}