aws_sdk_ec2/operation/modify_vpc_endpoint_service_permissions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_vpc_endpoint_service_permissions::_modify_vpc_endpoint_service_permissions_output::ModifyVpcEndpointServicePermissionsOutputBuilder;
3
4pub use crate::operation::modify_vpc_endpoint_service_permissions::_modify_vpc_endpoint_service_permissions_input::ModifyVpcEndpointServicePermissionsInputBuilder;
5
6impl crate::operation::modify_vpc_endpoint_service_permissions::builders::ModifyVpcEndpointServicePermissionsInputBuilder {
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::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_vpc_endpoint_service_permissions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyVpcEndpointServicePermissions`.
24///
25/// <p>Modifies the permissions for your VPC endpoint service. You can add or remove permissions for service consumers (Amazon Web Services accounts, users, and IAM roles) to connect to your endpoint service. Principal ARNs with path components aren't supported.</p>
26/// <p>If you grant permissions to all principals, the service is public. Any users who know the name of a public service can send a request to attach an endpoint. If the service does not require manual approval, attachments are automatically approved.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct ModifyVpcEndpointServicePermissionsFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::modify_vpc_endpoint_service_permissions::builders::ModifyVpcEndpointServicePermissionsInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsOutput,
36        crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsError,
37    > for ModifyVpcEndpointServicePermissionsFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsOutput,
45            crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl ModifyVpcEndpointServicePermissionsFluentBuilder {
52    /// Creates a new `ModifyVpcEndpointServicePermissionsFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the ModifyVpcEndpointServicePermissions as a reference.
61    pub fn as_input(&self) -> &crate::operation::modify_vpc_endpoint_service_permissions::builders::ModifyVpcEndpointServicePermissionsInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins =
86            crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissions::operation_runtime_plugins(
87                self.handle.runtime_plugins.clone(),
88                &self.handle.conf,
89                self.config_override,
90            );
91        crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissions::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsOutput,
99        crate::operation::modify_vpc_endpoint_service_permissions::ModifyVpcEndpointServicePermissionsError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <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>
114    pub fn dry_run(mut self, input: bool) -> Self {
115        self.inner = self.inner.dry_run(input);
116        self
117    }
118    /// <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>
119    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
120        self.inner = self.inner.set_dry_run(input);
121        self
122    }
123    /// <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>
124    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
125        self.inner.get_dry_run()
126    }
127    /// <p>The ID of the service.</p>
128    pub fn service_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.service_id(input.into());
130        self
131    }
132    /// <p>The ID of the service.</p>
133    pub fn set_service_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_service_id(input);
135        self
136    }
137    /// <p>The ID of the service.</p>
138    pub fn get_service_id(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_service_id()
140    }
141    ///
142    /// Appends an item to `AddAllowedPrincipals`.
143    ///
144    /// To override the contents of this collection use [`set_add_allowed_principals`](Self::set_add_allowed_principals).
145    ///
146    /// <p>The Amazon Resource Names (ARN) of the principals. Permissions are granted to the principals in this list. To grant permissions to all principals, specify an asterisk (*).</p>
147    pub fn add_allowed_principals(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.add_allowed_principals(input.into());
149        self
150    }
151    /// <p>The Amazon Resource Names (ARN) of the principals. Permissions are granted to the principals in this list. To grant permissions to all principals, specify an asterisk (*).</p>
152    pub fn set_add_allowed_principals(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153        self.inner = self.inner.set_add_allowed_principals(input);
154        self
155    }
156    /// <p>The Amazon Resource Names (ARN) of the principals. Permissions are granted to the principals in this list. To grant permissions to all principals, specify an asterisk (*).</p>
157    pub fn get_add_allowed_principals(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
158        self.inner.get_add_allowed_principals()
159    }
160    ///
161    /// Appends an item to `RemoveAllowedPrincipals`.
162    ///
163    /// To override the contents of this collection use [`set_remove_allowed_principals`](Self::set_remove_allowed_principals).
164    ///
165    /// <p>The Amazon Resource Names (ARN) of the principals. Permissions are revoked for principals in this list.</p>
166    pub fn remove_allowed_principals(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.remove_allowed_principals(input.into());
168        self
169    }
170    /// <p>The Amazon Resource Names (ARN) of the principals. Permissions are revoked for principals in this list.</p>
171    pub fn set_remove_allowed_principals(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
172        self.inner = self.inner.set_remove_allowed_principals(input);
173        self
174    }
175    /// <p>The Amazon Resource Names (ARN) of the principals. Permissions are revoked for principals in this list.</p>
176    pub fn get_remove_allowed_principals(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
177        self.inner.get_remove_allowed_principals()
178    }
179}