class MetricRule extends Message

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

Used by metric-based quotas only.

Generated from protobuf message google.api.MetricRule

Methods

__construct(array $data = NULL)

Constructor.

string
getSelector()

Selects the methods to which this rule applies.

$this
setSelector(string $var)

Selects the methods to which this rule applies.

MapField
getMetricCosts()

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

$this
setMetricCosts(array|MapField $var)

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

Details

at line 56
__construct(array $data = NULL)

Constructor.

Parameters

array $data { Optional. Data for populating the Message object.

@type string $selector
      Selects the methods to which this rule applies.
      Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
@type array|\Google\Protobuf\Internal\MapField $metric_costs
      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.

}

at line 68
string getSelector()

Selects the methods to which this rule applies.

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

Generated from protobuf field string selector = 1;

Return Value

string

at line 81
$this setSelector(string $var)

Selects the methods to which this rule applies.

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

Generated from protobuf field string selector = 1;

Parameters

string $var

Return Value

$this

at line 99
MapField getMetricCosts()

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.

Generated from protobuf field map<string, int64> metric_costs = 2;

Return Value

MapField

at line 115
$this setMetricCosts(array|MapField $var)

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.

Generated from protobuf field map<string, int64> metric_costs = 2;

Parameters

array|MapField $var

Return Value

$this