aws_sdk_qconnect/operation/search_content/
_search_content_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 SearchContentInput {
6    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
7    pub next_token: ::std::option::Option<::std::string::String>,
8    /// <p>The maximum number of results to return per page.</p>
9    pub max_results: ::std::option::Option<i32>,
10    /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
11    pub knowledge_base_id: ::std::option::Option<::std::string::String>,
12    /// <p>The search expression to filter results.</p>
13    pub search_expression: ::std::option::Option<crate::types::SearchExpression>,
14}
15impl SearchContentInput {
16    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
17    pub fn next_token(&self) -> ::std::option::Option<&str> {
18        self.next_token.as_deref()
19    }
20    /// <p>The maximum number of results to return per page.</p>
21    pub fn max_results(&self) -> ::std::option::Option<i32> {
22        self.max_results
23    }
24    /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
25    pub fn knowledge_base_id(&self) -> ::std::option::Option<&str> {
26        self.knowledge_base_id.as_deref()
27    }
28    /// <p>The search expression to filter results.</p>
29    pub fn search_expression(&self) -> ::std::option::Option<&crate::types::SearchExpression> {
30        self.search_expression.as_ref()
31    }
32}
33impl SearchContentInput {
34    /// Creates a new builder-style object to manufacture [`SearchContentInput`](crate::operation::search_content::SearchContentInput).
35    pub fn builder() -> crate::operation::search_content::builders::SearchContentInputBuilder {
36        crate::operation::search_content::builders::SearchContentInputBuilder::default()
37    }
38}
39
40/// A builder for [`SearchContentInput`](crate::operation::search_content::SearchContentInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct SearchContentInputBuilder {
44    pub(crate) next_token: ::std::option::Option<::std::string::String>,
45    pub(crate) max_results: ::std::option::Option<i32>,
46    pub(crate) knowledge_base_id: ::std::option::Option<::std::string::String>,
47    pub(crate) search_expression: ::std::option::Option<crate::types::SearchExpression>,
48}
49impl SearchContentInputBuilder {
50    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
51    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.next_token = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
56    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.next_token = input;
58        self
59    }
60    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
61    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
62        &self.next_token
63    }
64    /// <p>The maximum number of results to return per page.</p>
65    pub fn max_results(mut self, input: i32) -> Self {
66        self.max_results = ::std::option::Option::Some(input);
67        self
68    }
69    /// <p>The maximum number of results to return per page.</p>
70    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
71        self.max_results = input;
72        self
73    }
74    /// <p>The maximum number of results to return per page.</p>
75    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
76        &self.max_results
77    }
78    /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
79    /// This field is required.
80    pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.knowledge_base_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
85    pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.knowledge_base_id = input;
87        self
88    }
89    /// <p>The identifier of the knowledge base. This should not be a QUICK_RESPONSES type knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
90    pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.knowledge_base_id
92    }
93    /// <p>The search expression to filter results.</p>
94    /// This field is required.
95    pub fn search_expression(mut self, input: crate::types::SearchExpression) -> Self {
96        self.search_expression = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The search expression to filter results.</p>
100    pub fn set_search_expression(mut self, input: ::std::option::Option<crate::types::SearchExpression>) -> Self {
101        self.search_expression = input;
102        self
103    }
104    /// <p>The search expression to filter results.</p>
105    pub fn get_search_expression(&self) -> &::std::option::Option<crate::types::SearchExpression> {
106        &self.search_expression
107    }
108    /// Consumes the builder and constructs a [`SearchContentInput`](crate::operation::search_content::SearchContentInput).
109    pub fn build(
110        self,
111    ) -> ::std::result::Result<crate::operation::search_content::SearchContentInput, ::aws_smithy_types::error::operation::BuildError> {
112        ::std::result::Result::Ok(crate::operation::search_content::SearchContentInput {
113            next_token: self.next_token,
114            max_results: self.max_results,
115            knowledge_base_id: self.knowledge_base_id,
116            search_expression: self.search_expression,
117        })
118    }
119}