Debian Codegraph @

google/api/usage.proto

raw
1 // Copyright 2026 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 syntax = "proto3";
16
17 package google.api;
18
19 option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;serviceconfig";
20 option java_multiple_files = true;
21 option java_outer_classname = "UsageProto";
22 option java_package = "com.google.api";
23 option objc_class_prefix = "GAPI";
24
25 // Configuration controlling usage of a service.
26 message Usage {
27 // Requirements that must be satisfied before a consumer project can use the
28 // service. Each requirement is of the form <service.name>/<requirement-id>;
29 // for example 'serviceusage.googleapis.com/billing-enabled'.
30 //
31 // For Google APIs, a Terms of Service requirement must be included here.
32 // Google Cloud APIs must include "serviceusage.googleapis.com/tos/cloud".
33 // Other Google APIs should include
34 // "serviceusage.googleapis.com/tos/universal". Additional ToS can be
35 // included based on the business needs.
36 repeated string requirements = 1;
37
38 // A list of usage rules that apply to individual API methods.
39 //
40 // **NOTE:** All service configuration rules follow "last one wins" order.
41 repeated UsageRule rules = 6;
42
43 // The full resource name of a channel used for sending notifications to the
44 // service producer.
45 //
46 // Google Service Management currently only supports
47 // [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) as a notification
48 // channel. To use Google Cloud Pub/Sub as the channel, this must be the name
49 // of a Cloud Pub/Sub topic that uses the Cloud Pub/Sub topic name format
50 // documented in https://cloud.google.com/pubsub/docs/overview.
51 string producer_notification_channel = 7;
52 }
53
54 // Usage configuration rules for the service.
55 message UsageRule {
56 // Selects the methods to which this rule applies. Use '*' to indicate all
57 // methods in all APIs.
58 //
59 // Refer to [selector][google.api.DocumentationRule.selector] for syntax
60 // details.
61 string selector = 1;
62
63 // Use this rule to configure unregistered calls for the service. Unregistered
64 // calls are calls that do not contain consumer project identity.
65 // (Example: calls that do not contain an API key).
66 //
67 // WARNING: By default, API methods do not allow unregistered calls, and each
68 // method call must be identified by a consumer project identity.
69 bool allow_unregistered_calls = 2;
70
71 // If true, the selected method should skip service control and the control
72 // plane features, such as quota and billing, will not be available.
73 // This flag is used by Google Cloud Endpoints to bypass checks for internal
74 // methods, such as service health check methods.
75 bool skip_service_control = 3;
76 }