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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// A directed edge in the context graph connecting two nodes.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Edge {
/// The unique identifier of the edge within the context graph.
pub edge_id: ::std::option::Option<::std::string::String>,
/// The node identifier the edge originates from.
pub from: ::std::option::Option<::std::string::String>,
/// The node identifier the edge points to.
pub to: ::std::option::Option<::std::string::String>,
/// The kind of relationship the edge represents.
pub edge_type: ::std::option::Option<crate::types::EdgeType>,
/// The operations observed on this edge.
pub operations: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
pub edge_properties: ::std::option::Option<crate::types::EdgeProperties>,
/// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` 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 kinds of telemetry signal observed on this edge.
pub signal_types: ::std::option::Option<::std::vec::Vec<crate::types::Signal>>,
/// The discovery sources that contributed this edge.
pub sources: ::std::option::Option<::std::vec::Vec<crate::types::Source>>,
/// Descriptive metadata about the edge. Present only when the request sets includeMetadata.
pub metadata: ::std::option::Option<crate::types::Metadata>,
/// When this edge was first observed (UTC), at minute granularity. For an edge 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 edge was most recently observed (UTC), at minute granularity. For an edge that merged across sources, this is the latest value any source reported.
pub last_observed_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Edge {
/// The unique identifier of the edge within the context graph.
pub fn edge_id(&self) -> ::std::option::Option<&str> {
self.edge_id.as_deref()
}
/// The node identifier the edge originates from.
pub fn from(&self) -> ::std::option::Option<&str> {
self.from.as_deref()
}
/// The node identifier the edge points to.
pub fn to(&self) -> ::std::option::Option<&str> {
self.to.as_deref()
}
/// The kind of relationship the edge represents.
pub fn edge_type(&self) -> ::std::option::Option<&crate::types::EdgeType> {
self.edge_type.as_ref()
}
/// The operations observed on this edge.
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.operations.is_none()`.
pub fn operations(&self) -> &[::std::string::String] {
self.operations.as_deref().unwrap_or_default()
}
/// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
pub fn edge_properties(&self) -> ::std::option::Option<&crate::types::EdgeProperties> {
self.edge_properties.as_ref()
}
/// The edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` 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 kinds of telemetry signal observed on this edge.
///
/// 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 edge.
///
/// 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 edge. Present only when the request sets includeMetadata.
pub fn metadata(&self) -> ::std::option::Option<&crate::types::Metadata> {
self.metadata.as_ref()
}
/// When this edge was first observed (UTC), at minute granularity. For an edge 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 edge was most recently observed (UTC), at minute granularity. For an edge 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()
}
}
impl Edge {
/// Creates a new builder-style object to manufacture [`Edge`](crate::types::Edge).
pub fn builder() -> crate::types::builders::EdgeBuilder {
crate::types::builders::EdgeBuilder::default()
}
}
/// A builder for [`Edge`](crate::types::Edge).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EdgeBuilder {
pub(crate) edge_id: ::std::option::Option<::std::string::String>,
pub(crate) from: ::std::option::Option<::std::string::String>,
pub(crate) to: ::std::option::Option<::std::string::String>,
pub(crate) edge_type: ::std::option::Option<crate::types::EdgeType>,
pub(crate) operations: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) edge_properties: ::std::option::Option<crate::types::EdgeProperties>,
pub(crate) telemetry_attributes: ::std::option::Option<::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>,
}
impl EdgeBuilder {
/// The unique identifier of the edge within the context graph.
pub fn edge_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.edge_id = ::std::option::Option::Some(input.into());
self
}
/// The unique identifier of the edge within the context graph.
pub fn set_edge_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.edge_id = input;
self
}
/// The unique identifier of the edge within the context graph.
pub fn get_edge_id(&self) -> &::std::option::Option<::std::string::String> {
&self.edge_id
}
/// The node identifier the edge originates from.
pub fn from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.from = ::std::option::Option::Some(input.into());
self
}
/// The node identifier the edge originates from.
pub fn set_from(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.from = input;
self
}
/// The node identifier the edge originates from.
pub fn get_from(&self) -> &::std::option::Option<::std::string::String> {
&self.from
}
/// The node identifier the edge points to.
pub fn to(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.to = ::std::option::Option::Some(input.into());
self
}
/// The node identifier the edge points to.
pub fn set_to(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.to = input;
self
}
/// The node identifier the edge points to.
pub fn get_to(&self) -> &::std::option::Option<::std::string::String> {
&self.to
}
/// The kind of relationship the edge represents.
pub fn edge_type(mut self, input: crate::types::EdgeType) -> Self {
self.edge_type = ::std::option::Option::Some(input);
self
}
/// The kind of relationship the edge represents.
pub fn set_edge_type(mut self, input: ::std::option::Option<crate::types::EdgeType>) -> Self {
self.edge_type = input;
self
}
/// The kind of relationship the edge represents.
pub fn get_edge_type(&self) -> &::std::option::Option<crate::types::EdgeType> {
&self.edge_type
}
/// Appends an item to `operations`.
///
/// To override the contents of this collection use [`set_operations`](Self::set_operations).
///
/// The operations observed on this edge.
pub fn operations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.operations.unwrap_or_default();
v.push(input.into());
self.operations = ::std::option::Option::Some(v);
self
}
/// The operations observed on this edge.
pub fn set_operations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.operations = input;
self
}
/// The operations observed on this edge.
pub fn get_operations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.operations
}
/// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
pub fn edge_properties(mut self, input: crate::types::EdgeProperties) -> Self {
self.edge_properties = ::std::option::Option::Some(input);
self
}
/// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
pub fn set_edge_properties(mut self, input: ::std::option::Option<crate::types::EdgeProperties>) -> Self {
self.edge_properties = input;
self
}
/// Attributes promoted out of the flat attribute map onto typed members. Which members are present depends on what produced the edge.
pub fn get_edge_properties(&self) -> &::std::option::Option<crate::types::EdgeProperties> {
&self.edge_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 edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` 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 edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` 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 edge's OpenTelemetry (OTel) attributes, as emitted by telemetry. A key promoted onto an `edgeProperties` 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
}
/// 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 edge.
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 edge.
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 edge.
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 edge.
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 edge.
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 edge.
pub fn get_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Source>> {
&self.sources
}
/// Descriptive metadata about the edge. 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 edge. 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 edge. Present only when the request sets includeMetadata.
pub fn get_metadata(&self) -> &::std::option::Option<crate::types::Metadata> {
&self.metadata
}
/// When this edge was first observed (UTC), at minute granularity. For an edge 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 edge was first observed (UTC), at minute granularity. For an edge 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 edge was first observed (UTC), at minute granularity. For an edge 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 edge was most recently observed (UTC), at minute granularity. For an edge 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 edge was most recently observed (UTC), at minute granularity. For an edge 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 edge was most recently observed (UTC), at minute granularity. For an edge 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
}
/// Consumes the builder and constructs a [`Edge`](crate::types::Edge).
pub fn build(self) -> crate::types::Edge {
crate::types::Edge {
edge_id: self.edge_id,
from: self.from,
to: self.to,
edge_type: self.edge_type,
operations: self.operations,
edge_properties: self.edge_properties,
telemetry_attributes: self.telemetry_attributes,
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,
}
}
}