aws_sdk_qbusiness/operation/get_index/
_get_index_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 GetIndexOutput {
6    /// <p>The identifier of the Amazon Q Business application associated with the index.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the Amazon Q Business index.</p>
9    pub index_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the Amazon Q Business index.</p>
11    pub display_name: ::std::option::Option<::std::string::String>,
12    /// <p>The Amazon Resource Name (ARN) of the Amazon Q Business index.</p>
13    pub index_arn: ::std::option::Option<::std::string::String>,
14    /// <p>The current status of the index. When the value is <code>ACTIVE</code>, the index is ready for use. If the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
15    pub status: ::std::option::Option<crate::types::IndexStatus>,
16    /// <p>The type of index attached to your Amazon Q Business application.</p>
17    pub r#type: ::std::option::Option<crate::types::IndexType>,
18    /// <p>The description for the Amazon Q Business index.</p>
19    pub description: ::std::option::Option<::std::string::String>,
20    /// <p>The Unix timestamp when the Amazon Q Business index was created.</p>
21    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
22    /// <p>The Unix timestamp when the Amazon Q Business index was last updated.</p>
23    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24    /// <p>The storage capacity units chosen for your Amazon Q Business index.</p>
25    pub capacity_configuration: ::std::option::Option<crate::types::IndexCapacityConfiguration>,
26    /// <p>Configuration information for document attributes or metadata. Document metadata are fields associated with your documents. For example, the company department name associated with each document. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes">Understanding document attributes</a>.</p>
27    pub document_attribute_configurations: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeConfiguration>>,
28    /// <p>When the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
29    pub error: ::std::option::Option<crate::types::ErrorDetail>,
30    /// <p>Provides information about the number of documents indexed.</p>
31    pub index_statistics: ::std::option::Option<crate::types::IndexStatistics>,
32    _request_id: Option<String>,
33}
34impl GetIndexOutput {
35    /// <p>The identifier of the Amazon Q Business application associated with the index.</p>
36    pub fn application_id(&self) -> ::std::option::Option<&str> {
37        self.application_id.as_deref()
38    }
39    /// <p>The identifier of the Amazon Q Business index.</p>
40    pub fn index_id(&self) -> ::std::option::Option<&str> {
41        self.index_id.as_deref()
42    }
43    /// <p>The name of the Amazon Q Business index.</p>
44    pub fn display_name(&self) -> ::std::option::Option<&str> {
45        self.display_name.as_deref()
46    }
47    /// <p>The Amazon Resource Name (ARN) of the Amazon Q Business index.</p>
48    pub fn index_arn(&self) -> ::std::option::Option<&str> {
49        self.index_arn.as_deref()
50    }
51    /// <p>The current status of the index. When the value is <code>ACTIVE</code>, the index is ready for use. If the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
52    pub fn status(&self) -> ::std::option::Option<&crate::types::IndexStatus> {
53        self.status.as_ref()
54    }
55    /// <p>The type of index attached to your Amazon Q Business application.</p>
56    pub fn r#type(&self) -> ::std::option::Option<&crate::types::IndexType> {
57        self.r#type.as_ref()
58    }
59    /// <p>The description for the Amazon Q Business index.</p>
60    pub fn description(&self) -> ::std::option::Option<&str> {
61        self.description.as_deref()
62    }
63    /// <p>The Unix timestamp when the Amazon Q Business index was created.</p>
64    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
65        self.created_at.as_ref()
66    }
67    /// <p>The Unix timestamp when the Amazon Q Business index was last updated.</p>
68    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
69        self.updated_at.as_ref()
70    }
71    /// <p>The storage capacity units chosen for your Amazon Q Business index.</p>
72    pub fn capacity_configuration(&self) -> ::std::option::Option<&crate::types::IndexCapacityConfiguration> {
73        self.capacity_configuration.as_ref()
74    }
75    /// <p>Configuration information for document attributes or metadata. Document metadata are fields associated with your documents. For example, the company department name associated with each document. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes">Understanding document attributes</a>.</p>
76    ///
77    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.document_attribute_configurations.is_none()`.
78    pub fn document_attribute_configurations(&self) -> &[crate::types::DocumentAttributeConfiguration] {
79        self.document_attribute_configurations.as_deref().unwrap_or_default()
80    }
81    /// <p>When the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
82    pub fn error(&self) -> ::std::option::Option<&crate::types::ErrorDetail> {
83        self.error.as_ref()
84    }
85    /// <p>Provides information about the number of documents indexed.</p>
86    pub fn index_statistics(&self) -> ::std::option::Option<&crate::types::IndexStatistics> {
87        self.index_statistics.as_ref()
88    }
89}
90impl ::aws_types::request_id::RequestId for GetIndexOutput {
91    fn request_id(&self) -> Option<&str> {
92        self._request_id.as_deref()
93    }
94}
95impl GetIndexOutput {
96    /// Creates a new builder-style object to manufacture [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
97    pub fn builder() -> crate::operation::get_index::builders::GetIndexOutputBuilder {
98        crate::operation::get_index::builders::GetIndexOutputBuilder::default()
99    }
100}
101
102/// A builder for [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
103#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
104#[non_exhaustive]
105pub struct GetIndexOutputBuilder {
106    pub(crate) application_id: ::std::option::Option<::std::string::String>,
107    pub(crate) index_id: ::std::option::Option<::std::string::String>,
108    pub(crate) display_name: ::std::option::Option<::std::string::String>,
109    pub(crate) index_arn: ::std::option::Option<::std::string::String>,
110    pub(crate) status: ::std::option::Option<crate::types::IndexStatus>,
111    pub(crate) r#type: ::std::option::Option<crate::types::IndexType>,
112    pub(crate) description: ::std::option::Option<::std::string::String>,
113    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
114    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
115    pub(crate) capacity_configuration: ::std::option::Option<crate::types::IndexCapacityConfiguration>,
116    pub(crate) document_attribute_configurations: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeConfiguration>>,
117    pub(crate) error: ::std::option::Option<crate::types::ErrorDetail>,
118    pub(crate) index_statistics: ::std::option::Option<crate::types::IndexStatistics>,
119    _request_id: Option<String>,
120}
121impl GetIndexOutputBuilder {
122    /// <p>The identifier of the Amazon Q Business application associated with the index.</p>
123    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.application_id = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The identifier of the Amazon Q Business application associated with the index.</p>
128    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.application_id = input;
130        self
131    }
132    /// <p>The identifier of the Amazon Q Business application associated with the index.</p>
133    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
134        &self.application_id
135    }
136    /// <p>The identifier of the Amazon Q Business index.</p>
137    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.index_id = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The identifier of the Amazon Q Business index.</p>
142    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.index_id = input;
144        self
145    }
146    /// <p>The identifier of the Amazon Q Business index.</p>
147    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
148        &self.index_id
149    }
150    /// <p>The name of the Amazon Q Business index.</p>
151    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        self.display_name = ::std::option::Option::Some(input.into());
153        self
154    }
155    /// <p>The name of the Amazon Q Business index.</p>
156    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.display_name = input;
158        self
159    }
160    /// <p>The name of the Amazon Q Business index.</p>
161    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
162        &self.display_name
163    }
164    /// <p>The Amazon Resource Name (ARN) of the Amazon Q Business index.</p>
165    pub fn index_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
166        self.index_arn = ::std::option::Option::Some(input.into());
167        self
168    }
169    /// <p>The Amazon Resource Name (ARN) of the Amazon Q Business index.</p>
170    pub fn set_index_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.index_arn = input;
172        self
173    }
174    /// <p>The Amazon Resource Name (ARN) of the Amazon Q Business index.</p>
175    pub fn get_index_arn(&self) -> &::std::option::Option<::std::string::String> {
176        &self.index_arn
177    }
178    /// <p>The current status of the index. When the value is <code>ACTIVE</code>, the index is ready for use. If the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
179    pub fn status(mut self, input: crate::types::IndexStatus) -> Self {
180        self.status = ::std::option::Option::Some(input);
181        self
182    }
183    /// <p>The current status of the index. When the value is <code>ACTIVE</code>, the index is ready for use. If the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
184    pub fn set_status(mut self, input: ::std::option::Option<crate::types::IndexStatus>) -> Self {
185        self.status = input;
186        self
187    }
188    /// <p>The current status of the index. When the value is <code>ACTIVE</code>, the index is ready for use. If the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
189    pub fn get_status(&self) -> &::std::option::Option<crate::types::IndexStatus> {
190        &self.status
191    }
192    /// <p>The type of index attached to your Amazon Q Business application.</p>
193    pub fn r#type(mut self, input: crate::types::IndexType) -> Self {
194        self.r#type = ::std::option::Option::Some(input);
195        self
196    }
197    /// <p>The type of index attached to your Amazon Q Business application.</p>
198    pub fn set_type(mut self, input: ::std::option::Option<crate::types::IndexType>) -> Self {
199        self.r#type = input;
200        self
201    }
202    /// <p>The type of index attached to your Amazon Q Business application.</p>
203    pub fn get_type(&self) -> &::std::option::Option<crate::types::IndexType> {
204        &self.r#type
205    }
206    /// <p>The description for the Amazon Q Business index.</p>
207    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.description = ::std::option::Option::Some(input.into());
209        self
210    }
211    /// <p>The description for the Amazon Q Business index.</p>
212    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.description = input;
214        self
215    }
216    /// <p>The description for the Amazon Q Business index.</p>
217    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
218        &self.description
219    }
220    /// <p>The Unix timestamp when the Amazon Q Business index was created.</p>
221    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
222        self.created_at = ::std::option::Option::Some(input);
223        self
224    }
225    /// <p>The Unix timestamp when the Amazon Q Business index was created.</p>
226    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
227        self.created_at = input;
228        self
229    }
230    /// <p>The Unix timestamp when the Amazon Q Business index was created.</p>
231    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
232        &self.created_at
233    }
234    /// <p>The Unix timestamp when the Amazon Q Business index was last updated.</p>
235    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
236        self.updated_at = ::std::option::Option::Some(input);
237        self
238    }
239    /// <p>The Unix timestamp when the Amazon Q Business index was last updated.</p>
240    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
241        self.updated_at = input;
242        self
243    }
244    /// <p>The Unix timestamp when the Amazon Q Business index was last updated.</p>
245    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
246        &self.updated_at
247    }
248    /// <p>The storage capacity units chosen for your Amazon Q Business index.</p>
249    pub fn capacity_configuration(mut self, input: crate::types::IndexCapacityConfiguration) -> Self {
250        self.capacity_configuration = ::std::option::Option::Some(input);
251        self
252    }
253    /// <p>The storage capacity units chosen for your Amazon Q Business index.</p>
254    pub fn set_capacity_configuration(mut self, input: ::std::option::Option<crate::types::IndexCapacityConfiguration>) -> Self {
255        self.capacity_configuration = input;
256        self
257    }
258    /// <p>The storage capacity units chosen for your Amazon Q Business index.</p>
259    pub fn get_capacity_configuration(&self) -> &::std::option::Option<crate::types::IndexCapacityConfiguration> {
260        &self.capacity_configuration
261    }
262    /// Appends an item to `document_attribute_configurations`.
263    ///
264    /// To override the contents of this collection use [`set_document_attribute_configurations`](Self::set_document_attribute_configurations).
265    ///
266    /// <p>Configuration information for document attributes or metadata. Document metadata are fields associated with your documents. For example, the company department name associated with each document. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes">Understanding document attributes</a>.</p>
267    pub fn document_attribute_configurations(mut self, input: crate::types::DocumentAttributeConfiguration) -> Self {
268        let mut v = self.document_attribute_configurations.unwrap_or_default();
269        v.push(input);
270        self.document_attribute_configurations = ::std::option::Option::Some(v);
271        self
272    }
273    /// <p>Configuration information for document attributes or metadata. Document metadata are fields associated with your documents. For example, the company department name associated with each document. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes">Understanding document attributes</a>.</p>
274    pub fn set_document_attribute_configurations(
275        mut self,
276        input: ::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeConfiguration>>,
277    ) -> Self {
278        self.document_attribute_configurations = input;
279        self
280    }
281    /// <p>Configuration information for document attributes or metadata. Document metadata are fields associated with your documents. For example, the company department name associated with each document. For more information, see <a href="https://docs.aws.amazon.com/amazonq/latest/business-use-dg/doc-attributes-types.html#doc-attributes">Understanding document attributes</a>.</p>
282    pub fn get_document_attribute_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DocumentAttributeConfiguration>> {
283        &self.document_attribute_configurations
284    }
285    /// <p>When the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
286    pub fn error(mut self, input: crate::types::ErrorDetail) -> Self {
287        self.error = ::std::option::Option::Some(input);
288        self
289    }
290    /// <p>When the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
291    pub fn set_error(mut self, input: ::std::option::Option<crate::types::ErrorDetail>) -> Self {
292        self.error = input;
293        self
294    }
295    /// <p>When the <code>Status</code> field value is <code>FAILED</code>, the <code>ErrorMessage</code> field contains a message that explains why.</p>
296    pub fn get_error(&self) -> &::std::option::Option<crate::types::ErrorDetail> {
297        &self.error
298    }
299    /// <p>Provides information about the number of documents indexed.</p>
300    pub fn index_statistics(mut self, input: crate::types::IndexStatistics) -> Self {
301        self.index_statistics = ::std::option::Option::Some(input);
302        self
303    }
304    /// <p>Provides information about the number of documents indexed.</p>
305    pub fn set_index_statistics(mut self, input: ::std::option::Option<crate::types::IndexStatistics>) -> Self {
306        self.index_statistics = input;
307        self
308    }
309    /// <p>Provides information about the number of documents indexed.</p>
310    pub fn get_index_statistics(&self) -> &::std::option::Option<crate::types::IndexStatistics> {
311        &self.index_statistics
312    }
313    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
314        self._request_id = Some(request_id.into());
315        self
316    }
317
318    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
319        self._request_id = request_id;
320        self
321    }
322    /// Consumes the builder and constructs a [`GetIndexOutput`](crate::operation::get_index::GetIndexOutput).
323    pub fn build(self) -> crate::operation::get_index::GetIndexOutput {
324        crate::operation::get_index::GetIndexOutput {
325            application_id: self.application_id,
326            index_id: self.index_id,
327            display_name: self.display_name,
328            index_arn: self.index_arn,
329            status: self.status,
330            r#type: self.r#type,
331            description: self.description,
332            created_at: self.created_at,
333            updated_at: self.updated_at,
334            capacity_configuration: self.capacity_configuration,
335            document_attribute_configurations: self.document_attribute_configurations,
336            error: self.error,
337            index_statistics: self.index_statistics,
338            _request_id: self._request_id,
339        }
340    }
341}