aws_sdk_wisdom/operation/query_assistant/
_query_assistant_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)]
5pub struct QueryAssistantInput {
6    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
7    pub assistant_id: ::std::option::Option<::std::string::String>,
8    /// <p>The text to search for.</p>
9    pub query_text: ::std::option::Option<::std::string::String>,
10    /// <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>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    /// <p>The maximum number of results to return per page.</p>
13    pub max_results: ::std::option::Option<i32>,
14}
15impl QueryAssistantInput {
16    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
17    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
18        self.assistant_id.as_deref()
19    }
20    /// <p>The text to search for.</p>
21    pub fn query_text(&self) -> ::std::option::Option<&str> {
22        self.query_text.as_deref()
23    }
24    /// <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>
25    pub fn next_token(&self) -> ::std::option::Option<&str> {
26        self.next_token.as_deref()
27    }
28    /// <p>The maximum number of results to return per page.</p>
29    pub fn max_results(&self) -> ::std::option::Option<i32> {
30        self.max_results
31    }
32}
33impl ::std::fmt::Debug for QueryAssistantInput {
34    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35        let mut formatter = f.debug_struct("QueryAssistantInput");
36        formatter.field("assistant_id", &self.assistant_id);
37        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
38        formatter.field("next_token", &self.next_token);
39        formatter.field("max_results", &self.max_results);
40        formatter.finish()
41    }
42}
43impl QueryAssistantInput {
44    /// Creates a new builder-style object to manufacture [`QueryAssistantInput`](crate::operation::query_assistant::QueryAssistantInput).
45    pub fn builder() -> crate::operation::query_assistant::builders::QueryAssistantInputBuilder {
46        crate::operation::query_assistant::builders::QueryAssistantInputBuilder::default()
47    }
48}
49
50/// A builder for [`QueryAssistantInput`](crate::operation::query_assistant::QueryAssistantInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct QueryAssistantInputBuilder {
54    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
55    pub(crate) query_text: ::std::option::Option<::std::string::String>,
56    pub(crate) next_token: ::std::option::Option<::std::string::String>,
57    pub(crate) max_results: ::std::option::Option<i32>,
58}
59impl QueryAssistantInputBuilder {
60    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
61    /// This field is required.
62    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.assistant_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
67    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.assistant_id = input;
69        self
70    }
71    /// <p>The identifier of the Wisdom assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
72    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.assistant_id
74    }
75    /// <p>The text to search for.</p>
76    /// This field is required.
77    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.query_text = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The text to search for.</p>
82    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.query_text = input;
84        self
85    }
86    /// <p>The text to search for.</p>
87    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
88        &self.query_text
89    }
90    /// <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>
91    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.next_token = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <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>
96    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.next_token = input;
98        self
99    }
100    /// <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>
101    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
102        &self.next_token
103    }
104    /// <p>The maximum number of results to return per page.</p>
105    pub fn max_results(mut self, input: i32) -> Self {
106        self.max_results = ::std::option::Option::Some(input);
107        self
108    }
109    /// <p>The maximum number of results to return per page.</p>
110    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
111        self.max_results = input;
112        self
113    }
114    /// <p>The maximum number of results to return per page.</p>
115    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
116        &self.max_results
117    }
118    /// Consumes the builder and constructs a [`QueryAssistantInput`](crate::operation::query_assistant::QueryAssistantInput).
119    pub fn build(
120        self,
121    ) -> ::std::result::Result<crate::operation::query_assistant::QueryAssistantInput, ::aws_smithy_types::error::operation::BuildError> {
122        ::std::result::Result::Ok(crate::operation::query_assistant::QueryAssistantInput {
123            assistant_id: self.assistant_id,
124            query_text: self.query_text,
125            next_token: self.next_token,
126            max_results: self.max_results,
127        })
128    }
129}
130impl ::std::fmt::Debug for QueryAssistantInputBuilder {
131    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
132        let mut formatter = f.debug_struct("QueryAssistantInputBuilder");
133        formatter.field("assistant_id", &self.assistant_id);
134        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
135        formatter.field("next_token", &self.next_token);
136        formatter.field("max_results", &self.max_results);
137        formatter.finish()
138    }
139}