aws_sdk_databasemigration/operation/modify_instance_profile/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_instance_profile::_modify_instance_profile_output::ModifyInstanceProfileOutputBuilder;
3
4pub use crate::operation::modify_instance_profile::_modify_instance_profile_input::ModifyInstanceProfileInputBuilder;
5
6impl crate::operation::modify_instance_profile::builders::ModifyInstanceProfileInputBuilder {
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_instance_profile::ModifyInstanceProfileOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_instance_profile::ModifyInstanceProfileError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_instance_profile();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyInstanceProfile`.
24///
25/// <p>Modifies the specified instance profile using the provided parameters.</p><note>
26/// <p>All migration projects associated with the instance profile must be deleted or modified before you can modify the instance profile.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct ModifyInstanceProfileFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::modify_instance_profile::builders::ModifyInstanceProfileInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::modify_instance_profile::ModifyInstanceProfileOutput,
37        crate::operation::modify_instance_profile::ModifyInstanceProfileError,
38    > for ModifyInstanceProfileFluentBuilder
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::modify_instance_profile::ModifyInstanceProfileOutput,
46            crate::operation::modify_instance_profile::ModifyInstanceProfileError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl ModifyInstanceProfileFluentBuilder {
53    /// Creates a new `ModifyInstanceProfileFluentBuilder`.
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 ModifyInstanceProfile as a reference.
62    pub fn as_input(&self) -> &crate::operation::modify_instance_profile::builders::ModifyInstanceProfileInputBuilder {
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::modify_instance_profile::ModifyInstanceProfileOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::modify_instance_profile::ModifyInstanceProfileError,
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 = crate::operation::modify_instance_profile::ModifyInstanceProfile::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::modify_instance_profile::ModifyInstanceProfile::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_instance_profile::ModifyInstanceProfileOutput,
99        crate::operation::modify_instance_profile::ModifyInstanceProfileError,
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>The identifier of the instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.</p>
114    pub fn instance_profile_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.instance_profile_identifier(input.into());
116        self
117    }
118    /// <p>The identifier of the instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.</p>
119    pub fn set_instance_profile_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_instance_profile_identifier(input);
121        self
122    }
123    /// <p>The identifier of the instance profile. Identifiers must begin with a letter and must contain only ASCII letters, digits, and hyphens. They can't end with a hyphen, or contain two consecutive hyphens.</p>
124    pub fn get_instance_profile_identifier(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_instance_profile_identifier()
126    }
127    /// <p>The Availability Zone where the instance profile runs.</p>
128    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.availability_zone(input.into());
130        self
131    }
132    /// <p>The Availability Zone where the instance profile runs.</p>
133    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_availability_zone(input);
135        self
136    }
137    /// <p>The Availability Zone where the instance profile runs.</p>
138    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_availability_zone()
140    }
141    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
142    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses your default encryption key.</p>
143    /// <p>KMS creates the default encryption key for your Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each Amazon Web Services Region.</p>
144    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.kms_key_arn(input.into());
146        self
147    }
148    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
149    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses your default encryption key.</p>
150    /// <p>KMS creates the default encryption key for your Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each Amazon Web Services Region.</p>
151    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_kms_key_arn(input);
153        self
154    }
155    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
156    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses your default encryption key.</p>
157    /// <p>KMS creates the default encryption key for your Amazon Web Services account. Your Amazon Web Services account has a different default encryption key for each Amazon Web Services Region.</p>
158    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_kms_key_arn()
160    }
161    /// <p>Specifies the accessibility options for the instance profile. A value of <code>true</code> represents an instance profile with a public IP address. A value of <code>false</code> represents an instance profile with a private IP address. The default value is <code>true</code>.</p>
162    pub fn publicly_accessible(mut self, input: bool) -> Self {
163        self.inner = self.inner.publicly_accessible(input);
164        self
165    }
166    /// <p>Specifies the accessibility options for the instance profile. A value of <code>true</code> represents an instance profile with a public IP address. A value of <code>false</code> represents an instance profile with a private IP address. The default value is <code>true</code>.</p>
167    pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
168        self.inner = self.inner.set_publicly_accessible(input);
169        self
170    }
171    /// <p>Specifies the accessibility options for the instance profile. A value of <code>true</code> represents an instance profile with a public IP address. A value of <code>false</code> represents an instance profile with a private IP address. The default value is <code>true</code>.</p>
172    pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
173        self.inner.get_publicly_accessible()
174    }
175    /// <p>Specifies the network type for the instance profile. A value of <code>IPV4</code> represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of <code>IPV6</code> represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of <code>DUAL</code> represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.</p>
176    pub fn network_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.network_type(input.into());
178        self
179    }
180    /// <p>Specifies the network type for the instance profile. A value of <code>IPV4</code> represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of <code>IPV6</code> represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of <code>DUAL</code> represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.</p>
181    pub fn set_network_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_network_type(input);
183        self
184    }
185    /// <p>Specifies the network type for the instance profile. A value of <code>IPV4</code> represents an instance profile with IPv4 network type and only supports IPv4 addressing. A value of <code>IPV6</code> represents an instance profile with IPv6 network type and only supports IPv6 addressing. A value of <code>DUAL</code> represents an instance profile with dual network type that supports IPv4 and IPv6 addressing.</p>
186    pub fn get_network_type(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_network_type()
188    }
189    /// <p>A user-friendly name for the instance profile.</p>
190    pub fn instance_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.instance_profile_name(input.into());
192        self
193    }
194    /// <p>A user-friendly name for the instance profile.</p>
195    pub fn set_instance_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_instance_profile_name(input);
197        self
198    }
199    /// <p>A user-friendly name for the instance profile.</p>
200    pub fn get_instance_profile_name(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_instance_profile_name()
202    }
203    /// <p>A user-friendly description for the instance profile.</p>
204    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.description(input.into());
206        self
207    }
208    /// <p>A user-friendly description for the instance profile.</p>
209    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_description(input);
211        self
212    }
213    /// <p>A user-friendly description for the instance profile.</p>
214    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_description()
216    }
217    /// <p>A subnet group to associate with the instance profile.</p>
218    pub fn subnet_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.inner = self.inner.subnet_group_identifier(input.into());
220        self
221    }
222    /// <p>A subnet group to associate with the instance profile.</p>
223    pub fn set_subnet_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224        self.inner = self.inner.set_subnet_group_identifier(input);
225        self
226    }
227    /// <p>A subnet group to associate with the instance profile.</p>
228    pub fn get_subnet_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
229        self.inner.get_subnet_group_identifier()
230    }
231    ///
232    /// Appends an item to `VpcSecurityGroups`.
233    ///
234    /// To override the contents of this collection use [`set_vpc_security_groups`](Self::set_vpc_security_groups).
235    ///
236    /// <p>Specifies the VPC security groups to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>
237    pub fn vpc_security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.vpc_security_groups(input.into());
239        self
240    }
241    /// <p>Specifies the VPC security groups to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>
242    pub fn set_vpc_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
243        self.inner = self.inner.set_vpc_security_groups(input);
244        self
245    }
246    /// <p>Specifies the VPC security groups to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>
247    pub fn get_vpc_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
248        self.inner.get_vpc_security_groups()
249    }
250}