aws_sdk_cloudhsm/operation/modify_hsm/
_modify_hsm_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the inputs for the <code>ModifyHsm</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ModifyHsmInput {
7    /// <p>The ARN of the HSM to modify.</p>
8    pub hsm_arn: ::std::option::Option<::std::string::String>,
9    /// <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>
10    pub subnet_id: ::std::option::Option<::std::string::String>,
11    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
12    /// <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>
13    pub eni_ip: ::std::option::Option<::std::string::String>,
14    /// <p>The new IAM role ARN.</p>
15    pub iam_role_arn: ::std::option::Option<::std::string::String>,
16    /// <p>The new external ID.</p>
17    pub external_id: ::std::option::Option<::std::string::String>,
18    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
19    pub syslog_ip: ::std::option::Option<::std::string::String>,
20}
21impl ModifyHsmInput {
22    /// <p>The ARN of the HSM to modify.</p>
23    pub fn hsm_arn(&self) -> ::std::option::Option<&str> {
24        self.hsm_arn.as_deref()
25    }
26    /// <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>
27    pub fn subnet_id(&self) -> ::std::option::Option<&str> {
28        self.subnet_id.as_deref()
29    }
30    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
31    /// <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>
32    pub fn eni_ip(&self) -> ::std::option::Option<&str> {
33        self.eni_ip.as_deref()
34    }
35    /// <p>The new IAM role ARN.</p>
36    pub fn iam_role_arn(&self) -> ::std::option::Option<&str> {
37        self.iam_role_arn.as_deref()
38    }
39    /// <p>The new external ID.</p>
40    pub fn external_id(&self) -> ::std::option::Option<&str> {
41        self.external_id.as_deref()
42    }
43    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
44    pub fn syslog_ip(&self) -> ::std::option::Option<&str> {
45        self.syslog_ip.as_deref()
46    }
47}
48impl ModifyHsmInput {
49    /// Creates a new builder-style object to manufacture [`ModifyHsmInput`](crate::operation::modify_hsm::ModifyHsmInput).
50    pub fn builder() -> crate::operation::modify_hsm::builders::ModifyHsmInputBuilder {
51        crate::operation::modify_hsm::builders::ModifyHsmInputBuilder::default()
52    }
53}
54
55/// A builder for [`ModifyHsmInput`](crate::operation::modify_hsm::ModifyHsmInput).
56#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct ModifyHsmInputBuilder {
59    pub(crate) hsm_arn: ::std::option::Option<::std::string::String>,
60    pub(crate) subnet_id: ::std::option::Option<::std::string::String>,
61    pub(crate) eni_ip: ::std::option::Option<::std::string::String>,
62    pub(crate) iam_role_arn: ::std::option::Option<::std::string::String>,
63    pub(crate) external_id: ::std::option::Option<::std::string::String>,
64    pub(crate) syslog_ip: ::std::option::Option<::std::string::String>,
65}
66impl ModifyHsmInputBuilder {
67    /// <p>The ARN of the HSM to modify.</p>
68    /// This field is required.
69    pub fn hsm_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.hsm_arn = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>The ARN of the HSM to modify.</p>
74    pub fn set_hsm_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.hsm_arn = input;
76        self
77    }
78    /// <p>The ARN of the HSM to modify.</p>
79    pub fn get_hsm_arn(&self) -> &::std::option::Option<::std::string::String> {
80        &self.hsm_arn
81    }
82    /// <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>
83    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.subnet_id = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <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>
88    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.subnet_id = input;
90        self
91    }
92    /// <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>
93    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
94        &self.subnet_id
95    }
96    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
97    /// <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>
98    pub fn eni_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.eni_ip = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
103    /// <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>
104    pub fn set_eni_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.eni_ip = input;
106        self
107    }
108    /// <p>The new IP address for the elastic network interface (ENI) attached to the HSM.</p>
109    /// <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>
110    pub fn get_eni_ip(&self) -> &::std::option::Option<::std::string::String> {
111        &self.eni_ip
112    }
113    /// <p>The new IAM role ARN.</p>
114    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.iam_role_arn = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The new IAM role ARN.</p>
119    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.iam_role_arn = input;
121        self
122    }
123    /// <p>The new IAM role ARN.</p>
124    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
125        &self.iam_role_arn
126    }
127    /// <p>The new external ID.</p>
128    pub fn external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.external_id = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>The new external ID.</p>
133    pub fn set_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.external_id = input;
135        self
136    }
137    /// <p>The new external ID.</p>
138    pub fn get_external_id(&self) -> &::std::option::Option<::std::string::String> {
139        &self.external_id
140    }
141    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
142    pub fn syslog_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.syslog_ip = ::std::option::Option::Some(input.into());
144        self
145    }
146    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
147    pub fn set_syslog_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.syslog_ip = input;
149        self
150    }
151    /// <p>The new IP address for the syslog monitoring server. The AWS CloudHSM service only supports one syslog monitoring server.</p>
152    pub fn get_syslog_ip(&self) -> &::std::option::Option<::std::string::String> {
153        &self.syslog_ip
154    }
155    /// Consumes the builder and constructs a [`ModifyHsmInput`](crate::operation::modify_hsm::ModifyHsmInput).
156    pub fn build(self) -> ::std::result::Result<crate::operation::modify_hsm::ModifyHsmInput, ::aws_smithy_types::error::operation::BuildError> {
157        ::std::result::Result::Ok(crate::operation::modify_hsm::ModifyHsmInput {
158            hsm_arn: self.hsm_arn,
159            subnet_id: self.subnet_id,
160            eni_ip: self.eni_ip,
161            iam_role_arn: self.iam_role_arn,
162            external_id: self.external_id,
163            syslog_ip: self.syslog_ip,
164        })
165    }
166}