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/DateTime.h>
10 #include <utility>
11 
12 namespace Aws
13 {
14 namespace Utils
15 {
16 namespace Json
17 {
18   class JsonValue;
19   class JsonView;
20 } // namespace Json
21 } // namespace Utils
22 namespace XRay
23 {
24 namespace Model
25 {
26 
27   /**
28    * <p>Temporary changes to a sampling rule configuration. To meet the global
29    * sampling target for a rule, X-Ray calculates a new reservoir for each service
30    * based on the recent sampling results of all services that called <a
31    * href="https://docs.aws.amazon.com/xray/latest/api/API_GetSamplingTargets.html">GetSamplingTargets</a>.</p><p><h3>See
32    * Also:</h3>   <a
33    * href="http://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/SamplingTargetDocument">AWS
34    * API Reference</a></p>
35    */
36   class AWS_XRAY_API SamplingTargetDocument
37   {
38   public:
39     SamplingTargetDocument();
40     SamplingTargetDocument(Aws::Utils::Json::JsonView jsonValue);
41     SamplingTargetDocument& operator=(Aws::Utils::Json::JsonView jsonValue);
42     Aws::Utils::Json::JsonValue Jsonize() const;
43 
44 
45     /**
46      * <p>The name of the sampling rule.</p>
47      */
GetRuleName()48     inline const Aws::String& GetRuleName() const{ return m_ruleName; }
49 
50     /**
51      * <p>The name of the sampling rule.</p>
52      */
RuleNameHasBeenSet()53     inline bool RuleNameHasBeenSet() const { return m_ruleNameHasBeenSet; }
54 
55     /**
56      * <p>The name of the sampling rule.</p>
57      */
SetRuleName(const Aws::String & value)58     inline void SetRuleName(const Aws::String& value) { m_ruleNameHasBeenSet = true; m_ruleName = value; }
59 
60     /**
61      * <p>The name of the sampling rule.</p>
62      */
SetRuleName(Aws::String && value)63     inline void SetRuleName(Aws::String&& value) { m_ruleNameHasBeenSet = true; m_ruleName = std::move(value); }
64 
65     /**
66      * <p>The name of the sampling rule.</p>
67      */
SetRuleName(const char * value)68     inline void SetRuleName(const char* value) { m_ruleNameHasBeenSet = true; m_ruleName.assign(value); }
69 
70     /**
71      * <p>The name of the sampling rule.</p>
72      */
WithRuleName(const Aws::String & value)73     inline SamplingTargetDocument& WithRuleName(const Aws::String& value) { SetRuleName(value); return *this;}
74 
75     /**
76      * <p>The name of the sampling rule.</p>
77      */
WithRuleName(Aws::String && value)78     inline SamplingTargetDocument& WithRuleName(Aws::String&& value) { SetRuleName(std::move(value)); return *this;}
79 
80     /**
81      * <p>The name of the sampling rule.</p>
82      */
WithRuleName(const char * value)83     inline SamplingTargetDocument& WithRuleName(const char* value) { SetRuleName(value); return *this;}
84 
85 
86     /**
87      * <p>The percentage of matching requests to instrument, after the reservoir is
88      * exhausted.</p>
89      */
GetFixedRate()90     inline double GetFixedRate() const{ return m_fixedRate; }
91 
92     /**
93      * <p>The percentage of matching requests to instrument, after the reservoir is
94      * exhausted.</p>
95      */
FixedRateHasBeenSet()96     inline bool FixedRateHasBeenSet() const { return m_fixedRateHasBeenSet; }
97 
98     /**
99      * <p>The percentage of matching requests to instrument, after the reservoir is
100      * exhausted.</p>
101      */
SetFixedRate(double value)102     inline void SetFixedRate(double value) { m_fixedRateHasBeenSet = true; m_fixedRate = value; }
103 
104     /**
105      * <p>The percentage of matching requests to instrument, after the reservoir is
106      * exhausted.</p>
107      */
WithFixedRate(double value)108     inline SamplingTargetDocument& WithFixedRate(double value) { SetFixedRate(value); return *this;}
109 
110 
111     /**
112      * <p>The number of requests per second that X-Ray allocated for this service.</p>
113      */
GetReservoirQuota()114     inline int GetReservoirQuota() const{ return m_reservoirQuota; }
115 
116     /**
117      * <p>The number of requests per second that X-Ray allocated for this service.</p>
118      */
ReservoirQuotaHasBeenSet()119     inline bool ReservoirQuotaHasBeenSet() const { return m_reservoirQuotaHasBeenSet; }
120 
121     /**
122      * <p>The number of requests per second that X-Ray allocated for this service.</p>
123      */
SetReservoirQuota(int value)124     inline void SetReservoirQuota(int value) { m_reservoirQuotaHasBeenSet = true; m_reservoirQuota = value; }
125 
126     /**
127      * <p>The number of requests per second that X-Ray allocated for this service.</p>
128      */
WithReservoirQuota(int value)129     inline SamplingTargetDocument& WithReservoirQuota(int value) { SetReservoirQuota(value); return *this;}
130 
131 
132     /**
133      * <p>When the reservoir quota expires.</p>
134      */
GetReservoirQuotaTTL()135     inline const Aws::Utils::DateTime& GetReservoirQuotaTTL() const{ return m_reservoirQuotaTTL; }
136 
137     /**
138      * <p>When the reservoir quota expires.</p>
139      */
ReservoirQuotaTTLHasBeenSet()140     inline bool ReservoirQuotaTTLHasBeenSet() const { return m_reservoirQuotaTTLHasBeenSet; }
141 
142     /**
143      * <p>When the reservoir quota expires.</p>
144      */
SetReservoirQuotaTTL(const Aws::Utils::DateTime & value)145     inline void SetReservoirQuotaTTL(const Aws::Utils::DateTime& value) { m_reservoirQuotaTTLHasBeenSet = true; m_reservoirQuotaTTL = value; }
146 
147     /**
148      * <p>When the reservoir quota expires.</p>
149      */
SetReservoirQuotaTTL(Aws::Utils::DateTime && value)150     inline void SetReservoirQuotaTTL(Aws::Utils::DateTime&& value) { m_reservoirQuotaTTLHasBeenSet = true; m_reservoirQuotaTTL = std::move(value); }
151 
152     /**
153      * <p>When the reservoir quota expires.</p>
154      */
WithReservoirQuotaTTL(const Aws::Utils::DateTime & value)155     inline SamplingTargetDocument& WithReservoirQuotaTTL(const Aws::Utils::DateTime& value) { SetReservoirQuotaTTL(value); return *this;}
156 
157     /**
158      * <p>When the reservoir quota expires.</p>
159      */
WithReservoirQuotaTTL(Aws::Utils::DateTime && value)160     inline SamplingTargetDocument& WithReservoirQuotaTTL(Aws::Utils::DateTime&& value) { SetReservoirQuotaTTL(std::move(value)); return *this;}
161 
162 
163     /**
164      * <p>The number of seconds for the service to wait before getting sampling targets
165      * again.</p>
166      */
GetInterval()167     inline int GetInterval() const{ return m_interval; }
168 
169     /**
170      * <p>The number of seconds for the service to wait before getting sampling targets
171      * again.</p>
172      */
IntervalHasBeenSet()173     inline bool IntervalHasBeenSet() const { return m_intervalHasBeenSet; }
174 
175     /**
176      * <p>The number of seconds for the service to wait before getting sampling targets
177      * again.</p>
178      */
SetInterval(int value)179     inline void SetInterval(int value) { m_intervalHasBeenSet = true; m_interval = value; }
180 
181     /**
182      * <p>The number of seconds for the service to wait before getting sampling targets
183      * again.</p>
184      */
WithInterval(int value)185     inline SamplingTargetDocument& WithInterval(int value) { SetInterval(value); return *this;}
186 
187   private:
188 
189     Aws::String m_ruleName;
190     bool m_ruleNameHasBeenSet;
191 
192     double m_fixedRate;
193     bool m_fixedRateHasBeenSet;
194 
195     int m_reservoirQuota;
196     bool m_reservoirQuotaHasBeenSet;
197 
198     Aws::Utils::DateTime m_reservoirQuotaTTL;
199     bool m_reservoirQuotaTTLHasBeenSet;
200 
201     int m_interval;
202     bool m_intervalHasBeenSet;
203   };
204 
205 } // namespace Model
206 } // namespace XRay
207 } // namespace Aws
208