aws_sdk_resourcegroups/operation/search_resources/
_search_resources_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 SearchResourcesOutput {
6    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
7    pub resource_identifiers: ::std::option::Option<::std::vec::Vec<crate::types::ResourceIdentifier>>,
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>.</p>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    /// <p>A list of <code>QueryError</code> objects. Each error contains an <code>ErrorCode</code> and <code>Message</code>.</p>
11    /// <p>Possible values for <code>ErrorCode</code>:</p>
12    /// <ul>
13    /// <li>
14    /// <p><code>CLOUDFORMATION_STACK_INACTIVE</code></p></li>
15    /// <li>
16    /// <p><code>CLOUDFORMATION_STACK_NOT_EXISTING</code></p></li>
17    /// <li>
18    /// <p><code>CLOUDFORMATION_STACK_UNASSUMABLE_ROLE </code></p></li>
19    /// </ul>
20    pub query_errors: ::std::option::Option<::std::vec::Vec<crate::types::QueryError>>,
21    _request_id: Option<String>,
22}
23impl SearchResourcesOutput {
24    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_identifiers.is_none()`.
27    pub fn resource_identifiers(&self) -> &[crate::types::ResourceIdentifier] {
28        self.resource_identifiers.as_deref().unwrap_or_default()
29    }
30    /// <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>.</p>
31    pub fn next_token(&self) -> ::std::option::Option<&str> {
32        self.next_token.as_deref()
33    }
34    /// <p>A list of <code>QueryError</code> objects. Each error contains an <code>ErrorCode</code> and <code>Message</code>.</p>
35    /// <p>Possible values for <code>ErrorCode</code>:</p>
36    /// <ul>
37    /// <li>
38    /// <p><code>CLOUDFORMATION_STACK_INACTIVE</code></p></li>
39    /// <li>
40    /// <p><code>CLOUDFORMATION_STACK_NOT_EXISTING</code></p></li>
41    /// <li>
42    /// <p><code>CLOUDFORMATION_STACK_UNASSUMABLE_ROLE </code></p></li>
43    /// </ul>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.query_errors.is_none()`.
46    pub fn query_errors(&self) -> &[crate::types::QueryError] {
47        self.query_errors.as_deref().unwrap_or_default()
48    }
49}
50impl ::aws_types::request_id::RequestId for SearchResourcesOutput {
51    fn request_id(&self) -> Option<&str> {
52        self._request_id.as_deref()
53    }
54}
55impl SearchResourcesOutput {
56    /// Creates a new builder-style object to manufacture [`SearchResourcesOutput`](crate::operation::search_resources::SearchResourcesOutput).
57    pub fn builder() -> crate::operation::search_resources::builders::SearchResourcesOutputBuilder {
58        crate::operation::search_resources::builders::SearchResourcesOutputBuilder::default()
59    }
60}
61
62/// A builder for [`SearchResourcesOutput`](crate::operation::search_resources::SearchResourcesOutput).
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
64#[non_exhaustive]
65pub struct SearchResourcesOutputBuilder {
66    pub(crate) resource_identifiers: ::std::option::Option<::std::vec::Vec<crate::types::ResourceIdentifier>>,
67    pub(crate) next_token: ::std::option::Option<::std::string::String>,
68    pub(crate) query_errors: ::std::option::Option<::std::vec::Vec<crate::types::QueryError>>,
69    _request_id: Option<String>,
70}
71impl SearchResourcesOutputBuilder {
72    /// Appends an item to `resource_identifiers`.
73    ///
74    /// To override the contents of this collection use [`set_resource_identifiers`](Self::set_resource_identifiers).
75    ///
76    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
77    pub fn resource_identifiers(mut self, input: crate::types::ResourceIdentifier) -> Self {
78        let mut v = self.resource_identifiers.unwrap_or_default();
79        v.push(input);
80        self.resource_identifiers = ::std::option::Option::Some(v);
81        self
82    }
83    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
84    pub fn set_resource_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourceIdentifier>>) -> Self {
85        self.resource_identifiers = input;
86        self
87    }
88    /// <p>The ARNs and resource types of resources that are members of the group that you specified.</p>
89    pub fn get_resource_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourceIdentifier>> {
90        &self.resource_identifiers
91    }
92    /// <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>.</p>
93    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.next_token = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <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>.</p>
98    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99        self.next_token = input;
100        self
101    }
102    /// <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>.</p>
103    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
104        &self.next_token
105    }
106    /// Appends an item to `query_errors`.
107    ///
108    /// To override the contents of this collection use [`set_query_errors`](Self::set_query_errors).
109    ///
110    /// <p>A list of <code>QueryError</code> objects. Each error contains an <code>ErrorCode</code> and <code>Message</code>.</p>
111    /// <p>Possible values for <code>ErrorCode</code>:</p>
112    /// <ul>
113    /// <li>
114    /// <p><code>CLOUDFORMATION_STACK_INACTIVE</code></p></li>
115    /// <li>
116    /// <p><code>CLOUDFORMATION_STACK_NOT_EXISTING</code></p></li>
117    /// <li>
118    /// <p><code>CLOUDFORMATION_STACK_UNASSUMABLE_ROLE </code></p></li>
119    /// </ul>
120    pub fn query_errors(mut self, input: crate::types::QueryError) -> Self {
121        let mut v = self.query_errors.unwrap_or_default();
122        v.push(input);
123        self.query_errors = ::std::option::Option::Some(v);
124        self
125    }
126    /// <p>A list of <code>QueryError</code> objects. Each error contains an <code>ErrorCode</code> and <code>Message</code>.</p>
127    /// <p>Possible values for <code>ErrorCode</code>:</p>
128    /// <ul>
129    /// <li>
130    /// <p><code>CLOUDFORMATION_STACK_INACTIVE</code></p></li>
131    /// <li>
132    /// <p><code>CLOUDFORMATION_STACK_NOT_EXISTING</code></p></li>
133    /// <li>
134    /// <p><code>CLOUDFORMATION_STACK_UNASSUMABLE_ROLE </code></p></li>
135    /// </ul>
136    pub fn set_query_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::QueryError>>) -> Self {
137        self.query_errors = input;
138        self
139    }
140    /// <p>A list of <code>QueryError</code> objects. Each error contains an <code>ErrorCode</code> and <code>Message</code>.</p>
141    /// <p>Possible values for <code>ErrorCode</code>:</p>
142    /// <ul>
143    /// <li>
144    /// <p><code>CLOUDFORMATION_STACK_INACTIVE</code></p></li>
145    /// <li>
146    /// <p><code>CLOUDFORMATION_STACK_NOT_EXISTING</code></p></li>
147    /// <li>
148    /// <p><code>CLOUDFORMATION_STACK_UNASSUMABLE_ROLE </code></p></li>
149    /// </ul>
150    pub fn get_query_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::QueryError>> {
151        &self.query_errors
152    }
153    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
154        self._request_id = Some(request_id.into());
155        self
156    }
157
158    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
159        self._request_id = request_id;
160        self
161    }
162    /// Consumes the builder and constructs a [`SearchResourcesOutput`](crate::operation::search_resources::SearchResourcesOutput).
163    pub fn build(self) -> crate::operation::search_resources::SearchResourcesOutput {
164        crate::operation::search_resources::SearchResourcesOutput {
165            resource_identifiers: self.resource_identifiers,
166            next_token: self.next_token,
167            query_errors: self.query_errors,
168            _request_id: self._request_id,
169        }
170    }
171}