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>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
7pub cluster_name: ::std::option::Option<::std::string::String>,
8/// <p>Specify the instance groups to update.</p>
9pub instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
10/// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
11pub node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
12/// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
13pub instance_groups_to_delete: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14}
15impl UpdateClusterInput {
16/// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
17pub fn cluster_name(&self) -> ::std::option::Option<&str> {
18self.cluster_name.as_deref()
19 }
20/// <p>Specify the instance groups to update.</p>
21 ///
22 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_groups.is_none()`.
23pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
24self.instance_groups.as_deref().unwrap_or_default()
25 }
26/// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
27pub fn node_recovery(&self) -> ::std::option::Option<&crate::types::ClusterNodeRecovery> {
28self.node_recovery.as_ref()
29 }
30/// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
31 ///
32 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_groups_to_delete.is_none()`.
33pub fn instance_groups_to_delete(&self) -> &[::std::string::String] {
34self.instance_groups_to_delete.as_deref().unwrap_or_default()
35 }
36}
37impl UpdateClusterInput {
38/// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
39pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
40crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
41 }
42}
4344/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct UpdateClusterInputBuilder {
48pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
49pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
50pub(crate) node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
51pub(crate) instance_groups_to_delete: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
52}
53impl UpdateClusterInputBuilder {
54/// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
55 /// This field is required.
56pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57self.cluster_name = ::std::option::Option::Some(input.into());
58self
59}
60/// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
61pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62self.cluster_name = input;
63self
64}
65/// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
66pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
67&self.cluster_name
68 }
69/// Appends an item to `instance_groups`.
70 ///
71 /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
72 ///
73 /// <p>Specify the instance groups to update.</p>
74pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
75let mut v = self.instance_groups.unwrap_or_default();
76 v.push(input);
77self.instance_groups = ::std::option::Option::Some(v);
78self
79}
80/// <p>Specify the instance groups to update.</p>
81pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
82self.instance_groups = input;
83self
84}
85/// <p>Specify the instance groups to update.</p>
86pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
87&self.instance_groups
88 }
89/// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
90pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
91self.node_recovery = ::std::option::Option::Some(input);
92self
93}
94/// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
95pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
96self.node_recovery = input;
97self
98}
99/// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
100pub fn get_node_recovery(&self) -> &::std::option::Option<crate::types::ClusterNodeRecovery> {
101&self.node_recovery
102 }
103/// Appends an item to `instance_groups_to_delete`.
104 ///
105 /// To override the contents of this collection use [`set_instance_groups_to_delete`](Self::set_instance_groups_to_delete).
106 ///
107 /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
108pub fn instance_groups_to_delete(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109let mut v = self.instance_groups_to_delete.unwrap_or_default();
110 v.push(input.into());
111self.instance_groups_to_delete = ::std::option::Option::Some(v);
112self
113}
114/// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
115pub fn set_instance_groups_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
116self.instance_groups_to_delete = input;
117self
118}
119/// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
120pub fn get_instance_groups_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
121&self.instance_groups_to_delete
122 }
123/// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
124pub fn build(
125self,
126 ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
127 ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
128 cluster_name: self.cluster_name,
129 instance_groups: self.instance_groups,
130 node_recovery: self.node_recovery,
131 instance_groups_to_delete: self.instance_groups_to_delete,
132 })
133 }
134}