aws-sdk-redshift 1.106.0

AWS SDK for Amazon Redshift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_identity_center_auth_token::_get_identity_center_auth_token_input::GetIdentityCenterAuthTokenInputBuilder;

pub use crate::operation::get_identity_center_auth_token::_get_identity_center_auth_token_output::GetIdentityCenterAuthTokenOutputBuilder;

impl crate::operation::get_identity_center_auth_token::builders::GetIdentityCenterAuthTokenInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_identity_center_auth_token();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetIdentityCenterAuthToken`.
///
/// <p>Generates an encrypted authentication token that propagates the caller's Amazon Web Services IAM Identity Center identity to Amazon Redshift clusters. This API extracts the Amazon Web Services IAM Identity Center identity from enhanced credentials and creates a secure token that Amazon Redshift drivers can use for authentication.</p>
/// <p>The token is encrypted using Key Management Service (KMS) and can only be decrypted by the specified Amazon Redshift clusters. The token contains the caller's Amazon Web Services IAM Identity Center identity information and is valid for a limited time period.</p>
/// <p>This API is exclusively for use with Amazon Web Services IAM Identity Center enhanced credentials. If the caller is not using enhanced credentials with embedded Amazon Web Services IAM Identity Center identity, the API will return an error.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetIdentityCenterAuthTokenFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_identity_center_auth_token::builders::GetIdentityCenterAuthTokenInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenOutput,
        crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenError,
    > for GetIdentityCenterAuthTokenFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenOutput,
            crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetIdentityCenterAuthTokenFluentBuilder {
    /// Creates a new `GetIdentityCenterAuthTokenFluentBuilder`.
    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 GetIdentityCenterAuthToken as a reference.
    pub fn as_input(&self) -> &crate::operation::get_identity_center_auth_token::builders::GetIdentityCenterAuthTokenInputBuilder {
        &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::get_identity_center_auth_token::GetIdentityCenterAuthTokenOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenError,
            ::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::get_identity_center_auth_token::GetIdentityCenterAuthToken::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthToken::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::get_identity_center_auth_token::GetIdentityCenterAuthTokenOutput,
        crate::operation::get_identity_center_auth_token::GetIdentityCenterAuthTokenError,
        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
    }
    ///
    /// Appends an item to `ClusterIds`.
    ///
    /// To override the contents of this collection use [`set_cluster_ids`](Self::set_cluster_ids).
    ///
    /// <p>A list of cluster identifiers that the generated token can be used with. The token will be scoped to only allow authentication to the specified clusters.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p><code>ClusterIds</code> must contain at least 1 cluster identifier.</p></li>
    /// <li>
    /// <p><code>ClusterIds</code> can hold a maximum of 20 cluster identifiers.</p></li>
    /// <li>
    /// <p>Cluster identifiers must be 1 to 63 characters in length.</p></li>
    /// <li>
    /// <p>The characters accepted for cluster identifiers are the following:</p>
    /// <ul>
    /// <li>
    /// <p>Alphanumeric characters</p></li>
    /// <li>
    /// <p>Hyphens</p></li>
    /// </ul></li>
    /// <li>
    /// <p>Cluster identifiers must start with a letter.</p></li>
    /// <li>
    /// <p>Cluster identifiers can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// </ul>
    pub fn cluster_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cluster_ids(input.into());
        self
    }
    /// <p>A list of cluster identifiers that the generated token can be used with. The token will be scoped to only allow authentication to the specified clusters.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p><code>ClusterIds</code> must contain at least 1 cluster identifier.</p></li>
    /// <li>
    /// <p><code>ClusterIds</code> can hold a maximum of 20 cluster identifiers.</p></li>
    /// <li>
    /// <p>Cluster identifiers must be 1 to 63 characters in length.</p></li>
    /// <li>
    /// <p>The characters accepted for cluster identifiers are the following:</p>
    /// <ul>
    /// <li>
    /// <p>Alphanumeric characters</p></li>
    /// <li>
    /// <p>Hyphens</p></li>
    /// </ul></li>
    /// <li>
    /// <p>Cluster identifiers must start with a letter.</p></li>
    /// <li>
    /// <p>Cluster identifiers can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// </ul>
    pub fn set_cluster_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_cluster_ids(input);
        self
    }
    /// <p>A list of cluster identifiers that the generated token can be used with. The token will be scoped to only allow authentication to the specified clusters.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p><code>ClusterIds</code> must contain at least 1 cluster identifier.</p></li>
    /// <li>
    /// <p><code>ClusterIds</code> can hold a maximum of 20 cluster identifiers.</p></li>
    /// <li>
    /// <p>Cluster identifiers must be 1 to 63 characters in length.</p></li>
    /// <li>
    /// <p>The characters accepted for cluster identifiers are the following:</p>
    /// <ul>
    /// <li>
    /// <p>Alphanumeric characters</p></li>
    /// <li>
    /// <p>Hyphens</p></li>
    /// </ul></li>
    /// <li>
    /// <p>Cluster identifiers must start with a letter.</p></li>
    /// <li>
    /// <p>Cluster identifiers can't end with a hyphen or contain two consecutive hyphens.</p></li>
    /// </ul>
    pub fn get_cluster_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_cluster_ids()
    }
}