aws_sdk_dax/operation/update_cluster/
_update_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 UpdateClusterInput {
6    /// <p>The name of the DAX cluster to be modified.</p>
7    pub cluster_name: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the changes being made to the cluster.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>A range of time when maintenance of DAX cluster software will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes less than 30 minutes, and is performed automatically within the maintenance window.</p>
11    pub preferred_maintenance_window: ::std::option::Option<::std::string::String>,
12    /// <p>The Amazon Resource Name (ARN) that identifies the topic.</p>
13    pub notification_topic_arn: ::std::option::Option<::std::string::String>,
14    /// <p>The current state of the topic. A value of “active” means that notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the topic.</p>
15    pub notification_topic_status: ::std::option::Option<::std::string::String>,
16    /// <p>The name of a parameter group for this cluster.</p>
17    pub parameter_group_name: ::std::option::Option<::std::string::String>,
18    /// <p>A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is not specified, DAX assigns the default VPC security group to each node.</p>
19    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20}
21impl UpdateClusterInput {
22    /// <p>The name of the DAX cluster to be modified.</p>
23    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
24        self.cluster_name.as_deref()
25    }
26    /// <p>A description of the changes being made to the cluster.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>A range of time when maintenance of DAX cluster software will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes less than 30 minutes, and is performed automatically within the maintenance window.</p>
31    pub fn preferred_maintenance_window(&self) -> ::std::option::Option<&str> {
32        self.preferred_maintenance_window.as_deref()
33    }
34    /// <p>The Amazon Resource Name (ARN) that identifies the topic.</p>
35    pub fn notification_topic_arn(&self) -> ::std::option::Option<&str> {
36        self.notification_topic_arn.as_deref()
37    }
38    /// <p>The current state of the topic. A value of “active” means that notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the topic.</p>
39    pub fn notification_topic_status(&self) -> ::std::option::Option<&str> {
40        self.notification_topic_status.as_deref()
41    }
42    /// <p>The name of a parameter group for this cluster.</p>
43    pub fn parameter_group_name(&self) -> ::std::option::Option<&str> {
44        self.parameter_group_name.as_deref()
45    }
46    /// <p>A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is not specified, DAX assigns the default VPC security group to each node.</p>
47    ///
48    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
49    pub fn security_group_ids(&self) -> &[::std::string::String] {
50        self.security_group_ids.as_deref().unwrap_or_default()
51    }
52}
53impl UpdateClusterInput {
54    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
55    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
56        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
57    }
58}
59
60/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct UpdateClusterInputBuilder {
64    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
65    pub(crate) description: ::std::option::Option<::std::string::String>,
66    pub(crate) preferred_maintenance_window: ::std::option::Option<::std::string::String>,
67    pub(crate) notification_topic_arn: ::std::option::Option<::std::string::String>,
68    pub(crate) notification_topic_status: ::std::option::Option<::std::string::String>,
69    pub(crate) parameter_group_name: ::std::option::Option<::std::string::String>,
70    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
71}
72impl UpdateClusterInputBuilder {
73    /// <p>The name of the DAX cluster to be modified.</p>
74    /// This field is required.
75    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.cluster_name = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The name of the DAX cluster to be modified.</p>
80    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.cluster_name = input;
82        self
83    }
84    /// <p>The name of the DAX cluster to be modified.</p>
85    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
86        &self.cluster_name
87    }
88    /// <p>A description of the changes being made to the cluster.</p>
89    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.description = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>A description of the changes being made to the cluster.</p>
94    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.description = input;
96        self
97    }
98    /// <p>A description of the changes being made to the cluster.</p>
99    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
100        &self.description
101    }
102    /// <p>A range of time when maintenance of DAX cluster software will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes less than 30 minutes, and is performed automatically within the maintenance window.</p>
103    pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.preferred_maintenance_window = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>A range of time when maintenance of DAX cluster software will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes less than 30 minutes, and is performed automatically within the maintenance window.</p>
108    pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.preferred_maintenance_window = input;
110        self
111    }
112    /// <p>A range of time when maintenance of DAX cluster software will be performed. For example: <code>sun:01:00-sun:09:00</code>. Cluster maintenance normally takes less than 30 minutes, and is performed automatically within the maintenance window.</p>
113    pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
114        &self.preferred_maintenance_window
115    }
116    /// <p>The Amazon Resource Name (ARN) that identifies the topic.</p>
117    pub fn notification_topic_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.notification_topic_arn = ::std::option::Option::Some(input.into());
119        self
120    }
121    /// <p>The Amazon Resource Name (ARN) that identifies the topic.</p>
122    pub fn set_notification_topic_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.notification_topic_arn = input;
124        self
125    }
126    /// <p>The Amazon Resource Name (ARN) that identifies the topic.</p>
127    pub fn get_notification_topic_arn(&self) -> &::std::option::Option<::std::string::String> {
128        &self.notification_topic_arn
129    }
130    /// <p>The current state of the topic. A value of “active” means that notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the topic.</p>
131    pub fn notification_topic_status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.notification_topic_status = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The current state of the topic. A value of “active” means that notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the topic.</p>
136    pub fn set_notification_topic_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.notification_topic_status = input;
138        self
139    }
140    /// <p>The current state of the topic. A value of “active” means that notifications will be sent to the topic. A value of “inactive” means that notifications will not be sent to the topic.</p>
141    pub fn get_notification_topic_status(&self) -> &::std::option::Option<::std::string::String> {
142        &self.notification_topic_status
143    }
144    /// <p>The name of a parameter group for this cluster.</p>
145    pub fn parameter_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.parameter_group_name = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The name of a parameter group for this cluster.</p>
150    pub fn set_parameter_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.parameter_group_name = input;
152        self
153    }
154    /// <p>The name of a parameter group for this cluster.</p>
155    pub fn get_parameter_group_name(&self) -> &::std::option::Option<::std::string::String> {
156        &self.parameter_group_name
157    }
158    /// Appends an item to `security_group_ids`.
159    ///
160    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
161    ///
162    /// <p>A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is not specified, DAX assigns the default VPC security group to each node.</p>
163    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        let mut v = self.security_group_ids.unwrap_or_default();
165        v.push(input.into());
166        self.security_group_ids = ::std::option::Option::Some(v);
167        self
168    }
169    /// <p>A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is not specified, DAX assigns the default VPC security group to each node.</p>
170    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
171        self.security_group_ids = input;
172        self
173    }
174    /// <p>A list of user-specified security group IDs to be assigned to each node in the DAX cluster. If this parameter is not specified, DAX assigns the default VPC security group to each node.</p>
175    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
176        &self.security_group_ids
177    }
178    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
179    pub fn build(
180        self,
181    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
182        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
183            cluster_name: self.cluster_name,
184            description: self.description,
185            preferred_maintenance_window: self.preferred_maintenance_window,
186            notification_topic_arn: self.notification_topic_arn,
187            notification_topic_status: self.notification_topic_status,
188            parameter_group_name: self.parameter_group_name,
189            security_group_ids: self.security_group_ids,
190        })
191    }
192}