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}
13impl UpdateClusterInput {
14    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
15    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
16        self.cluster_name.as_deref()
17    }
18    /// <p>Specify the instance groups to update.</p>
19    ///
20    /// 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()`.
21    pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
22        self.instance_groups.as_deref().unwrap_or_default()
23    }
24    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
25    pub fn node_recovery(&self) -> ::std::option::Option<&crate::types::ClusterNodeRecovery> {
26        self.node_recovery.as_ref()
27    }
28}
29impl UpdateClusterInput {
30    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
31    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
32        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
33    }
34}
35
36/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct UpdateClusterInputBuilder {
40    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
41    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
42    pub(crate) node_recovery: ::std::option::Option<crate::types::ClusterNodeRecovery>,
43}
44impl UpdateClusterInputBuilder {
45    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
46    /// This field is required.
47    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.cluster_name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
52    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.cluster_name = input;
54        self
55    }
56    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
57    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.cluster_name
59    }
60    /// Appends an item to `instance_groups`.
61    ///
62    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
63    ///
64    /// <p>Specify the instance groups to update.</p>
65    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
66        let mut v = self.instance_groups.unwrap_or_default();
67        v.push(input);
68        self.instance_groups = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>Specify the instance groups to update.</p>
72    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
73        self.instance_groups = input;
74        self
75    }
76    /// <p>Specify the instance groups to update.</p>
77    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
78        &self.instance_groups
79    }
80    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
81    pub fn node_recovery(mut self, input: crate::types::ClusterNodeRecovery) -> Self {
82        self.node_recovery = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
86    pub fn set_node_recovery(mut self, input: ::std::option::Option<crate::types::ClusterNodeRecovery>) -> Self {
87        self.node_recovery = input;
88        self
89    }
90    /// <p>The node recovery mode to be applied to the SageMaker HyperPod cluster.</p>
91    pub fn get_node_recovery(&self) -> &::std::option::Option<crate::types::ClusterNodeRecovery> {
92        &self.node_recovery
93    }
94    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
98        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
99            cluster_name: self.cluster_name,
100            instance_groups: self.instance_groups,
101            node_recovery: self.node_recovery,
102        })
103    }
104}