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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A collection of segment documents with matching trace IDs.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Trace {
/// <p>The unique identifier for the request that generated the trace's segments and subsegments.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The length of time in seconds between the start time of the earliest segment that started and the end time of the last segment that completed.</p>
pub duration: ::std::option::Option<f64>,
/// <p>LimitExceeded is set to true when the trace has exceeded the <code>Trace document size</code> limit. For more information about this limit and other X-Ray limits and quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web Services X-Ray endpoints and quotas</a>.</p>
pub limit_exceeded: ::std::option::Option<bool>,
/// <p>Segment documents for the segments and subsegments that comprise the trace.</p>
pub segments: ::std::option::Option<::std::vec::Vec<crate::types::Segment>>,
}
impl Trace {
/// <p>The unique identifier for the request that generated the trace's segments and subsegments.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The length of time in seconds between the start time of the earliest segment that started and the end time of the last segment that completed.</p>
pub fn duration(&self) -> ::std::option::Option<f64> {
self.duration
}
/// <p>LimitExceeded is set to true when the trace has exceeded the <code>Trace document size</code> limit. For more information about this limit and other X-Ray limits and quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web Services X-Ray endpoints and quotas</a>.</p>
pub fn limit_exceeded(&self) -> ::std::option::Option<bool> {
self.limit_exceeded
}
/// <p>Segment documents for the segments and subsegments that comprise the trace.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.segments.is_none()`.
pub fn segments(&self) -> &[crate::types::Segment] {
self.segments.as_deref().unwrap_or_default()
}
}
impl Trace {
/// Creates a new builder-style object to manufacture [`Trace`](crate::types::Trace).
pub fn builder() -> crate::types::builders::TraceBuilder {
crate::types::builders::TraceBuilder::default()
}
}
/// A builder for [`Trace`](crate::types::Trace).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct TraceBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) duration: ::std::option::Option<f64>,
pub(crate) limit_exceeded: ::std::option::Option<bool>,
pub(crate) segments: ::std::option::Option<::std::vec::Vec<crate::types::Segment>>,
}
impl TraceBuilder {
/// <p>The unique identifier for the request that generated the trace's segments and subsegments.</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>The unique identifier for the request that generated the trace's segments and subsegments.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The unique identifier for the request that generated the trace's segments and subsegments.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The length of time in seconds between the start time of the earliest segment that started and the end time of the last segment that completed.</p>
pub fn duration(mut self, input: f64) -> Self {
self.duration = ::std::option::Option::Some(input);
self
}
/// <p>The length of time in seconds between the start time of the earliest segment that started and the end time of the last segment that completed.</p>
pub fn set_duration(mut self, input: ::std::option::Option<f64>) -> Self {
self.duration = input;
self
}
/// <p>The length of time in seconds between the start time of the earliest segment that started and the end time of the last segment that completed.</p>
pub fn get_duration(&self) -> &::std::option::Option<f64> {
&self.duration
}
/// <p>LimitExceeded is set to true when the trace has exceeded the <code>Trace document size</code> limit. For more information about this limit and other X-Ray limits and quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web Services X-Ray endpoints and quotas</a>.</p>
pub fn limit_exceeded(mut self, input: bool) -> Self {
self.limit_exceeded = ::std::option::Option::Some(input);
self
}
/// <p>LimitExceeded is set to true when the trace has exceeded the <code>Trace document size</code> limit. For more information about this limit and other X-Ray limits and quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web Services X-Ray endpoints and quotas</a>.</p>
pub fn set_limit_exceeded(mut self, input: ::std::option::Option<bool>) -> Self {
self.limit_exceeded = input;
self
}
/// <p>LimitExceeded is set to true when the trace has exceeded the <code>Trace document size</code> limit. For more information about this limit and other X-Ray limits and quotas, see <a href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web Services X-Ray endpoints and quotas</a>.</p>
pub fn get_limit_exceeded(&self) -> &::std::option::Option<bool> {
&self.limit_exceeded
}
/// Appends an item to `segments`.
///
/// To override the contents of this collection use [`set_segments`](Self::set_segments).
///
/// <p>Segment documents for the segments and subsegments that comprise the trace.</p>
pub fn segments(mut self, input: crate::types::Segment) -> Self {
let mut v = self.segments.unwrap_or_default();
v.push(input);
self.segments = ::std::option::Option::Some(v);
self
}
/// <p>Segment documents for the segments and subsegments that comprise the trace.</p>
pub fn set_segments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Segment>>) -> Self {
self.segments = input;
self
}
/// <p>Segment documents for the segments and subsegments that comprise the trace.</p>
pub fn get_segments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Segment>> {
&self.segments
}
/// Consumes the builder and constructs a [`Trace`](crate::types::Trace).
pub fn build(self) -> crate::types::Trace {
crate::types::Trace {
id: self.id,
duration: self.duration,
limit_exceeded: self.limit_exceeded,
segments: self.segments,
}
}
}