/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace XRay { namespace Model { /** *

Temporary changes to a sampling rule configuration. To meet the global * sampling target for a rule, X-Ray calculates a new reservoir for each service * based on the recent sampling results of all services that called GetSamplingTargets.

See * Also:

AWS * API Reference

*/ class SamplingTargetDocument { public: AWS_XRAY_API SamplingTargetDocument(); AWS_XRAY_API SamplingTargetDocument(Aws::Utils::Json::JsonView jsonValue); AWS_XRAY_API SamplingTargetDocument& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_XRAY_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The name of the sampling rule.

*/ inline const Aws::String& GetRuleName() const{ return m_ruleName; } /** *

The name of the sampling rule.

*/ inline bool RuleNameHasBeenSet() const { return m_ruleNameHasBeenSet; } /** *

The name of the sampling rule.

*/ inline void SetRuleName(const Aws::String& value) { m_ruleNameHasBeenSet = true; m_ruleName = value; } /** *

The name of the sampling rule.

*/ inline void SetRuleName(Aws::String&& value) { m_ruleNameHasBeenSet = true; m_ruleName = std::move(value); } /** *

The name of the sampling rule.

*/ inline void SetRuleName(const char* value) { m_ruleNameHasBeenSet = true; m_ruleName.assign(value); } /** *

The name of the sampling rule.

*/ inline SamplingTargetDocument& WithRuleName(const Aws::String& value) { SetRuleName(value); return *this;} /** *

The name of the sampling rule.

*/ inline SamplingTargetDocument& WithRuleName(Aws::String&& value) { SetRuleName(std::move(value)); return *this;} /** *

The name of the sampling rule.

*/ inline SamplingTargetDocument& WithRuleName(const char* value) { SetRuleName(value); return *this;} /** *

The percentage of matching requests to instrument, after the reservoir is * exhausted.

*/ inline double GetFixedRate() const{ return m_fixedRate; } /** *

The percentage of matching requests to instrument, after the reservoir is * exhausted.

*/ inline bool FixedRateHasBeenSet() const { return m_fixedRateHasBeenSet; } /** *

The percentage of matching requests to instrument, after the reservoir is * exhausted.

*/ inline void SetFixedRate(double value) { m_fixedRateHasBeenSet = true; m_fixedRate = value; } /** *

The percentage of matching requests to instrument, after the reservoir is * exhausted.

*/ inline SamplingTargetDocument& WithFixedRate(double value) { SetFixedRate(value); return *this;} /** *

The number of requests per second that X-Ray allocated for this service.

*/ inline int GetReservoirQuota() const{ return m_reservoirQuota; } /** *

The number of requests per second that X-Ray allocated for this service.

*/ inline bool ReservoirQuotaHasBeenSet() const { return m_reservoirQuotaHasBeenSet; } /** *

The number of requests per second that X-Ray allocated for this service.

*/ inline void SetReservoirQuota(int value) { m_reservoirQuotaHasBeenSet = true; m_reservoirQuota = value; } /** *

The number of requests per second that X-Ray allocated for this service.

*/ inline SamplingTargetDocument& WithReservoirQuota(int value) { SetReservoirQuota(value); return *this;} /** *

When the reservoir quota expires.

*/ inline const Aws::Utils::DateTime& GetReservoirQuotaTTL() const{ return m_reservoirQuotaTTL; } /** *

When the reservoir quota expires.

*/ inline bool ReservoirQuotaTTLHasBeenSet() const { return m_reservoirQuotaTTLHasBeenSet; } /** *

When the reservoir quota expires.

*/ inline void SetReservoirQuotaTTL(const Aws::Utils::DateTime& value) { m_reservoirQuotaTTLHasBeenSet = true; m_reservoirQuotaTTL = value; } /** *

When the reservoir quota expires.

*/ inline void SetReservoirQuotaTTL(Aws::Utils::DateTime&& value) { m_reservoirQuotaTTLHasBeenSet = true; m_reservoirQuotaTTL = std::move(value); } /** *

When the reservoir quota expires.

*/ inline SamplingTargetDocument& WithReservoirQuotaTTL(const Aws::Utils::DateTime& value) { SetReservoirQuotaTTL(value); return *this;} /** *

When the reservoir quota expires.

*/ inline SamplingTargetDocument& WithReservoirQuotaTTL(Aws::Utils::DateTime&& value) { SetReservoirQuotaTTL(std::move(value)); return *this;} /** *

The number of seconds for the service to wait before getting sampling targets * again.

*/ inline int GetInterval() const{ return m_interval; } /** *

The number of seconds for the service to wait before getting sampling targets * again.

*/ inline bool IntervalHasBeenSet() const { return m_intervalHasBeenSet; } /** *

The number of seconds for the service to wait before getting sampling targets * again.

*/ inline void SetInterval(int value) { m_intervalHasBeenSet = true; m_interval = value; } /** *

The number of seconds for the service to wait before getting sampling targets * again.

*/ inline SamplingTargetDocument& WithInterval(int value) { SetInterval(value); return *this;} private: Aws::String m_ruleName; bool m_ruleNameHasBeenSet = false; double m_fixedRate; bool m_fixedRateHasBeenSet = false; int m_reservoirQuota; bool m_reservoirQuotaHasBeenSet = false; Aws::Utils::DateTime m_reservoirQuotaTTL; bool m_reservoirQuotaTTLHasBeenSet = false; int m_interval; bool m_intervalHasBeenSet = false; }; } // namespace Model } // namespace XRay } // namespace Aws