/** * 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 { /** *

A sampling rule that services use to decide whether to instrument a request. * Rule fields can match properties of the service, or properties of a request. The * service can ignore rules that don't match its properties.

See * Also:

AWS * API Reference

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The name of the sampling rule. Specify a rule by either name or ARN, but not * both.

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

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline const Aws::String& GetRuleARN() const{ return m_ruleARN; } /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline bool RuleARNHasBeenSet() const { return m_ruleARNHasBeenSet; } /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline void SetRuleARN(const Aws::String& value) { m_ruleARNHasBeenSet = true; m_ruleARN = value; } /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline void SetRuleARN(Aws::String&& value) { m_ruleARNHasBeenSet = true; m_ruleARN = std::move(value); } /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline void SetRuleARN(const char* value) { m_ruleARNHasBeenSet = true; m_ruleARN.assign(value); } /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline SamplingRule& WithRuleARN(const Aws::String& value) { SetRuleARN(value); return *this;} /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline SamplingRule& WithRuleARN(Aws::String&& value) { SetRuleARN(std::move(value)); return *this;} /** *

The ARN of the sampling rule. Specify a rule by either name or ARN, but not * both.

*/ inline SamplingRule& WithRuleARN(const char* value) { SetRuleARN(value); return *this;} /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline const Aws::String& GetResourceARN() const{ return m_resourceARN; } /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline bool ResourceARNHasBeenSet() const { return m_resourceARNHasBeenSet; } /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline void SetResourceARN(const Aws::String& value) { m_resourceARNHasBeenSet = true; m_resourceARN = value; } /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline void SetResourceARN(Aws::String&& value) { m_resourceARNHasBeenSet = true; m_resourceARN = std::move(value); } /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline void SetResourceARN(const char* value) { m_resourceARNHasBeenSet = true; m_resourceARN.assign(value); } /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline SamplingRule& WithResourceARN(const Aws::String& value) { SetResourceARN(value); return *this;} /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline SamplingRule& WithResourceARN(Aws::String&& value) { SetResourceARN(std::move(value)); return *this;} /** *

Matches the ARN of the Amazon Web Services resource on which the service * runs.

*/ inline SamplingRule& WithResourceARN(const char* value) { SetResourceARN(value); return *this;} /** *

The priority of the sampling rule.

*/ inline int GetPriority() const{ return m_priority; } /** *

The priority of the sampling rule.

*/ inline bool PriorityHasBeenSet() const { return m_priorityHasBeenSet; } /** *

The priority of the sampling rule.

*/ inline void SetPriority(int value) { m_priorityHasBeenSet = true; m_priority = value; } /** *

The priority of the sampling rule.

*/ inline SamplingRule& WithPriority(int value) { SetPriority(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 SamplingRule& WithFixedRate(double value) { SetFixedRate(value); return *this;} /** *

A fixed number of matching requests to instrument per second, prior to * applying the fixed rate. The reservoir is not used directly by services, but * applies to all services using the rule collectively.

*/ inline int GetReservoirSize() const{ return m_reservoirSize; } /** *

A fixed number of matching requests to instrument per second, prior to * applying the fixed rate. The reservoir is not used directly by services, but * applies to all services using the rule collectively.

*/ inline bool ReservoirSizeHasBeenSet() const { return m_reservoirSizeHasBeenSet; } /** *

A fixed number of matching requests to instrument per second, prior to * applying the fixed rate. The reservoir is not used directly by services, but * applies to all services using the rule collectively.

*/ inline void SetReservoirSize(int value) { m_reservoirSizeHasBeenSet = true; m_reservoirSize = value; } /** *

A fixed number of matching requests to instrument per second, prior to * applying the fixed rate. The reservoir is not used directly by services, but * applies to all services using the rule collectively.

*/ inline SamplingRule& WithReservoirSize(int value) { SetReservoirSize(value); return *this;} /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline const Aws::String& GetServiceName() const{ return m_serviceName; } /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline bool ServiceNameHasBeenSet() const { return m_serviceNameHasBeenSet; } /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline void SetServiceName(const Aws::String& value) { m_serviceNameHasBeenSet = true; m_serviceName = value; } /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline void SetServiceName(Aws::String&& value) { m_serviceNameHasBeenSet = true; m_serviceName = std::move(value); } /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline void SetServiceName(const char* value) { m_serviceNameHasBeenSet = true; m_serviceName.assign(value); } /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline SamplingRule& WithServiceName(const Aws::String& value) { SetServiceName(value); return *this;} /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline SamplingRule& WithServiceName(Aws::String&& value) { SetServiceName(std::move(value)); return *this;} /** *

Matches the name that the service uses to identify itself in * segments.

*/ inline SamplingRule& WithServiceName(const char* value) { SetServiceName(value); return *this;} /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline const Aws::String& GetServiceType() const{ return m_serviceType; } /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline bool ServiceTypeHasBeenSet() const { return m_serviceTypeHasBeenSet; } /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline void SetServiceType(const Aws::String& value) { m_serviceTypeHasBeenSet = true; m_serviceType = value; } /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline void SetServiceType(Aws::String&& value) { m_serviceTypeHasBeenSet = true; m_serviceType = std::move(value); } /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline void SetServiceType(const char* value) { m_serviceTypeHasBeenSet = true; m_serviceType.assign(value); } /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline SamplingRule& WithServiceType(const Aws::String& value) { SetServiceType(value); return *this;} /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline SamplingRule& WithServiceType(Aws::String&& value) { SetServiceType(std::move(value)); return *this;} /** *

Matches the origin that the service uses to identify its type in * segments.

*/ inline SamplingRule& WithServiceType(const char* value) { SetServiceType(value); return *this;} /** *

Matches the hostname from a request URL.

*/ inline const Aws::String& GetHost() const{ return m_host; } /** *

Matches the hostname from a request URL.

*/ inline bool HostHasBeenSet() const { return m_hostHasBeenSet; } /** *

Matches the hostname from a request URL.

*/ inline void SetHost(const Aws::String& value) { m_hostHasBeenSet = true; m_host = value; } /** *

Matches the hostname from a request URL.

*/ inline void SetHost(Aws::String&& value) { m_hostHasBeenSet = true; m_host = std::move(value); } /** *

Matches the hostname from a request URL.

*/ inline void SetHost(const char* value) { m_hostHasBeenSet = true; m_host.assign(value); } /** *

Matches the hostname from a request URL.

*/ inline SamplingRule& WithHost(const Aws::String& value) { SetHost(value); return *this;} /** *

Matches the hostname from a request URL.

*/ inline SamplingRule& WithHost(Aws::String&& value) { SetHost(std::move(value)); return *this;} /** *

Matches the hostname from a request URL.

*/ inline SamplingRule& WithHost(const char* value) { SetHost(value); return *this;} /** *

Matches the HTTP method of a request.

*/ inline const Aws::String& GetHTTPMethod() const{ return m_hTTPMethod; } /** *

Matches the HTTP method of a request.

*/ inline bool HTTPMethodHasBeenSet() const { return m_hTTPMethodHasBeenSet; } /** *

Matches the HTTP method of a request.

*/ inline void SetHTTPMethod(const Aws::String& value) { m_hTTPMethodHasBeenSet = true; m_hTTPMethod = value; } /** *

Matches the HTTP method of a request.

*/ inline void SetHTTPMethod(Aws::String&& value) { m_hTTPMethodHasBeenSet = true; m_hTTPMethod = std::move(value); } /** *

Matches the HTTP method of a request.

*/ inline void SetHTTPMethod(const char* value) { m_hTTPMethodHasBeenSet = true; m_hTTPMethod.assign(value); } /** *

Matches the HTTP method of a request.

*/ inline SamplingRule& WithHTTPMethod(const Aws::String& value) { SetHTTPMethod(value); return *this;} /** *

Matches the HTTP method of a request.

*/ inline SamplingRule& WithHTTPMethod(Aws::String&& value) { SetHTTPMethod(std::move(value)); return *this;} /** *

Matches the HTTP method of a request.

*/ inline SamplingRule& WithHTTPMethod(const char* value) { SetHTTPMethod(value); return *this;} /** *

Matches the path from a request URL.

*/ inline const Aws::String& GetURLPath() const{ return m_uRLPath; } /** *

Matches the path from a request URL.

*/ inline bool URLPathHasBeenSet() const { return m_uRLPathHasBeenSet; } /** *

Matches the path from a request URL.

*/ inline void SetURLPath(const Aws::String& value) { m_uRLPathHasBeenSet = true; m_uRLPath = value; } /** *

Matches the path from a request URL.

*/ inline void SetURLPath(Aws::String&& value) { m_uRLPathHasBeenSet = true; m_uRLPath = std::move(value); } /** *

Matches the path from a request URL.

*/ inline void SetURLPath(const char* value) { m_uRLPathHasBeenSet = true; m_uRLPath.assign(value); } /** *

Matches the path from a request URL.

*/ inline SamplingRule& WithURLPath(const Aws::String& value) { SetURLPath(value); return *this;} /** *

Matches the path from a request URL.

*/ inline SamplingRule& WithURLPath(Aws::String&& value) { SetURLPath(std::move(value)); return *this;} /** *

Matches the path from a request URL.

*/ inline SamplingRule& WithURLPath(const char* value) { SetURLPath(value); return *this;} /** *

The version of the sampling rule format (1).

*/ inline int GetVersion() const{ return m_version; } /** *

The version of the sampling rule format (1).

*/ inline bool VersionHasBeenSet() const { return m_versionHasBeenSet; } /** *

The version of the sampling rule format (1).

*/ inline void SetVersion(int value) { m_versionHasBeenSet = true; m_version = value; } /** *

The version of the sampling rule format (1).

*/ inline SamplingRule& WithVersion(int value) { SetVersion(value); return *this;} /** *

Matches attributes derived from the request.

*/ inline const Aws::Map& GetAttributes() const{ return m_attributes; } /** *

Matches attributes derived from the request.

*/ inline bool AttributesHasBeenSet() const { return m_attributesHasBeenSet; } /** *

Matches attributes derived from the request.

*/ inline void SetAttributes(const Aws::Map& value) { m_attributesHasBeenSet = true; m_attributes = value; } /** *

Matches attributes derived from the request.

*/ inline void SetAttributes(Aws::Map&& value) { m_attributesHasBeenSet = true; m_attributes = std::move(value); } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& WithAttributes(const Aws::Map& value) { SetAttributes(value); return *this;} /** *

Matches attributes derived from the request.

*/ inline SamplingRule& WithAttributes(Aws::Map&& value) { SetAttributes(std::move(value)); return *this;} /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(const Aws::String& key, const Aws::String& value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, value); return *this; } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(Aws::String&& key, const Aws::String& value) { m_attributesHasBeenSet = true; m_attributes.emplace(std::move(key), value); return *this; } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(const Aws::String& key, Aws::String&& value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, std::move(value)); return *this; } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(Aws::String&& key, Aws::String&& value) { m_attributesHasBeenSet = true; m_attributes.emplace(std::move(key), std::move(value)); return *this; } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(const char* key, Aws::String&& value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, std::move(value)); return *this; } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(Aws::String&& key, const char* value) { m_attributesHasBeenSet = true; m_attributes.emplace(std::move(key), value); return *this; } /** *

Matches attributes derived from the request.

*/ inline SamplingRule& AddAttributes(const char* key, const char* value) { m_attributesHasBeenSet = true; m_attributes.emplace(key, value); return *this; } private: Aws::String m_ruleName; bool m_ruleNameHasBeenSet = false; Aws::String m_ruleARN; bool m_ruleARNHasBeenSet = false; Aws::String m_resourceARN; bool m_resourceARNHasBeenSet = false; int m_priority; bool m_priorityHasBeenSet = false; double m_fixedRate; bool m_fixedRateHasBeenSet = false; int m_reservoirSize; bool m_reservoirSizeHasBeenSet = false; Aws::String m_serviceName; bool m_serviceNameHasBeenSet = false; Aws::String m_serviceType; bool m_serviceTypeHasBeenSet = false; Aws::String m_host; bool m_hostHasBeenSet = false; Aws::String m_hTTPMethod; bool m_hTTPMethodHasBeenSet = false; Aws::String m_uRLPath; bool m_uRLPathHasBeenSet = false; int m_version; bool m_versionHasBeenSet = false; Aws::Map m_attributes; bool m_attributesHasBeenSet = false; }; } // namespace Model } // namespace XRay } // namespace Aws