aws-sdk-ec2 1.221.0

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

pub use crate::operation::create_transit_gateway_metering_policy_entry::_create_transit_gateway_metering_policy_entry_output::CreateTransitGatewayMeteringPolicyEntryOutputBuilder;

impl crate::operation::create_transit_gateway_metering_policy_entry::builders::CreateTransitGatewayMeteringPolicyEntryInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_transit_gateway_metering_policy_entry();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateTransitGatewayMeteringPolicyEntry`.
///
/// <p>Creates an entry in a transit gateway metering policy to define traffic measurement rules.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateTransitGatewayMeteringPolicyEntryFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_transit_gateway_metering_policy_entry::builders::CreateTransitGatewayMeteringPolicyEntryInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryOutput,
        crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryError,
    > for CreateTransitGatewayMeteringPolicyEntryFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryOutput,
            crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateTransitGatewayMeteringPolicyEntryFluentBuilder {
    /// Creates a new `CreateTransitGatewayMeteringPolicyEntryFluentBuilder`.
    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 CreateTransitGatewayMeteringPolicyEntry as a reference.
    pub fn as_input(
        &self,
    ) -> &crate::operation::create_transit_gateway_metering_policy_entry::builders::CreateTransitGatewayMeteringPolicyEntryInputBuilder {
        &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::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryError,
            ::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::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntry::operation_runtime_plugins(
                self.handle.runtime_plugins.clone(),
                &self.handle.conf,
                self.config_override,
            );
        crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntry::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::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryOutput,
        crate::operation::create_transit_gateway_metering_policy_entry::CreateTransitGatewayMeteringPolicyEntryError,
        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 ID of the transit gateway metering policy to add the entry to.</p>
    pub fn transit_gateway_metering_policy_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.transit_gateway_metering_policy_id(input.into());
        self
    }
    /// <p>The ID of the transit gateway metering policy to add the entry to.</p>
    pub fn set_transit_gateway_metering_policy_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_transit_gateway_metering_policy_id(input);
        self
    }
    /// <p>The ID of the transit gateway metering policy to add the entry to.</p>
    pub fn get_transit_gateway_metering_policy_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_transit_gateway_metering_policy_id()
    }
    /// <p>The rule number for the metering policy entry. Rules are processed in order from lowest to highest number.</p>
    pub fn policy_rule_number(mut self, input: i32) -> Self {
        self.inner = self.inner.policy_rule_number(input);
        self
    }
    /// <p>The rule number for the metering policy entry. Rules are processed in order from lowest to highest number.</p>
    pub fn set_policy_rule_number(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_policy_rule_number(input);
        self
    }
    /// <p>The rule number for the metering policy entry. Rules are processed in order from lowest to highest number.</p>
    pub fn get_policy_rule_number(&self) -> &::std::option::Option<i32> {
        self.inner.get_policy_rule_number()
    }
    /// <p>The ID of the source transit gateway attachment for traffic matching.</p>
    pub fn source_transit_gateway_attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.source_transit_gateway_attachment_id(input.into());
        self
    }
    /// <p>The ID of the source transit gateway attachment for traffic matching.</p>
    pub fn set_source_transit_gateway_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_source_transit_gateway_attachment_id(input);
        self
    }
    /// <p>The ID of the source transit gateway attachment for traffic matching.</p>
    pub fn get_source_transit_gateway_attachment_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_source_transit_gateway_attachment_id()
    }
    /// <p>The type of the source transit gateway attachment for traffic matching. Note that the <code>tgw-peering</code> resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.</p>
    pub fn source_transit_gateway_attachment_type(mut self, input: crate::types::TransitGatewayAttachmentResourceType) -> Self {
        self.inner = self.inner.source_transit_gateway_attachment_type(input);
        self
    }
    /// <p>The type of the source transit gateway attachment for traffic matching. Note that the <code>tgw-peering</code> resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.</p>
    pub fn set_source_transit_gateway_attachment_type(
        mut self,
        input: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>,
    ) -> Self {
        self.inner = self.inner.set_source_transit_gateway_attachment_type(input);
        self
    }
    /// <p>The type of the source transit gateway attachment for traffic matching. Note that the <code>tgw-peering</code> resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.</p>
    pub fn get_source_transit_gateway_attachment_type(&self) -> &::std::option::Option<crate::types::TransitGatewayAttachmentResourceType> {
        self.inner.get_source_transit_gateway_attachment_type()
    }
    /// <p>The source CIDR block for traffic matching.</p>
    pub fn source_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.source_cidr_block(input.into());
        self
    }
    /// <p>The source CIDR block for traffic matching.</p>
    pub fn set_source_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_source_cidr_block(input);
        self
    }
    /// <p>The source CIDR block for traffic matching.</p>
    pub fn get_source_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_source_cidr_block()
    }
    /// <p>The source port range for traffic matching.</p>
    pub fn source_port_range(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.source_port_range(input.into());
        self
    }
    /// <p>The source port range for traffic matching.</p>
    pub fn set_source_port_range(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_source_port_range(input);
        self
    }
    /// <p>The source port range for traffic matching.</p>
    pub fn get_source_port_range(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_source_port_range()
    }
    /// <p>The ID of the destination transit gateway attachment for traffic matching.</p>
    pub fn destination_transit_gateway_attachment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.destination_transit_gateway_attachment_id(input.into());
        self
    }
    /// <p>The ID of the destination transit gateway attachment for traffic matching.</p>
    pub fn set_destination_transit_gateway_attachment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_destination_transit_gateway_attachment_id(input);
        self
    }
    /// <p>The ID of the destination transit gateway attachment for traffic matching.</p>
    pub fn get_destination_transit_gateway_attachment_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_destination_transit_gateway_attachment_id()
    }
    /// <p>The type of the destination transit gateway attachment for traffic matching. Note that the <code>tgw-peering</code> resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.</p>
    pub fn destination_transit_gateway_attachment_type(mut self, input: crate::types::TransitGatewayAttachmentResourceType) -> Self {
        self.inner = self.inner.destination_transit_gateway_attachment_type(input);
        self
    }
    /// <p>The type of the destination transit gateway attachment for traffic matching. Note that the <code>tgw-peering</code> resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.</p>
    pub fn set_destination_transit_gateway_attachment_type(
        mut self,
        input: ::std::option::Option<crate::types::TransitGatewayAttachmentResourceType>,
    ) -> Self {
        self.inner = self.inner.set_destination_transit_gateway_attachment_type(input);
        self
    }
    /// <p>The type of the destination transit gateway attachment for traffic matching. Note that the <code>tgw-peering</code> resource type has been deprecated. To configure metering policies for Connect, use the transport attachment type.</p>
    pub fn get_destination_transit_gateway_attachment_type(&self) -> &::std::option::Option<crate::types::TransitGatewayAttachmentResourceType> {
        self.inner.get_destination_transit_gateway_attachment_type()
    }
    /// <p>The destination CIDR block for traffic matching.</p>
    pub fn destination_cidr_block(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.destination_cidr_block(input.into());
        self
    }
    /// <p>The destination CIDR block for traffic matching.</p>
    pub fn set_destination_cidr_block(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_destination_cidr_block(input);
        self
    }
    /// <p>The destination CIDR block for traffic matching.</p>
    pub fn get_destination_cidr_block(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_destination_cidr_block()
    }
    /// <p>The destination port range for traffic matching.</p>
    pub fn destination_port_range(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.destination_port_range(input.into());
        self
    }
    /// <p>The destination port range for traffic matching.</p>
    pub fn set_destination_port_range(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_destination_port_range(input);
        self
    }
    /// <p>The destination port range for traffic matching.</p>
    pub fn get_destination_port_range(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_destination_port_range()
    }
    /// <p>The protocol for traffic matching (1, 6, 17, etc.).</p>
    pub fn protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.protocol(input.into());
        self
    }
    /// <p>The protocol for traffic matching (1, 6, 17, etc.).</p>
    pub fn set_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_protocol(input);
        self
    }
    /// <p>The protocol for traffic matching (1, 6, 17, etc.).</p>
    pub fn get_protocol(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_protocol()
    }
    /// <p>The Amazon Web Services account ID to which the metered traffic should be attributed.</p>
    pub fn metered_account(mut self, input: crate::types::TransitGatewayMeteringPayerType) -> Self {
        self.inner = self.inner.metered_account(input);
        self
    }
    /// <p>The Amazon Web Services account ID to which the metered traffic should be attributed.</p>
    pub fn set_metered_account(mut self, input: ::std::option::Option<crate::types::TransitGatewayMeteringPayerType>) -> Self {
        self.inner = self.inner.set_metered_account(input);
        self
    }
    /// <p>The Amazon Web Services account ID to which the metered traffic should be attributed.</p>
    pub fn get_metered_account(&self) -> &::std::option::Option<crate::types::TransitGatewayMeteringPayerType> {
        self.inner.get_metered_account()
    }
    /// <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()
    }
}