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 an Amazon Web Services owned encryption key to encrypt your resources.</p>
143    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.kms_key_arn(input.into());
145        self
146    }
147    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
148    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses an Amazon Web Services owned encryption key to encrypt your resources.</p>
149    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_kms_key_arn(input);
151        self
152    }
153    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
154    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses an Amazon Web Services owned encryption key to encrypt your resources.</p>
155    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_kms_key_arn()
157    }
158    /// <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>
159    pub fn publicly_accessible(mut self, input: bool) -> Self {
160        self.inner = self.inner.publicly_accessible(input);
161        self
162    }
163    /// <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>
164    pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
165        self.inner = self.inner.set_publicly_accessible(input);
166        self
167    }
168    /// <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>
169    pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
170        self.inner.get_publicly_accessible()
171    }
172    /// <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>
173    pub fn network_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.network_type(input.into());
175        self
176    }
177    /// <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>
178    pub fn set_network_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_network_type(input);
180        self
181    }
182    /// <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>
183    pub fn get_network_type(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_network_type()
185    }
186    /// <p>A user-friendly name for the instance profile.</p>
187    pub fn instance_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.instance_profile_name(input.into());
189        self
190    }
191    /// <p>A user-friendly name for the instance profile.</p>
192    pub fn set_instance_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.inner = self.inner.set_instance_profile_name(input);
194        self
195    }
196    /// <p>A user-friendly name for the instance profile.</p>
197    pub fn get_instance_profile_name(&self) -> &::std::option::Option<::std::string::String> {
198        self.inner.get_instance_profile_name()
199    }
200    /// <p>A user-friendly description for the instance profile.</p>
201    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.description(input.into());
203        self
204    }
205    /// <p>A user-friendly description for the instance profile.</p>
206    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.inner = self.inner.set_description(input);
208        self
209    }
210    /// <p>A user-friendly description for the instance profile.</p>
211    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
212        self.inner.get_description()
213    }
214    /// <p>A subnet group to associate with the instance profile.</p>
215    pub fn subnet_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.inner = self.inner.subnet_group_identifier(input.into());
217        self
218    }
219    /// <p>A subnet group to associate with the instance profile.</p>
220    pub fn set_subnet_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.inner = self.inner.set_subnet_group_identifier(input);
222        self
223    }
224    /// <p>A subnet group to associate with the instance profile.</p>
225    pub fn get_subnet_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
226        self.inner.get_subnet_group_identifier()
227    }
228    ///
229    /// Appends an item to `VpcSecurityGroups`.
230    ///
231    /// To override the contents of this collection use [`set_vpc_security_groups`](Self::set_vpc_security_groups).
232    ///
233    /// <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>
234    pub fn vpc_security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.vpc_security_groups(input.into());
236        self
237    }
238    /// <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>
239    pub fn set_vpc_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
240        self.inner = self.inner.set_vpc_security_groups(input);
241        self
242    }
243    /// <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>
244    pub fn get_vpc_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
245        self.inner.get_vpc_security_groups()
246    }
247}