Skip to main content

aws_sdk_kendra/types/
_featured_results_set.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A set of featured results that are displayed at the top of your search results. Featured results are placed above all other results for certain queries. If there's an exact match of a query, then one or more specific documents are featured in the search results.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct FeaturedResultsSet {
7    /// <p>The identifier of the set of featured results.</p>
8    pub featured_results_set_id: ::std::option::Option<::std::string::String>,
9    /// <p>The name for the set of featured results.</p>
10    pub featured_results_set_name: ::std::option::Option<::std::string::String>,
11    /// <p>The description for the set of featured results.</p>
12    pub description: ::std::option::Option<::std::string::String>,
13    /// <p>The current status of the set of featured results. When the value is <code>ACTIVE</code>, featured results are ready for use. You can still configure your settings before setting the status to <code>ACTIVE</code>. You can set the status to <code>ACTIVE</code> or <code>INACTIVE</code> using the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html">UpdateFeaturedResultsSet</a> API. The queries you specify for featured results must be unique per featured results set for each index, whether the status is <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
14    pub status: ::std::option::Option<crate::types::FeaturedResultsSetStatus>,
15    /// <p>The list of queries for featuring results.</p>
16    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
17    pub query_texts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18    /// <p>The list of document IDs for the documents you want to feature at the top of the search results page. You can use the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html">Query</a> API to search for specific documents with their document IDs included in the result items, or you can use the console.</p>
19    /// <p>You can add up to four featured documents. You can request to increase this limit by contacting <a href="http://aws.amazon.com/contact-us/">Support</a>.</p>
20    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
21    pub featured_documents: ::std::option::Option<::std::vec::Vec<crate::types::FeaturedDocument>>,
22    /// <p>The Unix timestamp when the set of featured results was last updated.</p>
23    pub last_updated_timestamp: ::std::option::Option<i64>,
24    /// <p>The Unix timestamp when the set of featured results was created.</p>
25    pub creation_timestamp: ::std::option::Option<i64>,
26}
27impl FeaturedResultsSet {
28    /// <p>The identifier of the set of featured results.</p>
29    pub fn featured_results_set_id(&self) -> ::std::option::Option<&str> {
30        self.featured_results_set_id.as_deref()
31    }
32    /// <p>The name for the set of featured results.</p>
33    pub fn featured_results_set_name(&self) -> ::std::option::Option<&str> {
34        self.featured_results_set_name.as_deref()
35    }
36    /// <p>The description for the set of featured results.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>The current status of the set of featured results. When the value is <code>ACTIVE</code>, featured results are ready for use. You can still configure your settings before setting the status to <code>ACTIVE</code>. You can set the status to <code>ACTIVE</code> or <code>INACTIVE</code> using the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html">UpdateFeaturedResultsSet</a> API. The queries you specify for featured results must be unique per featured results set for each index, whether the status is <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
41    pub fn status(&self) -> ::std::option::Option<&crate::types::FeaturedResultsSetStatus> {
42        self.status.as_ref()
43    }
44    /// <p>The list of queries for featuring results.</p>
45    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
46    ///
47    /// 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_texts.is_none()`.
48    pub fn query_texts(&self) -> &[::std::string::String] {
49        self.query_texts.as_deref().unwrap_or_default()
50    }
51    /// <p>The list of document IDs for the documents you want to feature at the top of the search results page. You can use the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html">Query</a> API to search for specific documents with their document IDs included in the result items, or you can use the console.</p>
52    /// <p>You can add up to four featured documents. You can request to increase this limit by contacting <a href="http://aws.amazon.com/contact-us/">Support</a>.</p>
53    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
54    ///
55    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.featured_documents.is_none()`.
56    pub fn featured_documents(&self) -> &[crate::types::FeaturedDocument] {
57        self.featured_documents.as_deref().unwrap_or_default()
58    }
59    /// <p>The Unix timestamp when the set of featured results was last updated.</p>
60    pub fn last_updated_timestamp(&self) -> ::std::option::Option<i64> {
61        self.last_updated_timestamp
62    }
63    /// <p>The Unix timestamp when the set of featured results was created.</p>
64    pub fn creation_timestamp(&self) -> ::std::option::Option<i64> {
65        self.creation_timestamp
66    }
67}
68impl FeaturedResultsSet {
69    /// Creates a new builder-style object to manufacture [`FeaturedResultsSet`](crate::types::FeaturedResultsSet).
70    pub fn builder() -> crate::types::builders::FeaturedResultsSetBuilder {
71        crate::types::builders::FeaturedResultsSetBuilder::default()
72    }
73}
74
75/// A builder for [`FeaturedResultsSet`](crate::types::FeaturedResultsSet).
76#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
77#[non_exhaustive]
78pub struct FeaturedResultsSetBuilder {
79    pub(crate) featured_results_set_id: ::std::option::Option<::std::string::String>,
80    pub(crate) featured_results_set_name: ::std::option::Option<::std::string::String>,
81    pub(crate) description: ::std::option::Option<::std::string::String>,
82    pub(crate) status: ::std::option::Option<crate::types::FeaturedResultsSetStatus>,
83    pub(crate) query_texts: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
84    pub(crate) featured_documents: ::std::option::Option<::std::vec::Vec<crate::types::FeaturedDocument>>,
85    pub(crate) last_updated_timestamp: ::std::option::Option<i64>,
86    pub(crate) creation_timestamp: ::std::option::Option<i64>,
87}
88impl FeaturedResultsSetBuilder {
89    /// <p>The identifier of the set of featured results.</p>
90    pub fn featured_results_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.featured_results_set_id = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The identifier of the set of featured results.</p>
95    pub fn set_featured_results_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.featured_results_set_id = input;
97        self
98    }
99    /// <p>The identifier of the set of featured results.</p>
100    pub fn get_featured_results_set_id(&self) -> &::std::option::Option<::std::string::String> {
101        &self.featured_results_set_id
102    }
103    /// <p>The name for the set of featured results.</p>
104    pub fn featured_results_set_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.featured_results_set_name = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The name for the set of featured results.</p>
109    pub fn set_featured_results_set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.featured_results_set_name = input;
111        self
112    }
113    /// <p>The name for the set of featured results.</p>
114    pub fn get_featured_results_set_name(&self) -> &::std::option::Option<::std::string::String> {
115        &self.featured_results_set_name
116    }
117    /// <p>The description for the set of featured results.</p>
118    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.description = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The description for the set of featured results.</p>
123    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.description = input;
125        self
126    }
127    /// <p>The description for the set of featured results.</p>
128    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
129        &self.description
130    }
131    /// <p>The current status of the set of featured results. When the value is <code>ACTIVE</code>, featured results are ready for use. You can still configure your settings before setting the status to <code>ACTIVE</code>. You can set the status to <code>ACTIVE</code> or <code>INACTIVE</code> using the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html">UpdateFeaturedResultsSet</a> API. The queries you specify for featured results must be unique per featured results set for each index, whether the status is <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
132    pub fn status(mut self, input: crate::types::FeaturedResultsSetStatus) -> Self {
133        self.status = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>The current status of the set of featured results. When the value is <code>ACTIVE</code>, featured results are ready for use. You can still configure your settings before setting the status to <code>ACTIVE</code>. You can set the status to <code>ACTIVE</code> or <code>INACTIVE</code> using the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html">UpdateFeaturedResultsSet</a> API. The queries you specify for featured results must be unique per featured results set for each index, whether the status is <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
137    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FeaturedResultsSetStatus>) -> Self {
138        self.status = input;
139        self
140    }
141    /// <p>The current status of the set of featured results. When the value is <code>ACTIVE</code>, featured results are ready for use. You can still configure your settings before setting the status to <code>ACTIVE</code>. You can set the status to <code>ACTIVE</code> or <code>INACTIVE</code> using the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_UpdateFeaturedResultsSet.html">UpdateFeaturedResultsSet</a> API. The queries you specify for featured results must be unique per featured results set for each index, whether the status is <code>ACTIVE</code> or <code>INACTIVE</code>.</p>
142    pub fn get_status(&self) -> &::std::option::Option<crate::types::FeaturedResultsSetStatus> {
143        &self.status
144    }
145    /// Appends an item to `query_texts`.
146    ///
147    /// To override the contents of this collection use [`set_query_texts`](Self::set_query_texts).
148    ///
149    /// <p>The list of queries for featuring results.</p>
150    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
151    pub fn query_texts(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152        let mut v = self.query_texts.unwrap_or_default();
153        v.push(input.into());
154        self.query_texts = ::std::option::Option::Some(v);
155        self
156    }
157    /// <p>The list of queries for featuring results.</p>
158    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
159    pub fn set_query_texts(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
160        self.query_texts = input;
161        self
162    }
163    /// <p>The list of queries for featuring results.</p>
164    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
165    pub fn get_query_texts(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
166        &self.query_texts
167    }
168    /// Appends an item to `featured_documents`.
169    ///
170    /// To override the contents of this collection use [`set_featured_documents`](Self::set_featured_documents).
171    ///
172    /// <p>The list of document IDs for the documents you want to feature at the top of the search results page. You can use the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html">Query</a> API to search for specific documents with their document IDs included in the result items, or you can use the console.</p>
173    /// <p>You can add up to four featured documents. You can request to increase this limit by contacting <a href="http://aws.amazon.com/contact-us/">Support</a>.</p>
174    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
175    pub fn featured_documents(mut self, input: crate::types::FeaturedDocument) -> Self {
176        let mut v = self.featured_documents.unwrap_or_default();
177        v.push(input);
178        self.featured_documents = ::std::option::Option::Some(v);
179        self
180    }
181    /// <p>The list of document IDs for the documents you want to feature at the top of the search results page. You can use the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html">Query</a> API to search for specific documents with their document IDs included in the result items, or you can use the console.</p>
182    /// <p>You can add up to four featured documents. You can request to increase this limit by contacting <a href="http://aws.amazon.com/contact-us/">Support</a>.</p>
183    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
184    pub fn set_featured_documents(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FeaturedDocument>>) -> Self {
185        self.featured_documents = input;
186        self
187    }
188    /// <p>The list of document IDs for the documents you want to feature at the top of the search results page. You can use the <a href="https://docs.aws.amazon.com/kendra/latest/dg/API_Query.html">Query</a> API to search for specific documents with their document IDs included in the result items, or you can use the console.</p>
189    /// <p>You can add up to four featured documents. You can request to increase this limit by contacting <a href="http://aws.amazon.com/contact-us/">Support</a>.</p>
190    /// <p>Specific queries are mapped to specific documents for featuring in the results. If a query contains an exact match, then one or more specific documents are featured in the results. The exact match applies to the full query. For example, if you only specify 'Kendra', queries such as 'How does kendra semantically rank results?' will not render the featured results. Featured results are designed for specific queries, rather than queries that are too broad in scope.</p>
191    pub fn get_featured_documents(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FeaturedDocument>> {
192        &self.featured_documents
193    }
194    /// <p>The Unix timestamp when the set of featured results was last updated.</p>
195    pub fn last_updated_timestamp(mut self, input: i64) -> Self {
196        self.last_updated_timestamp = ::std::option::Option::Some(input);
197        self
198    }
199    /// <p>The Unix timestamp when the set of featured results was last updated.</p>
200    pub fn set_last_updated_timestamp(mut self, input: ::std::option::Option<i64>) -> Self {
201        self.last_updated_timestamp = input;
202        self
203    }
204    /// <p>The Unix timestamp when the set of featured results was last updated.</p>
205    pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<i64> {
206        &self.last_updated_timestamp
207    }
208    /// <p>The Unix timestamp when the set of featured results was created.</p>
209    pub fn creation_timestamp(mut self, input: i64) -> Self {
210        self.creation_timestamp = ::std::option::Option::Some(input);
211        self
212    }
213    /// <p>The Unix timestamp when the set of featured results was created.</p>
214    pub fn set_creation_timestamp(mut self, input: ::std::option::Option<i64>) -> Self {
215        self.creation_timestamp = input;
216        self
217    }
218    /// <p>The Unix timestamp when the set of featured results was created.</p>
219    pub fn get_creation_timestamp(&self) -> &::std::option::Option<i64> {
220        &self.creation_timestamp
221    }
222    /// Consumes the builder and constructs a [`FeaturedResultsSet`](crate::types::FeaturedResultsSet).
223    pub fn build(self) -> crate::types::FeaturedResultsSet {
224        crate::types::FeaturedResultsSet {
225            featured_results_set_id: self.featured_results_set_id,
226            featured_results_set_name: self.featured_results_set_name,
227            description: self.description,
228            status: self.status,
229            query_texts: self.query_texts,
230            featured_documents: self.featured_documents,
231            last_updated_timestamp: self.last_updated_timestamp,
232            creation_timestamp: self.creation_timestamp,
233        }
234    }
235}