aws_sdk_medialive/operation/create_node/
_create_node_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Placeholder documentation for CreateNodeResponse
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateNodeOutput {
7    /// The ARN of the Node. It is automatically assigned when the Node is created.
8    pub arn: ::std::option::Option<::std::string::String>,
9    /// An array of IDs. Each ID is one ChannelPlacementGroup that is associated with this Node. Empty if the Node is not yet associated with any groups.
10    pub channel_placement_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// The ID of the Cluster that the Node belongs to.
12    pub cluster_id: ::std::option::Option<::std::string::String>,
13    /// The current connection state of the Node.
14    pub connection_state: ::std::option::Option<crate::types::NodeConnectionState>,
15    /// The unique ID of the Node. Unique in the Cluster. The ID is the resource-id portion of the ARN.
16    pub id: ::std::option::Option<::std::string::String>,
17    /// The ARN of the EC2 instance hosting the Node.
18    pub instance_arn: ::std::option::Option<::std::string::String>,
19    /// The name that you specified for the Node.
20    pub name: ::std::option::Option<::std::string::String>,
21    /// Documentation update needed
22    pub node_interface_mappings: ::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMapping>>,
23    /// The initial role current 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.
24    pub role: ::std::option::Option<crate::types::NodeRole>,
25    /// The current state of the Node.
26    pub state: ::std::option::Option<crate::types::NodeState>,
27    /// An array of SDI source mappings. Each mapping connects one logical SdiSource to the physical SDI card and port that the physical SDI source uses.
28    pub sdi_source_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMapping>>,
29    _request_id: Option<String>,
30}
31impl CreateNodeOutput {
32    /// The ARN of the Node. It is automatically assigned when the Node is created.
33    pub fn arn(&self) -> ::std::option::Option<&str> {
34        self.arn.as_deref()
35    }
36    /// An array of IDs. Each ID is one ChannelPlacementGroup that is associated with this Node. Empty if the Node is not yet associated with any groups.
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.channel_placement_groups.is_none()`.
39    pub fn channel_placement_groups(&self) -> &[::std::string::String] {
40        self.channel_placement_groups.as_deref().unwrap_or_default()
41    }
42    /// The ID of the Cluster that the Node belongs to.
43    pub fn cluster_id(&self) -> ::std::option::Option<&str> {
44        self.cluster_id.as_deref()
45    }
46    /// The current connection state of the Node.
47    pub fn connection_state(&self) -> ::std::option::Option<&crate::types::NodeConnectionState> {
48        self.connection_state.as_ref()
49    }
50    /// The unique ID of the Node. Unique in the Cluster. The ID is the resource-id portion of the ARN.
51    pub fn id(&self) -> ::std::option::Option<&str> {
52        self.id.as_deref()
53    }
54    /// The ARN of the EC2 instance hosting the Node.
55    pub fn instance_arn(&self) -> ::std::option::Option<&str> {
56        self.instance_arn.as_deref()
57    }
58    /// The name that you specified for the Node.
59    pub fn name(&self) -> ::std::option::Option<&str> {
60        self.name.as_deref()
61    }
62    /// Documentation update needed
63    ///
64    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.node_interface_mappings.is_none()`.
65    pub fn node_interface_mappings(&self) -> &[crate::types::NodeInterfaceMapping] {
66        self.node_interface_mappings.as_deref().unwrap_or_default()
67    }
68    /// The initial role current 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.
69    pub fn role(&self) -> ::std::option::Option<&crate::types::NodeRole> {
70        self.role.as_ref()
71    }
72    /// The current state of the Node.
73    pub fn state(&self) -> ::std::option::Option<&crate::types::NodeState> {
74        self.state.as_ref()
75    }
76    /// An array of SDI source mappings. Each mapping connects one logical SdiSource to the physical SDI card and port that the physical SDI source uses.
77    ///
78    /// 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()`.
79    pub fn sdi_source_mappings(&self) -> &[crate::types::SdiSourceMapping] {
80        self.sdi_source_mappings.as_deref().unwrap_or_default()
81    }
82}
83impl ::aws_types::request_id::RequestId for CreateNodeOutput {
84    fn request_id(&self) -> Option<&str> {
85        self._request_id.as_deref()
86    }
87}
88impl CreateNodeOutput {
89    /// Creates a new builder-style object to manufacture [`CreateNodeOutput`](crate::operation::create_node::CreateNodeOutput).
90    pub fn builder() -> crate::operation::create_node::builders::CreateNodeOutputBuilder {
91        crate::operation::create_node::builders::CreateNodeOutputBuilder::default()
92    }
93}
94
95/// A builder for [`CreateNodeOutput`](crate::operation::create_node::CreateNodeOutput).
96#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
97#[non_exhaustive]
98pub struct CreateNodeOutputBuilder {
99    pub(crate) arn: ::std::option::Option<::std::string::String>,
100    pub(crate) channel_placement_groups: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
101    pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
102    pub(crate) connection_state: ::std::option::Option<crate::types::NodeConnectionState>,
103    pub(crate) id: ::std::option::Option<::std::string::String>,
104    pub(crate) instance_arn: ::std::option::Option<::std::string::String>,
105    pub(crate) name: ::std::option::Option<::std::string::String>,
106    pub(crate) node_interface_mappings: ::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMapping>>,
107    pub(crate) role: ::std::option::Option<crate::types::NodeRole>,
108    pub(crate) state: ::std::option::Option<crate::types::NodeState>,
109    pub(crate) sdi_source_mappings: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMapping>>,
110    _request_id: Option<String>,
111}
112impl CreateNodeOutputBuilder {
113    /// The ARN of the Node. It is automatically assigned when the Node is created.
114    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.arn = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// The ARN of the Node. It is automatically assigned when the Node is created.
119    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.arn = input;
121        self
122    }
123    /// The ARN of the Node. It is automatically assigned when the Node is created.
124    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
125        &self.arn
126    }
127    /// Appends an item to `channel_placement_groups`.
128    ///
129    /// To override the contents of this collection use [`set_channel_placement_groups`](Self::set_channel_placement_groups).
130    ///
131    /// An array of IDs. Each ID is one ChannelPlacementGroup that is associated with this Node. Empty if the Node is not yet associated with any groups.
132    pub fn channel_placement_groups(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        let mut v = self.channel_placement_groups.unwrap_or_default();
134        v.push(input.into());
135        self.channel_placement_groups = ::std::option::Option::Some(v);
136        self
137    }
138    /// An array of IDs. Each ID is one ChannelPlacementGroup that is associated with this Node. Empty if the Node is not yet associated with any groups.
139    pub fn set_channel_placement_groups(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
140        self.channel_placement_groups = input;
141        self
142    }
143    /// An array of IDs. Each ID is one ChannelPlacementGroup that is associated with this Node. Empty if the Node is not yet associated with any groups.
144    pub fn get_channel_placement_groups(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
145        &self.channel_placement_groups
146    }
147    /// The ID of the Cluster that the Node belongs to.
148    pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.cluster_id = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// The ID of the Cluster that the Node belongs to.
153    pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.cluster_id = input;
155        self
156    }
157    /// The ID of the Cluster that the Node belongs to.
158    pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
159        &self.cluster_id
160    }
161    /// The current connection state of the Node.
162    pub fn connection_state(mut self, input: crate::types::NodeConnectionState) -> Self {
163        self.connection_state = ::std::option::Option::Some(input);
164        self
165    }
166    /// The current connection state of the Node.
167    pub fn set_connection_state(mut self, input: ::std::option::Option<crate::types::NodeConnectionState>) -> Self {
168        self.connection_state = input;
169        self
170    }
171    /// The current connection state of the Node.
172    pub fn get_connection_state(&self) -> &::std::option::Option<crate::types::NodeConnectionState> {
173        &self.connection_state
174    }
175    /// The unique ID of the Node. Unique in the Cluster. The ID is the resource-id portion of the ARN.
176    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.id = ::std::option::Option::Some(input.into());
178        self
179    }
180    /// The unique ID of the Node. Unique in the Cluster. The ID is the resource-id portion of the ARN.
181    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.id = input;
183        self
184    }
185    /// The unique ID of the Node. Unique in the Cluster. The ID is the resource-id portion of the ARN.
186    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
187        &self.id
188    }
189    /// The ARN of the EC2 instance hosting the Node.
190    pub fn instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.instance_arn = ::std::option::Option::Some(input.into());
192        self
193    }
194    /// The ARN of the EC2 instance hosting the Node.
195    pub fn set_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.instance_arn = input;
197        self
198    }
199    /// The ARN of the EC2 instance hosting the Node.
200    pub fn get_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
201        &self.instance_arn
202    }
203    /// The name that you specified for the Node.
204    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.name = ::std::option::Option::Some(input.into());
206        self
207    }
208    /// The name that you specified for the Node.
209    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.name = input;
211        self
212    }
213    /// The name that you specified for the Node.
214    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
215        &self.name
216    }
217    /// Appends an item to `node_interface_mappings`.
218    ///
219    /// To override the contents of this collection use [`set_node_interface_mappings`](Self::set_node_interface_mappings).
220    ///
221    /// Documentation update needed
222    pub fn node_interface_mappings(mut self, input: crate::types::NodeInterfaceMapping) -> Self {
223        let mut v = self.node_interface_mappings.unwrap_or_default();
224        v.push(input);
225        self.node_interface_mappings = ::std::option::Option::Some(v);
226        self
227    }
228    /// Documentation update needed
229    pub fn set_node_interface_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMapping>>) -> Self {
230        self.node_interface_mappings = input;
231        self
232    }
233    /// Documentation update needed
234    pub fn get_node_interface_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMapping>> {
235        &self.node_interface_mappings
236    }
237    /// The initial role current 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.
238    pub fn role(mut self, input: crate::types::NodeRole) -> Self {
239        self.role = ::std::option::Option::Some(input);
240        self
241    }
242    /// The initial role current 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.
243    pub fn set_role(mut self, input: ::std::option::Option<crate::types::NodeRole>) -> Self {
244        self.role = input;
245        self
246    }
247    /// The initial role current 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.
248    pub fn get_role(&self) -> &::std::option::Option<crate::types::NodeRole> {
249        &self.role
250    }
251    /// The current state of the Node.
252    pub fn state(mut self, input: crate::types::NodeState) -> Self {
253        self.state = ::std::option::Option::Some(input);
254        self
255    }
256    /// The current state of the Node.
257    pub fn set_state(mut self, input: ::std::option::Option<crate::types::NodeState>) -> Self {
258        self.state = input;
259        self
260    }
261    /// The current state of the Node.
262    pub fn get_state(&self) -> &::std::option::Option<crate::types::NodeState> {
263        &self.state
264    }
265    /// Appends an item to `sdi_source_mappings`.
266    ///
267    /// To override the contents of this collection use [`set_sdi_source_mappings`](Self::set_sdi_source_mappings).
268    ///
269    /// An array of SDI source mappings. Each mapping connects one logical SdiSource to the physical SDI card and port that the physical SDI source uses.
270    pub fn sdi_source_mappings(mut self, input: crate::types::SdiSourceMapping) -> Self {
271        let mut v = self.sdi_source_mappings.unwrap_or_default();
272        v.push(input);
273        self.sdi_source_mappings = ::std::option::Option::Some(v);
274        self
275    }
276    /// An array of SDI source mappings. Each mapping connects one logical SdiSource to the physical SDI card and port that the physical SDI source uses.
277    pub fn set_sdi_source_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMapping>>) -> Self {
278        self.sdi_source_mappings = input;
279        self
280    }
281    /// An array of SDI source mappings. Each mapping connects one logical SdiSource to the physical SDI card and port that the physical SDI source uses.
282    pub fn get_sdi_source_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SdiSourceMapping>> {
283        &self.sdi_source_mappings
284    }
285    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
286        self._request_id = Some(request_id.into());
287        self
288    }
289
290    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
291        self._request_id = request_id;
292        self
293    }
294    /// Consumes the builder and constructs a [`CreateNodeOutput`](crate::operation::create_node::CreateNodeOutput).
295    pub fn build(self) -> crate::operation::create_node::CreateNodeOutput {
296        crate::operation::create_node::CreateNodeOutput {
297            arn: self.arn,
298            channel_placement_groups: self.channel_placement_groups,
299            cluster_id: self.cluster_id,
300            connection_state: self.connection_state,
301            id: self.id,
302            instance_arn: self.instance_arn,
303            name: self.name,
304            node_interface_mappings: self.node_interface_mappings,
305            role: self.role,
306            state: self.state,
307            sdi_source_mappings: self.sdi_source_mappings,
308            _request_id: self._request_id,
309        }
310    }
311}