1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #pragma once
7 #include <aws/xray/XRay_EXPORTS.h>
8 #include <aws/core/utils/memory/stl/AWSString.h>
9 #include <aws/core/utils/memory/stl/AWSVector.h>
10 #include <aws/xray/model/Segment.h>
11 #include <utility>
12 
13 namespace Aws
14 {
15 namespace Utils
16 {
17 namespace Json
18 {
19   class JsonValue;
20   class JsonView;
21 } // namespace Json
22 } // namespace Utils
23 namespace XRay
24 {
25 namespace Model
26 {
27 
28   /**
29    * <p>A collection of segment documents with matching trace IDs.</p><p><h3>See
30    * Also:</h3>   <a
31    * href="http://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/Trace">AWS API
32    * Reference</a></p>
33    */
34   class AWS_XRAY_API Trace
35   {
36   public:
37     Trace();
38     Trace(Aws::Utils::Json::JsonView jsonValue);
39     Trace& operator=(Aws::Utils::Json::JsonView jsonValue);
40     Aws::Utils::Json::JsonValue Jsonize() const;
41 
42 
43     /**
44      * <p>The unique identifier for the request that generated the trace's segments and
45      * subsegments.</p>
46      */
GetId()47     inline const Aws::String& GetId() const{ return m_id; }
48 
49     /**
50      * <p>The unique identifier for the request that generated the trace's segments and
51      * subsegments.</p>
52      */
IdHasBeenSet()53     inline bool IdHasBeenSet() const { return m_idHasBeenSet; }
54 
55     /**
56      * <p>The unique identifier for the request that generated the trace's segments and
57      * subsegments.</p>
58      */
SetId(const Aws::String & value)59     inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; }
60 
61     /**
62      * <p>The unique identifier for the request that generated the trace's segments and
63      * subsegments.</p>
64      */
SetId(Aws::String && value)65     inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); }
66 
67     /**
68      * <p>The unique identifier for the request that generated the trace's segments and
69      * subsegments.</p>
70      */
SetId(const char * value)71     inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); }
72 
73     /**
74      * <p>The unique identifier for the request that generated the trace's segments and
75      * subsegments.</p>
76      */
WithId(const Aws::String & value)77     inline Trace& WithId(const Aws::String& value) { SetId(value); return *this;}
78 
79     /**
80      * <p>The unique identifier for the request that generated the trace's segments and
81      * subsegments.</p>
82      */
WithId(Aws::String && value)83     inline Trace& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;}
84 
85     /**
86      * <p>The unique identifier for the request that generated the trace's segments and
87      * subsegments.</p>
88      */
WithId(const char * value)89     inline Trace& WithId(const char* value) { SetId(value); return *this;}
90 
91 
92     /**
93      * <p>The length of time in seconds between the start time of the root segment and
94      * the end time of the last segment that completed.</p>
95      */
GetDuration()96     inline double GetDuration() const{ return m_duration; }
97 
98     /**
99      * <p>The length of time in seconds between the start time of the root segment and
100      * the end time of the last segment that completed.</p>
101      */
DurationHasBeenSet()102     inline bool DurationHasBeenSet() const { return m_durationHasBeenSet; }
103 
104     /**
105      * <p>The length of time in seconds between the start time of the root segment and
106      * the end time of the last segment that completed.</p>
107      */
SetDuration(double value)108     inline void SetDuration(double value) { m_durationHasBeenSet = true; m_duration = value; }
109 
110     /**
111      * <p>The length of time in seconds between the start time of the root segment and
112      * the end time of the last segment that completed.</p>
113      */
WithDuration(double value)114     inline Trace& WithDuration(double value) { SetDuration(value); return *this;}
115 
116 
117     /**
118      * <p>LimitExceeded is set to true when the trace has exceeded one of the defined
119      * quotas. For more information about quotas, see <a
120      * href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web
121      * Services X-Ray endpoints and quotas</a>.</p>
122      */
GetLimitExceeded()123     inline bool GetLimitExceeded() const{ return m_limitExceeded; }
124 
125     /**
126      * <p>LimitExceeded is set to true when the trace has exceeded one of the defined
127      * quotas. For more information about quotas, see <a
128      * href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web
129      * Services X-Ray endpoints and quotas</a>.</p>
130      */
LimitExceededHasBeenSet()131     inline bool LimitExceededHasBeenSet() const { return m_limitExceededHasBeenSet; }
132 
133     /**
134      * <p>LimitExceeded is set to true when the trace has exceeded one of the defined
135      * quotas. For more information about quotas, see <a
136      * href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web
137      * Services X-Ray endpoints and quotas</a>.</p>
138      */
SetLimitExceeded(bool value)139     inline void SetLimitExceeded(bool value) { m_limitExceededHasBeenSet = true; m_limitExceeded = value; }
140 
141     /**
142      * <p>LimitExceeded is set to true when the trace has exceeded one of the defined
143      * quotas. For more information about quotas, see <a
144      * href="https://docs.aws.amazon.com/general/latest/gr/xray.html">Amazon Web
145      * Services X-Ray endpoints and quotas</a>.</p>
146      */
WithLimitExceeded(bool value)147     inline Trace& WithLimitExceeded(bool value) { SetLimitExceeded(value); return *this;}
148 
149 
150     /**
151      * <p>Segment documents for the segments and subsegments that comprise the
152      * trace.</p>
153      */
GetSegments()154     inline const Aws::Vector<Segment>& GetSegments() const{ return m_segments; }
155 
156     /**
157      * <p>Segment documents for the segments and subsegments that comprise the
158      * trace.</p>
159      */
SegmentsHasBeenSet()160     inline bool SegmentsHasBeenSet() const { return m_segmentsHasBeenSet; }
161 
162     /**
163      * <p>Segment documents for the segments and subsegments that comprise the
164      * trace.</p>
165      */
SetSegments(const Aws::Vector<Segment> & value)166     inline void SetSegments(const Aws::Vector<Segment>& value) { m_segmentsHasBeenSet = true; m_segments = value; }
167 
168     /**
169      * <p>Segment documents for the segments and subsegments that comprise the
170      * trace.</p>
171      */
SetSegments(Aws::Vector<Segment> && value)172     inline void SetSegments(Aws::Vector<Segment>&& value) { m_segmentsHasBeenSet = true; m_segments = std::move(value); }
173 
174     /**
175      * <p>Segment documents for the segments and subsegments that comprise the
176      * trace.</p>
177      */
WithSegments(const Aws::Vector<Segment> & value)178     inline Trace& WithSegments(const Aws::Vector<Segment>& value) { SetSegments(value); return *this;}
179 
180     /**
181      * <p>Segment documents for the segments and subsegments that comprise the
182      * trace.</p>
183      */
WithSegments(Aws::Vector<Segment> && value)184     inline Trace& WithSegments(Aws::Vector<Segment>&& value) { SetSegments(std::move(value)); return *this;}
185 
186     /**
187      * <p>Segment documents for the segments and subsegments that comprise the
188      * trace.</p>
189      */
AddSegments(const Segment & value)190     inline Trace& AddSegments(const Segment& value) { m_segmentsHasBeenSet = true; m_segments.push_back(value); return *this; }
191 
192     /**
193      * <p>Segment documents for the segments and subsegments that comprise the
194      * trace.</p>
195      */
AddSegments(Segment && value)196     inline Trace& AddSegments(Segment&& value) { m_segmentsHasBeenSet = true; m_segments.push_back(std::move(value)); return *this; }
197 
198   private:
199 
200     Aws::String m_id;
201     bool m_idHasBeenSet;
202 
203     double m_duration;
204     bool m_durationHasBeenSet;
205 
206     bool m_limitExceeded;
207     bool m_limitExceededHasBeenSet;
208 
209     Aws::Vector<Segment> m_segments;
210     bool m_segmentsHasBeenSet;
211   };
212 
213 } // namespace Model
214 } // namespace XRay
215 } // namespace Aws
216