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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// A node in the context graph representing a service, resource, or remote service.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Node {
/// The unique identifier of the node within the context graph.
pub node_id: ::std::option::Option<::std::string::String>,
/// Whether the node is a service, a resource, or a remote service.
pub node_type: ::std::option::Option<crate::types::NodeType>,
/// The primary display name of the node.
pub name: ::std::option::Option<::std::string::String>,
/// Other names this node was observed under. A node that merged across sources reports one resolved name, and the names it was merged away from appear here.
pub alternate_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// The tags observed on the underlying resource.
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// Identity attributes promoted out of the flat attribute map onto typed members.
pub node_properties: ::std::option::Option<crate::types::NodeProperties>,
/// The node's OpenTelemetry (OTel) attributes, as emitted by telemetry — the raw values, as opposed to the normalized `nodeProperties`. A key promoted onto a `nodeProperties` member is removed here, so no value appears twice.
pub telemetry_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// The operations observed on this node, keyed by operation name. Each value lists the dimension sets that identify the metric series for that operation.
pub operation_details: ::std::option::Option<
::std::collections::HashMap<
::std::string::String,
::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
>,
>,
/// The kinds of telemetry signal observed on this node.
pub signal_types: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>,
/// The discovery sources that contributed this node.
pub sources: ::std::option::Option<::std::vec::Vec<crate::types::Source>>,
/// Descriptive metadata about the node. Present only when the request sets includeMetadata.
pub metadata: ::std::option::Option<crate::types::Metadata>,
/// When this node was first observed (UTC), at minute granularity. For a node that merged across sources, this is the earliest value any source reported.
pub first_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// When this node was most recently observed (UTC), at minute granularity. For a node that merged across sources, this is the latest value any source reported.
pub last_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
/// Outbound edges originating from this node. Each edge carries its `from`.
pub edges: ::std::option::Option<::std::vec::Vec<crate::types::Edge>>,
}
impl Node {
/// The unique identifier of the node within the context graph.
pub fn node_id(&self) -> ::std::option::Option<&str> {
self.node_id.as_deref()
}
/// Whether the node is a service, a resource, or a remote service.
pub fn node_type(&self) -> ::std::option::Option<&crate::types::NodeType> {
self.node_type.as_ref()
}
/// The primary display name of the node.
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// Other names this node was observed under. A node that merged across sources reports one resolved name, and the names it was merged away from appear here.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.alternate_names.is_none()`.
pub fn alternate_names(&self) -> &[::std::string::String] {
self.alternate_names.as_deref().unwrap_or_default()
}
/// The tags observed on the underlying resource.
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
/// Identity attributes promoted out of the flat attribute map onto typed members.
pub fn node_properties(&self) -> ::std::option::Option<&crate::types::NodeProperties> {
self.node_properties.as_ref()
}
/// The node's OpenTelemetry (OTel) attributes, as emitted by telemetry — the raw values, as opposed to the normalized `nodeProperties`. A key promoted onto a `nodeProperties` member is removed here, so no value appears twice.
pub fn telemetry_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.telemetry_attributes.as_ref()
}
/// The operations observed on this node, keyed by operation name. Each value lists the dimension sets that identify the metric series for that operation.
pub fn operation_details(
&self,
) -> ::std::option::Option<
&::std::collections::HashMap<
::std::string::String,
::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
>,
> {
self.operation_details.as_ref()
}
/// The kinds of telemetry signal observed on this node.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.signal_types.is_none()`.
pub fn signal_types(&self) -> &[crate::types::Signal] {
self.signal_types.as_deref().unwrap_or_default()
}
/// The discovery sources that contributed this node.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sources.is_none()`.
pub fn sources(&self) -> &[crate::types::Source] {
self.sources.as_deref().unwrap_or_default()
}
/// Descriptive metadata about the node. Present only when the request sets includeMetadata.
pub fn metadata(&self) -> ::std::option::Option<&crate::types::Metadata> {
self.metadata.as_ref()
}
/// When this node was first observed (UTC), at minute granularity. For a node that merged across sources, this is the earliest value any source reported.
pub fn first_observed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.first_observed_at.as_ref()
}
/// When this node was most recently observed (UTC), at minute granularity. For a node that merged across sources, this is the latest value any source reported.
pub fn last_observed_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_observed_at.as_ref()
}
/// Outbound edges originating from this node. Each edge carries its `from`.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.edges.is_none()`.
pub fn edges(&self) -> &[crate::types::Edge] {
self.edges.as_deref().unwrap_or_default()
}
}
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) node_id: ::std::option::Option<::std::string::String>,
pub(crate) node_type: ::std::option::Option<crate::types::NodeType>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) alternate_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) node_properties: ::std::option::Option<crate::types::NodeProperties>,
pub(crate) telemetry_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) operation_details: ::std::option::Option<
::std::collections::HashMap<
::std::string::String,
::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
>,
>,
pub(crate) signal_types: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>,
pub(crate) sources: ::std::option::Option<::std::vec::Vec<crate::types::Source>>,
pub(crate) metadata: ::std::option::Option<crate::types::Metadata>,
pub(crate) first_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) edges: ::std::option::Option<::std::vec::Vec<crate::types::Edge>>,
}
impl NodeBuilder {
/// The unique identifier of the node within the context graph.
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
}
/// The unique identifier of the node within the context graph.
pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.node_id = input;
self
}
/// The unique identifier of the node within the context graph.
pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
&self.node_id
}
/// Whether the node is a service, a resource, or a remote service.
pub fn node_type(mut self, input: crate::types::NodeType) -> Self {
self.node_type = ::std::option::Option::Some(input);
self
}
/// Whether the node is a service, a resource, or a remote service.
pub fn set_node_type(mut self, input: ::std::option::Option<crate::types::NodeType>) -> Self {
self.node_type = input;
self
}
/// Whether the node is a service, a resource, or a remote service.
pub fn get_node_type(&self) -> &::std::option::Option<crate::types::NodeType> {
&self.node_type
}
/// The primary display name of the node.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// The primary display name of the node.
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// The primary display name of the node.
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// Appends an item to `alternate_names`.
///
/// To override the contents of this collection use [`set_alternate_names`](Self::set_alternate_names).
///
/// Other names this node was observed under. A node that merged across sources reports one resolved name, and the names it was merged away from appear here.
pub fn alternate_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.alternate_names.unwrap_or_default();
v.push(input.into());
self.alternate_names = ::std::option::Option::Some(v);
self
}
/// Other names this node was observed under. A node that merged across sources reports one resolved name, and the names it was merged away from appear here.
pub fn set_alternate_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.alternate_names = input;
self
}
/// Other names this node was observed under. A node that merged across sources reports one resolved name, and the names it was merged away from appear here.
pub fn get_alternate_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.alternate_names
}
/// Adds a key-value pair to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// The tags observed on the underlying resource.
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
/// The tags observed on the underlying resource.
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
/// The tags observed on the underlying resource.
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
/// Identity attributes promoted out of the flat attribute map onto typed members.
pub fn node_properties(mut self, input: crate::types::NodeProperties) -> Self {
self.node_properties = ::std::option::Option::Some(input);
self
}
/// Identity attributes promoted out of the flat attribute map onto typed members.
pub fn set_node_properties(mut self, input: ::std::option::Option<crate::types::NodeProperties>) -> Self {
self.node_properties = input;
self
}
/// Identity attributes promoted out of the flat attribute map onto typed members.
pub fn get_node_properties(&self) -> &::std::option::Option<crate::types::NodeProperties> {
&self.node_properties
}
/// Adds a key-value pair to `telemetry_attributes`.
///
/// To override the contents of this collection use [`set_telemetry_attributes`](Self::set_telemetry_attributes).
///
/// The node's OpenTelemetry (OTel) attributes, as emitted by telemetry — the raw values, as opposed to the normalized `nodeProperties`. A key promoted onto a `nodeProperties` member is removed here, so no value appears twice.
pub fn telemetry_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.telemetry_attributes.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.telemetry_attributes = ::std::option::Option::Some(hash_map);
self
}
/// The node's OpenTelemetry (OTel) attributes, as emitted by telemetry — the raw values, as opposed to the normalized `nodeProperties`. A key promoted onto a `nodeProperties` member is removed here, so no value appears twice.
pub fn set_telemetry_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.telemetry_attributes = input;
self
}
/// The node's OpenTelemetry (OTel) attributes, as emitted by telemetry — the raw values, as opposed to the normalized `nodeProperties`. A key promoted onto a `nodeProperties` member is removed here, so no value appears twice.
pub fn get_telemetry_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.telemetry_attributes
}
/// Adds a key-value pair to `operation_details`.
///
/// To override the contents of this collection use [`set_operation_details`](Self::set_operation_details).
///
/// The operations observed on this node, keyed by operation name. Each value lists the dimension sets that identify the metric series for that operation.
pub fn operation_details(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: ::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
let mut hash_map = self.operation_details.unwrap_or_default();
hash_map.insert(k.into(), v);
self.operation_details = ::std::option::Option::Some(hash_map);
self
}
/// The operations observed on this node, keyed by operation name. Each value lists the dimension sets that identify the metric series for that operation.
pub fn set_operation_details(
mut self,
input: ::std::option::Option<
::std::collections::HashMap<
::std::string::String,
::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
>,
>,
) -> Self {
self.operation_details = input;
self
}
/// The operations observed on this node, keyed by operation name. Each value lists the dimension sets that identify the metric series for that operation.
pub fn get_operation_details(
&self,
) -> &::std::option::Option<
::std::collections::HashMap<
::std::string::String,
::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
>,
> {
&self.operation_details
}
/// Appends an item to `signal_types`.
///
/// To override the contents of this collection use [`set_signal_types`](Self::set_signal_types).
///
/// The kinds of telemetry signal observed on this node.
pub fn signal_types(mut self, input: crate::types::Signal) -> Self {
let mut v = self.signal_types.unwrap_or_default();
v.push(input);
self.signal_types = ::std::option::Option::Some(v);
self
}
/// The kinds of telemetry signal observed on this node.
pub fn set_signal_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>) -> Self {
self.signal_types = input;
self
}
/// The kinds of telemetry signal observed on this node.
pub fn get_signal_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Signal>> {
&self.signal_types
}
/// Appends an item to `sources`.
///
/// To override the contents of this collection use [`set_sources`](Self::set_sources).
///
/// The discovery sources that contributed this node.
pub fn sources(mut self, input: crate::types::Source) -> Self {
let mut v = self.sources.unwrap_or_default();
v.push(input);
self.sources = ::std::option::Option::Some(v);
self
}
/// The discovery sources that contributed this node.
pub fn set_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Source>>) -> Self {
self.sources = input;
self
}
/// The discovery sources that contributed this node.
pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Source>> {
&self.sources
}
/// Descriptive metadata about the node. Present only when the request sets includeMetadata.
pub fn metadata(mut self, input: crate::types::Metadata) -> Self {
self.metadata = ::std::option::Option::Some(input);
self
}
/// Descriptive metadata about the node. Present only when the request sets includeMetadata.
pub fn set_metadata(mut self, input: ::std::option::Option<crate::types::Metadata>) -> Self {
self.metadata = input;
self
}
/// Descriptive metadata about the node. Present only when the request sets includeMetadata.
pub fn get_metadata(&self) -> &::std::option::Option<crate::types::Metadata> {
&self.metadata
}
/// When this node was first observed (UTC), at minute granularity. For a node that merged across sources, this is the earliest value any source reported.
pub fn first_observed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.first_observed_at = ::std::option::Option::Some(input);
self
}
/// When this node was first observed (UTC), at minute granularity. For a node that merged across sources, this is the earliest value any source reported.
pub fn set_first_observed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.first_observed_at = input;
self
}
/// When this node was first observed (UTC), at minute granularity. For a node that merged across sources, this is the earliest value any source reported.
pub fn get_first_observed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.first_observed_at
}
/// When this node was most recently observed (UTC), at minute granularity. For a node that merged across sources, this is the latest value any source reported.
pub fn last_observed_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_observed_at = ::std::option::Option::Some(input);
self
}
/// When this node was most recently observed (UTC), at minute granularity. For a node that merged across sources, this is the latest value any source reported.
pub fn set_last_observed_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_observed_at = input;
self
}
/// When this node was most recently observed (UTC), at minute granularity. For a node that merged across sources, this is the latest value any source reported.
pub fn get_last_observed_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_observed_at
}
/// Appends an item to `edges`.
///
/// To override the contents of this collection use [`set_edges`](Self::set_edges).
///
/// Outbound edges originating from this node. Each edge carries its `from`.
pub fn edges(mut self, input: crate::types::Edge) -> Self {
let mut v = self.edges.unwrap_or_default();
v.push(input);
self.edges = ::std::option::Option::Some(v);
self
}
/// Outbound edges originating from this node. Each edge carries its `from`.
pub fn set_edges(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Edge>>) -> Self {
self.edges = input;
self
}
/// Outbound edges originating from this node. Each edge carries its `from`.
pub fn get_edges(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Edge>> {
&self.edges
}
/// Consumes the builder and constructs a [`Node`](crate::types::Node).
pub fn build(self) -> crate::types::Node {
crate::types::Node {
node_id: self.node_id,
node_type: self.node_type,
name: self.name,
alternate_names: self.alternate_names,
tags: self.tags,
node_properties: self.node_properties,
telemetry_attributes: self.telemetry_attributes,
operation_details: self.operation_details,
signal_types: self.signal_types,
sources: self.sources,
metadata: self.metadata,
first_observed_at: self.first_observed_at,
last_observed_at: self.last_observed_at,
edges: self.edges,
}
}
}