aws-sdk-ec2 1.236.0

AWS SDK for Amazon Elastic Compute Cloud
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::modify_account_vpc_encryption_control::_modify_account_vpc_encryption_control_input::ModifyAccountVpcEncryptionControlInputBuilder;

pub use crate::operation::modify_account_vpc_encryption_control::_modify_account_vpc_encryption_control_output::ModifyAccountVpcEncryptionControlOutputBuilder;

impl crate::operation::modify_account_vpc_encryption_control::builders::ModifyAccountVpcEncryptionControlInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.modify_account_vpc_encryption_control();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ModifyAccountVpcEncryptionControl`.
///
/// <p>Modifies the account-level VPC Encryption Control configuration. This sets the encryption control mode and resource exclusions that apply to the VPCs in your account. VPC Encryption Control enables you to enforce encryption for all data in transit within and between VPCs to meet compliance requirements.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-encryption-controls.html">Enforce VPC encryption in transit</a> in the <i>Amazon VPC User Guide</i>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ModifyAccountVpcEncryptionControlFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::modify_account_vpc_encryption_control::builders::ModifyAccountVpcEncryptionControlInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlOutput,
        crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlError,
    > for ModifyAccountVpcEncryptionControlFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlOutput,
            crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ModifyAccountVpcEncryptionControlFluentBuilder {
    /// Creates a new `ModifyAccountVpcEncryptionControlFluentBuilder`.
    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 ModifyAccountVpcEncryptionControl as a reference.
    pub fn as_input(&self) -> &crate::operation::modify_account_vpc_encryption_control::builders::ModifyAccountVpcEncryptionControlInputBuilder {
        &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::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlError,
            ::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::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControl::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControl::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::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlOutput,
        crate::operation::modify_account_vpc_encryption_control::ModifyAccountVpcEncryptionControlError,
        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>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.inner = self.inner.dry_run(input);
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_dry_run(input);
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        self.inner.get_dry_run()
    }
    /// <p>The encryption mode for the account encryption control configuration.</p>
    pub fn mode(mut self, input: crate::types::AccountVpcEncryptionControlMode) -> Self {
        self.inner = self.inner.mode(input);
        self
    }
    /// <p>The encryption mode for the account encryption control configuration.</p>
    pub fn set_mode(mut self, input: ::std::option::Option<crate::types::AccountVpcEncryptionControlMode>) -> Self {
        self.inner = self.inner.set_mode(input);
        self
    }
    /// <p>The encryption mode for the account encryption control configuration.</p>
    pub fn get_mode(&self) -> &::std::option::Option<crate::types::AccountVpcEncryptionControlMode> {
        self.inner.get_mode()
    }
    /// <p>Specifies whether to exclude internet gateway resource from account-level encryption enforcement.</p>
    pub fn internet_gateway(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.internet_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude internet gateway resource from account-level encryption enforcement.</p>
    pub fn set_internet_gateway(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_internet_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude internet gateway resource from account-level encryption enforcement.</p>
    pub fn get_internet_gateway(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_internet_gateway()
    }
    /// <p>Specifies whether to exclude egress-only internet gateway resource from account-level encryption enforcement.</p>
    pub fn egress_only_internet_gateway(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.egress_only_internet_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude egress-only internet gateway resource from account-level encryption enforcement.</p>
    pub fn set_egress_only_internet_gateway(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_egress_only_internet_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude egress-only internet gateway resource from account-level encryption enforcement.</p>
    pub fn get_egress_only_internet_gateway(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_egress_only_internet_gateway()
    }
    /// <p>Specifies whether to exclude NAT gateway resource from account-level encryption enforcement.</p>
    pub fn nat_gateway(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.nat_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude NAT gateway resource from account-level encryption enforcement.</p>
    pub fn set_nat_gateway(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_nat_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude NAT gateway resource from account-level encryption enforcement.</p>
    pub fn get_nat_gateway(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_nat_gateway()
    }
    /// <p>Specifies whether to exclude virtual private gateway resource from account-level encryption enforcement.</p>
    pub fn virtual_private_gateway(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.virtual_private_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude virtual private gateway resource from account-level encryption enforcement.</p>
    pub fn set_virtual_private_gateway(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_virtual_private_gateway(input);
        self
    }
    /// <p>Specifies whether to exclude virtual private gateway resource from account-level encryption enforcement.</p>
    pub fn get_virtual_private_gateway(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_virtual_private_gateway()
    }
    /// <p>Specifies whether to exclude VPC peering connection resource from account-level encryption enforcement.</p>
    pub fn vpc_peering(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.vpc_peering(input);
        self
    }
    /// <p>Specifies whether to exclude VPC peering connection resource from account-level encryption enforcement.</p>
    pub fn set_vpc_peering(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_vpc_peering(input);
        self
    }
    /// <p>Specifies whether to exclude VPC peering connection resource from account-level encryption enforcement.</p>
    pub fn get_vpc_peering(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_vpc_peering()
    }
    /// <p>Specifies whether to exclude Lambda service from account-level encryption enforcement.</p>
    pub fn lambda(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.lambda(input);
        self
    }
    /// <p>Specifies whether to exclude Lambda service from account-level encryption enforcement.</p>
    pub fn set_lambda(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_lambda(input);
        self
    }
    /// <p>Specifies whether to exclude Lambda service from account-level encryption enforcement.</p>
    pub fn get_lambda(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_lambda()
    }
    /// <p>Specifies whether to exclude VPC Lattice service from account-level encryption enforcement.</p>
    pub fn vpc_lattice(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.vpc_lattice(input);
        self
    }
    /// <p>Specifies whether to exclude VPC Lattice service from account-level encryption enforcement.</p>
    pub fn set_vpc_lattice(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_vpc_lattice(input);
        self
    }
    /// <p>Specifies whether to exclude VPC Lattice service from account-level encryption enforcement.</p>
    pub fn get_vpc_lattice(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_vpc_lattice()
    }
    /// <p>Specifies whether to exclude Elastic File System service from account-level encryption enforcement.</p>
    pub fn elastic_file_system(mut self, input: crate::types::VpcEncryptionControlExclusionStateInput) -> Self {
        self.inner = self.inner.elastic_file_system(input);
        self
    }
    /// <p>Specifies whether to exclude Elastic File System service from account-level encryption enforcement.</p>
    pub fn set_elastic_file_system(mut self, input: ::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput>) -> Self {
        self.inner = self.inner.set_elastic_file_system(input);
        self
    }
    /// <p>Specifies whether to exclude Elastic File System service from account-level encryption enforcement.</p>
    pub fn get_elastic_file_system(&self) -> &::std::option::Option<crate::types::VpcEncryptionControlExclusionStateInput> {
        self.inner.get_elastic_file_system()
    }
}