aws_sdk_ec2/operation/describe_route_server_peers/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_route_server_peers::_describe_route_server_peers_output::DescribeRouteServerPeersOutputBuilder;
3
4pub use crate::operation::describe_route_server_peers::_describe_route_server_peers_input::DescribeRouteServerPeersInputBuilder;
5
6impl crate::operation::describe_route_server_peers::builders::DescribeRouteServerPeersInputBuilder {
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::describe_route_server_peers::DescribeRouteServerPeersOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_route_server_peers::DescribeRouteServerPeersError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_route_server_peers();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeRouteServerPeers`.
24///
25/// <p>Describes one or more route server peers.</p>
26/// <p>A route server peer is a session between a route server endpoint and the device deployed in Amazon Web Services (such as a firewall appliance or other network security function running on an EC2 instance). The device must meet these requirements:</p>
27/// <ul>
28/// <li>
29/// <p>Have an elastic network interface in the VPC</p></li>
30/// <li>
31/// <p>Support BGP (Border Gateway Protocol)</p></li>
32/// <li>
33/// <p>Can initiate BGP sessions</p></li>
34/// </ul>
35/// <p>For more information see <a href="https://docs.aws.amazon.com/vpc/latest/userguide/dynamic-routing-route-server.html">Dynamic routing in your VPC with VPC Route Server</a> in the <i>Amazon VPC User Guide</i>.</p>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct DescribeRouteServerPeersFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::describe_route_server_peers::builders::DescribeRouteServerPeersInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::describe_route_server_peers::DescribeRouteServerPeersOutput,
45        crate::operation::describe_route_server_peers::DescribeRouteServerPeersError,
46    > for DescribeRouteServerPeersFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::describe_route_server_peers::DescribeRouteServerPeersOutput,
54            crate::operation::describe_route_server_peers::DescribeRouteServerPeersError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl DescribeRouteServerPeersFluentBuilder {
61    /// Creates a new `DescribeRouteServerPeersFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the DescribeRouteServerPeers as a reference.
70    pub fn as_input(&self) -> &crate::operation::describe_route_server_peers::builders::DescribeRouteServerPeersInputBuilder {
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::describe_route_server_peers::DescribeRouteServerPeersOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::describe_route_server_peers::DescribeRouteServerPeersError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins = crate::operation::describe_route_server_peers::DescribeRouteServerPeers::operation_runtime_plugins(
95            self.handle.runtime_plugins.clone(),
96            &self.handle.conf,
97            self.config_override,
98        );
99        crate::operation::describe_route_server_peers::DescribeRouteServerPeers::orchestrate(&runtime_plugins, input).await
100    }
101
102    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103    pub fn customize(
104        self,
105    ) -> crate::client::customize::CustomizableOperation<
106        crate::operation::describe_route_server_peers::DescribeRouteServerPeersOutput,
107        crate::operation::describe_route_server_peers::DescribeRouteServerPeersError,
108        Self,
109    > {
110        crate::client::customize::CustomizableOperation::new(self)
111    }
112    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113        self.set_config_override(::std::option::Option::Some(config_override.into()));
114        self
115    }
116
117    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118        self.config_override = config_override;
119        self
120    }
121    /// Create a paginator for this request
122    ///
123    /// Paginators are used by calling [`send().await`](crate::operation::describe_route_server_peers::paginator::DescribeRouteServerPeersPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
124    pub fn into_paginator(self) -> crate::operation::describe_route_server_peers::paginator::DescribeRouteServerPeersPaginator {
125        crate::operation::describe_route_server_peers::paginator::DescribeRouteServerPeersPaginator::new(self.handle, self.inner)
126    }
127    ///
128    /// Appends an item to `RouteServerPeerIds`.
129    ///
130    /// To override the contents of this collection use [`set_route_server_peer_ids`](Self::set_route_server_peer_ids).
131    ///
132    /// <p>The IDs of the route server peers to describe.</p>
133    pub fn route_server_peer_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.route_server_peer_ids(input.into());
135        self
136    }
137    /// <p>The IDs of the route server peers to describe.</p>
138    pub fn set_route_server_peer_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
139        self.inner = self.inner.set_route_server_peer_ids(input);
140        self
141    }
142    /// <p>The IDs of the route server peers to describe.</p>
143    pub fn get_route_server_peer_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
144        self.inner.get_route_server_peer_ids()
145    }
146    /// <p>The token for the next page of results.</p>
147    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.next_token(input.into());
149        self
150    }
151    /// <p>The token for the next page of results.</p>
152    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_next_token(input);
154        self
155    }
156    /// <p>The token for the next page of results.</p>
157    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_next_token()
159    }
160    /// <p>The maximum number of results to return with a single call.</p>
161    pub fn max_results(mut self, input: i32) -> Self {
162        self.inner = self.inner.max_results(input);
163        self
164    }
165    /// <p>The maximum number of results to return with a single call.</p>
166    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
167        self.inner = self.inner.set_max_results(input);
168        self
169    }
170    /// <p>The maximum number of results to return with a single call.</p>
171    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
172        self.inner.get_max_results()
173    }
174    ///
175    /// Appends an item to `Filters`.
176    ///
177    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
178    ///
179    /// <p>One or more filters to apply to the describe request.</p>
180    pub fn filters(mut self, input: crate::types::Filter) -> Self {
181        self.inner = self.inner.filters(input);
182        self
183    }
184    /// <p>One or more filters to apply to the describe request.</p>
185    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
186        self.inner = self.inner.set_filters(input);
187        self
188    }
189    /// <p>One or more filters to apply to the describe request.</p>
190    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
191        self.inner.get_filters()
192    }
193    /// <p>A check for 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>
194    pub fn dry_run(mut self, input: bool) -> Self {
195        self.inner = self.inner.dry_run(input);
196        self
197    }
198    /// <p>A check for 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>
199    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
200        self.inner = self.inner.set_dry_run(input);
201        self
202    }
203    /// <p>A check for 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>
204    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
205        self.inner.get_dry_run()
206    }
207}