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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A structure that represents a node in a dependency graph, containing information about a service, resource, or other entity and its characteristics.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Node {
/// <p>The key attributes that identify this node, including Type, Name, and Environment information.</p>
pub key_attributes: ::std::collections::HashMap<::std::string::String, ::std::string::String>,
/// <p>The name of the entity represented by this node.</p>
pub name: ::std::string::String,
/// <p>A unique identifier for this node within the dependency graph.</p>
pub node_id: ::std::string::String,
/// <p>The operation associated with this node, if applicable.</p>
pub operation: ::std::option::Option<::std::string::String>,
/// <p>The type of entity represented by this node, such as <code>Service</code> or <code>Resource</code>.</p>
pub r#type: ::std::option::Option<::std::string::String>,
/// <p>The duration or processing time associated with this node, if applicable.</p>
pub duration: ::std::option::Option<f64>,
/// <p>The status of the entity represented by this node.</p>
pub status: ::std::option::Option<::std::string::String>,
}
impl Node {
/// <p>The key attributes that identify this node, including Type, Name, and Environment information.</p>
pub fn key_attributes(&self) -> &::std::collections::HashMap<::std::string::String, ::std::string::String> {
&self.key_attributes
}
/// <p>The name of the entity represented by this node.</p>
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
/// <p>A unique identifier for this node within the dependency graph.</p>
pub fn node_id(&self) -> &str {
use std::ops::Deref;
self.node_id.deref()
}
/// <p>The operation associated with this node, if applicable.</p>
pub fn operation(&self) -> ::std::option::Option<&str> {
self.operation.as_deref()
}
/// <p>The type of entity represented by this node, such as <code>Service</code> or <code>Resource</code>.</p>
pub fn r#type(&self) -> ::std::option::Option<&str> {
self.r#type.as_deref()
}
/// <p>The duration or processing time associated with this node, if applicable.</p>
pub fn duration(&self) -> ::std::option::Option<f64> {
self.duration
}
/// <p>The status of the entity represented by this node.</p>
pub fn status(&self) -> ::std::option::Option<&str> {
self.status.as_deref()
}
}
impl Node {
/// Creates a new builder-style object to manufacture [`Node`](crate::types::Node).
pub fn builder() -> crate::types::builders::NodeBuilder {
crate::types::builders::NodeBuilder::default()
}
}
/// A builder for [`Node`](crate::types::Node).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct NodeBuilder {
pub(crate) key_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) node_id: ::std::option::Option<::std::string::String>,
pub(crate) operation: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) duration: ::std::option::Option<f64>,
pub(crate) status: ::std::option::Option<::std::string::String>,
}
impl NodeBuilder {
/// Adds a key-value pair to `key_attributes`.
///
/// To override the contents of this collection use [`set_key_attributes`](Self::set_key_attributes).
///
/// <p>The key attributes that identify this node, including Type, Name, and Environment information.</p>
pub fn key_attributes(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.key_attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.key_attributes = ::std::option::Option::Some(hash_map);
self
}
/// <p>The key attributes that identify this node, including Type, Name, and Environment information.</p>
pub fn set_key_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.key_attributes = input;
self
}
/// <p>The key attributes that identify this node, including Type, Name, and Environment information.</p>
pub fn get_key_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.key_attributes
}
/// <p>The name of the entity represented by this node.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the entity represented by this node.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the entity represented by this node.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>A unique identifier for this node within the dependency graph.</p>
/// This field is required.
pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.node_id = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique identifier for this node within the dependency graph.</p>
pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.node_id = input;
self
}
/// <p>A unique identifier for this node within the dependency graph.</p>
pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
&self.node_id
}
/// <p>The operation associated with this node, if applicable.</p>
pub fn operation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.operation = ::std::option::Option::Some(input.into());
self
}
/// <p>The operation associated with this node, if applicable.</p>
pub fn set_operation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.operation = input;
self
}
/// <p>The operation associated with this node, if applicable.</p>
pub fn get_operation(&self) -> &::std::option::Option<::std::string::String> {
&self.operation
}
/// <p>The type of entity represented by this node, such as <code>Service</code> or <code>Resource</code>.</p>
pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
/// <p>The type of entity represented by this node, such as <code>Service</code> or <code>Resource</code>.</p>
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
/// <p>The type of entity represented by this node, such as <code>Service</code> or <code>Resource</code>.</p>
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
/// <p>The duration or processing time associated with this node, if applicable.</p>
pub fn duration(mut self, input: f64) -> Self {
self.duration = ::std::option::Option::Some(input);
self
}
/// <p>The duration or processing time associated with this node, if applicable.</p>
pub fn set_duration(mut self, input: ::std::option::Option<f64>) -> Self {
self.duration = input;
self
}
/// <p>The duration or processing time associated with this node, if applicable.</p>
pub fn get_duration(&self) -> &::std::option::Option<f64> {
&self.duration
}
/// <p>The status of the entity represented by this node.</p>
pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status = ::std::option::Option::Some(input.into());
self
}
/// <p>The status of the entity represented by this node.</p>
pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status = input;
self
}
/// <p>The status of the entity represented by this node.</p>
pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
&self.status
}
/// Consumes the builder and constructs a [`Node`](crate::types::Node).
/// This method will fail if any of the following fields are not set:
/// - [`key_attributes`](crate::types::builders::NodeBuilder::key_attributes)
/// - [`name`](crate::types::builders::NodeBuilder::name)
/// - [`node_id`](crate::types::builders::NodeBuilder::node_id)
pub fn build(self) -> ::std::result::Result<crate::types::Node, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Node {
key_attributes: self.key_attributes.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"key_attributes",
"key_attributes was not specified but it is required when building Node",
)
})?,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building Node",
)
})?,
node_id: self.node_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"node_id",
"node_id was not specified but it is required when building Node",
)
})?,
operation: self.operation,
r#type: self.r#type,
duration: self.duration,
status: self.status,
})
}
}