1// Code generated by protoc-gen-go. DO NOT EDIT.
2// source: google/api/quota.proto
3
4package serviceconfig
5
6import (
7	fmt "fmt"
8	math "math"
9
10	proto "github.com/golang/protobuf/proto"
11)
12
13// Reference imports to suppress errors if they are not otherwise used.
14var _ = proto.Marshal
15var _ = fmt.Errorf
16var _ = math.Inf
17
18// This is a compile-time assertion to ensure that this generated file
19// is compatible with the proto package it is being compiled against.
20// A compilation error at this line likely means your copy of the
21// proto package needs to be updated.
22const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
23
24// Quota configuration helps to achieve fairness and budgeting in service
25// usage.
26//
27// The metric based quota configuration works this way:
28// - The service configuration defines a set of metrics.
29// - For API calls, the quota.metric_rules maps methods to metrics with
30//   corresponding costs.
31// - The quota.limits defines limits on the metrics, which will be used for
32//   quota checks at runtime.
33//
34// An example quota configuration in yaml format:
35//
36//    quota:
37//      limits:
38//
39//      - name: apiWriteQpsPerProject
40//        metric: library.googleapis.com/write_calls
41//        unit: "1/min/{project}"  # rate limit for consumer projects
42//        values:
43//          STANDARD: 10000
44//
45//
46//      # The metric rules bind all methods to the read_calls metric,
47//      # except for the UpdateBook and DeleteBook methods. These two methods
48//      # are mapped to the write_calls metric, with the UpdateBook method
49//      # consuming at twice rate as the DeleteBook method.
50//      metric_rules:
51//      - selector: "*"
52//        metric_costs:
53//          library.googleapis.com/read_calls: 1
54//      - selector: google.example.library.v1.LibraryService.UpdateBook
55//        metric_costs:
56//          library.googleapis.com/write_calls: 2
57//      - selector: google.example.library.v1.LibraryService.DeleteBook
58//        metric_costs:
59//          library.googleapis.com/write_calls: 1
60//
61//  Corresponding Metric definition:
62//
63//      metrics:
64//      - name: library.googleapis.com/read_calls
65//        display_name: Read requests
66//        metric_kind: DELTA
67//        value_type: INT64
68//
69//      - name: library.googleapis.com/write_calls
70//        display_name: Write requests
71//        metric_kind: DELTA
72//        value_type: INT64
73//
74//
75type Quota struct {
76	// List of `QuotaLimit` definitions for the service.
77	Limits []*QuotaLimit `protobuf:"bytes,3,rep,name=limits,proto3" json:"limits,omitempty"`
78	// List of `MetricRule` definitions, each one mapping a selected method to one
79	// or more metrics.
80	MetricRules          []*MetricRule `protobuf:"bytes,4,rep,name=metric_rules,json=metricRules,proto3" json:"metric_rules,omitempty"`
81	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
82	XXX_unrecognized     []byte        `json:"-"`
83	XXX_sizecache        int32         `json:"-"`
84}
85
86func (m *Quota) Reset()         { *m = Quota{} }
87func (m *Quota) String() string { return proto.CompactTextString(m) }
88func (*Quota) ProtoMessage()    {}
89func (*Quota) Descriptor() ([]byte, []int) {
90	return fileDescriptor_6822ef0454b3845a, []int{0}
91}
92
93func (m *Quota) XXX_Unmarshal(b []byte) error {
94	return xxx_messageInfo_Quota.Unmarshal(m, b)
95}
96func (m *Quota) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
97	return xxx_messageInfo_Quota.Marshal(b, m, deterministic)
98}
99func (m *Quota) XXX_Merge(src proto.Message) {
100	xxx_messageInfo_Quota.Merge(m, src)
101}
102func (m *Quota) XXX_Size() int {
103	return xxx_messageInfo_Quota.Size(m)
104}
105func (m *Quota) XXX_DiscardUnknown() {
106	xxx_messageInfo_Quota.DiscardUnknown(m)
107}
108
109var xxx_messageInfo_Quota proto.InternalMessageInfo
110
111func (m *Quota) GetLimits() []*QuotaLimit {
112	if m != nil {
113		return m.Limits
114	}
115	return nil
116}
117
118func (m *Quota) GetMetricRules() []*MetricRule {
119	if m != nil {
120		return m.MetricRules
121	}
122	return nil
123}
124
125// Bind API methods to metrics. Binding a method to a metric causes that
126// metric's configured quota behaviors to apply to the method call.
127type MetricRule struct {
128	// Selects the methods to which this rule applies.
129	//
130	// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
131	Selector string `protobuf:"bytes,1,opt,name=selector,proto3" json:"selector,omitempty"`
132	// Metrics to update when the selected methods are called, and the associated
133	// cost applied to each metric.
134	//
135	// The key of the map is the metric name, and the values are the amount
136	// increased for the metric against which the quota limits are defined.
137	// The value must not be negative.
138	MetricCosts          map[string]int64 `protobuf:"bytes,2,rep,name=metric_costs,json=metricCosts,proto3" json:"metric_costs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
139	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
140	XXX_unrecognized     []byte           `json:"-"`
141	XXX_sizecache        int32            `json:"-"`
142}
143
144func (m *MetricRule) Reset()         { *m = MetricRule{} }
145func (m *MetricRule) String() string { return proto.CompactTextString(m) }
146func (*MetricRule) ProtoMessage()    {}
147func (*MetricRule) Descriptor() ([]byte, []int) {
148	return fileDescriptor_6822ef0454b3845a, []int{1}
149}
150
151func (m *MetricRule) XXX_Unmarshal(b []byte) error {
152	return xxx_messageInfo_MetricRule.Unmarshal(m, b)
153}
154func (m *MetricRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
155	return xxx_messageInfo_MetricRule.Marshal(b, m, deterministic)
156}
157func (m *MetricRule) XXX_Merge(src proto.Message) {
158	xxx_messageInfo_MetricRule.Merge(m, src)
159}
160func (m *MetricRule) XXX_Size() int {
161	return xxx_messageInfo_MetricRule.Size(m)
162}
163func (m *MetricRule) XXX_DiscardUnknown() {
164	xxx_messageInfo_MetricRule.DiscardUnknown(m)
165}
166
167var xxx_messageInfo_MetricRule proto.InternalMessageInfo
168
169func (m *MetricRule) GetSelector() string {
170	if m != nil {
171		return m.Selector
172	}
173	return ""
174}
175
176func (m *MetricRule) GetMetricCosts() map[string]int64 {
177	if m != nil {
178		return m.MetricCosts
179	}
180	return nil
181}
182
183// `QuotaLimit` defines a specific limit that applies over a specified duration
184// for a limit type. There can be at most one limit for a duration and limit
185// type combination defined within a `QuotaGroup`.
186type QuotaLimit struct {
187	// Name of the quota limit.
188	//
189	// The name must be provided, and it must be unique within the service. The
190	// name can only include alphanumeric characters as well as '-'.
191	//
192	// The maximum length of the limit name is 64 characters.
193	Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"`
194	// Optional. User-visible, extended description for this quota limit.
195	// Should be used only when more context is needed to understand this limit
196	// than provided by the limit's display name (see: `display_name`).
197	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
198	// Default number of tokens that can be consumed during the specified
199	// duration. This is the number of tokens assigned when a client
200	// application developer activates the service for his/her project.
201	//
202	// Specifying a value of 0 will block all requests. This can be used if you
203	// are provisioning quota to selected consumers and blocking others.
204	// Similarly, a value of -1 will indicate an unlimited quota. No other
205	// negative values are allowed.
206	//
207	// Used by group-based quotas only.
208	DefaultLimit int64 `protobuf:"varint,3,opt,name=default_limit,json=defaultLimit,proto3" json:"default_limit,omitempty"`
209	// Maximum number of tokens that can be consumed during the specified
210	// duration. Client application developers can override the default limit up
211	// to this maximum. If specified, this value cannot be set to a value less
212	// than the default limit. If not specified, it is set to the default limit.
213	//
214	// To allow clients to apply overrides with no upper bound, set this to -1,
215	// indicating unlimited maximum quota.
216	//
217	// Used by group-based quotas only.
218	MaxLimit int64 `protobuf:"varint,4,opt,name=max_limit,json=maxLimit,proto3" json:"max_limit,omitempty"`
219	// Free tier value displayed in the Developers Console for this limit.
220	// The free tier is the number of tokens that will be subtracted from the
221	// billed amount when billing is enabled.
222	// This field can only be set on a limit with duration "1d", in a billable
223	// group; it is invalid on any other limit. If this field is not set, it
224	// defaults to 0, indicating that there is no free tier for this service.
225	//
226	// Used by group-based quotas only.
227	FreeTier int64 `protobuf:"varint,7,opt,name=free_tier,json=freeTier,proto3" json:"free_tier,omitempty"`
228	// Duration of this limit in textual notation. Example: "100s", "24h", "1d".
229	// For duration longer than a day, only multiple of days is supported. We
230	// support only "100s" and "1d" for now. Additional support will be added in
231	// the future. "0" indicates indefinite duration.
232	//
233	// Used by group-based quotas only.
234	Duration string `protobuf:"bytes,5,opt,name=duration,proto3" json:"duration,omitempty"`
235	// The name of the metric this quota limit applies to. The quota limits with
236	// the same metric will be checked together during runtime. The metric must be
237	// defined within the service config.
238	Metric string `protobuf:"bytes,8,opt,name=metric,proto3" json:"metric,omitempty"`
239	// Specify the unit of the quota limit. It uses the same syntax as
240	// [Metric.unit][]. The supported unit kinds are determined by the quota
241	// backend system.
242	//
243	// Here are some examples:
244	// * "1/min/{project}" for quota per minute per project.
245	//
246	// Note: the order of unit components is insignificant.
247	// The "1" at the beginning is required to follow the metric unit syntax.
248	Unit string `protobuf:"bytes,9,opt,name=unit,proto3" json:"unit,omitempty"`
249	// Tiered limit values. You must specify this as a key:value pair, with an
250	// integer value that is the maximum number of requests allowed for the
251	// specified unit. Currently only STANDARD is supported.
252	Values map[string]int64 `protobuf:"bytes,10,rep,name=values,proto3" json:"values,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
253	// User-visible display name for this limit.
254	// Optional. If not set, the UI will provide a default display name based on
255	// the quota configuration. This field can be used to override the default
256	// display name generated from the configuration.
257	DisplayName          string   `protobuf:"bytes,12,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"`
258	XXX_NoUnkeyedLiteral struct{} `json:"-"`
259	XXX_unrecognized     []byte   `json:"-"`
260	XXX_sizecache        int32    `json:"-"`
261}
262
263func (m *QuotaLimit) Reset()         { *m = QuotaLimit{} }
264func (m *QuotaLimit) String() string { return proto.CompactTextString(m) }
265func (*QuotaLimit) ProtoMessage()    {}
266func (*QuotaLimit) Descriptor() ([]byte, []int) {
267	return fileDescriptor_6822ef0454b3845a, []int{2}
268}
269
270func (m *QuotaLimit) XXX_Unmarshal(b []byte) error {
271	return xxx_messageInfo_QuotaLimit.Unmarshal(m, b)
272}
273func (m *QuotaLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
274	return xxx_messageInfo_QuotaLimit.Marshal(b, m, deterministic)
275}
276func (m *QuotaLimit) XXX_Merge(src proto.Message) {
277	xxx_messageInfo_QuotaLimit.Merge(m, src)
278}
279func (m *QuotaLimit) XXX_Size() int {
280	return xxx_messageInfo_QuotaLimit.Size(m)
281}
282func (m *QuotaLimit) XXX_DiscardUnknown() {
283	xxx_messageInfo_QuotaLimit.DiscardUnknown(m)
284}
285
286var xxx_messageInfo_QuotaLimit proto.InternalMessageInfo
287
288func (m *QuotaLimit) GetName() string {
289	if m != nil {
290		return m.Name
291	}
292	return ""
293}
294
295func (m *QuotaLimit) GetDescription() string {
296	if m != nil {
297		return m.Description
298	}
299	return ""
300}
301
302func (m *QuotaLimit) GetDefaultLimit() int64 {
303	if m != nil {
304		return m.DefaultLimit
305	}
306	return 0
307}
308
309func (m *QuotaLimit) GetMaxLimit() int64 {
310	if m != nil {
311		return m.MaxLimit
312	}
313	return 0
314}
315
316func (m *QuotaLimit) GetFreeTier() int64 {
317	if m != nil {
318		return m.FreeTier
319	}
320	return 0
321}
322
323func (m *QuotaLimit) GetDuration() string {
324	if m != nil {
325		return m.Duration
326	}
327	return ""
328}
329
330func (m *QuotaLimit) GetMetric() string {
331	if m != nil {
332		return m.Metric
333	}
334	return ""
335}
336
337func (m *QuotaLimit) GetUnit() string {
338	if m != nil {
339		return m.Unit
340	}
341	return ""
342}
343
344func (m *QuotaLimit) GetValues() map[string]int64 {
345	if m != nil {
346		return m.Values
347	}
348	return nil
349}
350
351func (m *QuotaLimit) GetDisplayName() string {
352	if m != nil {
353		return m.DisplayName
354	}
355	return ""
356}
357
358func init() {
359	proto.RegisterType((*Quota)(nil), "google.api.Quota")
360	proto.RegisterType((*MetricRule)(nil), "google.api.MetricRule")
361	proto.RegisterMapType((map[string]int64)(nil), "google.api.MetricRule.MetricCostsEntry")
362	proto.RegisterType((*QuotaLimit)(nil), "google.api.QuotaLimit")
363	proto.RegisterMapType((map[string]int64)(nil), "google.api.QuotaLimit.ValuesEntry")
364}
365
366func init() {
367	proto.RegisterFile("google/api/quota.proto", fileDescriptor_6822ef0454b3845a)
368}
369
370var fileDescriptor_6822ef0454b3845a = []byte{
371	// 453 bytes of a gzipped FileDescriptorProto
372	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x8e, 0xd3, 0x30,
373	0x10, 0x55, 0x9a, 0x6e, 0x68, 0xa7, 0x05, 0xad, 0x2c, 0x54, 0x59, 0xe5, 0x52, 0xca, 0x81, 0x9e,
374	0x52, 0x09, 0x2e, 0xec, 0x22, 0x21, 0xb1, 0x68, 0x85, 0x40, 0x80, 0x4a, 0x84, 0x38, 0x70, 0xa9,
375	0x4c, 0x3a, 0x8d, 0x2c, 0x9c, 0x38, 0xd8, 0xce, 0x6a, 0x7b, 0xe6, 0x4f, 0xf8, 0x06, 0x3e, 0x10,
376	0x79, 0xec, 0x6d, 0x0b, 0xec, 0x85, 0xdb, 0xcc, 0x7b, 0x6f, 0xfc, 0xe2, 0xe7, 0x09, 0x4c, 0x2a,
377	0xad, 0x2b, 0x85, 0x4b, 0xd1, 0xca, 0xe5, 0xf7, 0x4e, 0x3b, 0x91, 0xb7, 0x46, 0x3b, 0xcd, 0x20,
378	0xe0, 0xb9, 0x68, 0xe5, 0xdc, 0xc0, 0xc9, 0x47, 0x4f, 0xb1, 0x1c, 0x32, 0x25, 0x6b, 0xe9, 0x2c,
379	0x4f, 0x67, 0xe9, 0x62, 0xf4, 0x64, 0x92, 0x1f, 0x54, 0x39, 0x49, 0xde, 0x79, 0xba, 0x88, 0x2a,
380	0x76, 0x06, 0xe3, 0x1a, 0x9d, 0x91, 0xe5, 0xda, 0x74, 0x0a, 0x2d, 0xef, 0xff, 0x3b, 0xf5, 0x9e,
381	0xf8, 0xa2, 0x53, 0x58, 0x8c, 0xea, 0x7d, 0x6d, 0xe7, 0xbf, 0x12, 0x80, 0x03, 0xc7, 0xa6, 0x30,
382	0xb0, 0xa8, 0xb0, 0x74, 0xda, 0xf0, 0x64, 0x96, 0x2c, 0x86, 0xc5, 0xbe, 0x67, 0x6f, 0xf7, 0x2e,
383	0xa5, 0xb6, 0xce, 0xf2, 0x1e, 0xb9, 0x3c, 0xbe, 0xdd, 0x25, 0x96, 0xaf, 0xbc, 0xf2, 0xb2, 0x71,
384	0x66, 0x77, 0x63, 0x4b, 0xc8, 0xf4, 0x05, 0x9c, 0xfe, 0x2d, 0x60, 0xa7, 0x90, 0x7e, 0xc3, 0x5d,
385	0xb4, 0xf5, 0x25, 0xbb, 0x0f, 0x27, 0x57, 0x42, 0x75, 0xc8, 0x7b, 0xb3, 0x64, 0x91, 0x16, 0xa1,
386	0x39, 0xef, 0x3d, 0x4b, 0xe6, 0x3f, 0x52, 0x80, 0x43, 0x10, 0x8c, 0x41, 0xbf, 0x11, 0x35, 0xf2,
387	0x8c, 0x66, 0xa9, 0x66, 0x33, 0x18, 0x6d, 0xd0, 0x96, 0x46, 0xb6, 0x4e, 0xea, 0x86, 0x8e, 0x18,
388	0x16, 0xc7, 0x10, 0x7b, 0x04, 0x77, 0x37, 0xb8, 0x15, 0x9d, 0x72, 0x6b, 0x0a, 0x92, 0xa7, 0x64,
389	0x33, 0x8e, 0x60, 0x38, 0xfa, 0x01, 0x0c, 0x6b, 0x71, 0x1d, 0x05, 0x7d, 0x12, 0x0c, 0x6a, 0x71,
390	0xbd, 0x27, 0xb7, 0x06, 0x71, 0xed, 0x24, 0x1a, 0x7e, 0x27, 0x90, 0x1e, 0xf8, 0x24, 0xd1, 0xf8,
391	0x2c, 0x37, 0x9d, 0x11, 0xe4, 0x7e, 0x12, 0xb2, 0xbc, 0xe9, 0xd9, 0x04, 0xb2, 0x10, 0x07, 0x1f,
392	0x10, 0x13, 0x3b, 0x7f, 0x91, 0xae, 0x91, 0x8e, 0x0f, 0xc3, 0x45, 0x7c, 0xcd, 0xce, 0x21, 0xa3,
393	0x8b, 0x5b, 0x0e, 0x94, 0xf8, 0xfc, 0xf6, 0x6d, 0xc8, 0x3f, 0x93, 0x28, 0x84, 0x1d, 0x27, 0xd8,
394	0x43, 0x18, 0x6f, 0xa4, 0x6d, 0x95, 0xd8, 0xad, 0x29, 0xa0, 0x71, 0x4c, 0x21, 0x60, 0x1f, 0x44,
395	0x8d, 0xd3, 0x33, 0x18, 0x1d, 0x4d, 0xfe, 0xcf, 0x2b, 0x5c, 0x28, 0xb8, 0x57, 0xea, 0xfa, 0xe8,
396	0x73, 0x2e, 0xc2, 0xa3, 0xac, 0xfc, 0x6a, 0xaf, 0x92, 0x2f, 0x97, 0x91, 0xa9, 0xb4, 0x12, 0x4d,
397	0x95, 0x6b, 0x53, 0x2d, 0x2b, 0x6c, 0x68, 0xf1, 0x97, 0x81, 0x12, 0xad, 0xb4, 0xf4, 0x4f, 0x58,
398	0x34, 0x57, 0xb2, 0xc4, 0x52, 0x37, 0x5b, 0x59, 0x3d, 0xff, 0xa3, 0xfb, 0xd9, 0xeb, 0xbf, 0x7e,
399	0xb9, 0x7a, 0xf3, 0x35, 0xa3, 0xc1, 0xa7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x00, 0x7a, 0xae,
400	0xf6, 0x4b, 0x03, 0x00, 0x00,
401}
402