aws_sdk_glue/types/
_code_gen_node.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CodeGenNode {
7 pub id: ::std::string::String,
9 pub node_type: ::std::string::String,
11 pub args: ::std::vec::Vec<crate::types::CodeGenNodeArg>,
13 pub line_number: i32,
15}
16impl CodeGenNode {
17 pub fn id(&self) -> &str {
19 use std::ops::Deref;
20 self.id.deref()
21 }
22 pub fn node_type(&self) -> &str {
24 use std::ops::Deref;
25 self.node_type.deref()
26 }
27 pub fn args(&self) -> &[crate::types::CodeGenNodeArg] {
29 use std::ops::Deref;
30 self.args.deref()
31 }
32 pub fn line_number(&self) -> i32 {
34 self.line_number
35 }
36}
37impl CodeGenNode {
38 pub fn builder() -> crate::types::builders::CodeGenNodeBuilder {
40 crate::types::builders::CodeGenNodeBuilder::default()
41 }
42}
43
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
46#[non_exhaustive]
47pub struct CodeGenNodeBuilder {
48 pub(crate) id: ::std::option::Option<::std::string::String>,
49 pub(crate) node_type: ::std::option::Option<::std::string::String>,
50 pub(crate) args: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>>,
51 pub(crate) line_number: ::std::option::Option<i32>,
52}
53impl CodeGenNodeBuilder {
54 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57 self.id = ::std::option::Option::Some(input.into());
58 self
59 }
60 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62 self.id = input;
63 self
64 }
65 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
67 &self.id
68 }
69 pub fn node_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72 self.node_type = ::std::option::Option::Some(input.into());
73 self
74 }
75 pub fn set_node_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77 self.node_type = input;
78 self
79 }
80 pub fn get_node_type(&self) -> &::std::option::Option<::std::string::String> {
82 &self.node_type
83 }
84 pub fn args(mut self, input: crate::types::CodeGenNodeArg) -> Self {
90 let mut v = self.args.unwrap_or_default();
91 v.push(input);
92 self.args = ::std::option::Option::Some(v);
93 self
94 }
95 pub fn set_args(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>>) -> Self {
97 self.args = input;
98 self
99 }
100 pub fn get_args(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>> {
102 &self.args
103 }
104 pub fn line_number(mut self, input: i32) -> Self {
106 self.line_number = ::std::option::Option::Some(input);
107 self
108 }
109 pub fn set_line_number(mut self, input: ::std::option::Option<i32>) -> Self {
111 self.line_number = input;
112 self
113 }
114 pub fn get_line_number(&self) -> &::std::option::Option<i32> {
116 &self.line_number
117 }
118 pub fn build(self) -> ::std::result::Result<crate::types::CodeGenNode, ::aws_smithy_types::error::operation::BuildError> {
124 ::std::result::Result::Ok(crate::types::CodeGenNode {
125 id: self.id.ok_or_else(|| {
126 ::aws_smithy_types::error::operation::BuildError::missing_field(
127 "id",
128 "id was not specified but it is required when building CodeGenNode",
129 )
130 })?,
131 node_type: self.node_type.ok_or_else(|| {
132 ::aws_smithy_types::error::operation::BuildError::missing_field(
133 "node_type",
134 "node_type was not specified but it is required when building CodeGenNode",
135 )
136 })?,
137 args: self.args.ok_or_else(|| {
138 ::aws_smithy_types::error::operation::BuildError::missing_field(
139 "args",
140 "args was not specified but it is required when building CodeGenNode",
141 )
142 })?,
143 line_number: self.line_number.unwrap_or_default(),
144 })
145 }
146}