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/xray/model/SamplingStrategyName.h>
9 #include <utility>
10 
11 namespace Aws
12 {
13 namespace Utils
14 {
15 namespace Json
16 {
17   class JsonValue;
18   class JsonView;
19 } // namespace Json
20 } // namespace Utils
21 namespace XRay
22 {
23 namespace Model
24 {
25 
26   /**
27    * <p>The name and value of a sampling rule to apply to a trace
28    * summary.</p><p><h3>See Also:</h3>   <a
29    * href="http://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/SamplingStrategy">AWS
30    * API Reference</a></p>
31    */
32   class AWS_XRAY_API SamplingStrategy
33   {
34   public:
35     SamplingStrategy();
36     SamplingStrategy(Aws::Utils::Json::JsonView jsonValue);
37     SamplingStrategy& operator=(Aws::Utils::Json::JsonView jsonValue);
38     Aws::Utils::Json::JsonValue Jsonize() const;
39 
40 
41     /**
42      * <p>The name of a sampling rule.</p>
43      */
GetName()44     inline const SamplingStrategyName& GetName() const{ return m_name; }
45 
46     /**
47      * <p>The name of a sampling rule.</p>
48      */
NameHasBeenSet()49     inline bool NameHasBeenSet() const { return m_nameHasBeenSet; }
50 
51     /**
52      * <p>The name of a sampling rule.</p>
53      */
SetName(const SamplingStrategyName & value)54     inline void SetName(const SamplingStrategyName& value) { m_nameHasBeenSet = true; m_name = value; }
55 
56     /**
57      * <p>The name of a sampling rule.</p>
58      */
SetName(SamplingStrategyName && value)59     inline void SetName(SamplingStrategyName&& value) { m_nameHasBeenSet = true; m_name = std::move(value); }
60 
61     /**
62      * <p>The name of a sampling rule.</p>
63      */
WithName(const SamplingStrategyName & value)64     inline SamplingStrategy& WithName(const SamplingStrategyName& value) { SetName(value); return *this;}
65 
66     /**
67      * <p>The name of a sampling rule.</p>
68      */
WithName(SamplingStrategyName && value)69     inline SamplingStrategy& WithName(SamplingStrategyName&& value) { SetName(std::move(value)); return *this;}
70 
71 
72     /**
73      * <p>The value of a sampling rule.</p>
74      */
GetValue()75     inline double GetValue() const{ return m_value; }
76 
77     /**
78      * <p>The value of a sampling rule.</p>
79      */
ValueHasBeenSet()80     inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }
81 
82     /**
83      * <p>The value of a sampling rule.</p>
84      */
SetValue(double value)85     inline void SetValue(double value) { m_valueHasBeenSet = true; m_value = value; }
86 
87     /**
88      * <p>The value of a sampling rule.</p>
89      */
WithValue(double value)90     inline SamplingStrategy& WithValue(double value) { SetValue(value); return *this;}
91 
92   private:
93 
94     SamplingStrategyName m_name;
95     bool m_nameHasBeenSet;
96 
97     double m_value;
98     bool m_valueHasBeenSet;
99   };
100 
101 } // namespace Model
102 } // namespace XRay
103 } // namespace Aws
104