aws_sdk_cloudhsm/operation/create_hsm/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_hsm::_create_hsm_output::CreateHsmOutputBuilder;
3
4pub use crate::operation::create_hsm::_create_hsm_input::CreateHsmInputBuilder;
5
6impl crate::operation::create_hsm::builders::CreateHsmInputBuilder {
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_hsm::CreateHsmOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_hsm::CreateHsmError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_hsm();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateHsm`.
24///
25/// <p>This is documentation for <b>AWS CloudHSM Classic</b>. For more information, see <a href="http://aws.amazon.com/cloudhsm/faqs-classic/">AWS CloudHSM Classic FAQs</a>, the <a href="https://docs.aws.amazon.com/cloudhsm/classic/userguide/">AWS CloudHSM Classic User Guide</a>, and the <a href="https://docs.aws.amazon.com/cloudhsm/classic/APIReference/">AWS CloudHSM Classic API Reference</a>.</p>
26/// <p><b>For information about the current version of AWS CloudHSM</b>, see <a href="http://aws.amazon.com/cloudhsm/">AWS CloudHSM</a>, the <a href="https://docs.aws.amazon.com/cloudhsm/latest/userguide/">AWS CloudHSM User Guide</a>, and the <a href="https://docs.aws.amazon.com/cloudhsm/latest/APIReference/">AWS CloudHSM API Reference</a>.</p>
27/// <p>Creates an uninitialized HSM instance.</p>
28/// <p>There is an upfront fee charged for each HSM instance that you create with the <code>CreateHsm</code> operation. If you accidentally provision an HSM and want to request a refund, delete the instance using the <code>DeleteHsm</code> operation, go to the <a href="https://console.aws.amazon.com/support/home">AWS Support Center</a>, create a new case, and select <b>Account and Billing Support</b>.</p><important>
29/// <p>It can take up to 20 minutes to create and provision an HSM. You can monitor the status of the HSM with the <code>DescribeHsm</code> operation. The HSM is ready to be initialized when the status changes to <code>RUNNING</code>.</p>
30/// </important>
31#[deprecated(note = "This API is deprecated.")]
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct CreateHsmFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::create_hsm::builders::CreateHsmInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl crate::client::customize::internal::CustomizableSend<crate::operation::create_hsm::CreateHsmOutput, crate::operation::create_hsm::CreateHsmError>
39    for CreateHsmFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<crate::operation::create_hsm::CreateHsmOutput, crate::operation::create_hsm::CreateHsmError>,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateHsmFluentBuilder {
51    /// Creates a new `CreateHsmFluentBuilder`.
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 CreateHsm as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_hsm::builders::CreateHsmInputBuilder {
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_hsm::CreateHsmOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_hsm::CreateHsmError,
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_hsm::CreateHsm::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_hsm::CreateHsm::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_hsm::CreateHsmOutput,
97        crate::operation::create_hsm::CreateHsmError,
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 identifier of the subnet in your VPC in which to place the HSM.</p>
112    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.subnet_id(input.into());
114        self
115    }
116    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
117    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_subnet_id(input);
119        self
120    }
121    /// <p>The identifier of the subnet in your VPC in which to place the HSM.</p>
122    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_subnet_id()
124    }
125    /// <p>The SSH public key to install on the HSM.</p>
126    pub fn ssh_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.ssh_key(input.into());
128        self
129    }
130    /// <p>The SSH public key to install on the HSM.</p>
131    pub fn set_ssh_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_ssh_key(input);
133        self
134    }
135    /// <p>The SSH public key to install on the HSM.</p>
136    pub fn get_ssh_key(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_ssh_key()
138    }
139    /// <p>The IP address to assign to the HSM's ENI.</p>
140    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
141    pub fn eni_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142        self.inner = self.inner.eni_ip(input.into());
143        self
144    }
145    /// <p>The IP address to assign to the HSM's ENI.</p>
146    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
147    pub fn set_eni_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_eni_ip(input);
149        self
150    }
151    /// <p>The IP address to assign to the HSM's ENI.</p>
152    /// <p>If an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the subnet.</p>
153    pub fn get_eni_ip(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_eni_ip()
155    }
156    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
157    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.iam_role_arn(input.into());
159        self
160    }
161    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
162    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_iam_role_arn(input);
164        self
165    }
166    /// <p>The ARN of an IAM role to enable the AWS CloudHSM service to allocate an ENI on your behalf.</p>
167    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_iam_role_arn()
169    }
170    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
171    pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.external_id(input.into());
173        self
174    }
175    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
176    pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_external_id(input);
178        self
179    }
180    /// <p>The external ID from <code>IamRoleArn</code>, if present.</p>
181    pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_external_id()
183    }
184    /// <p>Specifies the type of subscription for the HSM.</p>
185    /// <ul>
186    /// <li>
187    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
188    /// <li>
189    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
190    /// </ul>
191    pub fn subscription_type(mut self, input: crate::types::SubscriptionType) -> Self {
192        self.inner = self.inner.subscription_type(input);
193        self
194    }
195    /// <p>Specifies the type of subscription for the HSM.</p>
196    /// <ul>
197    /// <li>
198    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
199    /// <li>
200    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
201    /// </ul>
202    pub fn set_subscription_type(mut self, input: ::std::option::Option<crate::types::SubscriptionType>) -> Self {
203        self.inner = self.inner.set_subscription_type(input);
204        self
205    }
206    /// <p>Specifies the type of subscription for the HSM.</p>
207    /// <ul>
208    /// <li>
209    /// <p><b>PRODUCTION</b> - The HSM is being used in a production environment.</p></li>
210    /// <li>
211    /// <p><b>TRIAL</b> - The HSM is being used in a product trial.</p></li>
212    /// </ul>
213    pub fn get_subscription_type(&self) -> &::std::option::Option<crate::types::SubscriptionType> {
214        self.inner.get_subscription_type()
215    }
216    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
217    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.inner = self.inner.client_token(input.into());
219        self
220    }
221    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
222    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223        self.inner = self.inner.set_client_token(input);
224        self
225    }
226    /// <p>A user-defined token to ensure idempotence. Subsequent calls to this operation with the same token will be ignored.</p>
227    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
228        self.inner.get_client_token()
229    }
230    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
231    pub fn syslog_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.syslog_ip(input.into());
233        self
234    }
235    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
236    pub fn set_syslog_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237        self.inner = self.inner.set_syslog_ip(input);
238        self
239    }
240    /// <p>The IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
241    pub fn get_syslog_ip(&self) -> &::std::option::Option<::std::string::String> {
242        self.inner.get_syslog_ip()
243    }
244}