aws-sdk-context 1.0.0

AWS SDK for AWS Context
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::delete_connection::_delete_connection_input::DeleteConnectionInputBuilder;

pub use crate::operation::delete_connection::_delete_connection_output::DeleteConnectionOutputBuilder;

impl crate::operation::delete_connection::builders::DeleteConnectionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::delete_connection::DeleteConnectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::delete_connection::DeleteConnectionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.delete_connection();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `DeleteConnection`.
///
/// <p>Deletes a connection. While any agent context still uses the connection, the request fails with <code>ConflictException</code>. Remove the connection from each agent context with UpdateAgentContext, and wait until AWS Context has removed the connection's data from the agent context, before you retry. For a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> connection, <code>deletionMode</code> specifies whether AWS Context also deletes the AWS Glue connection. If the connection stays <code>DELETING</code>, call DeleteConnection again to finish the cleanup. Deleting a connection that doesn't exist or is already being deleted succeeds, so you can safely retry.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DeleteConnectionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::delete_connection::builders::DeleteConnectionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::delete_connection::DeleteConnectionOutput,
        crate::operation::delete_connection::DeleteConnectionError,
    > for DeleteConnectionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::delete_connection::DeleteConnectionOutput,
            crate::operation::delete_connection::DeleteConnectionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl DeleteConnectionFluentBuilder {
    /// Creates a new `DeleteConnectionFluentBuilder`.
    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 DeleteConnection as a reference.
    pub fn as_input(&self) -> &crate::operation::delete_connection::builders::DeleteConnectionInputBuilder {
        &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::delete_connection::DeleteConnectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::delete_connection::DeleteConnectionError,
            ::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::delete_connection::DeleteConnection::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::delete_connection::DeleteConnection::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::delete_connection::DeleteConnectionOutput,
        crate::operation::delete_connection::DeleteConnectionError,
        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 connection to delete, by its ID (which starts with <code>conn-</code>) or its ARN.</p>
    pub fn connection_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.connection_id(input.into());
        self
    }
    /// <p>The connection to delete, by its ID (which starts with <code>conn-</code>) or its ARN.</p>
    pub fn set_connection_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_connection_id(input);
        self
    }
    /// <p>The connection to delete, by its ID (which starts with <code>conn-</code>) or its ARN.</p>
    pub fn get_connection_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_connection_id()
    }
    /// <p>Specifies what happens to the connectivity resources behind the connection: the AWS Glue connection, whether AWS Context created it or you specified an existing one. AWS Context keeps the AWS Glue connections named in <code>glueConnectionMappings</code>. This member doesn't affect agent context content. To remove the connection's content from an agent context, remove the connection from the agent context with UpdateAgentContext. AWS Context never changes your source data. If you omit it, the default is <code>RETAIN</code>. It has no effect on <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
    pub fn deletion_mode(mut self, input: crate::types::DeletionMode) -> Self {
        self.inner = self.inner.deletion_mode(input);
        self
    }
    /// <p>Specifies what happens to the connectivity resources behind the connection: the AWS Glue connection, whether AWS Context created it or you specified an existing one. AWS Context keeps the AWS Glue connections named in <code>glueConnectionMappings</code>. This member doesn't affect agent context content. To remove the connection's content from an agent context, remove the connection from the agent context with UpdateAgentContext. AWS Context never changes your source data. If you omit it, the default is <code>RETAIN</code>. It has no effect on <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
    pub fn set_deletion_mode(mut self, input: ::std::option::Option<crate::types::DeletionMode>) -> Self {
        self.inner = self.inner.set_deletion_mode(input);
        self
    }
    /// <p>Specifies what happens to the connectivity resources behind the connection: the AWS Glue connection, whether AWS Context created it or you specified an existing one. AWS Context keeps the AWS Glue connections named in <code>glueConnectionMappings</code>. This member doesn't affect agent context content. To remove the connection's content from an agent context, remove the connection from the agent context with UpdateAgentContext. AWS Context never changes your source data. If you omit it, the default is <code>RETAIN</code>. It has no effect on <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
    pub fn get_deletion_mode(&self) -> &::std::option::Option<crate::types::DeletionMode> {
        self.inner.get_deletion_mode()
    }
}