// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::enable_sharing_with_aws_organization::_enable_sharing_with_aws_organization_input::EnableSharingWithAwsOrganizationInputBuilder;
pub use crate::operation::enable_sharing_with_aws_organization::_enable_sharing_with_aws_organization_output::EnableSharingWithAwsOrganizationOutputBuilder;
impl crate::operation::enable_sharing_with_aws_organization::builders::EnableSharingWithAwsOrganizationInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.enable_sharing_with_aws_organization();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `EnableSharingWithAwsOrganization`.
///
/// <p>Enables resource sharing within your organization in Organizations. This operation creates a service-linked role called <code>AWSServiceRoleForResourceAccessManager</code> that has the IAM managed policy named AWSResourceAccessManagerServiceRolePolicy attached. This role permits RAM to retrieve information about the organization and its structure. This lets you share resources with all of the accounts in the calling account's organization by specifying the organization ID, or all of the accounts in an organizational unit (OU) by specifying the OU ID. Until you enable sharing within the organization, you can specify only individual Amazon Web Services accounts, or for supported resource types, IAM roles and users.</p>
/// <p>You must call this operation from an IAM role or user in the organization's management account.</p>
/// <p></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct EnableSharingWithAwsOrganizationFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::enable_sharing_with_aws_organization::builders::EnableSharingWithAwsOrganizationInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationOutput,
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationError,
> for EnableSharingWithAwsOrganizationFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationOutput,
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl EnableSharingWithAwsOrganizationFluentBuilder {
/// Creates a new `EnableSharingWithAwsOrganizationFluentBuilder`.
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 EnableSharingWithAwsOrganization as a reference.
pub fn as_input(&self) -> &crate::operation::enable_sharing_with_aws_organization::builders::EnableSharingWithAwsOrganizationInputBuilder {
&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::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationError,
::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::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganization::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganization::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::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationOutput,
crate::operation::enable_sharing_with_aws_organization::EnableSharingWithAwsOrganizationError,
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
}
}