Show / Hide Table of Contents

Class MetricRule

Bind API methods to metrics. Binding a method to a metric causes that metric's configured quota behaviors to apply to the method call.

Inheritance
System.Object
MetricRule
Implements
IMessage<MetricRule>
IMessage
System.IEquatable<MetricRule>
IDeepCloneable<MetricRule>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api
Assembly: Google.Api.CommonProtos.dll
Syntax
public sealed class MetricRule : IMessage<MetricRule>, IMessage, IEquatable<MetricRule>, IDeepCloneable<MetricRule>

Constructors

MetricRule()

Declaration
public MetricRule()

MetricRule(MetricRule)

Declaration
public MetricRule(MetricRule other)
Parameters
Type Name Description
MetricRule other

Fields

MetricCostsFieldNumber

Field number for the "metric_costs" field.

Declaration
public const int MetricCostsFieldNumber = 2
Field Value
Type Description
System.Int32

SelectorFieldNumber

Field number for the "selector" field.

Declaration
public const int SelectorFieldNumber = 1
Field Value
Type Description
System.Int32

Properties

Descriptor

Declaration
public static MessageDescriptor Descriptor { get; }
Property Value
Type Description
MessageDescriptor

MetricCosts

Metrics to update when the selected methods are called, and the associated cost applied to each metric.

The key of the map is the metric name, and the values are the amount increased for the metric against which the quota limits are defined. The value must not be negative.

Declaration
public MapField<string, long> MetricCosts { get; }
Property Value
Type Description
MapField<System.String, System.Int64>

Parser

Declaration
public static MessageParser<MetricRule> Parser { get; }
Property Value
Type Description
MessageParser<MetricRule>

Selector

Selects the methods to which this rule applies.

Refer to [selector][google.api.DocumentationRule.selector] for syntax details.

Declaration
public string Selector { get; set; }
Property Value
Type Description
System.String

Methods

CalculateSize()

Declaration
public int CalculateSize()
Returns
Type Description
System.Int32
Implements
IMessage.CalculateSize()

Clone()

Declaration
public MetricRule Clone()
Returns
Type Description
MetricRule
Implements
IDeepCloneable<T>.Clone()

Equals(MetricRule)

Declaration
public bool Equals(MetricRule other)
Parameters
Type Name Description
MetricRule other
Returns
Type Description
System.Boolean
Implements
System.IEquatable<T>.Equals(T)

Equals(Object)

Declaration
public override bool Equals(object other)
Parameters
Type Name Description
System.Object other
Returns
Type Description
System.Boolean
Overrides
System.Object.Equals(System.Object)

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32
Overrides
System.Object.GetHashCode()

MergeFrom(MetricRule)

Declaration
public void MergeFrom(MetricRule other)
Parameters
Type Name Description
MetricRule other
Implements
IMessage<T>.MergeFrom(T)

MergeFrom(CodedInputStream)

Declaration
public void MergeFrom(CodedInputStream input)
Parameters
Type Name Description
CodedInputStream input
Implements
IMessage.MergeFrom(CodedInputStream)

ToString()

Declaration
public override string ToString()
Returns
Type Description
System.String
Overrides
System.Object.ToString()

WriteTo(CodedOutputStream)

Declaration
public void WriteTo(CodedOutputStream output)
Parameters
Type Name Description
CodedOutputStream output
Implements
IMessage.WriteTo(CodedOutputStream)

Explicit Interface Implementations

IMessage.Descriptor

Declaration
MessageDescriptor IMessage.Descriptor { get; }
Returns
Type Description
MessageDescriptor
Implements
IMessage.Descriptor
Back to top