1- // Copyright 2019 Google LLC.
1+ // Copyright 2022 Google LLC
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.
1111// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212// See the License for the specific language governing permissions and
1313// limitations under the License.
14- //
1514
1615syntax = "proto3" ;
1716
@@ -30,10 +29,14 @@ option java_multiple_files = true;
3029option java_outer_classname = "CloudBillingProto" ;
3130option java_package = "com.google.cloud.billing.v1" ;
3231
33- // Retrieves GCP Console billing accounts and associates them with projects.
32+ // Retrieves the Google Cloud Console billing accounts and associates them with
33+ // projects.
3434service CloudBilling {
3535 option (google.api.default_host ) = "cloudbilling.googleapis.com" ;
36- option (google.api.oauth_scopes ) = "https://www.googleapis.com/auth/cloud-platform" ;
36+ option (google.api.oauth_scopes ) =
37+ "https://www.googleapis.com/auth/cloud-billing,"
38+ "https://www.googleapis.com/auth/cloud-billing.readonly,"
39+ "https://www.googleapis.com/auth/cloud-platform" ;
3740
3841 // Gets information about a billing account. The current authenticated user
3942 // must be a [viewer of the billing
@@ -69,15 +72,20 @@ service CloudBilling {
6972 option (google.api.method_signature ) = "name,account" ;
7073 }
7174
72- // Creates a billing account.
73- // This method can only be used to create
74- // [billing subaccounts](https://cloud.google.com/billing/docs/concepts)
75- // by GCP resellers.
75+ // This method creates [billing
76+ // subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).
77+ //
78+ // Google Cloud resellers should use the
79+ // Channel Services APIs,
80+ // [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create)
81+ // and
82+ // [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).
83+ //
7684 // When creating a subaccount, the current authenticated user must have the
77- // `billing.accounts.update` IAM permission on the master account, which is
85+ // `billing.accounts.update` IAM permission on the parent account, which is
7886 // typically given to billing account
7987 // [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).
80- // This method will return an error if the master account has not been
88+ // This method will return an error if the parent account has not been
8189 // provisioned as a reseller account.
8290 rpc CreateBillingAccount (CreateBillingAccountRequest ) returns (BillingAccount ) {
8391 option (google.api.http ) = {
@@ -99,9 +107,10 @@ service CloudBilling {
99107 }
100108
101109 // Gets the billing information for a project. The current authenticated user
102- // must have [permission to view the
103- // project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo
104- // ).
110+ // must have the `resourcemanager.projects.get` permission for the project,
111+ // which can be granted by assigning the [Project
112+ // Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles)
113+ // role.
105114 rpc GetProjectBillingInfo (GetProjectBillingInfoRequest ) returns (ProjectBillingInfo ) {
106115 option (google.api.http ) = {
107116 get : "/v1/{name=projects/*}/billingInfo"
@@ -118,7 +127,7 @@ service CloudBilling {
118127 // usage charges.
119128 //
120129 // *Note:* Incurred charges that have not yet been reported in the transaction
121- // history of the GCP Console might be billed to the new billing
130+ // history of the Google Cloud Console might be billed to the new billing
122131 // account, even if the charge occurred before the new billing account was
123132 // assigned to the project.
124133 //
@@ -184,37 +193,41 @@ service CloudBilling {
184193 }
185194}
186195
187- // A billing account in [GCP Console](https://console.cloud.google.com/).
188- // You can assign a billing account to one or more projects.
196+ // A billing account in the
197+ // [Google Cloud Console](https://console.cloud.google.com/). You can assign a
198+ // billing account to one or more projects.
189199message BillingAccount {
190- // The resource name of the billing account. The resource name has the form
200+ // Output only. The resource name of the billing account. The resource name has the form
191201 // `billingAccounts/{billing_account_id}`. For example,
192202 // `billingAccounts/012345-567890-ABCDEF` would be the resource name for
193203 // billing account `012345-567890-ABCDEF`.
194- string name = 1 [(google.api.resource_reference ) = {
195- type : "cloudbilling.googleapis.com/BillingAccount"
196- }];
204+ string name = 1 [
205+ (google.api.field_behavior ) = OUTPUT_ONLY ,
206+ (google.api.resource_reference ) = {
207+ type : "cloudbilling.googleapis.com/BillingAccount"
208+ }
209+ ];
197210
198211 // Output only. True if the billing account is open, and will therefore be charged for any
199212 // usage on associated projects. False if the billing account is closed, and
200213 // therefore projects associated with it will be unable to use paid services.
201214 bool open = 2 [(google.api.field_behavior ) = OUTPUT_ONLY ];
202215
203216 // The display name given to the billing account, such as `My Billing
204- // Account`. This name is displayed in the GCP Console.
217+ // Account`. This name is displayed in the Google Cloud Console.
205218 string display_name = 3 ;
206219
207220 // If this account is a
208221 // [subaccount](https://cloud.google.com/billing/docs/concepts), then this
209- // will be the resource name of the master billing account that it is being
222+ // will be the resource name of the parent billing account that it is being
210223 // resold through.
211224 // Otherwise this will be empty.
212225 string master_billing_account = 4 ;
213226}
214227
215- // Encapsulation of billing information for a GCP Console project. A project
216- // has at most one associated billing account at a time (but a billing account
217- // can be assigned to multiple projects).
228+ // Encapsulation of billing information for a Google Cloud Console project. A
229+ // project has at most one associated billing account at a time (but a billing
230+ // account can be assigned to multiple projects).
218231message ProjectBillingInfo {
219232 // The resource name for the `ProjectBillingInfo`; has the form
220233 // `projects/{project_id}/billingInfo`. For example, the resource name for the
@@ -285,7 +298,7 @@ message ListBillingAccountsResponse {
285298message CreateBillingAccountRequest {
286299 // Required. The billing account resource to create.
287300 // Currently CreateBillingAccount only supports subaccount creation, so
288- // any created billing accounts must be under a provided master billing
301+ // any created billing accounts must be under a provided parent billing
289302 // account.
290303 BillingAccount billing_account = 1 [(google.api.field_behavior ) = REQUIRED ];
291304}
0 commit comments