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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents a node in a directed acyclic graph (DAG)</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CodeGenNode {
    /// <p>A node identifier that is unique within the node's graph.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The type of node that this is.</p>
    pub node_type: ::std::option::Option<::std::string::String>,
    /// <p>Properties of the node, in the form of name-value pairs.</p>
    pub args: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>>,
    /// <p>The line number of the node.</p>
    pub line_number: i32,
}
impl CodeGenNode {
    /// <p>A node identifier that is unique within the node's graph.</p>
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The type of node that this is.</p>
    pub fn node_type(&self) -> ::std::option::Option<&str> {
        self.node_type.as_deref()
    }
    /// <p>Properties of the node, in the form of name-value pairs.</p>
    pub fn args(&self) -> ::std::option::Option<&[crate::types::CodeGenNodeArg]> {
        self.args.as_deref()
    }
    /// <p>The line number of the node.</p>
    pub fn line_number(&self) -> i32 {
        self.line_number
    }
}
impl CodeGenNode {
    /// Creates a new builder-style object to manufacture [`CodeGenNode`](crate::types::CodeGenNode).
    pub fn builder() -> crate::types::builders::CodeGenNodeBuilder {
        crate::types::builders::CodeGenNodeBuilder::default()
    }
}

/// A builder for [`CodeGenNode`](crate::types::CodeGenNode).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CodeGenNodeBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) node_type: ::std::option::Option<::std::string::String>,
    pub(crate) args: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>>,
    pub(crate) line_number: ::std::option::Option<i32>,
}
impl CodeGenNodeBuilder {
    /// <p>A node identifier that is unique within the node's graph.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A node identifier that is unique within the node's graph.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>A node identifier that is unique within the node's graph.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The type of node that this is.</p>
    pub fn node_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.node_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of node that this is.</p>
    pub fn set_node_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.node_type = input;
        self
    }
    /// <p>The type of node that this is.</p>
    pub fn get_node_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.node_type
    }
    /// Appends an item to `args`.
    ///
    /// To override the contents of this collection use [`set_args`](Self::set_args).
    ///
    /// <p>Properties of the node, in the form of name-value pairs.</p>
    pub fn args(mut self, input: crate::types::CodeGenNodeArg) -> Self {
        let mut v = self.args.unwrap_or_default();
        v.push(input);
        self.args = ::std::option::Option::Some(v);
        self
    }
    /// <p>Properties of the node, in the form of name-value pairs.</p>
    pub fn set_args(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>>) -> Self {
        self.args = input;
        self
    }
    /// <p>Properties of the node, in the form of name-value pairs.</p>
    pub fn get_args(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CodeGenNodeArg>> {
        &self.args
    }
    /// <p>The line number of the node.</p>
    pub fn line_number(mut self, input: i32) -> Self {
        self.line_number = ::std::option::Option::Some(input);
        self
    }
    /// <p>The line number of the node.</p>
    pub fn set_line_number(mut self, input: ::std::option::Option<i32>) -> Self {
        self.line_number = input;
        self
    }
    /// <p>The line number of the node.</p>
    pub fn get_line_number(&self) -> &::std::option::Option<i32> {
        &self.line_number
    }
    /// Consumes the builder and constructs a [`CodeGenNode`](crate::types::CodeGenNode).
    pub fn build(self) -> crate::types::CodeGenNode {
        crate::types::CodeGenNode {
            id: self.id,
            node_type: self.node_type,
            args: self.args,
            line_number: self.line_number.unwrap_or_default(),
        }
    }
}