/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the xray-2016-04-12.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.XRay.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.
///
public partial class SamplingRule
{
private Dictionary _attributes = new Dictionary();
private double? _fixedRate;
private string _host;
private string _httpMethod;
private int? _priority;
private int? _reservoirSize;
private string _resourceARN;
private string _ruleARN;
private string _ruleName;
private string _serviceName;
private string _serviceType;
private string _urlPath;
private int? _version;
///
/// Gets and sets the property Attributes.
///
/// Matches attributes derived from the request.
///
///
[AWSProperty(Max=5)]
public Dictionary Attributes
{
get { return this._attributes; }
set { this._attributes = value; }
}
// Check to see if Attributes property is set
internal bool IsSetAttributes()
{
return this._attributes != null && this._attributes.Count > 0;
}
///
/// Gets and sets the property FixedRate.
///
/// The percentage of matching requests to instrument, after the reservoir is exhausted.
///
///
[AWSProperty(Required=true, Min=0, Max=1)]
public double FixedRate
{
get { return this._fixedRate.GetValueOrDefault(); }
set { this._fixedRate = value; }
}
// Check to see if FixedRate property is set
internal bool IsSetFixedRate()
{
return this._fixedRate.HasValue;
}
///
/// Gets and sets the property Host.
///
/// Matches the hostname from a request URL.
///
///
[AWSProperty(Required=true, Max=64)]
public string Host
{
get { return this._host; }
set { this._host = value; }
}
// Check to see if Host property is set
internal bool IsSetHost()
{
return this._host != null;
}
///
/// Gets and sets the property HTTPMethod.
///
/// Matches the HTTP method of a request.
///
///
[AWSProperty(Required=true, Max=10)]
public string HTTPMethod
{
get { return this._httpMethod; }
set { this._httpMethod = value; }
}
// Check to see if HTTPMethod property is set
internal bool IsSetHTTPMethod()
{
return this._httpMethod != null;
}
///
/// Gets and sets the property Priority.
///
/// The priority of the sampling rule.
///
///
[AWSProperty(Required=true, Min=1, Max=9999)]
public int Priority
{
get { return this._priority.GetValueOrDefault(); }
set { this._priority = value; }
}
// Check to see if Priority property is set
internal bool IsSetPriority()
{
return this._priority.HasValue;
}
///
/// Gets and sets the property 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.
///
///
[AWSProperty(Required=true, Min=0)]
public int ReservoirSize
{
get { return this._reservoirSize.GetValueOrDefault(); }
set { this._reservoirSize = value; }
}
// Check to see if ReservoirSize property is set
internal bool IsSetReservoirSize()
{
return this._reservoirSize.HasValue;
}
///
/// Gets and sets the property ResourceARN.
///
/// Matches the ARN of the Amazon Web Services resource on which the service runs.
///
///
[AWSProperty(Required=true, Max=500)]
public string ResourceARN
{
get { return this._resourceARN; }
set { this._resourceARN = value; }
}
// Check to see if ResourceARN property is set
internal bool IsSetResourceARN()
{
return this._resourceARN != null;
}
///
/// Gets and sets the property RuleARN.
///
/// The ARN of the sampling rule. Specify a rule by either name or ARN, but not both.
///
///
public string RuleARN
{
get { return this._ruleARN; }
set { this._ruleARN = value; }
}
// Check to see if RuleARN property is set
internal bool IsSetRuleARN()
{
return this._ruleARN != null;
}
///
/// Gets and sets the property RuleName.
///
/// The name of the sampling rule. Specify a rule by either name or ARN, but not both.
///
///
[AWSProperty(Min=1, Max=32)]
public string RuleName
{
get { return this._ruleName; }
set { this._ruleName = value; }
}
// Check to see if RuleName property is set
internal bool IsSetRuleName()
{
return this._ruleName != null;
}
///
/// Gets and sets the property ServiceName.
///
/// Matches the name
that the service uses to identify itself in segments.
///
///
[AWSProperty(Required=true, Max=64)]
public string ServiceName
{
get { return this._serviceName; }
set { this._serviceName = value; }
}
// Check to see if ServiceName property is set
internal bool IsSetServiceName()
{
return this._serviceName != null;
}
///
/// Gets and sets the property ServiceType.
///
/// Matches the origin
that the service uses to identify its type in segments.
///
///
[AWSProperty(Required=true, Max=64)]
public string ServiceType
{
get { return this._serviceType; }
set { this._serviceType = value; }
}
// Check to see if ServiceType property is set
internal bool IsSetServiceType()
{
return this._serviceType != null;
}
///
/// Gets and sets the property URLPath.
///
/// Matches the path from a request URL.
///
///
[AWSProperty(Required=true, Max=128)]
public string URLPath
{
get { return this._urlPath; }
set { this._urlPath = value; }
}
// Check to see if URLPath property is set
internal bool IsSetURLPath()
{
return this._urlPath != null;
}
///
/// Gets and sets the property Version.
///
/// The version of the sampling rule format (1
).
///
///
[AWSProperty(Required=true, Min=1)]
public int Version
{
get { return this._version.GetValueOrDefault(); }
set { this._version = value; }
}
// Check to see if Version property is set
internal bool IsSetVersion()
{
return this._version.HasValue;
}
}
}