aws_sdk_ec2/operation/register_transit_gateway_multicast_group_sources/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::register_transit_gateway_multicast_group_sources::_register_transit_gateway_multicast_group_sources_output::RegisterTransitGatewayMulticastGroupSourcesOutputBuilder;
3
4pub use crate::operation::register_transit_gateway_multicast_group_sources::_register_transit_gateway_multicast_group_sources_input::RegisterTransitGatewayMulticastGroupSourcesInputBuilder;
5
6impl crate::operation::register_transit_gateway_multicast_group_sources::builders::RegisterTransitGatewayMulticastGroupSourcesInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.register_transit_gateway_multicast_group_sources();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RegisterTransitGatewayMulticastGroupSources`.
24///
25/// <p>Registers sources (network interfaces) with the specified transit gateway multicast group.</p>
26/// <p>A multicast source is a network interface attached to a supported instance that sends multicast traffic. For more information about supported instances, see <a href="https://docs.aws.amazon.com/vpc/latest/tgw/tgw-multicast-overview.html">Multicast on transit gateways</a> in the <i>Amazon Web Services Transit Gateways Guide</i>.</p>
27/// <p>After you add the source, use <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html">SearchTransitGatewayMulticastGroups</a> to verify that the source was added to the multicast group.</p>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct RegisterTransitGatewayMulticastGroupSourcesFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::register_transit_gateway_multicast_group_sources::builders::RegisterTransitGatewayMulticastGroupSourcesInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesOutput,
37        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesError,
38    > for RegisterTransitGatewayMulticastGroupSourcesFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesOutput,
46            crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl RegisterTransitGatewayMulticastGroupSourcesFluentBuilder {
53    /// Creates a new `RegisterTransitGatewayMulticastGroupSourcesFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the RegisterTransitGatewayMulticastGroupSources as a reference.
62    pub fn as_input(
63        &self,
64    ) -> &crate::operation::register_transit_gateway_multicast_group_sources::builders::RegisterTransitGatewayMulticastGroupSourcesInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSources::operation_runtime_plugins(
89                            self.handle.runtime_plugins.clone(),
90                            &self.handle.conf,
91                            self.config_override,
92                        );
93        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSources::orchestrate(
94            &runtime_plugins,
95            input,
96        )
97        .await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesOutput,
105        crate::operation::register_transit_gateway_multicast_group_sources::RegisterTransitGatewayMulticastGroupSourcesError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The ID of the transit gateway multicast domain.</p>
120    pub fn transit_gateway_multicast_domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.transit_gateway_multicast_domain_id(input.into());
122        self
123    }
124    /// <p>The ID of the transit gateway multicast domain.</p>
125    pub fn set_transit_gateway_multicast_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_transit_gateway_multicast_domain_id(input);
127        self
128    }
129    /// <p>The ID of the transit gateway multicast domain.</p>
130    pub fn get_transit_gateway_multicast_domain_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_transit_gateway_multicast_domain_id()
132    }
133    /// <p>The IP address assigned to the transit gateway multicast group.</p>
134    pub fn group_ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.group_ip_address(input.into());
136        self
137    }
138    /// <p>The IP address assigned to the transit gateway multicast group.</p>
139    pub fn set_group_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_group_ip_address(input);
141        self
142    }
143    /// <p>The IP address assigned to the transit gateway multicast group.</p>
144    pub fn get_group_ip_address(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_group_ip_address()
146    }
147    ///
148    /// Appends an item to `NetworkInterfaceIds`.
149    ///
150    /// To override the contents of this collection use [`set_network_interface_ids`](Self::set_network_interface_ids).
151    ///
152    /// <p>The group sources' network interface IDs to register with the transit gateway multicast group.</p>
153    pub fn network_interface_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.network_interface_ids(input.into());
155        self
156    }
157    /// <p>The group sources' network interface IDs to register with the transit gateway multicast group.</p>
158    pub fn set_network_interface_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
159        self.inner = self.inner.set_network_interface_ids(input);
160        self
161    }
162    /// <p>The group sources' network interface IDs to register with the transit gateway multicast group.</p>
163    pub fn get_network_interface_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
164        self.inner.get_network_interface_ids()
165    }
166    /// <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>
167    pub fn dry_run(mut self, input: bool) -> Self {
168        self.inner = self.inner.dry_run(input);
169        self
170    }
171    /// <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>
172    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
173        self.inner = self.inner.set_dry_run(input);
174        self
175    }
176    /// <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>
177    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
178        self.inner.get_dry_run()
179    }
180}