aws_sdk_cloudhsmv2/operation/create_hsm/_create_hsm_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateHsmInput {
6 /// <p>The identifier (ID) of the HSM's cluster. To find the cluster ID, use <code>DescribeClusters</code>.</p>
7 pub cluster_id: ::std::option::Option<::std::string::String>,
8 /// <p>The Availability Zone where you are creating the HSM. To find the cluster's Availability Zones, use <code>DescribeClusters</code>.</p>
9 pub availability_zone: ::std::option::Option<::std::string::String>,
10 /// <p>The HSM's IP address. If you specify an IP address, use an available address from the subnet that maps to the Availability Zone where you are creating the HSM. If you don't specify an IP address, one is chosen for you from that subnet.</p>
11 pub ip_address: ::std::option::Option<::std::string::String>,
12}
13impl CreateHsmInput {
14 /// <p>The identifier (ID) of the HSM's cluster. To find the cluster ID, use <code>DescribeClusters</code>.</p>
15 pub fn cluster_id(&self) -> ::std::option::Option<&str> {
16 self.cluster_id.as_deref()
17 }
18 /// <p>The Availability Zone where you are creating the HSM. To find the cluster's Availability Zones, use <code>DescribeClusters</code>.</p>
19 pub fn availability_zone(&self) -> ::std::option::Option<&str> {
20 self.availability_zone.as_deref()
21 }
22 /// <p>The HSM's IP address. If you specify an IP address, use an available address from the subnet that maps to the Availability Zone where you are creating the HSM. If you don't specify an IP address, one is chosen for you from that subnet.</p>
23 pub fn ip_address(&self) -> ::std::option::Option<&str> {
24 self.ip_address.as_deref()
25 }
26}
27impl CreateHsmInput {
28 /// Creates a new builder-style object to manufacture [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
29 pub fn builder() -> crate::operation::create_hsm::builders::CreateHsmInputBuilder {
30 crate::operation::create_hsm::builders::CreateHsmInputBuilder::default()
31 }
32}
33
34/// A builder for [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateHsmInputBuilder {
38 pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
39 pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
40 pub(crate) ip_address: ::std::option::Option<::std::string::String>,
41}
42impl CreateHsmInputBuilder {
43 /// <p>The identifier (ID) of the HSM's cluster. To find the cluster ID, use <code>DescribeClusters</code>.</p>
44 /// This field is required.
45 pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
46 self.cluster_id = ::std::option::Option::Some(input.into());
47 self
48 }
49 /// <p>The identifier (ID) of the HSM's cluster. To find the cluster ID, use <code>DescribeClusters</code>.</p>
50 pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
51 self.cluster_id = input;
52 self
53 }
54 /// <p>The identifier (ID) of the HSM's cluster. To find the cluster ID, use <code>DescribeClusters</code>.</p>
55 pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
56 &self.cluster_id
57 }
58 /// <p>The Availability Zone where you are creating the HSM. To find the cluster's Availability Zones, use <code>DescribeClusters</code>.</p>
59 /// This field is required.
60 pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61 self.availability_zone = ::std::option::Option::Some(input.into());
62 self
63 }
64 /// <p>The Availability Zone where you are creating the HSM. To find the cluster's Availability Zones, use <code>DescribeClusters</code>.</p>
65 pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66 self.availability_zone = input;
67 self
68 }
69 /// <p>The Availability Zone where you are creating the HSM. To find the cluster's Availability Zones, use <code>DescribeClusters</code>.</p>
70 pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
71 &self.availability_zone
72 }
73 /// <p>The HSM's IP address. If you specify an IP address, use an available address from the subnet that maps to the Availability Zone where you are creating the HSM. If you don't specify an IP address, one is chosen for you from that subnet.</p>
74 pub fn ip_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.ip_address = ::std::option::Option::Some(input.into());
76 self
77 }
78 /// <p>The HSM's IP address. If you specify an IP address, use an available address from the subnet that maps to the Availability Zone where you are creating the HSM. If you don't specify an IP address, one is chosen for you from that subnet.</p>
79 pub fn set_ip_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.ip_address = input;
81 self
82 }
83 /// <p>The HSM's IP address. If you specify an IP address, use an available address from the subnet that maps to the Availability Zone where you are creating the HSM. If you don't specify an IP address, one is chosen for you from that subnet.</p>
84 pub fn get_ip_address(&self) -> &::std::option::Option<::std::string::String> {
85 &self.ip_address
86 }
87 /// Consumes the builder and constructs a [`CreateHsmInput`](crate::operation::create_hsm::CreateHsmInput).
88 pub fn build(self) -> ::std::result::Result<crate::operation::create_hsm::CreateHsmInput, ::aws_smithy_types::error::operation::BuildError> {
89 ::std::result::Result::Ok(crate::operation::create_hsm::CreateHsmInput {
90 cluster_id: self.cluster_id,
91 availability_zone: self.availability_zone,
92 ip_address: self.ip_address,
93 })
94 }
95}