aws_sdk_databasemigration/operation/create_instance_profile/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_instance_profile::_create_instance_profile_output::CreateInstanceProfileOutputBuilder;
3
4pub use crate::operation::create_instance_profile::_create_instance_profile_input::CreateInstanceProfileInputBuilder;
5
6impl crate::operation::create_instance_profile::builders::CreateInstanceProfileInputBuilder {
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::create_instance_profile::CreateInstanceProfileOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_instance_profile::CreateInstanceProfileError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_instance_profile();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateInstanceProfile`.
24///
25/// <p>Creates the instance profile using the specified parameters.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateInstanceProfileFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_instance_profile::builders::CreateInstanceProfileInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_instance_profile::CreateInstanceProfileOutput,
35        crate::operation::create_instance_profile::CreateInstanceProfileError,
36    > for CreateInstanceProfileFluentBuilder
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::create_instance_profile::CreateInstanceProfileOutput,
44            crate::operation::create_instance_profile::CreateInstanceProfileError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateInstanceProfileFluentBuilder {
51    /// Creates a new `CreateInstanceProfileFluentBuilder`.
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 CreateInstanceProfile as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_instance_profile::builders::CreateInstanceProfileInputBuilder {
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::create_instance_profile::CreateInstanceProfileOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_instance_profile::CreateInstanceProfileError,
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 = crate::operation::create_instance_profile::CreateInstanceProfile::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_instance_profile::CreateInstanceProfile::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_instance_profile::CreateInstanceProfileOutput,
97        crate::operation::create_instance_profile::CreateInstanceProfileError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The Availability Zone where the instance profile will be created. The default value is a random, system-chosen Availability Zone in the Amazon Web Services Region where your data provider is created, for examplem <code>us-east-1d</code>.</p>
112    pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.availability_zone(input.into());
114        self
115    }
116    /// <p>The Availability Zone where the instance profile will be created. The default value is a random, system-chosen Availability Zone in the Amazon Web Services Region where your data provider is created, for examplem <code>us-east-1d</code>.</p>
117    pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_availability_zone(input);
119        self
120    }
121    /// <p>The Availability Zone where the instance profile will be created. The default value is a random, system-chosen Availability Zone in the Amazon Web Services Region where your data provider is created, for examplem <code>us-east-1d</code>.</p>
122    pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_availability_zone()
124    }
125    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
126    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses your default encryption key.</p>
127    /// <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>
128    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.kms_key_arn(input.into());
130        self
131    }
132    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
133    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses your default encryption key.</p>
134    /// <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>
135    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_kms_key_arn(input);
137        self
138    }
139    /// <p>The Amazon Resource Name (ARN) of the KMS key that is used to encrypt the connection parameters for the instance profile.</p>
140    /// <p>If you don't specify a value for the <code>KmsKeyArn</code> parameter, then DMS uses your default encryption key.</p>
141    /// <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>
142    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_kms_key_arn()
144    }
145    /// <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>
146    pub fn publicly_accessible(mut self, input: bool) -> Self {
147        self.inner = self.inner.publicly_accessible(input);
148        self
149    }
150    /// <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>
151    pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
152        self.inner = self.inner.set_publicly_accessible(input);
153        self
154    }
155    /// <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>
156    pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
157        self.inner.get_publicly_accessible()
158    }
159    ///
160    /// Appends an item to `Tags`.
161    ///
162    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
163    ///
164    /// <p>One or more tags to be assigned to the instance profile.</p>
165    pub fn tags(mut self, input: crate::types::Tag) -> Self {
166        self.inner = self.inner.tags(input);
167        self
168    }
169    /// <p>One or more tags to be assigned to the instance profile.</p>
170    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
171        self.inner = self.inner.set_tags(input);
172        self
173    }
174    /// <p>One or more tags to be assigned to the instance profile.</p>
175    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
176        self.inner.get_tags()
177    }
178    /// <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>
179    pub fn network_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.inner = self.inner.network_type(input.into());
181        self
182    }
183    /// <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>
184    pub fn set_network_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.inner = self.inner.set_network_type(input);
186        self
187    }
188    /// <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>
189    pub fn get_network_type(&self) -> &::std::option::Option<::std::string::String> {
190        self.inner.get_network_type()
191    }
192    /// <p>A user-friendly name for the instance profile.</p>
193    pub fn instance_profile_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.instance_profile_name(input.into());
195        self
196    }
197    /// <p>A user-friendly name for the instance profile.</p>
198    pub fn set_instance_profile_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.inner = self.inner.set_instance_profile_name(input);
200        self
201    }
202    /// <p>A user-friendly name for the instance profile.</p>
203    pub fn get_instance_profile_name(&self) -> &::std::option::Option<::std::string::String> {
204        self.inner.get_instance_profile_name()
205    }
206    /// <p>A user-friendly description of the instance profile.</p>
207    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.description(input.into());
209        self
210    }
211    /// <p>A user-friendly description of the instance profile.</p>
212    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_description(input);
214        self
215    }
216    /// <p>A user-friendly description of the instance profile.</p>
217    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_description()
219    }
220    /// <p>A subnet group to associate with the instance profile.</p>
221    pub fn subnet_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
222        self.inner = self.inner.subnet_group_identifier(input.into());
223        self
224    }
225    /// <p>A subnet group to associate with the instance profile.</p>
226    pub fn set_subnet_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
227        self.inner = self.inner.set_subnet_group_identifier(input);
228        self
229    }
230    /// <p>A subnet group to associate with the instance profile.</p>
231    pub fn get_subnet_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
232        self.inner.get_subnet_group_identifier()
233    }
234    ///
235    /// Appends an item to `VpcSecurityGroups`.
236    ///
237    /// To override the contents of this collection use [`set_vpc_security_groups`](Self::set_vpc_security_groups).
238    ///
239    /// <p>Specifies the VPC security group names to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>
240    pub fn vpc_security_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241        self.inner = self.inner.vpc_security_groups(input.into());
242        self
243    }
244    /// <p>Specifies the VPC security group names to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>
245    pub fn set_vpc_security_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
246        self.inner = self.inner.set_vpc_security_groups(input);
247        self
248    }
249    /// <p>Specifies the VPC security group names to be used with the instance profile. The VPC security group must work with the VPC containing the instance profile.</p>
250    pub fn get_vpc_security_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
251        self.inner.get_vpc_security_groups()
252    }
253}