aws-sdk-quicksight 1.145.0

AWS SDK for Amazon QuickSight
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_knowledge_base::_create_knowledge_base_input::CreateKnowledgeBaseInputBuilder;

pub use crate::operation::create_knowledge_base::_create_knowledge_base_output::CreateKnowledgeBaseOutputBuilder;

impl crate::operation::create_knowledge_base::builders::CreateKnowledgeBaseInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_knowledge_base();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateKnowledgeBase`.
///
/// <p>Creates a knowledge base from a specified data source. Supported data source connector types include:</p>
/// <ul>
/// <li>
/// <p><code>S3_KNOWLEDGE_BASE</code> – Uses an Amazon S3 bucket as the data source.</p></li>
/// <li>
/// <p><code>WEB_CRAWLER</code> – Uses web pages indexed by the built-in web crawler as the data source.</p></li>
/// <li>
/// <p><code>GOOGLE_DRIVE</code> – Uses Google Drive as the data source. Supports service account authentication only.</p></li>
/// <li>
/// <p><code>SHAREPOINT</code> – Uses SharePoint as the data source. Supports two-legged OAuth only.</p></li>
/// <li>
/// <p><code>ONE_DRIVE</code> – Uses OneDrive as the data source. Supports two-legged OAuth only.</p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateKnowledgeBaseFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_knowledge_base::builders::CreateKnowledgeBaseInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
        crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
    > for CreateKnowledgeBaseFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
            crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateKnowledgeBaseFluentBuilder {
    /// Creates a new `CreateKnowledgeBaseFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateKnowledgeBase as a reference.
    pub fn as_input(&self) -> &crate::operation::create_knowledge_base::builders::CreateKnowledgeBaseInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_knowledge_base::CreateKnowledgeBase::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_knowledge_base::CreateKnowledgeBase::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_knowledge_base::CreateKnowledgeBaseOutput,
        crate::operation::create_knowledge_base::CreateKnowledgeBaseError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The ID of the Amazon Web Services account that contains the knowledge base.</p>
    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.aws_account_id(input.into());
        self
    }
    /// <p>The ID of the Amazon Web Services account that contains the knowledge base.</p>
    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_aws_account_id(input);
        self
    }
    /// <p>The ID of the Amazon Web Services account that contains the knowledge base.</p>
    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_aws_account_id()
    }
    /// <p>The unique identifier for the knowledge base.</p>
    pub fn knowledge_base_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.knowledge_base_id(input.into());
        self
    }
    /// <p>The unique identifier for the knowledge base.</p>
    pub fn set_knowledge_base_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_knowledge_base_id(input);
        self
    }
    /// <p>The unique identifier for the knowledge base.</p>
    pub fn get_knowledge_base_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_knowledge_base_id()
    }
    /// <p>The name of the knowledge base.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.name(input.into());
        self
    }
    /// <p>The name of the knowledge base.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_name(input);
        self
    }
    /// <p>The name of the knowledge base.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The Amazon Resource Name (ARN) of the data source for the knowledge base.</p>
    pub fn data_source_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.data_source_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the data source for the knowledge base.</p>
    pub fn set_data_source_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_data_source_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the data source for the knowledge base.</p>
    pub fn get_data_source_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_data_source_arn()
    }
    /// <p>The configuration settings for a knowledge base.</p>
    pub fn knowledge_base_configuration(mut self, input: crate::types::KnowledgeBaseConfiguration) -> Self {
        self.inner = self.inner.knowledge_base_configuration(input);
        self
    }
    /// <p>The configuration settings for a knowledge base.</p>
    pub fn set_knowledge_base_configuration(mut self, input: ::std::option::Option<crate::types::KnowledgeBaseConfiguration>) -> Self {
        self.inner = self.inner.set_knowledge_base_configuration(input);
        self
    }
    /// <p>The configuration settings for a knowledge base.</p>
    pub fn get_knowledge_base_configuration(&self) -> &::std::option::Option<crate::types::KnowledgeBaseConfiguration> {
        self.inner.get_knowledge_base_configuration()
    }
    /// <p>A description for the knowledge base. If you don't specify a description, the knowledge base is created without one.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A description for the knowledge base. If you don't specify a description, the knowledge base is created without one.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A description for the knowledge base. If you don't specify a description, the knowledge base is created without one.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    ///
    /// Appends an item to `Permissions`.
    ///
    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
    ///
    /// <p>A list of resource permissions on the knowledge base. Each entry grants a specified Amazon QuickSight principal either owner or viewer access. If you don't specify permissions, only the primary owner (if provided) receives owner access.</p>
    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
        self.inner = self.inner.permissions(input);
        self
    }
    /// <p>A list of resource permissions on the knowledge base. Each entry grants a specified Amazon QuickSight principal either owner or viewer access. If you don't specify permissions, only the primary owner (if provided) receives owner access.</p>
    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
        self.inner = self.inner.set_permissions(input);
        self
    }
    /// <p>A list of resource permissions on the knowledge base. Each entry grants a specified Amazon QuickSight principal either owner or viewer access. If you don't specify permissions, only the primary owner (if provided) receives owner access.</p>
    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
        self.inner.get_permissions()
    }
    /// <p>The configuration for media extraction from knowledge base documents.</p>
    pub fn media_extraction_configuration(mut self, input: crate::types::MediaExtractionConfiguration) -> Self {
        self.inner = self.inner.media_extraction_configuration(input);
        self
    }
    /// <p>The configuration for media extraction from knowledge base documents.</p>
    pub fn set_media_extraction_configuration(mut self, input: ::std::option::Option<crate::types::MediaExtractionConfiguration>) -> Self {
        self.inner = self.inner.set_media_extraction_configuration(input);
        self
    }
    /// <p>The configuration for media extraction from knowledge base documents.</p>
    pub fn get_media_extraction_configuration(&self) -> &::std::option::Option<crate::types::MediaExtractionConfiguration> {
        self.inner.get_media_extraction_configuration()
    }
    /// <p>The access control configuration for the knowledge base. If you don't specify this parameter, document-level ACLs are disabled.</p>
    pub fn access_control_configuration(mut self, input: crate::types::AccessControlConfiguration) -> Self {
        self.inner = self.inner.access_control_configuration(input);
        self
    }
    /// <p>The access control configuration for the knowledge base. If you don't specify this parameter, document-level ACLs are disabled.</p>
    pub fn set_access_control_configuration(mut self, input: ::std::option::Option<crate::types::AccessControlConfiguration>) -> Self {
        self.inner = self.inner.set_access_control_configuration(input);
        self
    }
    /// <p>The access control configuration for the knowledge base. If you don't specify this parameter, document-level ACLs are disabled.</p>
    pub fn get_access_control_configuration(&self) -> &::std::option::Option<crate::types::AccessControlConfiguration> {
        self.inner.get_access_control_configuration()
    }
    /// <p>The Amazon Resource Name (ARN) of the primary owner for the knowledge base. The specified user is always granted owner access, regardless of what is specified in the <code>Permissions</code> field. If you don't specify a primary owner, the knowledge base is created without one.</p>
    pub fn primary_owner_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.primary_owner_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the primary owner for the knowledge base. The specified user is always granted owner access, regardless of what is specified in the <code>Permissions</code> field. If you don't specify a primary owner, the knowledge base is created without one.</p>
    pub fn set_primary_owner_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_primary_owner_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the primary owner for the knowledge base. The specified user is always granted owner access, regardless of what is specified in the <code>Permissions</code> field. If you don't specify a primary owner, the knowledge base is created without one.</p>
    pub fn get_primary_owner_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_primary_owner_arn()
    }
    ///
    /// Appends an item to `Tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to assign to the knowledge base. If you don't specify tags, the knowledge base is created without tags.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        self.inner = self.inner.tags(input);
        self
    }
    /// <p>The tags to assign to the knowledge base. If you don't specify tags, the knowledge base is created without tags.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.inner = self.inner.set_tags(input);
        self
    }
    /// <p>The tags to assign to the knowledge base. If you don't specify tags, the knowledge base is created without tags.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        self.inner.get_tags()
    }
}