aws_sdk_cloudhsm/operation/modify_hsm/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_hsm::_modify_hsm_output::ModifyHsmOutputBuilder;
3
4pub use crate::operation::modify_hsm::_modify_hsm_input::ModifyHsmInputBuilder;
5
6impl crate::operation::modify_hsm::builders::ModifyHsmInputBuilder {
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_hsm::ModifyHsmOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_hsm::ModifyHsmError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_hsm();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyHsm`.
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>Modifies an HSM.</p><important>
28/// <p>This operation can result in the HSM being offline for up to 15 minutes while the AWS CloudHSM service is reconfigured. If you are modifying a production HSM, you should ensure that your AWS CloudHSM service is configured for high availability, and consider executing this operation during a maintenance window.</p>
29/// </important>
30#[deprecated(note = "This API is deprecated.")]
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct ModifyHsmFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::modify_hsm::builders::ModifyHsmInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl crate::client::customize::internal::CustomizableSend<crate::operation::modify_hsm::ModifyHsmOutput, crate::operation::modify_hsm::ModifyHsmError>
38    for ModifyHsmFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<crate::operation::modify_hsm::ModifyHsmOutput, crate::operation::modify_hsm::ModifyHsmError>,
45    > {
46        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
47    }
48}
49impl ModifyHsmFluentBuilder {
50    /// Creates a new `ModifyHsmFluentBuilder`.
51    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
52        Self {
53            handle,
54            inner: ::std::default::Default::default(),
55            config_override: ::std::option::Option::None,
56        }
57    }
58    /// Access the ModifyHsm as a reference.
59    pub fn as_input(&self) -> &crate::operation::modify_hsm::builders::ModifyHsmInputBuilder {
60        &self.inner
61    }
62    /// Sends the request and returns the response.
63    ///
64    /// If an error occurs, an `SdkError` will be returned with additional details that
65    /// can be matched against.
66    ///
67    /// By default, any retryable failures will be retried twice. Retry behavior
68    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
69    /// set when configuring the client.
70    pub async fn send(
71        self,
72    ) -> ::std::result::Result<
73        crate::operation::modify_hsm::ModifyHsmOutput,
74        ::aws_smithy_runtime_api::client::result::SdkError<
75            crate::operation::modify_hsm::ModifyHsmError,
76            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
77        >,
78    > {
79        let input = self
80            .inner
81            .build()
82            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
83        let runtime_plugins = crate::operation::modify_hsm::ModifyHsm::operation_runtime_plugins(
84            self.handle.runtime_plugins.clone(),
85            &self.handle.conf,
86            self.config_override,
87        );
88        crate::operation::modify_hsm::ModifyHsm::orchestrate(&runtime_plugins, input).await
89    }
90
91    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
92    pub fn customize(
93        self,
94    ) -> crate::client::customize::CustomizableOperation<
95        crate::operation::modify_hsm::ModifyHsmOutput,
96        crate::operation::modify_hsm::ModifyHsmError,
97        Self,
98    > {
99        crate::client::customize::CustomizableOperation::new(self)
100    }
101    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
102        self.set_config_override(::std::option::Option::Some(config_override.into()));
103        self
104    }
105
106    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
107        self.config_override = config_override;
108        self
109    }
110    /// <p>The ARN of the HSM to modify.</p>
111    pub fn hsm_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.inner = self.inner.hsm_arn(input.into());
113        self
114    }
115    /// <p>The ARN of the HSM to modify.</p>
116    pub fn set_hsm_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.inner = self.inner.set_hsm_arn(input);
118        self
119    }
120    /// <p>The ARN of the HSM to modify.</p>
121    pub fn get_hsm_arn(&self) -> &::std::option::Option<::std::string::String> {
122        self.inner.get_hsm_arn()
123    }
124    /// <p>The new identifier of the subnet that the HSM is in. The new subnet must be in the same Availability Zone as the current subnet.</p>
125    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.subnet_id(input.into());
127        self
128    }
129    /// <p>The new identifier of the subnet that the HSM is in. The new subnet must be in the same Availability Zone as the current subnet.</p>
130    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_subnet_id(input);
132        self
133    }
134    /// <p>The new identifier of the subnet that the HSM is in. The new subnet must be in the same Availability Zone as the current subnet.</p>
135    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_subnet_id()
137    }
138    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
139    /// <p>If the HSM is moved to a different subnet, and an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the new subnet.</p>
140    pub fn eni_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.eni_ip(input.into());
142        self
143    }
144    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
145    /// <p>If the HSM is moved to a different subnet, and an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the new subnet.</p>
146    pub fn set_eni_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147        self.inner = self.inner.set_eni_ip(input);
148        self
149    }
150    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
151    /// <p>If the HSM is moved to a different subnet, and an IP address is not specified, an IP address will be randomly chosen from the CIDR range of the new subnet.</p>
152    pub fn get_eni_ip(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_eni_ip()
154    }
155    /// <p>The new IAM role ARN.</p>
156    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.iam_role_arn(input.into());
158        self
159    }
160    /// <p>The new IAM role ARN.</p>
161    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_iam_role_arn(input);
163        self
164    }
165    /// <p>The new IAM role ARN.</p>
166    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_iam_role_arn()
168    }
169    /// <p>The new external ID.</p>
170    pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.external_id(input.into());
172        self
173    }
174    /// <p>The new external ID.</p>
175    pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_external_id(input);
177        self
178    }
179    /// <p>The new external ID.</p>
180    pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_external_id()
182    }
183    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
184    pub fn syslog_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.syslog_ip(input.into());
186        self
187    }
188    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
189    pub fn set_syslog_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_syslog_ip(input);
191        self
192    }
193    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
194    pub fn get_syslog_ip(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_syslog_ip()
196    }
197}