Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

395 Zeilen
16 KiB

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