aws_sdk_iot/operation/search_index/
_search_index_input.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 SearchIndexInput {
6    /// <p>The search index name.</p>
7    pub index_name: ::std::option::Option<::std::string::String>,
8    /// <p>The search query string. For more information about the search query syntax, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query syntax</a>.</p>
9    pub query_string: ::std::option::Option<::std::string::String>,
10    /// <p>The token used to get the next set of results, or <code>null</code> if there are no additional results.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    /// <p>The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_SearchIndex.html#iot-SearchIndex-request-nextToken"> <code>nextToken</code> </a> to retrieve the next set of results until <code>nextToken</code> returns <code>NULL</code>.</p>
13    pub max_results: ::std::option::Option<i32>,
14    /// <p>The query version.</p>
15    pub query_version: ::std::option::Option<::std::string::String>,
16}
17impl SearchIndexInput {
18    /// <p>The search index name.</p>
19    pub fn index_name(&self) -> ::std::option::Option<&str> {
20        self.index_name.as_deref()
21    }
22    /// <p>The search query string. For more information about the search query syntax, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query syntax</a>.</p>
23    pub fn query_string(&self) -> ::std::option::Option<&str> {
24        self.query_string.as_deref()
25    }
26    /// <p>The token used to get the next set of results, or <code>null</code> if there are no additional results.</p>
27    pub fn next_token(&self) -> ::std::option::Option<&str> {
28        self.next_token.as_deref()
29    }
30    /// <p>The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_SearchIndex.html#iot-SearchIndex-request-nextToken"> <code>nextToken</code> </a> to retrieve the next set of results until <code>nextToken</code> returns <code>NULL</code>.</p>
31    pub fn max_results(&self) -> ::std::option::Option<i32> {
32        self.max_results
33    }
34    /// <p>The query version.</p>
35    pub fn query_version(&self) -> ::std::option::Option<&str> {
36        self.query_version.as_deref()
37    }
38}
39impl SearchIndexInput {
40    /// Creates a new builder-style object to manufacture [`SearchIndexInput`](crate::operation::search_index::SearchIndexInput).
41    pub fn builder() -> crate::operation::search_index::builders::SearchIndexInputBuilder {
42        crate::operation::search_index::builders::SearchIndexInputBuilder::default()
43    }
44}
45
46/// A builder for [`SearchIndexInput`](crate::operation::search_index::SearchIndexInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct SearchIndexInputBuilder {
50    pub(crate) index_name: ::std::option::Option<::std::string::String>,
51    pub(crate) query_string: ::std::option::Option<::std::string::String>,
52    pub(crate) next_token: ::std::option::Option<::std::string::String>,
53    pub(crate) max_results: ::std::option::Option<i32>,
54    pub(crate) query_version: ::std::option::Option<::std::string::String>,
55}
56impl SearchIndexInputBuilder {
57    /// <p>The search index name.</p>
58    pub fn index_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.index_name = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The search index name.</p>
63    pub fn set_index_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.index_name = input;
65        self
66    }
67    /// <p>The search index name.</p>
68    pub fn get_index_name(&self) -> &::std::option::Option<::std::string::String> {
69        &self.index_name
70    }
71    /// <p>The search query string. For more information about the search query syntax, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query syntax</a>.</p>
72    /// This field is required.
73    pub fn query_string(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.query_string = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The search query string. For more information about the search query syntax, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query syntax</a>.</p>
78    pub fn set_query_string(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.query_string = input;
80        self
81    }
82    /// <p>The search query string. For more information about the search query syntax, see <a href="https://docs.aws.amazon.com/iot/latest/developerguide/query-syntax.html">Query syntax</a>.</p>
83    pub fn get_query_string(&self) -> &::std::option::Option<::std::string::String> {
84        &self.query_string
85    }
86    /// <p>The token used to get the next set of results, or <code>null</code> if there are no additional results.</p>
87    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.next_token = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The token used to get the next set of results, or <code>null</code> if there are no additional results.</p>
92    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.next_token = input;
94        self
95    }
96    /// <p>The token used to get the next set of results, or <code>null</code> if there are no additional results.</p>
97    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
98        &self.next_token
99    }
100    /// <p>The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_SearchIndex.html#iot-SearchIndex-request-nextToken"> <code>nextToken</code> </a> to retrieve the next set of results until <code>nextToken</code> returns <code>NULL</code>.</p>
101    pub fn max_results(mut self, input: i32) -> Self {
102        self.max_results = ::std::option::Option::Some(input);
103        self
104    }
105    /// <p>The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_SearchIndex.html#iot-SearchIndex-request-nextToken"> <code>nextToken</code> </a> to retrieve the next set of results until <code>nextToken</code> returns <code>NULL</code>.</p>
106    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
107        self.max_results = input;
108        self
109    }
110    /// <p>The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use <a href="https://docs.aws.amazon.com/iot/latest/apireference/API_SearchIndex.html#iot-SearchIndex-request-nextToken"> <code>nextToken</code> </a> to retrieve the next set of results until <code>nextToken</code> returns <code>NULL</code>.</p>
111    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
112        &self.max_results
113    }
114    /// <p>The query version.</p>
115    pub fn query_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.query_version = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The query version.</p>
120    pub fn set_query_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.query_version = input;
122        self
123    }
124    /// <p>The query version.</p>
125    pub fn get_query_version(&self) -> &::std::option::Option<::std::string::String> {
126        &self.query_version
127    }
128    /// Consumes the builder and constructs a [`SearchIndexInput`](crate::operation::search_index::SearchIndexInput).
129    pub fn build(self) -> ::std::result::Result<crate::operation::search_index::SearchIndexInput, ::aws_smithy_types::error::operation::BuildError> {
130        ::std::result::Result::Ok(crate::operation::search_index::SearchIndexInput {
131            index_name: self.index_name,
132            query_string: self.query_string,
133            next_token: self.next_token,
134            max_results: self.max_results,
135            query_version: self.query_version,
136        })
137    }
138}