aws_sdk_ec2/operation/describe_vpc_endpoint_service_permissions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_vpc_endpoint_service_permissions::_describe_vpc_endpoint_service_permissions_output::DescribeVpcEndpointServicePermissionsOutputBuilder;
3
4pub use crate::operation::describe_vpc_endpoint_service_permissions::_describe_vpc_endpoint_service_permissions_input::DescribeVpcEndpointServicePermissionsInputBuilder;
5
6impl crate::operation::describe_vpc_endpoint_service_permissions::builders::DescribeVpcEndpointServicePermissionsInputBuilder {
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_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_vpc_endpoint_service_permissions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeVpcEndpointServicePermissions`.
24///
25/// <p>Describes the principals (service consumers) that are permitted to discover your VPC endpoint service. Principal ARNs with path components aren't supported.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DescribeVpcEndpointServicePermissionsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::describe_vpc_endpoint_service_permissions::builders::DescribeVpcEndpointServicePermissionsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsOutput,
35        crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsError,
36    > for DescribeVpcEndpointServicePermissionsFluentBuilder
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_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsOutput,
44            crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DescribeVpcEndpointServicePermissionsFluentBuilder {
51    /// Creates a new `DescribeVpcEndpointServicePermissionsFluentBuilder`.
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 DescribeVpcEndpointServicePermissions as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::describe_vpc_endpoint_service_permissions::builders::DescribeVpcEndpointServicePermissionsInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissions::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissions::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsOutput,
100        crate::operation::describe_vpc_endpoint_service_permissions::DescribeVpcEndpointServicePermissionsError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// Create a paginator for this request
115    ///
116    /// Paginators are used by calling [`send().await`](crate::operation::describe_vpc_endpoint_service_permissions::paginator::DescribeVpcEndpointServicePermissionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
117    pub fn into_paginator(
118        self,
119    ) -> crate::operation::describe_vpc_endpoint_service_permissions::paginator::DescribeVpcEndpointServicePermissionsPaginator {
120        crate::operation::describe_vpc_endpoint_service_permissions::paginator::DescribeVpcEndpointServicePermissionsPaginator::new(
121            self.handle,
122            self.inner,
123        )
124    }
125    /// <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>
126    pub fn dry_run(mut self, input: bool) -> Self {
127        self.inner = self.inner.dry_run(input);
128        self
129    }
130    /// <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>
131    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
132        self.inner = self.inner.set_dry_run(input);
133        self
134    }
135    /// <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>
136    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
137        self.inner.get_dry_run()
138    }
139    /// <p>The ID of the service.</p>
140    pub fn service_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.service_id(input.into());
142        self
143    }
144    /// <p>The ID of the service.</p>
145    pub fn set_service_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_service_id(input);
147        self
148    }
149    /// <p>The ID of the service.</p>
150    pub fn get_service_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_service_id()
152    }
153    ///
154    /// Appends an item to `Filters`.
155    ///
156    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
157    ///
158    /// <p>The filters.</p>
159    /// <ul>
160    /// <li>
161    /// <p><code>principal</code> - The ARN of the principal.</p></li>
162    /// <li>
163    /// <p><code>principal-type</code> - The principal type (<code>All</code> | <code>Service</code> | <code>OrganizationUnit</code> | <code>Account</code> | <code>User</code> | <code>Role</code>).</p></li>
164    /// </ul>
165    pub fn filters(mut self, input: crate::types::Filter) -> Self {
166        self.inner = self.inner.filters(input);
167        self
168    }
169    /// <p>The filters.</p>
170    /// <ul>
171    /// <li>
172    /// <p><code>principal</code> - The ARN of the principal.</p></li>
173    /// <li>
174    /// <p><code>principal-type</code> - The principal type (<code>All</code> | <code>Service</code> | <code>OrganizationUnit</code> | <code>Account</code> | <code>User</code> | <code>Role</code>).</p></li>
175    /// </ul>
176    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
177        self.inner = self.inner.set_filters(input);
178        self
179    }
180    /// <p>The filters.</p>
181    /// <ul>
182    /// <li>
183    /// <p><code>principal</code> - The ARN of the principal.</p></li>
184    /// <li>
185    /// <p><code>principal-type</code> - The principal type (<code>All</code> | <code>Service</code> | <code>OrganizationUnit</code> | <code>Account</code> | <code>User</code> | <code>Role</code>).</p></li>
186    /// </ul>
187    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
188        self.inner.get_filters()
189    }
190    /// <p>The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned <code>NextToken</code> value. This value can be between 5 and 1,000; if <code>MaxResults</code> is given a value larger than 1,000, only 1,000 results are returned.</p>
191    pub fn max_results(mut self, input: i32) -> Self {
192        self.inner = self.inner.max_results(input);
193        self
194    }
195    /// <p>The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned <code>NextToken</code> value. This value can be between 5 and 1,000; if <code>MaxResults</code> is given a value larger than 1,000, only 1,000 results are returned.</p>
196    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
197        self.inner = self.inner.set_max_results(input);
198        self
199    }
200    /// <p>The maximum number of results to return for the request in a single page. The remaining results of the initial request can be seen by sending another request with the returned <code>NextToken</code> value. This value can be between 5 and 1,000; if <code>MaxResults</code> is given a value larger than 1,000, only 1,000 results are returned.</p>
201    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
202        self.inner.get_max_results()
203    }
204    /// <p>The token to retrieve the next page of results.</p>
205    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.inner = self.inner.next_token(input.into());
207        self
208    }
209    /// <p>The token to retrieve the next page of results.</p>
210    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.inner = self.inner.set_next_token(input);
212        self
213    }
214    /// <p>The token to retrieve the next page of results.</p>
215    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
216        self.inner.get_next_token()
217    }
218}