aws_sdk_medialive/operation/create_node/
_create_node_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateNodeInput {
7 pub cluster_id: ::std::option::Option<::std::string::String>,
9 pub name: ::std::option::Option<::std::string::String>,
11 pub node_interface_mappings: ::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMappingCreateRequest>>,
13 pub request_id: ::std::option::Option<::std::string::String>,
15 pub role: ::std::option::Option<crate::types::NodeRole>,
17 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
19}
20impl CreateNodeInput {
21 pub fn cluster_id(&self) -> ::std::option::Option<&str> {
23 self.cluster_id.as_deref()
24 }
25 pub fn name(&self) -> ::std::option::Option<&str> {
27 self.name.as_deref()
28 }
29 pub fn node_interface_mappings(&self) -> &[crate::types::NodeInterfaceMappingCreateRequest] {
33 self.node_interface_mappings.as_deref().unwrap_or_default()
34 }
35 pub fn request_id(&self) -> ::std::option::Option<&str> {
37 self.request_id.as_deref()
38 }
39 pub fn role(&self) -> ::std::option::Option<&crate::types::NodeRole> {
41 self.role.as_ref()
42 }
43 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
45 self.tags.as_ref()
46 }
47}
48impl CreateNodeInput {
49 pub fn builder() -> crate::operation::create_node::builders::CreateNodeInputBuilder {
51 crate::operation::create_node::builders::CreateNodeInputBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct CreateNodeInputBuilder {
59 pub(crate) cluster_id: ::std::option::Option<::std::string::String>,
60 pub(crate) name: ::std::option::Option<::std::string::String>,
61 pub(crate) node_interface_mappings: ::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMappingCreateRequest>>,
62 pub(crate) request_id: ::std::option::Option<::std::string::String>,
63 pub(crate) role: ::std::option::Option<crate::types::NodeRole>,
64 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
65}
66impl CreateNodeInputBuilder {
67 pub fn cluster_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70 self.cluster_id = ::std::option::Option::Some(input.into());
71 self
72 }
73 pub fn set_cluster_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.cluster_id = input;
76 self
77 }
78 pub fn get_cluster_id(&self) -> &::std::option::Option<::std::string::String> {
80 &self.cluster_id
81 }
82 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.name = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.name = input;
90 self
91 }
92 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
94 &self.name
95 }
96 pub fn node_interface_mappings(mut self, input: crate::types::NodeInterfaceMappingCreateRequest) -> Self {
102 let mut v = self.node_interface_mappings.unwrap_or_default();
103 v.push(input);
104 self.node_interface_mappings = ::std::option::Option::Some(v);
105 self
106 }
107 pub fn set_node_interface_mappings(
109 mut self,
110 input: ::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMappingCreateRequest>>,
111 ) -> Self {
112 self.node_interface_mappings = input;
113 self
114 }
115 pub fn get_node_interface_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::NodeInterfaceMappingCreateRequest>> {
117 &self.node_interface_mappings
118 }
119 pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.request_id = ::std::option::Option::Some(input.into());
122 self
123 }
124 pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.request_id = input;
127 self
128 }
129 pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
131 &self.request_id
132 }
133 pub fn role(mut self, input: crate::types::NodeRole) -> Self {
135 self.role = ::std::option::Option::Some(input);
136 self
137 }
138 pub fn set_role(mut self, input: ::std::option::Option<crate::types::NodeRole>) -> Self {
140 self.role = input;
141 self
142 }
143 pub fn get_role(&self) -> &::std::option::Option<crate::types::NodeRole> {
145 &self.role
146 }
147 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
153 let mut hash_map = self.tags.unwrap_or_default();
154 hash_map.insert(k.into(), v.into());
155 self.tags = ::std::option::Option::Some(hash_map);
156 self
157 }
158 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
160 self.tags = input;
161 self
162 }
163 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
165 &self.tags
166 }
167 pub fn build(self) -> ::std::result::Result<crate::operation::create_node::CreateNodeInput, ::aws_smithy_types::error::operation::BuildError> {
169 ::std::result::Result::Ok(crate::operation::create_node::CreateNodeInput {
170 cluster_id: self.cluster_id,
171 name: self.name,
172 node_interface_mappings: self.node_interface_mappings,
173 request_id: self.request_id,
174 role: self.role,
175 tags: self.tags,
176 })
177 }
178}