| 1 |
<?php |
| 2 |
|
| 3 |
# Generated by the protocol buffer compiler. DO NOT EDIT! |
| 4 |
# source: google/api/quota.proto |
| 5 |
namespace Dudlewebs\WPMCS\GCP\Google\Api; |
| 6 |
|
| 7 |
use Dudlewebs\WPMCS\GCP\Google\Protobuf\Internal\GPBType; |
| 8 |
use Dudlewebs\WPMCS\GCP\Google\Protobuf\Internal\GPBUtil; |
| 9 |
use Dudlewebs\WPMCS\GCP\Google\Protobuf\RepeatedField; |
| 10 |
/** |
| 11 |
* Quota configuration helps to achieve fairness and budgeting in service |
| 12 |
* usage. |
| 13 |
* The metric based quota configuration works this way: |
| 14 |
* - The service configuration defines a set of metrics. |
| 15 |
* - For API calls, the quota.metric_rules maps methods to metrics with |
| 16 |
* corresponding costs. |
| 17 |
* - The quota.limits defines limits on the metrics, which will be used for |
| 18 |
* quota checks at runtime. |
| 19 |
* An example quota configuration in yaml format: |
| 20 |
* quota: |
| 21 |
* limits: |
| 22 |
* - name: apiWriteQpsPerProject |
| 23 |
* metric: library.googleapis.com/write_calls |
| 24 |
* unit: "1/min/{project}" # rate limit for consumer projects |
| 25 |
* values: |
| 26 |
* STANDARD: 10000 |
| 27 |
* (The metric rules bind all methods to the read_calls metric, |
| 28 |
* except for the UpdateBook and DeleteBook methods. These two methods |
| 29 |
* are mapped to the write_calls metric, with the UpdateBook method |
| 30 |
* consuming at twice rate as the DeleteBook method.) |
| 31 |
* metric_rules: |
| 32 |
* - selector: "*" |
| 33 |
* metric_costs: |
| 34 |
* library.googleapis.com/read_calls: 1 |
| 35 |
* - selector: google.example.library.v1.LibraryService.UpdateBook |
| 36 |
* metric_costs: |
| 37 |
* library.googleapis.com/write_calls: 2 |
| 38 |
* - selector: google.example.library.v1.LibraryService.DeleteBook |
| 39 |
* metric_costs: |
| 40 |
* library.googleapis.com/write_calls: 1 |
| 41 |
* Corresponding Metric definition: |
| 42 |
* metrics: |
| 43 |
* - name: library.googleapis.com/read_calls |
| 44 |
* display_name: Read requests |
| 45 |
* metric_kind: DELTA |
| 46 |
* value_type: INT64 |
| 47 |
* - name: library.googleapis.com/write_calls |
| 48 |
* display_name: Write requests |
| 49 |
* metric_kind: DELTA |
| 50 |
* value_type: INT64 |
| 51 |
* |
| 52 |
* Generated from protobuf message <code>google.api.Quota</code> |
| 53 |
*/ |
| 54 |
class Quota extends \Dudlewebs\WPMCS\GCP\Google\Protobuf\Internal\Message |
| 55 |
{ |
| 56 |
/** |
| 57 |
* List of QuotaLimit definitions for the service. |
| 58 |
* |
| 59 |
* Generated from protobuf field <code>repeated .google.api.QuotaLimit limits = 3;</code> |
| 60 |
*/ |
| 61 |
private $limits; |
| 62 |
/** |
| 63 |
* List of MetricRule definitions, each one mapping a selected method to one |
| 64 |
* or more metrics. |
| 65 |
* |
| 66 |
* Generated from protobuf field <code>repeated .google.api.MetricRule metric_rules = 4;</code> |
| 67 |
*/ |
| 68 |
private $metric_rules; |
| 69 |
/** |
| 70 |
* Constructor. |
| 71 |
* |
| 72 |
* @param array $data { |
| 73 |
* Optional. Data for populating the Message object. |
| 74 |
* |
| 75 |
* @type \Google\Api\QuotaLimit[] $limits |
| 76 |
* List of QuotaLimit definitions for the service. |
| 77 |
* @type \Google\Api\MetricRule[] $metric_rules |
| 78 |
* List of MetricRule definitions, each one mapping a selected method to one |
| 79 |
* or more metrics. |
| 80 |
* } |
| 81 |
*/ |
| 82 |
public function __construct($data = NULL) |
| 83 |
{ |
| 84 |
\Dudlewebs\WPMCS\GCP\GPBMetadata\Google\Api\Quota::initOnce(); |
| 85 |
parent::__construct($data); |
| 86 |
} |
| 87 |
/** |
| 88 |
* List of QuotaLimit definitions for the service. |
| 89 |
* |
| 90 |
* Generated from protobuf field <code>repeated .google.api.QuotaLimit limits = 3;</code> |
| 91 |
* @return RepeatedField<\Google\Api\QuotaLimit> |
| 92 |
*/ |
| 93 |
public function getLimits() |
| 94 |
{ |
| 95 |
return $this->limits; |
| 96 |
} |
| 97 |
/** |
| 98 |
* List of QuotaLimit definitions for the service. |
| 99 |
* |
| 100 |
* Generated from protobuf field <code>repeated .google.api.QuotaLimit limits = 3;</code> |
| 101 |
* @param \Google\Api\QuotaLimit[] $var |
| 102 |
* @return $this |
| 103 |
*/ |
| 104 |
public function setLimits($var) |
| 105 |
{ |
| 106 |
$arr = GPBUtil::checkRepeatedField($var, \Dudlewebs\WPMCS\GCP\Google\Protobuf\Internal\GPBType::MESSAGE, \Dudlewebs\WPMCS\GCP\Google\Api\QuotaLimit::class); |
| 107 |
$this->limits = $arr; |
| 108 |
return $this; |
| 109 |
} |
| 110 |
/** |
| 111 |
* List of MetricRule definitions, each one mapping a selected method to one |
| 112 |
* or more metrics. |
| 113 |
* |
| 114 |
* Generated from protobuf field <code>repeated .google.api.MetricRule metric_rules = 4;</code> |
| 115 |
* @return RepeatedField<\Google\Api\MetricRule> |
| 116 |
*/ |
| 117 |
public function getMetricRules() |
| 118 |
{ |
| 119 |
return $this->metric_rules; |
| 120 |
} |
| 121 |
/** |
| 122 |
* List of MetricRule definitions, each one mapping a selected method to one |
| 123 |
* or more metrics. |
| 124 |
* |
| 125 |
* Generated from protobuf field <code>repeated .google.api.MetricRule metric_rules = 4;</code> |
| 126 |
* @param \Google\Api\MetricRule[] $var |
| 127 |
* @return $this |
| 128 |
*/ |
| 129 |
public function setMetricRules($var) |
| 130 |
{ |
| 131 |
$arr = GPBUtil::checkRepeatedField($var, \Dudlewebs\WPMCS\GCP\Google\Protobuf\Internal\GPBType::MESSAGE, \Dudlewebs\WPMCS\GCP\Google\Api\MetricRule::class); |
| 132 |
$this->metric_rules = $arr; |
| 133 |
return $this; |
| 134 |
} |
| 135 |
} |
| 136 |
|