aws_sdk_medialive/operation/update_node/
_update_node_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// A request to update the node.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateNodeInput {
7    /// The ID of the cluster
8    pub cluster_id: ::std::option::Option<::std::string::String>,
9    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
10    pub name: ::std::option::Option<::std::string::String>,
11    /// The ID of the node.
12    pub node_id: ::std::option::Option<::std::string::String>,
13    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
14    pub role: ::std::option::Option<crate::types::NodeRole>,
15    /// The mappings of a SDI capture card port to a logical SDI data stream
16    pub sdi_source_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>>,
17}
18impl UpdateNodeInput {
19    /// The ID of the cluster
20    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
21        self.cluster_id.as_deref()
22    }
23    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
24    pub fn name(&self) -> ::std::option::Option<&str> {
25        self.name.as_deref()
26    }
27    /// The ID of the node.
28    pub fn node_id(&self) -> ::std::option::Option<&str> {
29        self.node_id.as_deref()
30    }
31    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
32    pub fn role(&self) -> ::std::option::Option<&crate::types::NodeRole> {
33        self.role.as_ref()
34    }
35    /// The mappings of a SDI capture card port to a logical SDI data stream
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sdi_source_mappings.is_none()`.
38    pub fn sdi_source_mappings(&self) -> &[crate::types::SdiSourceMappingUpdateRequest] {
39        self.sdi_source_mappings.as_deref().unwrap_or_default()
40    }
41}
42impl UpdateNodeInput {
43    /// Creates a new builder-style object to manufacture [`UpdateNodeInput`](crate::operation::update_node::UpdateNodeInput).
44    pub fn builder() -> crate::operation::update_node::builders::UpdateNodeInputBuilder {
45        crate::operation::update_node::builders::UpdateNodeInputBuilder::default()
46    }
47}
48
49/// A builder for [`UpdateNodeInput`](crate::operation::update_node::UpdateNodeInput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct UpdateNodeInputBuilder {
53    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
54    pub(crate) name: ::std::option::Option<::std::string::String>,
55    pub(crate) node_id: ::std::option::Option<::std::string::String>,
56    pub(crate) role: ::std::option::Option<crate::types::NodeRole>,
57    pub(crate) sdi_source_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>>,
58}
59impl UpdateNodeInputBuilder {
60    /// The ID of the cluster
61    /// This field is required.
62    pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.cluster_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// The ID of the cluster
67    pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.cluster_id = input;
69        self
70    }
71    /// The ID of the cluster
72    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.cluster_id
74    }
75    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
76    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.name = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
81    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.name = input;
83        self
84    }
85    /// Include this parameter only if you want to change the current name of the Node. Specify a name that is unique in the Cluster. You can't change the name. Names are case-sensitive.
86    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
87        &self.name
88    }
89    /// The ID of the node.
90    /// This field is required.
91    pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.node_id = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// The ID of the node.
96    pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.node_id = input;
98        self
99    }
100    /// The ID of the node.
101    pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
102        &self.node_id
103    }
104    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
105    pub fn role(mut self, input: crate::types::NodeRole) -> Self {
106        self.role = ::std::option::Option::Some(input);
107        self
108    }
109    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
110    pub fn set_role(mut self, input: ::std::option::Option<crate::types::NodeRole>) -> Self {
111        self.role = input;
112        self
113    }
114    /// The initial role of the Node in the Cluster. ACTIVE means the Node is available for encoding. BACKUP means the Node is a redundant Node and might get used if an ACTIVE Node fails.
115    pub fn get_role(&self) -> &::std::option::Option<crate::types::NodeRole> {
116        &self.role
117    }
118    /// Appends an item to `sdi_source_mappings`.
119    ///
120    /// To override the contents of this collection use [`set_sdi_source_mappings`](Self::set_sdi_source_mappings).
121    ///
122    /// The mappings of a SDI capture card port to a logical SDI data stream
123    pub fn sdi_source_mappings(mut self, input: crate::types::SdiSourceMappingUpdateRequest) -> Self {
124        let mut v = self.sdi_source_mappings.unwrap_or_default();
125        v.push(input);
126        self.sdi_source_mappings = ::std::option::Option::Some(v);
127        self
128    }
129    /// The mappings of a SDI capture card port to a logical SDI data stream
130    pub fn set_sdi_source_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>>) -> Self {
131        self.sdi_source_mappings = input;
132        self
133    }
134    /// The mappings of a SDI capture card port to a logical SDI data stream
135    pub fn get_sdi_source_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMappingUpdateRequest>> {
136        &self.sdi_source_mappings
137    }
138    /// Consumes the builder and constructs a [`UpdateNodeInput`](crate::operation::update_node::UpdateNodeInput).
139    pub fn build(self) -> ::std::result::Result<crate::operation::update_node::UpdateNodeInput, ::aws_smithy_types::error::operation::BuildError> {
140        ::std::result::Result::Ok(crate::operation::update_node::UpdateNodeInput {
141            cluster_id: self.cluster_id,
142            name: self.name,
143            node_id: self.node_id,
144            role: self.role,
145            sdi_source_mappings: self.sdi_source_mappings,
146        })
147    }
148}