Google API Common Protos Client - Class MetricRule (4.8.3)

Reference documentation and code samples for the Google API Common Protos Client 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.

Generated from protobuf message google.api.MetricRule

Namespace

Google \ Api

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ selector string

Selects the methods to which this rule applies. Refer to selector for syntax details.

↳ metric_costs array|Google\Protobuf\Internal\MapField

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.

getSelector

Selects the methods to which this rule applies.

Refer to selector for syntax details.

Returns
Type Description
string

setSelector

Selects the methods to which this rule applies.

Refer to selector for syntax details.

Parameter
Name Description
var string
Returns
Type Description
$this

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.

Returns
Type Description
Google\Protobuf\Internal\MapField

setMetricCosts

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.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this