aws_sdk_cloudhsmv2/operation/modify_cluster/
_modify_cluster_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 ModifyClusterInput {
6    /// <p>The desired HSM type of the cluster.</p>
7    pub hsm_type: ::std::option::Option<::std::string::String>,
8    /// <p>A policy that defines how the service retains backups.</p>
9    pub backup_retention_policy: ::std::option::Option<crate::types::BackupRetentionPolicy>,
10    /// <p>The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use <code>DescribeClusters</code>.</p>
11    pub cluster_id: ::std::option::Option<::std::string::String>,
12}
13impl ModifyClusterInput {
14    /// <p>The desired HSM type of the cluster.</p>
15    pub fn hsm_type(&self) -> ::std::option::Option<&str> {
16        self.hsm_type.as_deref()
17    }
18    /// <p>A policy that defines how the service retains backups.</p>
19    pub fn backup_retention_policy(&self) -> ::std::option::Option<&crate::types::BackupRetentionPolicy> {
20        self.backup_retention_policy.as_ref()
21    }
22    /// <p>The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use <code>DescribeClusters</code>.</p>
23    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
24        self.cluster_id.as_deref()
25    }
26}
27impl ModifyClusterInput {
28    /// Creates a new builder-style object to manufacture [`ModifyClusterInput`](crate::operation::modify_cluster::ModifyClusterInput).
29    pub fn builder() -> crate::operation::modify_cluster::builders::ModifyClusterInputBuilder {
30        crate::operation::modify_cluster::builders::ModifyClusterInputBuilder::default()
31    }
32}
33
34/// A builder for [`ModifyClusterInput`](crate::operation::modify_cluster::ModifyClusterInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct ModifyClusterInputBuilder {
38    pub(crate) hsm_type: ::std::option::Option<::std::string::String>,
39    pub(crate) backup_retention_policy: ::std::option::Option<crate::types::BackupRetentionPolicy>,
40    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
41}
42impl ModifyClusterInputBuilder {
43    /// <p>The desired HSM type of the cluster.</p>
44    pub fn hsm_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.hsm_type = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The desired HSM type of the cluster.</p>
49    pub fn set_hsm_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.hsm_type = input;
51        self
52    }
53    /// <p>The desired HSM type of the cluster.</p>
54    pub fn get_hsm_type(&self) -> &::std::option::Option<::std::string::String> {
55        &self.hsm_type
56    }
57    /// <p>A policy that defines how the service retains backups.</p>
58    pub fn backup_retention_policy(mut self, input: crate::types::BackupRetentionPolicy) -> Self {
59        self.backup_retention_policy = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>A policy that defines how the service retains backups.</p>
63    pub fn set_backup_retention_policy(mut self, input: ::std::option::Option<crate::types::BackupRetentionPolicy>) -> Self {
64        self.backup_retention_policy = input;
65        self
66    }
67    /// <p>A policy that defines how the service retains backups.</p>
68    pub fn get_backup_retention_policy(&self) -> &::std::option::Option<crate::types::BackupRetentionPolicy> {
69        &self.backup_retention_policy
70    }
71    /// <p>The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use <code>DescribeClusters</code>.</p>
72    /// This field is required.
73    pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.cluster_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use <code>DescribeClusters</code>.</p>
78    pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.cluster_id = input;
80        self
81    }
82    /// <p>The identifier (ID) of the cluster that you want to modify. To find the cluster ID, use <code>DescribeClusters</code>.</p>
83    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.cluster_id
85    }
86    /// Consumes the builder and constructs a [`ModifyClusterInput`](crate::operation::modify_cluster::ModifyClusterInput).
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::modify_cluster::ModifyClusterInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::modify_cluster::ModifyClusterInput {
91            hsm_type: self.hsm_type,
92            backup_retention_policy: self.backup_retention_policy,
93            cluster_id: self.cluster_id,
94        })
95    }
96}