1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateClusterInput {
    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
    pub cluster_name: ::std::option::Option<::std::string::String>,
    /// <p>Specify the instance groups to update.</p>
    pub instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
}
impl UpdateClusterInput {
    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
    pub fn cluster_name(&self) -> ::std::option::Option<&str> {
        self.cluster_name.as_deref()
    }
    /// <p>Specify the instance groups to update.</p>
    ///
    /// 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()`.
    pub fn instance_groups(&self) -> &[crate::types::ClusterInstanceGroupSpecification] {
        self.instance_groups.as_deref().unwrap_or_default()
    }
}
impl UpdateClusterInput {
    /// Creates a new builder-style object to manufacture [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
    pub fn builder() -> crate::operation::update_cluster::builders::UpdateClusterInputBuilder {
        crate::operation::update_cluster::builders::UpdateClusterInputBuilder::default()
    }
}

/// A builder for [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct UpdateClusterInputBuilder {
    pub(crate) cluster_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_groups: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>,
}
impl UpdateClusterInputBuilder {
    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
    /// This field is required.
    pub fn cluster_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.cluster_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
    pub fn set_cluster_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.cluster_name = input;
        self
    }
    /// <p>Specify the name of the SageMaker HyperPod cluster you want to update.</p>
    pub fn get_cluster_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.cluster_name
    }
    /// Appends an item to `instance_groups`.
    ///
    /// To override the contents of this collection use [`set_instance_groups`](Self::set_instance_groups).
    ///
    /// <p>Specify the instance groups to update.</p>
    pub fn instance_groups(mut self, input: crate::types::ClusterInstanceGroupSpecification) -> Self {
        let mut v = self.instance_groups.unwrap_or_default();
        v.push(input);
        self.instance_groups = ::std::option::Option::Some(v);
        self
    }
    /// <p>Specify the instance groups to update.</p>
    pub fn set_instance_groups(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>>) -> Self {
        self.instance_groups = input;
        self
    }
    /// <p>Specify the instance groups to update.</p>
    pub fn get_instance_groups(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClusterInstanceGroupSpecification>> {
        &self.instance_groups
    }
    /// Consumes the builder and constructs a [`UpdateClusterInput`](crate::operation::update_cluster::UpdateClusterInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_cluster::UpdateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_cluster::UpdateClusterInput {
            cluster_name: self.cluster_name,
            instance_groups: self.instance_groups,
        })
    }
}