aws-sdk-quicksight 1.134.0

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

pub use crate::operation::get_identity_context::_get_identity_context_output::GetIdentityContextOutputBuilder;

impl crate::operation::get_identity_context::builders::GetIdentityContextInputBuilder {
    /// 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_context::GetIdentityContextOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_identity_context::GetIdentityContextError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_identity_context();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetIdentityContext`.
///
/// <p>Retrieves the identity context for a Quick Sight user in a specified namespace, allowing you to obtain identity tokens that can be used with identity-enhanced IAM role sessions to call identity-aware APIs.</p>
/// <p>Currently, you can call the following APIs with identity-enhanced Credentials</p>
/// <ul>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_StartDashboardSnapshotJob.html">StartDashboardSnapshotJob</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DescribeDashboardSnapshotJob.html">DescribeDashboardSnapshotJob</a></p></li>
/// <li>
/// <p><a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_DescribeDashboardSnapshotJobResult.html">DescribeDashboardSnapshotJobResult</a></p></li>
/// </ul>
/// <p><b>Supported Authentication Methods</b></p>
/// <p>This API supports Quick Sight native users, IAM federated users, and Active Directory users. For Quick Sight users authenticated by Amazon Web Services Identity Center, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-identity-enhanced-iam-role-sessions.html">Identity Center documentation on identity-enhanced IAM role sessions</a>.</p>
/// <p><b>Supported Regions</b></p>
/// <p>The GetIdentityContext API works only in regions that support at least one of these identity types:</p>
/// <ul>
/// <li>
/// <p>Amazon Quick Sight native identity</p></li>
/// <li>
/// <p>IAM federated identity</p></li>
/// <li>
/// <p>Active Directory</p></li>
/// </ul>
/// <p>To use this API successfully, call it in the same region where your user's identity resides. For example, if your user's identity is in us-east-1, make the API call in us-east-1. For more information about managing identities in Amazon Quick Sight, see <a href="https://docs.aws.amazon.com/quicksight/latest/userguide/identity.html">Identity and access management in Amazon Quick Sight</a> in the Amazon Quick Sight User Guide.</p>
/// <p><b>Getting Identity-Enhanced Credentials</b></p>
/// <p>To obtain identity-enhanced credentials, follow these steps:</p>
/// <ul>
/// <li>
/// <p>Call the GetIdentityContext API to retrieve an identity token for the specified user.</p></li>
/// <li>
/// <p>Use the identity token with the <a href="https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html">STS AssumeRole API</a> to obtain identity-enhanced IAM role session credentials.</p></li>
/// </ul>
/// <p><b>Usage with STS AssumeRole</b></p>
/// <p>The identity token returned by this API should be used with the STS AssumeRole API to obtain credentials for an identity-enhanced IAM role session. When calling AssumeRole, include the identity token in the <code>ProvidedContexts</code> parameter with <code>ProviderArn</code> set to <code>arn:aws:iam::aws:contextProvider/QuickSight</code> and <code>ContextAssertion</code> set to the identity token received from this API.</p>
/// <p>The assumed role must allow the <code>sts:SetContext</code> action in addition to <code>sts:AssumeRole</code> in its trust relationship policy. The trust policy should include both actions for the principal that will be assuming the role.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetIdentityContextFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_identity_context::builders::GetIdentityContextInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_identity_context::GetIdentityContextOutput,
        crate::operation::get_identity_context::GetIdentityContextError,
    > for GetIdentityContextFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_identity_context::GetIdentityContextOutput,
            crate::operation::get_identity_context::GetIdentityContextError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetIdentityContextFluentBuilder {
    /// Creates a new `GetIdentityContextFluentBuilder`.
    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 GetIdentityContext as a reference.
    pub fn as_input(&self) -> &crate::operation::get_identity_context::builders::GetIdentityContextInputBuilder {
        &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_context::GetIdentityContextOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_identity_context::GetIdentityContextError,
            ::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_context::GetIdentityContext::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_identity_context::GetIdentityContext::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_context::GetIdentityContextOutput,
        crate::operation::get_identity_context::GetIdentityContextError,
        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 for the Amazon Web Services account that the user whose identity context you want to retrieve is in. Currently, you use the ID for the Amazon Web Services account that contains your Quick Sight account.</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 for the Amazon Web Services account that the user whose identity context you want to retrieve is in. Currently, you use the ID for the Amazon Web Services account that contains your Quick Sight account.</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 for the Amazon Web Services account that the user whose identity context you want to retrieve is in. Currently, you use the ID for the Amazon Web Services account that contains your Quick Sight account.</p>
    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_aws_account_id()
    }
    /// <p>The identifier for the user whose identity context you want to retrieve.</p>
    pub fn user_identifier(mut self, input: crate::types::UserIdentifier) -> Self {
        self.inner = self.inner.user_identifier(input);
        self
    }
    /// <p>The identifier for the user whose identity context you want to retrieve.</p>
    pub fn set_user_identifier(mut self, input: ::std::option::Option<crate::types::UserIdentifier>) -> Self {
        self.inner = self.inner.set_user_identifier(input);
        self
    }
    /// <p>The identifier for the user whose identity context you want to retrieve.</p>
    pub fn get_user_identifier(&self) -> &::std::option::Option<crate::types::UserIdentifier> {
        self.inner.get_user_identifier()
    }
    /// <p>The namespace of the user that you want to get identity context for. This parameter is required when the UserIdentifier is specified using Email or UserName.</p>
    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.namespace(input.into());
        self
    }
    /// <p>The namespace of the user that you want to get identity context for. This parameter is required when the UserIdentifier is specified using Email or UserName.</p>
    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_namespace(input);
        self
    }
    /// <p>The namespace of the user that you want to get identity context for. This parameter is required when the UserIdentifier is specified using Email or UserName.</p>
    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_namespace()
    }
    /// <p>The timestamp at which the session will expire.</p>
    pub fn session_expires_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.session_expires_at(input);
        self
    }
    /// <p>The timestamp at which the session will expire.</p>
    pub fn set_session_expires_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_session_expires_at(input);
        self
    }
    /// <p>The timestamp at which the session will expire.</p>
    pub fn get_session_expires_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_session_expires_at()
    }
    /// <p>The region in which the context is to be used. Use this parameter to obtain an identity context for cross-region use.</p>
    /// <p>The specified region must meet the following conditions:</p>
    /// <ul>
    /// <li>
    /// <p>The region must be in the same Amazon Web Services partition as the region you are calling from. Cross-partition requests are not supported. For example, you cannot specify a region in the <code>aws-cn</code> partition when calling from a region in the <code>aws</code> partition.</p></li>
    /// <li>
    /// <p>It must be a valid Amazon QuickSight supported region.</p></li>
    /// <li>
    /// <p>The calling customer account must be enabled in the specified context region.</p></li>
    /// <li>
    /// <p>This parameter is not supported when calling from an opt-in region.</p></li>
    /// </ul>
    pub fn context_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.context_region(input.into());
        self
    }
    /// <p>The region in which the context is to be used. Use this parameter to obtain an identity context for cross-region use.</p>
    /// <p>The specified region must meet the following conditions:</p>
    /// <ul>
    /// <li>
    /// <p>The region must be in the same Amazon Web Services partition as the region you are calling from. Cross-partition requests are not supported. For example, you cannot specify a region in the <code>aws-cn</code> partition when calling from a region in the <code>aws</code> partition.</p></li>
    /// <li>
    /// <p>It must be a valid Amazon QuickSight supported region.</p></li>
    /// <li>
    /// <p>The calling customer account must be enabled in the specified context region.</p></li>
    /// <li>
    /// <p>This parameter is not supported when calling from an opt-in region.</p></li>
    /// </ul>
    pub fn set_context_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_context_region(input);
        self
    }
    /// <p>The region in which the context is to be used. Use this parameter to obtain an identity context for cross-region use.</p>
    /// <p>The specified region must meet the following conditions:</p>
    /// <ul>
    /// <li>
    /// <p>The region must be in the same Amazon Web Services partition as the region you are calling from. Cross-partition requests are not supported. For example, you cannot specify a region in the <code>aws-cn</code> partition when calling from a region in the <code>aws</code> partition.</p></li>
    /// <li>
    /// <p>It must be a valid Amazon QuickSight supported region.</p></li>
    /// <li>
    /// <p>The calling customer account must be enabled in the specified context region.</p></li>
    /// <li>
    /// <p>This parameter is not supported when calling from an opt-in region.</p></li>
    /// </ul>
    pub fn get_context_region(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_context_region()
    }
}