aws_sdk_qconnect/operation/create_knowledge_base/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_knowledge_base::_create_knowledge_base_output::CreateKnowledgeBaseOutputBuilder;
3
4pub use crate::operation::create_knowledge_base::_create_knowledge_base_input::CreateKnowledgeBaseInputBuilder;
5
6impl crate::operation::create_knowledge_base::builders::CreateKnowledgeBaseInputBuilder {
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_knowledge_base::CreateKnowledgeBaseOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_knowledge_base();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateKnowledgeBase`.
24///
25/// <p>Creates a knowledge base.</p><note>
26/// <p>When using this API, you cannot reuse <a href="https://docs.aws.amazon.com/appintegrations/latest/APIReference/Welcome.html">Amazon AppIntegrations</a> DataIntegrations with external knowledge bases such as Salesforce and ServiceNow. If you do, you'll get an <code>InvalidRequestException</code> error.</p>
27/// <p>For example, you're programmatically managing your external knowledge base, and you want to add or remove one of the fields that is being ingested from Salesforce. Do the following:</p>
28/// <ol>
29/// <li>
30/// <p>Call <a href="https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_DeleteKnowledgeBase.html">DeleteKnowledgeBase</a>.</p></li>
31/// <li>
32/// <p>Call <a href="https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_DeleteDataIntegration.html">DeleteDataIntegration</a>.</p></li>
33/// <li>
34/// <p>Call <a href="https://docs.aws.amazon.com/appintegrations/latest/APIReference/API_CreateDataIntegration.html">CreateDataIntegration</a> to recreate the DataIntegration or a create different one.</p></li>
35/// <li>
36/// <p>Call CreateKnowledgeBase.</p></li>
37/// </ol>
38/// </note>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct CreateKnowledgeBaseFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::create_knowledge_base::builders::CreateKnowledgeBaseInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
48        crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
49    > for CreateKnowledgeBaseFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
57            crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl CreateKnowledgeBaseFluentBuilder {
64    /// Creates a new `CreateKnowledgeBaseFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the CreateKnowledgeBase as a reference.
73    pub fn as_input(&self) -> &crate::operation::create_knowledge_base::builders::CreateKnowledgeBaseInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::create_knowledge_base::CreateKnowledgeBase::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::create_knowledge_base::CreateKnowledgeBase::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
110        crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
125    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.client_token(input.into());
127        self
128    }
129    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
130    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_client_token(input);
132        self
133    }
134    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="http://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
135    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_client_token()
137    }
138    /// <p>The name of the knowledge base.</p>
139    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.name(input.into());
141        self
142    }
143    /// <p>The name of the knowledge base.</p>
144    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_name(input);
146        self
147    }
148    /// <p>The name of the knowledge base.</p>
149    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_name()
151    }
152    /// <p>The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content. EXTERNAL knowledge bases support integrations with third-party systems whose content is synchronized automatically.</p>
153    pub fn knowledge_base_type(mut self, input: crate::types::KnowledgeBaseType) -> Self {
154        self.inner = self.inner.knowledge_base_type(input);
155        self
156    }
157    /// <p>The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content. EXTERNAL knowledge bases support integrations with third-party systems whose content is synchronized automatically.</p>
158    pub fn set_knowledge_base_type(mut self, input: ::std::option::Option<crate::types::KnowledgeBaseType>) -> Self {
159        self.inner = self.inner.set_knowledge_base_type(input);
160        self
161    }
162    /// <p>The type of knowledge base. Only CUSTOM knowledge bases allow you to upload your own content. EXTERNAL knowledge bases support integrations with third-party systems whose content is synchronized automatically.</p>
163    pub fn get_knowledge_base_type(&self) -> &::std::option::Option<crate::types::KnowledgeBaseType> {
164        self.inner.get_knowledge_base_type()
165    }
166    /// <p>The source of the knowledge base content. Only set this argument for EXTERNAL or Managed knowledge bases.</p>
167    pub fn source_configuration(mut self, input: crate::types::SourceConfiguration) -> Self {
168        self.inner = self.inner.source_configuration(input);
169        self
170    }
171    /// <p>The source of the knowledge base content. Only set this argument for EXTERNAL or Managed knowledge bases.</p>
172    pub fn set_source_configuration(mut self, input: ::std::option::Option<crate::types::SourceConfiguration>) -> Self {
173        self.inner = self.inner.set_source_configuration(input);
174        self
175    }
176    /// <p>The source of the knowledge base content. Only set this argument for EXTERNAL or Managed knowledge bases.</p>
177    pub fn get_source_configuration(&self) -> &::std::option::Option<crate::types::SourceConfiguration> {
178        self.inner.get_source_configuration()
179    }
180    /// <p>Information about how to render the content.</p>
181    pub fn rendering_configuration(mut self, input: crate::types::RenderingConfiguration) -> Self {
182        self.inner = self.inner.rendering_configuration(input);
183        self
184    }
185    /// <p>Information about how to render the content.</p>
186    pub fn set_rendering_configuration(mut self, input: ::std::option::Option<crate::types::RenderingConfiguration>) -> Self {
187        self.inner = self.inner.set_rendering_configuration(input);
188        self
189    }
190    /// <p>Information about how to render the content.</p>
191    pub fn get_rendering_configuration(&self) -> &::std::option::Option<crate::types::RenderingConfiguration> {
192        self.inner.get_rendering_configuration()
193    }
194    /// <p>Contains details about how to ingest the documents in a data source.</p>
195    pub fn vector_ingestion_configuration(mut self, input: crate::types::VectorIngestionConfiguration) -> Self {
196        self.inner = self.inner.vector_ingestion_configuration(input);
197        self
198    }
199    /// <p>Contains details about how to ingest the documents in a data source.</p>
200    pub fn set_vector_ingestion_configuration(mut self, input: ::std::option::Option<crate::types::VectorIngestionConfiguration>) -> Self {
201        self.inner = self.inner.set_vector_ingestion_configuration(input);
202        self
203    }
204    /// <p>Contains details about how to ingest the documents in a data source.</p>
205    pub fn get_vector_ingestion_configuration(&self) -> &::std::option::Option<crate::types::VectorIngestionConfiguration> {
206        self.inner.get_vector_ingestion_configuration()
207    }
208    /// <p>The configuration information for the customer managed key used for encryption.</p>
209    /// <p>This KMS key must have a policy that allows <code>kms:CreateGrant</code>, <code>kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect.</p>
210    /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
211    pub fn server_side_encryption_configuration(mut self, input: crate::types::ServerSideEncryptionConfiguration) -> Self {
212        self.inner = self.inner.server_side_encryption_configuration(input);
213        self
214    }
215    /// <p>The configuration information for the customer managed key used for encryption.</p>
216    /// <p>This KMS key must have a policy that allows <code>kms:CreateGrant</code>, <code>kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect.</p>
217    /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
218    pub fn set_server_side_encryption_configuration(mut self, input: ::std::option::Option<crate::types::ServerSideEncryptionConfiguration>) -> Self {
219        self.inner = self.inner.set_server_side_encryption_configuration(input);
220        self
221    }
222    /// <p>The configuration information for the customer managed key used for encryption.</p>
223    /// <p>This KMS key must have a policy that allows <code>kms:CreateGrant</code>, <code>kms:DescribeKey</code>, <code>kms:Decrypt</code>, and <code>kms:GenerateDataKey*</code> permissions to the IAM identity using the key to invoke Amazon Q in Connect.</p>
224    /// <p>For more information about setting up a customer managed key for Amazon Q in Connect, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/enable-q.html">Enable Amazon Q in Connect for your instance</a>.</p>
225    pub fn get_server_side_encryption_configuration(&self) -> &::std::option::Option<crate::types::ServerSideEncryptionConfiguration> {
226        self.inner.get_server_side_encryption_configuration()
227    }
228    /// <p>The description.</p>
229    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.inner = self.inner.description(input.into());
231        self
232    }
233    /// <p>The description.</p>
234    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.inner = self.inner.set_description(input);
236        self
237    }
238    /// <p>The description.</p>
239    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
240        self.inner.get_description()
241    }
242    ///
243    /// Adds a key-value pair to `tags`.
244    ///
245    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
246    ///
247    /// <p>The tags used to organize, track, or control access for this resource.</p>
248    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
249        self.inner = self.inner.tags(k.into(), v.into());
250        self
251    }
252    /// <p>The tags used to organize, track, or control access for this resource.</p>
253    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
254        self.inner = self.inner.set_tags(input);
255        self
256    }
257    /// <p>The tags used to organize, track, or control access for this resource.</p>
258    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
259        self.inner.get_tags()
260    }
261}