aws_sdk_ec2/operation/describe_network_interface_permissions/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_network_interface_permissions::_describe_network_interface_permissions_output::DescribeNetworkInterfacePermissionsOutputBuilder;
3
4pub use crate::operation::describe_network_interface_permissions::_describe_network_interface_permissions_input::DescribeNetworkInterfacePermissionsInputBuilder;
5
6impl crate::operation::describe_network_interface_permissions::builders::DescribeNetworkInterfacePermissionsInputBuilder {
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_network_interface_permissions::DescribeNetworkInterfacePermissionsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_network_interface_permissions();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeNetworkInterfacePermissions`.
24///
25/// <p>Describes the permissions for your network interfaces.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DescribeNetworkInterfacePermissionsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::describe_network_interface_permissions::builders::DescribeNetworkInterfacePermissionsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsOutput,
35 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsError,
36 > for DescribeNetworkInterfacePermissionsFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsOutput,
44 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl DescribeNetworkInterfacePermissionsFluentBuilder {
51 /// Creates a new `DescribeNetworkInterfacePermissionsFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the DescribeNetworkInterfacePermissions as a reference.
60 pub fn as_input(&self) -> &crate::operation::describe_network_interface_permissions::builders::DescribeNetworkInterfacePermissionsInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins =
85 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissions::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissions::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsOutput,
98 crate::operation::describe_network_interface_permissions::DescribeNetworkInterfacePermissionsError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// Create a paginator for this request
113 ///
114 /// Paginators are used by calling [`send().await`](crate::operation::describe_network_interface_permissions::paginator::DescribeNetworkInterfacePermissionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
115 pub fn into_paginator(self) -> crate::operation::describe_network_interface_permissions::paginator::DescribeNetworkInterfacePermissionsPaginator {
116 crate::operation::describe_network_interface_permissions::paginator::DescribeNetworkInterfacePermissionsPaginator::new(
117 self.handle,
118 self.inner,
119 )
120 }
121 ///
122 /// Appends an item to `NetworkInterfacePermissionIds`.
123 ///
124 /// To override the contents of this collection use [`set_network_interface_permission_ids`](Self::set_network_interface_permission_ids).
125 ///
126 /// <p>The network interface permission IDs.</p>
127 pub fn network_interface_permission_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.network_interface_permission_ids(input.into());
129 self
130 }
131 /// <p>The network interface permission IDs.</p>
132 pub fn set_network_interface_permission_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
133 self.inner = self.inner.set_network_interface_permission_ids(input);
134 self
135 }
136 /// <p>The network interface permission IDs.</p>
137 pub fn get_network_interface_permission_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
138 self.inner.get_network_interface_permission_ids()
139 }
140 ///
141 /// Appends an item to `Filters`.
142 ///
143 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
144 ///
145 /// <p>One or more filters.</p>
146 /// <ul>
147 /// <li>
148 /// <p><code>network-interface-permission.network-interface-permission-id</code> - The ID of the permission.</p></li>
149 /// <li>
150 /// <p><code>network-interface-permission.network-interface-id</code> - The ID of the network interface.</p></li>
151 /// <li>
152 /// <p><code>network-interface-permission.aws-account-id</code> - The Amazon Web Services account ID.</p></li>
153 /// <li>
154 /// <p><code>network-interface-permission.aws-service</code> - The Amazon Web Services service.</p></li>
155 /// <li>
156 /// <p><code>network-interface-permission.permission</code> - The type of permission (<code>INSTANCE-ATTACH</code> | <code>EIP-ASSOCIATE</code>).</p></li>
157 /// </ul>
158 pub fn filters(mut self, input: crate::types::Filter) -> Self {
159 self.inner = self.inner.filters(input);
160 self
161 }
162 /// <p>One or more filters.</p>
163 /// <ul>
164 /// <li>
165 /// <p><code>network-interface-permission.network-interface-permission-id</code> - The ID of the permission.</p></li>
166 /// <li>
167 /// <p><code>network-interface-permission.network-interface-id</code> - The ID of the network interface.</p></li>
168 /// <li>
169 /// <p><code>network-interface-permission.aws-account-id</code> - The Amazon Web Services account ID.</p></li>
170 /// <li>
171 /// <p><code>network-interface-permission.aws-service</code> - The Amazon Web Services service.</p></li>
172 /// <li>
173 /// <p><code>network-interface-permission.permission</code> - The type of permission (<code>INSTANCE-ATTACH</code> | <code>EIP-ASSOCIATE</code>).</p></li>
174 /// </ul>
175 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
176 self.inner = self.inner.set_filters(input);
177 self
178 }
179 /// <p>One or more filters.</p>
180 /// <ul>
181 /// <li>
182 /// <p><code>network-interface-permission.network-interface-permission-id</code> - The ID of the permission.</p></li>
183 /// <li>
184 /// <p><code>network-interface-permission.network-interface-id</code> - The ID of the network interface.</p></li>
185 /// <li>
186 /// <p><code>network-interface-permission.aws-account-id</code> - The Amazon Web Services account ID.</p></li>
187 /// <li>
188 /// <p><code>network-interface-permission.aws-service</code> - The Amazon Web Services service.</p></li>
189 /// <li>
190 /// <p><code>network-interface-permission.permission</code> - The type of permission (<code>INSTANCE-ATTACH</code> | <code>EIP-ASSOCIATE</code>).</p></li>
191 /// </ul>
192 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
193 self.inner.get_filters()
194 }
195 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
196 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 self.inner = self.inner.next_token(input.into());
198 self
199 }
200 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
201 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_next_token(input);
203 self
204 }
205 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
206 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
207 self.inner.get_next_token()
208 }
209 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. If this parameter is not specified, up to 50 results are returned by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
210 pub fn max_results(mut self, input: i32) -> Self {
211 self.inner = self.inner.max_results(input);
212 self
213 }
214 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. If this parameter is not specified, up to 50 results are returned by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
215 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
216 self.inner = self.inner.set_max_results(input);
217 self
218 }
219 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. If this parameter is not specified, up to 50 results are returned by default. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
220 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
221 self.inner.get_max_results()
222 }
223}