aws-sdk-ssoadmin 1.97.0

AWS SDK for AWS Single Sign-On Admin
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_application_grant::_put_application_grant_input::PutApplicationGrantInputBuilder;

pub use crate::operation::put_application_grant::_put_application_grant_output::PutApplicationGrantOutputBuilder;

impl crate::operation::put_application_grant::builders::PutApplicationGrantInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::put_application_grant::PutApplicationGrantOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_application_grant::PutApplicationGrantError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_application_grant();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutApplicationGrant`.
///
/// <p>Creates a configuration for an application to use grants. Conceptually grants are authorization to request actions related to tokens. This configuration will be used when parties are requesting and receiving tokens during the trusted identity propagation process. For more information on the IAM Identity Center supported grant workflows, see <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/customermanagedapps-saml2-oauth2.html">SAML 2.0 and OAuth 2.0</a>.</p>
/// <p>A grant is created between your applications and Identity Center instance which enables an application to use specified mechanisms to obtain tokens. These tokens are used by your applications to gain access to Amazon Web Services resources on behalf of users. The following elements are within these exchanges:</p>
/// <ul>
/// <li>
/// <p><b>Requester</b> - The application requesting access to Amazon Web Services resources.</p></li>
/// <li>
/// <p><b>Subject</b> - Typically the user that is requesting access to Amazon Web Services resources.</p></li>
/// <li>
/// <p><b>Grant</b> - Conceptually, a grant is authorization to access Amazon Web Services resources. These grants authorize token generation for authenticating access to the requester and for the request to make requests on behalf of the subjects. There are four types of grants:</p>
/// <ul>
/// <li>
/// <p><b>AuthorizationCode</b> - Allows an application to request authorization through a series of user-agent redirects.</p></li>
/// <li>
/// <p><b>JWT bearer </b> - Authorizes an application to exchange a JSON Web Token that came from an external identity provider. To learn more, see <a href="https://datatracker.ietf.org/doc/html/rfc6749">RFC 6479</a>.</p></li>
/// <li>
/// <p><b>Refresh token</b> - Enables application to request new access tokens to replace expiring or expired access tokens.</p></li>
/// <li>
/// <p><b>Exchange token</b> - A grant that requests tokens from the authorization server by providing a ‘subject’ token with access scope authorizing trusted identity propagation to this application. To learn more, see <a href="https://datatracker.ietf.org/doc/html/rfc8693">RFC 8693</a>.</p></li>
/// </ul></li>
/// <li>
/// <p><b>Authorization server</b> - IAM Identity Center requests tokens.</p></li>
/// </ul>
/// <p>User credentials are never shared directly within these exchanges. Instead, applications use grants to request access tokens from IAM Identity Center. For more information, see <a href="https://datatracker.ietf.org/doc/html/rfc6749">RFC 6479</a>.</p>
/// <p class="title"><b>Use cases</b></p>
/// <ul>
/// <li>
/// <p>Connecting to custom applications.</p></li>
/// <li>
/// <p>Configuring an Amazon Web Services service to make calls to another Amazon Web Services services using JWT tokens.</p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutApplicationGrantFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_application_grant::builders::PutApplicationGrantInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_application_grant::PutApplicationGrantOutput,
        crate::operation::put_application_grant::PutApplicationGrantError,
    > for PutApplicationGrantFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_application_grant::PutApplicationGrantOutput,
            crate::operation::put_application_grant::PutApplicationGrantError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutApplicationGrantFluentBuilder {
    /// Creates a new `PutApplicationGrantFluentBuilder`.
    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 PutApplicationGrant as a reference.
    pub fn as_input(&self) -> &crate::operation::put_application_grant::builders::PutApplicationGrantInputBuilder {
        &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::put_application_grant::PutApplicationGrantOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_application_grant::PutApplicationGrantError,
            ::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::put_application_grant::PutApplicationGrant::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_application_grant::PutApplicationGrant::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::put_application_grant::PutApplicationGrantOutput,
        crate::operation::put_application_grant::PutApplicationGrantError,
        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>Specifies the ARN of the application to update.</p>
    pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.application_arn(input.into());
        self
    }
    /// <p>Specifies the ARN of the application to update.</p>
    pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_application_arn(input);
        self
    }
    /// <p>Specifies the ARN of the application to update.</p>
    pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_application_arn()
    }
    /// <p>Specifies the type of grant to update.</p>
    pub fn grant_type(mut self, input: crate::types::GrantType) -> Self {
        self.inner = self.inner.grant_type(input);
        self
    }
    /// <p>Specifies the type of grant to update.</p>
    pub fn set_grant_type(mut self, input: ::std::option::Option<crate::types::GrantType>) -> Self {
        self.inner = self.inner.set_grant_type(input);
        self
    }
    /// <p>Specifies the type of grant to update.</p>
    pub fn get_grant_type(&self) -> &::std::option::Option<crate::types::GrantType> {
        self.inner.get_grant_type()
    }
    /// <p>Specifies a structure that describes the grant to update.</p>
    pub fn grant(mut self, input: crate::types::Grant) -> Self {
        self.inner = self.inner.grant(input);
        self
    }
    /// <p>Specifies a structure that describes the grant to update.</p>
    pub fn set_grant(mut self, input: ::std::option::Option<crate::types::Grant>) -> Self {
        self.inner = self.inner.set_grant(input);
        self
    }
    /// <p>Specifies a structure that describes the grant to update.</p>
    pub fn get_grant(&self) -> &::std::option::Option<crate::types::Grant> {
        self.inner.get_grant()
    }
}