aws-sdk-organizations 1.120.0

AWS SDK for AWS Organizations
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::accept_handshake::_accept_handshake_input::AcceptHandshakeInputBuilder;

pub use crate::operation::accept_handshake::_accept_handshake_output::AcceptHandshakeOutputBuilder;

impl crate::operation::accept_handshake::builders::AcceptHandshakeInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::accept_handshake::AcceptHandshakeOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::accept_handshake::AcceptHandshakeError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.accept_handshake();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `AcceptHandshake`.
///
/// <p>Accepts a handshake by sending an <code>ACCEPTED</code> response to the sender. You can view accepted handshakes in API responses for 30 days before they are deleted.</p>
/// <p><b>Only the management account can accept the following handshakes</b>:</p>
/// <ul>
/// <li>
/// <p>Enable all features final confirmation (<code>APPROVE_ALL_FEATURES</code>)</p></li>
/// <li>
/// <p>Billing transfer (<code>TRANSFER_RESPONSIBILITY</code>)</p></li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/manage-begin-all-features-standard-migration.html#manage-approve-all-features-invite">Enabling all features</a> and <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_transfer_billing-respond-invitation.html">Responding to a billing transfer invitation</a> in the <i>Organizations User Guide</i>.</p>
/// <p><b>Only a member account can accept the following handshakes</b>:</p>
/// <ul>
/// <li>
/// <p>Invitation to join (<code>INVITE</code>)</p></li>
/// <li>
/// <p>Approve all features request (<code>ENABLE_ALL_FEATURES</code>)</p></li>
/// </ul>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_accept-decline-invite.html">Responding to invitations</a> and <a href="https://docs.aws.amazon.com/organizations/latest/userguide/manage-begin-all-features-standard-migration.html#manage-approve-all-features-invite">Enabling all features</a> in the <i>Organizations User Guide</i>.</p>
/// <p>When a handshake is accepted, Organizations logs membership events in CloudTrail, available only in the management account's event history. If the account was standalone and joined a new organization, an <code>AccountJoinedOrganization</code> event is logged with <code>joinedMethod:Invited</code> and <code>joinedTime</code> fields. If the account departed one organization and joined another, both an <code>AccountDepartedOrganization</code> event with <code>departedMethod:Left</code> and <code>departedTime</code> and an <code>AccountJoinedOrganization</code> event with <code>joinedMethod:Invited</code> and <code>joinedTime</code> are logged in their respective management accounts.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct AcceptHandshakeFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::accept_handshake::builders::AcceptHandshakeInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::accept_handshake::AcceptHandshakeOutput,
        crate::operation::accept_handshake::AcceptHandshakeError,
    > for AcceptHandshakeFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::accept_handshake::AcceptHandshakeOutput,
            crate::operation::accept_handshake::AcceptHandshakeError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl AcceptHandshakeFluentBuilder {
    /// Creates a new `AcceptHandshakeFluentBuilder`.
    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 AcceptHandshake as a reference.
    pub fn as_input(&self) -> &crate::operation::accept_handshake::builders::AcceptHandshakeInputBuilder {
        &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::accept_handshake::AcceptHandshakeOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::accept_handshake::AcceptHandshakeError,
            ::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::accept_handshake::AcceptHandshake::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::accept_handshake::AcceptHandshake::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::accept_handshake::AcceptHandshakeOutput,
        crate::operation::accept_handshake::AcceptHandshakeError,
        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>ID for the handshake that you want to accept.</p>
    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.</p>
    pub fn handshake_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.handshake_id(input.into());
        self
    }
    /// <p>ID for the handshake that you want to accept.</p>
    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.</p>
    pub fn set_handshake_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_handshake_id(input);
        self
    }
    /// <p>ID for the handshake that you want to accept.</p>
    /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> for handshake ID string requires "h-" followed by from 8 to 32 lowercase letters or digits.</p>
    pub fn get_handshake_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_handshake_id()
    }
}