aws_sdk_sagemaker/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>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
7    pub cluster_name: ::std::option::Option<::std::string::String>,
8    /// <p>Specify the instance groups to update.</p>
9    pub 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>
11    pub 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>
13    pub 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>
17    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
18        self.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()`.
23    pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
24        self.instance_groups.as_deref().unwrap_or_default()
25    }
26    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
27    pub fn node_recovery(&self) -> ::std::option::Option<&crate::types::ClusterNodeRecovery> {
28        self.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()`.
33    pub fn instance_groups_to_delete(&self) -> &[::std::string::String] {
34        self.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).
39    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
40        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
41    }
42}
43
44/// 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 {
48    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
49    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
50    pub(crate) node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
51    pub(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.
56    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57        self.cluster_name = ::std::option::Option::Some(input.into());
58        self
59    }
60    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
61    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62        self.cluster_name = input;
63        self
64    }
65    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
66    pub 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>
74    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
75        let mut v = self.instance_groups.unwrap_or_default();
76        v.push(input);
77        self.instance_groups = ::std::option::Option::Some(v);
78        self
79    }
80    /// <p>Specify the instance groups to update.</p>
81    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
82        self.instance_groups = input;
83        self
84    }
85    /// <p>Specify the instance groups to update.</p>
86    pub 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>
90    pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
91        self.node_recovery = ::std::option::Option::Some(input);
92        self
93    }
94    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
95    pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
96        self.node_recovery = input;
97        self
98    }
99    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
100    pub 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>
108    pub fn instance_groups_to_delete(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        let mut v = self.instance_groups_to_delete.unwrap_or_default();
110        v.push(input.into());
111        self.instance_groups_to_delete = ::std::option::Option::Some(v);
112        self
113    }
114    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
115    pub fn set_instance_groups_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
116        self.instance_groups_to_delete = input;
117        self
118    }
119    /// <p>Specify the names of the instance groups to delete. Use a single <code>,</code> as the separator between multiple names.</p>
120    pub 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).
124    pub fn build(
125        self,
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}