Skip to content

Commit 9f5a5ec

Browse files
Synchronize new proto changes.
1 parent 5fc84e9 commit 9f5a5ec

2 files changed

Lines changed: 41 additions & 70 deletions

File tree

google/api/billing.proto

Lines changed: 31 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2016 Google Inc.
1+
// Copyright 2017 Google Inc.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -23,76 +23,45 @@ option go_package = "google.golang.org/genproto/googleapis/api/serviceconfig;ser
2323
option java_multiple_files = true;
2424
option java_outer_classname = "BillingProto";
2525
option java_package = "com.google.api";
26+
option objc_class_prefix = "GAPI";
2627

2728

2829
// Billing related configuration of the service.
2930
//
30-
// The following example shows how to configure metrics for billing:
31-
//
31+
// The following example shows how to configure monitored resources and metrics
32+
// for billing:
33+
// monitored_resources:
34+
// - type: library.googleapis.com/branch
35+
// labels:
36+
// - key: /city
37+
// description: The city where the library branch is located in.
38+
// - key: /name
39+
// description: The name of the branch.
3240
// metrics:
33-
// - name: library.googleapis.com/read_calls
34-
// metric_kind: DELTA
35-
// value_type: INT64
36-
// - name: library.googleapis.com/write_calls
41+
// - name: library.googleapis.com/book/borrowed_count
3742
// metric_kind: DELTA
3843
// value_type: INT64
3944
// billing:
40-
// metrics:
41-
// - library.googleapis.com/read_calls
42-
// - library.googleapis.com/write_calls
43-
//
44-
// The next example shows how to enable billing status check and customize the
45-
// check behavior. It makes sure billing status check is included in the `Check`
46-
// method of [Service Control API](https://cloud.google.com/service-control/).
47-
// In the example, "google.storage.Get" method can be served when the billing
48-
// status is either `current` or `delinquent`, while "google.storage.Write"
49-
// method can only be served when the billing status is `current`:
50-
//
51-
// billing:
52-
// rules:
53-
// - selector: google.storage.Get
54-
// allowed_statuses:
55-
// - current
56-
// - delinquent
57-
// - selector: google.storage.Write
58-
// allowed_statuses: current
59-
//
60-
// Mostly services should only allow `current` status when serving requests.
61-
// In addition, services can choose to allow both `current` and `delinquent`
62-
// statuses when serving read-only requests to resources. If there's no
63-
// matching selector for operation, no billing status check will be performed.
64-
//
45+
// consumer_destinations:
46+
// - monitored_resource: library.googleapis.com/branch
47+
// metrics:
48+
// - library.googleapis.com/book/borrowed_count
6549
message Billing {
66-
// Names of the metrics to report to billing. Each name must
67-
// be defined in [Service.metrics][google.api.Service.metrics] section.
68-
repeated string metrics = 1;
69-
70-
// A list of billing status rules for configuring billing status check.
71-
repeated BillingStatusRule rules = 5;
72-
}
50+
// Configuration of a specific billing destination (Currently only support
51+
// bill against consumer project).
52+
message BillingDestination {
53+
// The monitored resource type. The type must be defined in
54+
// [Service.monitored_resources][google.api.Service.monitored_resources] section.
55+
string monitored_resource = 1;
7356

74-
// Defines the billing status requirements for operations.
75-
//
76-
// When used with
77-
// [Service Control API](https://cloud.google.com/service-control/), the
78-
// following statuses are supported:
79-
//
80-
// - **current**: the associated billing account is up to date and capable of
81-
// paying for resource usages.
82-
// - **delinquent**: the associated billing account has a correctable problem,
83-
// such as late payment.
84-
//
85-
// Mostly services should only allow `current` status when serving requests.
86-
// In addition, services can choose to allow both `current` and `delinquent`
87-
// statuses when serving read-only requests to resources. If the list of
88-
// allowed_statuses is empty, it means no billing requirement.
89-
//
90-
message BillingStatusRule {
91-
// Selects the operation names to which this rule applies.
92-
// Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
93-
string selector = 1;
57+
// Names of the metrics to report to this billing destination.
58+
// Each name must be defined in [Service.metrics][google.api.Service.metrics] section.
59+
repeated string metrics = 2;
60+
}
9461

95-
// Allowed billing statuses. The billing status check passes if the actual
96-
// billing status matches any of the provided values here.
97-
repeated string allowed_statuses = 2;
62+
// Billing configurations for sending metrics to the consumer project.
63+
// There can be multiple consumer destinations per service, each one must have
64+
// a different monitored resource type. A metric can be used in at most
65+
// one consumer destination.
66+
repeated BillingDestination consumer_destinations = 8;
9867
}

google/api/service.proto

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package google.api;
1919
import "google/api/annotations.proto";
2020
import "google/api/auth.proto";
2121
import "google/api/backend.proto";
22+
import "google/api/billing.proto";
2223
import "google/api/context.proto";
2324
import "google/api/control.proto";
2425
import "google/api/documentation.proto";
@@ -71,10 +72,10 @@ option objc_class_prefix = "GAPI";
7172
// requirements:
7273
// provider_id: google_calendar_auth
7374
message Service {
74-
// The version of the service configuration. The config version may
75-
// influence interpretation of the configuration, for example, to
76-
// determine defaults. This is documented together with applicable
77-
// options. The current default for the config version itself is `3`.
75+
// The semantic version of the service configuration. The config version
76+
// affects the interpretation of the service configuration. For example,
77+
// certain features are enabled by default for certain config versions.
78+
// The latest config version is `3`.
7879
google.protobuf.UInt32Value config_version = 20;
7980

8081
// The DNS address at which this service is available,
@@ -86,12 +87,10 @@ message Service {
8687
// generate one instead.
8788
string id = 33;
8889

89-
// The product title associated with this service.
90+
// The product title for this service.
9091
string title = 2;
9192

92-
// The id of the Google developer project that owns the service.
93-
// Members of this project can manage the service configuration,
94-
// manage consumption of the service, etc.
93+
// The Google project that owns this service.
9594
string producer_project_id = 22;
9695

9796
// A list of API interfaces exported by this service. Only the `name` field
@@ -159,6 +158,9 @@ message Service {
159158
// by the [Service.monitoring][google.api.Service.monitoring] and [Service.logging][google.api.Service.logging] configurations.
160159
repeated MonitoredResourceDescriptor monitored_resources = 25;
161160

161+
// Billing configuration.
162+
Billing billing = 26;
163+
162164
// Logging configuration.
163165
Logging logging = 27;
164166

0 commit comments

Comments
 (0)