aws_sdk_kendra/operation/create_faq/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_faq::_create_faq_output::CreateFaqOutputBuilder;
3
4pub use crate::operation::create_faq::_create_faq_input::CreateFaqInputBuilder;
5
6impl crate::operation::create_faq::builders::CreateFaqInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_faq::CreateFaqOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_faq::CreateFaqError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_faq();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateFaq`.
24///
25/// <p>Creates a set of frequently ask questions (FAQs) using a specified FAQ file stored in an Amazon S3 bucket.</p>
26/// <p>Adding FAQs to an index is an asynchronous operation.</p>
27/// <p>For an example of adding an FAQ to an index using Python and Java SDKs, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html#using-faq-file">Using your FAQ file</a>.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateFaqFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_faq::builders::CreateFaqInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl crate::client::customize::internal::CustomizableSend<crate::operation::create_faq::CreateFaqOutput, crate::operation::create_faq::CreateFaqError>
35    for CreateFaqFluentBuilder
36{
37    fn send(
38        self,
39        config_override: crate::config::Builder,
40    ) -> crate::client::customize::internal::BoxFuture<
41        crate::client::customize::internal::SendResult<crate::operation::create_faq::CreateFaqOutput, crate::operation::create_faq::CreateFaqError>,
42    > {
43        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
44    }
45}
46impl CreateFaqFluentBuilder {
47    /// Creates a new `CreateFaqFluentBuilder`.
48    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
49        Self {
50            handle,
51            inner: ::std::default::Default::default(),
52            config_override: ::std::option::Option::None,
53        }
54    }
55    /// Access the CreateFaq as a reference.
56    pub fn as_input(&self) -> &crate::operation::create_faq::builders::CreateFaqInputBuilder {
57        &self.inner
58    }
59    /// Sends the request and returns the response.
60    ///
61    /// If an error occurs, an `SdkError` will be returned with additional details that
62    /// can be matched against.
63    ///
64    /// By default, any retryable failures will be retried twice. Retry behavior
65    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
66    /// set when configuring the client.
67    pub async fn send(
68        self,
69    ) -> ::std::result::Result<
70        crate::operation::create_faq::CreateFaqOutput,
71        ::aws_smithy_runtime_api::client::result::SdkError<
72            crate::operation::create_faq::CreateFaqError,
73            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
74        >,
75    > {
76        let input = self
77            .inner
78            .build()
79            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
80        let runtime_plugins = crate::operation::create_faq::CreateFaq::operation_runtime_plugins(
81            self.handle.runtime_plugins.clone(),
82            &self.handle.conf,
83            self.config_override,
84        );
85        crate::operation::create_faq::CreateFaq::orchestrate(&runtime_plugins, input).await
86    }
87
88    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
89    pub fn customize(
90        self,
91    ) -> crate::client::customize::CustomizableOperation<
92        crate::operation::create_faq::CreateFaqOutput,
93        crate::operation::create_faq::CreateFaqError,
94        Self,
95    > {
96        crate::client::customize::CustomizableOperation::new(self)
97    }
98    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
99        self.set_config_override(::std::option::Option::Some(config_override.into()));
100        self
101    }
102
103    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
104        self.config_override = config_override;
105        self
106    }
107    /// <p>The identifier of the index for the FAQ.</p>
108    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.inner = self.inner.index_id(input.into());
110        self
111    }
112    /// <p>The identifier of the index for the FAQ.</p>
113    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.inner = self.inner.set_index_id(input);
115        self
116    }
117    /// <p>The identifier of the index for the FAQ.</p>
118    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
119        self.inner.get_index_id()
120    }
121    /// <p>A name for the FAQ.</p>
122    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.name(input.into());
124        self
125    }
126    /// <p>A name for the FAQ.</p>
127    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_name(input);
129        self
130    }
131    /// <p>A name for the FAQ.</p>
132    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
133        self.inner.get_name()
134    }
135    /// <p>A description for the FAQ.</p>
136    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.description(input.into());
138        self
139    }
140    /// <p>A description for the FAQ.</p>
141    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_description(input);
143        self
144    }
145    /// <p>A description for the FAQ.</p>
146    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_description()
148    }
149    /// <p>The path to the FAQ file in S3.</p>
150    pub fn s3_path(mut self, input: crate::types::S3Path) -> Self {
151        self.inner = self.inner.s3_path(input);
152        self
153    }
154    /// <p>The path to the FAQ file in S3.</p>
155    pub fn set_s3_path(mut self, input: ::std::option::Option<crate::types::S3Path>) -> Self {
156        self.inner = self.inner.set_s3_path(input);
157        self
158    }
159    /// <p>The path to the FAQ file in S3.</p>
160    pub fn get_s3_path(&self) -> &::std::option::Option<crate::types::S3Path> {
161        self.inner.get_s3_path()
162    }
163    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
164    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.role_arn(input.into());
166        self
167    }
168    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
169    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_role_arn(input);
171        self
172    }
173    /// <p>The Amazon Resource Name (ARN) of an IAM role with permission to access the S3 bucket that contains the FAQ file. For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/iam-roles.html">IAM access roles for Amazon Kendra</a>.</p>
174    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_role_arn()
176    }
177    ///
178    /// Appends an item to `Tags`.
179    ///
180    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
181    ///
182    /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
183    pub fn tags(mut self, input: crate::types::Tag) -> Self {
184        self.inner = self.inner.tags(input);
185        self
186    }
187    /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
188    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
189        self.inner = self.inner.set_tags(input);
190        self
191    }
192    /// <p>A list of key-value pairs that identify the FAQ. You can use the tags to identify and organize your resources and to control access to resources.</p>
193    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
194        self.inner.get_tags()
195    }
196    /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
197    /// <p>The default format is CSV.</p>
198    /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
199    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
200    pub fn file_format(mut self, input: crate::types::FaqFileFormat) -> Self {
201        self.inner = self.inner.file_format(input);
202        self
203    }
204    /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
205    /// <p>The default format is CSV.</p>
206    /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
207    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
208    pub fn set_file_format(mut self, input: ::std::option::Option<crate::types::FaqFileFormat>) -> Self {
209        self.inner = self.inner.set_file_format(input);
210        self
211    }
212    /// <p>The format of the FAQ input file. You can choose between a basic CSV format, a CSV format that includes customs attributes in a header, and a JSON format that includes custom attributes.</p>
213    /// <p>The default format is CSV.</p>
214    /// <p>The format must match the format of the file stored in the S3 bucket identified in the <code>S3Path</code> parameter.</p>
215    /// <p>For more information, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-creating-faq.html">Adding questions and answers</a>.</p>
216    pub fn get_file_format(&self) -> &::std::option::Option<crate::types::FaqFileFormat> {
217        self.inner.get_file_format()
218    }
219    /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
220    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221        self.inner = self.inner.client_token(input.into());
222        self
223    }
224    /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
225    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226        self.inner = self.inner.set_client_token(input);
227        self
228    }
229    /// <p>A token that you provide to identify the request to create a FAQ. Multiple calls to the <code>CreateFaqRequest</code> API with the same client token will create only one FAQ.</p>
230    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
231        self.inner.get_client_token()
232    }
233    /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
234    pub fn language_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.language_code(input.into());
236        self
237    }
238    /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
239    pub fn set_language_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.inner = self.inner.set_language_code(input);
241        self
242    }
243    /// <p>The code for a language. This allows you to support a language for the FAQ document. English is supported by default. For more information on supported languages, including their codes, see <a href="https://docs.aws.amazon.com/kendra/latest/dg/in-adding-languages.html">Adding documents in languages other than English</a>.</p>
244    pub fn get_language_code(&self) -> &::std::option::Option<::std::string::String> {
245        self.inner.get_language_code()
246    }
247}