// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::enable_federation::_enable_federation_input::EnableFederationInputBuilder;
pub use crate::operation::enable_federation::_enable_federation_output::EnableFederationOutputBuilder;
impl crate::operation::enable_federation::builders::EnableFederationInputBuilder {
/// 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_federation::EnableFederationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::enable_federation::EnableFederationError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.enable_federation();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `EnableFederation`.
///
/// <p>Enables Lake query federation on the specified event data store. Federating an event data store lets you view the metadata associated with the event data store in the Glue <a href="https://docs.aws.amazon.com/glue/latest/dg/components-overview.html#data-catalog-intro">Data Catalog</a> and run SQL queries against your event data using Amazon Athena. The table metadata stored in the Glue Data Catalog lets the Athena query engine know how to find, read, and process the data that you want to query.</p>
/// <p>When you enable Lake query federation, CloudTrail creates a managed database named <code>aws:cloudtrail</code> (if the database doesn't already exist) and a managed federated table in the Glue Data Catalog. The event data store ID is used for the table name. CloudTrail registers the role ARN and event data store in <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation-lake-formation.html">Lake Formation</a>, the service responsible for allowing fine-grained access control of the federated resources in the Glue Data Catalog.</p>
/// <p>For more information about Lake query federation, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html">Federate an event data store</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct EnableFederationFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::enable_federation::builders::EnableFederationInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::enable_federation::EnableFederationOutput,
crate::operation::enable_federation::EnableFederationError,
> for EnableFederationFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::enable_federation::EnableFederationOutput,
crate::operation::enable_federation::EnableFederationError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl EnableFederationFluentBuilder {
/// Creates a new `EnableFederationFluentBuilder`.
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 EnableFederation as a reference.
pub fn as_input(&self) -> &crate::operation::enable_federation::builders::EnableFederationInputBuilder {
&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_federation::EnableFederationOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::enable_federation::EnableFederationError,
::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_federation::EnableFederation::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::enable_federation::EnableFederation::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_federation::EnableFederationOutput,
crate::operation::enable_federation::EnableFederationError,
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 ARN (or ID suffix of the ARN) of the event data store for which you want to enable Lake query federation.</p>
pub fn event_data_store(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.event_data_store(input.into());
self
}
/// <p>The ARN (or ID suffix of the ARN) of the event data store for which you want to enable Lake query federation.</p>
pub fn set_event_data_store(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_event_data_store(input);
self
}
/// <p>The ARN (or ID suffix of the ARN) of the event data store for which you want to enable Lake query federation.</p>
pub fn get_event_data_store(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_event_data_store()
}
/// <p>The ARN of the federation role to use for the event data store. Amazon Web Services services like Lake Formation use this federation role to access data for the federated event data store. The federation role must exist in your account and provide the <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html#query-federation-permissions-role">required minimum permissions</a>.</p>
pub fn federation_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.federation_role_arn(input.into());
self
}
/// <p>The ARN of the federation role to use for the event data store. Amazon Web Services services like Lake Formation use this federation role to access data for the federated event data store. The federation role must exist in your account and provide the <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html#query-federation-permissions-role">required minimum permissions</a>.</p>
pub fn set_federation_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_federation_role_arn(input);
self
}
/// <p>The ARN of the federation role to use for the event data store. Amazon Web Services services like Lake Formation use this federation role to access data for the federated event data store. The federation role must exist in your account and provide the <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-federation.html#query-federation-permissions-role">required minimum permissions</a>.</p>
pub fn get_federation_role_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_federation_role_arn()
}
}