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::update_connection::_update_connection_input::UpdateConnectionInputBuilder;

pub use crate::operation::update_connection::_update_connection_output::UpdateConnectionOutputBuilder;

impl crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_connection::UpdateConnectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_connection::UpdateConnectionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_connection();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateConnection`.
///
/// <p>Updates a connection's configuration.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateConnectionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_connection::builders::UpdateConnectionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_connection::UpdateConnectionOutput,
        crate::operation::update_connection::UpdateConnectionError,
    > for UpdateConnectionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_connection::UpdateConnectionOutput,
            crate::operation::update_connection::UpdateConnectionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateConnectionFluentBuilder {
    /// Creates a new `UpdateConnectionFluentBuilder`.
    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 UpdateConnection as a reference.
    pub fn as_input(&self) -> &crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
        &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::update_connection::UpdateConnectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_connection::UpdateConnectionError,
            ::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::update_connection::UpdateConnection::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_connection::UpdateConnection::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::update_connection::UpdateConnectionOutput,
        crate::operation::update_connection::UpdateConnectionError,
        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 update, 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 update, 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 update, 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>The new name. If you omit it, the name is unchanged.</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 new name. If you omit it, the name is unchanged.</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 new name. If you omit it, the name is unchanged.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_name()
    }
    /// <p>The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of <code>CreateConnectionRequest.scope</code> apply, with the following additions:</p>
    /// <ul>
    /// <li>
    /// <p>A <code>DATABRICKS</code> or <code>SNOWFLAKE</code> scope names at most one <code>databricksCatalog</code> or <code>snowflakeDatabase</code>, unless the existing scope already names each one.</p></li>
    /// <li>
    /// <p>If the stored scope has a selector with a <code>glueService</code> segment, the new scope can't be empty. Every selector that it adds must also have a <code>glueService</code> segment. Otherwise, the request fails with <code>ValidationException</code>. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.</p></li>
    /// </ul>
    pub fn scope(mut self, input: crate::types::DataSourceScope) -> Self {
        self.inner = self.inner.scope(input);
        self
    }
    /// <p>The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of <code>CreateConnectionRequest.scope</code> apply, with the following additions:</p>
    /// <ul>
    /// <li>
    /// <p>A <code>DATABRICKS</code> or <code>SNOWFLAKE</code> scope names at most one <code>databricksCatalog</code> or <code>snowflakeDatabase</code>, unless the existing scope already names each one.</p></li>
    /// <li>
    /// <p>If the stored scope has a selector with a <code>glueService</code> segment, the new scope can't be empty. Every selector that it adds must also have a <code>glueService</code> segment. Otherwise, the request fails with <code>ValidationException</code>. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.</p></li>
    /// </ul>
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::DataSourceScope>) -> Self {
        self.inner = self.inner.set_scope(input);
        self
    }
    /// <p>The new ingestion scope for the connection. If you omit it, the existing scope is unchanged. The rules of <code>CreateConnectionRequest.scope</code> apply, with the following additions:</p>
    /// <ul>
    /// <li>
    /// <p>A <code>DATABRICKS</code> or <code>SNOWFLAKE</code> scope names at most one <code>databricksCatalog</code> or <code>snowflakeDatabase</code>, unless the existing scope already names each one.</p></li>
    /// <li>
    /// <p>If the stored scope has a selector with a <code>glueService</code> segment, the new scope can't be empty. Every selector that it adds must also have a <code>glueService</code> segment. Otherwise, the request fails with <code>ValidationException</code>. You can keep a selector that the stored scope already has, so resending the stored scope unchanged succeeds.</p></li>
    /// </ul>
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::DataSourceScope> {
        self.inner.get_scope()
    }
    /// <p>The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, a configuration with no variant clears a stored <code>iamRole</code>, and the connection is then returned with no <code>accessConfig</code>.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, you cannot add or remove the <code>iamRole</code>. An update that adds an <code>iamRole</code> to a connection stored without one fails with <code>ValidationException</code>. So does an update that provides a configuration without <code>iamRole</code> for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.</p>
    pub fn access_config(mut self, input: crate::types::AccessConfig) -> Self {
        self.inner = self.inner.access_config(input);
        self
    }
    /// <p>The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, a configuration with no variant clears a stored <code>iamRole</code>, and the connection is then returned with no <code>accessConfig</code>.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, you cannot add or remove the <code>iamRole</code>. An update that adds an <code>iamRole</code> to a connection stored without one fails with <code>ValidationException</code>. So does an update that provides a configuration without <code>iamRole</code> for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.</p>
    pub fn set_access_config(mut self, input: ::std::option::Option<crate::types::AccessConfig>) -> Self {
        self.inner = self.inner.set_access_config(input);
        self
    }
    /// <p>The updated access configuration for the data source. If you omit it, the existing configuration is unchanged. If you provide one, it replaces the stored configuration, including its variant.</p>
    /// <p>For <code>DATABRICKS</code> and <code>SNOWFLAKE</code>, a configuration with no variant clears a stored <code>iamRole</code>, and the connection is then returned with no <code>accessConfig</code>.</p>
    /// <p>For <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code>, you cannot add or remove the <code>iamRole</code>. An update that adds an <code>iamRole</code> to a connection stored without one fails with <code>ValidationException</code>. So does an update that provides a configuration without <code>iamRole</code> for a connection that has one. You can replace a stored role with another role. To change how such a connection reads its data source, delete the connection and create it again.</p>
    pub fn get_access_config(&self) -> &::std::option::Option<crate::types::AccessConfig> {
        self.inner.get_access_config()
    }
    /// <p>The new sync schedule for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the existing schedule is unchanged. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
    pub fn sync_schedule(mut self, input: crate::types::SyncSchedule) -> Self {
        self.inner = self.inner.sync_schedule(input);
        self
    }
    /// <p>The new sync schedule for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the existing schedule is unchanged. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
    pub fn set_sync_schedule(mut self, input: ::std::option::Option<crate::types::SyncSchedule>) -> Self {
        self.inner = self.inner.set_sync_schedule(input);
        self
    }
    /// <p>The new sync schedule for a <code>DATABRICKS</code> or <code>SNOWFLAKE</code> source. If you omit it, the existing schedule is unchanged. Not accepted for <code>GLUE_DATA_CATALOG</code> and <code>BEDROCK_KNOWLEDGE_BASE</code> connections.</p>
    pub fn get_sync_schedule(&self) -> &::std::option::Option<crate::types::SyncSchedule> {
        self.inner.get_sync_schedule()
    }
    /// <p>The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.</p>
    pub fn ingestion_config(mut self, input: crate::types::IngestionConfig) -> Self {
        self.inner = self.inner.ingestion_config(input);
        self
    }
    /// <p>The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.</p>
    pub fn set_ingestion_config(mut self, input: ::std::option::Option<crate::types::IngestionConfig>) -> Self {
        self.inner = self.inner.set_ingestion_config(input);
        self
    }
    /// <p>The ingestion configuration: the IAM role that a data producer assumes to push data into this connection. Required on every update, so that an existing connection always has an ingestion role that AWS Context can authorize. You must have <code>iam:PassRole</code> permission to pass this role to the data producer, and the role must be in your account. You can't clear the role.</p>
    pub fn get_ingestion_config(&self) -> &::std::option::Option<crate::types::IngestionConfig> {
        self.inner.get_ingestion_config()
    }
    ///
    /// Appends an item to `glueConnectionMappings`.
    ///
    /// To override the contents of this collection use [`set_glue_connection_mappings`](Self::set_glue_connection_mappings).
    ///
    /// <p>The AWS Glue connection for each <code>redshiftNamespace</code>, and for each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, in <code>scope</code>. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes <code>scope</code>, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of <code>CreateConnectionRequest.glueConnectionMappings</code>. You can't change the list of a <code>SNOWFLAKE</code> connection, which is keyed by <code>snowflakeDatabase</code>: omit it or send it unchanged.</p>
    pub fn glue_connection_mappings(mut self, input: crate::types::GlueConnectionMapping) -> Self {
        self.inner = self.inner.glue_connection_mappings(input);
        self
    }
    /// <p>The AWS Glue connection for each <code>redshiftNamespace</code>, and for each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, in <code>scope</code>. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes <code>scope</code>, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of <code>CreateConnectionRequest.glueConnectionMappings</code>. You can't change the list of a <code>SNOWFLAKE</code> connection, which is keyed by <code>snowflakeDatabase</code>: omit it or send it unchanged.</p>
    pub fn set_glue_connection_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>>) -> Self {
        self.inner = self.inner.set_glue_connection_mappings(input);
        self
    }
    /// <p>The AWS Glue connection for each <code>redshiftNamespace</code>, and for each <code>rdsInstance</code> and <code>rdsDatabase</code> pair, in <code>scope</code>. If you omit it, the stored list is kept. A list replaces the stored list, and an empty list clears it. If the update changes <code>scope</code>, or changes the role of a connection to another account's catalog, AWS Context validates the kept list again. The rules are those of <code>CreateConnectionRequest.glueConnectionMappings</code>. You can't change the list of a <code>SNOWFLAKE</code> connection, which is keyed by <code>snowflakeDatabase</code>: omit it or send it unchanged.</p>
    pub fn get_glue_connection_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlueConnectionMapping>> {
        self.inner.get_glue_connection_mappings()
    }
    /// <p>Specifies whether to publish a third-party connection created with <code>publish: false</code>. If <code>true</code>, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. <code>false</code> is not accepted, because a connection can't be unpublished. Delete the connection instead.</p>
    pub fn publish(mut self, input: bool) -> Self {
        self.inner = self.inner.publish(input);
        self
    }
    /// <p>Specifies whether to publish a third-party connection created with <code>publish: false</code>. If <code>true</code>, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. <code>false</code> is not accepted, because a connection can't be unpublished. Delete the connection instead.</p>
    pub fn set_publish(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_publish(input);
        self
    }
    /// <p>Specifies whether to publish a third-party connection created with <code>publish: false</code>. If <code>true</code>, AWS Context configures catalog synchronization. The connection moves to ACTIVE when AWS Glue finishes provisioning the managed crawler. This has no effect on an ACTIVE connection. <code>false</code> is not accepted, because a connection can't be unpublished. Delete the connection instead.</p>
    pub fn get_publish(&self) -> &::std::option::Option<bool> {
        self.inner.get_publish()
    }
}