Skip to content

Commit 8995a88

Browse files
Google APIscopybara-github
authored andcommitted
feat: added Sku.geo_taxonomy
fix: more oauth scopes PiperOrigin-RevId: 488493014
1 parent 452324b commit 8995a88

4 files changed

Lines changed: 136 additions & 48 deletions

File tree

google/cloud/billing/v1/BUILD.bazel

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -62,15 +71,18 @@ java_grpc_library(
6271
java_gapic_library(
6372
name = "billing_java_gapic",
6473
srcs = [":billing_proto_with_info"],
74+
gapic_yaml = None,
6575
grpc_service_config = "cloud_billing_grpc_service_config.json",
6676
rest_numeric_enums = False,
77+
service_yaml = "cloudbilling.yaml",
6778
test_deps = [
6879
":billing_java_grpc",
6980
"//google/iam/v1:iam_java_grpc",
7081
],
7182
transport = "grpc+rest",
7283
deps = [
7384
":billing_java_proto",
85+
"//google/api:api_java_proto",
7486
"//google/iam/v1:iam_java_proto",
7587
],
7688
)
@@ -127,6 +139,7 @@ go_gapic_library(
127139
srcs = [":billing_proto_with_info"],
128140
grpc_service_config = "cloud_billing_grpc_service_config.json",
129141
importpath = "cloud.google.com/go/billing/apiv1;billing",
142+
metadata = True,
130143
rest_numeric_enums = False,
131144
service_yaml = "cloudbilling.yaml",
132145
transport = "grpc+rest",
@@ -148,6 +161,7 @@ go_gapic_assembly_pkg(
148161
name = "gapi-cloud-billing-v1-go",
149162
deps = [
150163
":billing_go_gapic",
164+
":billing_go_gapic_srcjar-metadata.srcjar",
151165
":billing_go_gapic_srcjar-test.srcjar",
152166
":billing_go_proto",
153167
],
@@ -168,6 +182,7 @@ py_gapic_library(
168182
srcs = [":billing_proto"],
169183
grpc_service_config = "cloud_billing_grpc_service_config.json",
170184
rest_numeric_enums = False,
185+
service_yaml = "cloudbilling.yaml",
171186
transport = "grpc",
172187
deps = [
173188
"//google/iam/v1:iam_policy_py_proto",
@@ -219,6 +234,7 @@ php_gapic_library(
219234
srcs = [":billing_proto_with_info"],
220235
grpc_service_config = "cloud_billing_grpc_service_config.json",
221236
rest_numeric_enums = False,
237+
service_yaml = "cloudbilling.yaml",
222238
transport = "grpc+rest",
223239
deps = [
224240
":billing_php_grpc",
@@ -292,16 +308,17 @@ ruby_cloud_gapic_library(
292308
name = "billing_ruby_gapic",
293309
srcs = [":billing_proto_with_info"],
294310
extra_protoc_parameters = [
295-
"ruby-cloud-gem-name=google-cloud-billing-v1",
296-
"ruby-cloud-env-prefix=BILLING",
297-
"ruby-cloud-product-url=https://cloud.google.com/billing",
298311
"ruby-cloud-api-id=cloudbilling.googleapis.com",
299312
"ruby-cloud-api-shortname=cloudbilling",
313+
"ruby-cloud-env-prefix=BILLING",
314+
"ruby-cloud-gem-name=google-cloud-billing-v1",
315+
"ruby-cloud-product-url=https://cloud.google.com/billing",
300316
],
301317
grpc_service_config = "cloud_billing_grpc_service_config.json",
302318
rest_numeric_enums = False,
303319
ruby_cloud_description = "Allows developers to manage billing for their Google Cloud Platform projects programmatically.",
304320
ruby_cloud_title = "Billing V1",
321+
service_yaml = "cloudbilling.yaml",
305322
deps = [
306323
":billing_ruby_grpc",
307324
":billing_ruby_proto",

google/cloud/billing/v1/cloud_billing.proto

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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.
@@ -11,7 +11,6 @@
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

1615
syntax = "proto3";
1716

@@ -30,10 +29,14 @@ option java_multiple_files = true;
3029
option java_outer_classname = "CloudBillingProto";
3130
option 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.
3434
service 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.
189199
message 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).
218231
message 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 {
285298
message 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
}

google/cloud/billing/v1/cloud_catalog.proto

Lines changed: 50 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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.
@@ -11,7 +11,6 @@
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

1615
syntax = "proto3";
1716

@@ -36,7 +35,10 @@ option objc_class_prefix = "CLDCTLG";
3635
// and SKUs.
3736
service CloudCatalog {
3837
option (google.api.default_host) = "cloudbilling.googleapis.com";
39-
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
38+
option (google.api.oauth_scopes) =
39+
"https://www.googleapis.com/auth/cloud-billing,"
40+
"https://www.googleapis.com/auth/cloud-billing.readonly,"
41+
"https://www.googleapis.com/auth/cloud-platform";
4042

4143
// Lists all public cloud services.
4244
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
@@ -111,6 +113,9 @@ message Sku {
111113
// Identifies the service provider.
112114
// This is 'Google' for first party services in Google Cloud Platform.
113115
string service_provider_name = 7;
116+
117+
// The geographic taxonomy for this sku.
118+
GeoTaxonomy geo_taxonomy = 8;
114119
}
115120

116121
// Represents the category hierarchy of a SKU.
@@ -187,6 +192,21 @@ message PricingExpression {
187192
// Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte".
188193
string usage_unit = 1;
189194

195+
// The recommended quantity of units for displaying pricing info. When
196+
// displaying pricing info it is recommended to display:
197+
// (unit_price * display_quantity) per display_quantity usage_unit.
198+
// This field does not affect the pricing formula and is for display purposes
199+
// only.
200+
// Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and
201+
// the display_quantity is "1000" then the recommended way of displaying the
202+
// pricing info is "0.10 USD per 1000 GB"
203+
double display_quantity = 2;
204+
205+
// The list of tiered rates for this pricing. The total cost is computed by
206+
// applying each of the tiered rates on usage. This repeated list is sorted
207+
// by ascending order of start_usage_amount.
208+
repeated TierRate tiered_rates = 3;
209+
190210
// The unit of usage in human readable form.
191211
// Example: "gibi byte".
192212
string usage_unit_description = 4;
@@ -205,21 +225,6 @@ message PricingExpression {
205225
// start_usage_amount * base_unit_conversion_factor = start_usage_amount in
206226
// base_unit.
207227
double base_unit_conversion_factor = 7;
208-
209-
// The recommended quantity of units for displaying pricing info. When
210-
// displaying pricing info it is recommended to display:
211-
// (unit_price * display_quantity) per display_quantity usage_unit.
212-
// This field does not affect the pricing formula and is for display purposes
213-
// only.
214-
// Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and
215-
// the display_quantity is "1000" then the recommended way of displaying the
216-
// pricing info is "0.10 USD per 1000 GB"
217-
double display_quantity = 2;
218-
219-
// The list of tiered rates for this pricing. The total cost is computed by
220-
// applying each of the tiered rates on usage. This repeated list is sorted
221-
// by ascending order of start_usage_amount.
222-
repeated TierRate tiered_rates = 3;
223228
}
224229

225230
// Represents the aggregation level and interval for pricing of a single SKU.
@@ -256,6 +261,33 @@ message AggregationInfo {
256261
int32 aggregation_count = 3;
257262
}
258263

264+
// Encapsulates the geographic taxonomy data for a sku.
265+
message GeoTaxonomy {
266+
// The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL.
267+
enum Type {
268+
// The type is not specified.
269+
TYPE_UNSPECIFIED = 0;
270+
271+
// The sku is global in nature, e.g. a license sku. Global skus are
272+
// available in all regions, and so have an empty region list.
273+
GLOBAL = 1;
274+
275+
// The sku is available in a specific region, e.g. "us-west2".
276+
REGIONAL = 2;
277+
278+
// The sku is associated with multiple regions, e.g. "us-west2" and
279+
// "us-east1".
280+
MULTI_REGIONAL = 3;
281+
}
282+
283+
// The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL.
284+
Type type = 1;
285+
286+
// The list of regions associated with a sku. Empty for Global skus, which are
287+
// associated with all Google Cloud regions.
288+
repeated string regions = 2;
289+
}
290+
259291
// Request message for `ListServices`.
260292
message ListServicesRequest {
261293
// Requested page size. Defaults to 5000.

google/cloud/billing/v1/cloudbilling.yaml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type: google.api.Service
2-
config_version: 1
2+
config_version: 3
33
name: cloudbilling.googleapis.com
44
title: Cloud Billing API
55

@@ -17,12 +17,38 @@ authentication:
1717
- selector: 'google.cloud.billing.v1.CloudBilling.*'
1818
oauth:
1919
canonical_scopes: |-
20+
https://www.googleapis.com/auth/cloud-billing,
21+
https://www.googleapis.com/auth/cloud-billing.readonly,
22+
https://www.googleapis.com/auth/cloud-platform
23+
- selector: google.cloud.billing.v1.CloudBilling.CreateBillingAccount
24+
oauth:
25+
canonical_scopes: |-
26+
https://www.googleapis.com/auth/cloud-billing,
27+
https://www.googleapis.com/auth/cloud-platform
28+
- selector: google.cloud.billing.v1.CloudBilling.SetIamPolicy
29+
oauth:
30+
canonical_scopes: |-
31+
https://www.googleapis.com/auth/cloud-billing,
32+
https://www.googleapis.com/auth/cloud-platform
33+
- selector: google.cloud.billing.v1.CloudBilling.UpdateBillingAccount
34+
oauth:
35+
canonical_scopes: |-
36+
https://www.googleapis.com/auth/cloud-billing,
37+
https://www.googleapis.com/auth/cloud-platform
38+
- selector: google.cloud.billing.v1.CloudBilling.UpdateProjectBillingInfo
39+
oauth:
40+
canonical_scopes: |-
41+
https://www.googleapis.com/auth/cloud-billing,
2042
https://www.googleapis.com/auth/cloud-platform
2143
- selector: google.cloud.billing.v1.CloudCatalog.ListServices
2244
oauth:
2345
canonical_scopes: |-
46+
https://www.googleapis.com/auth/cloud-billing,
47+
https://www.googleapis.com/auth/cloud-billing.readonly,
2448
https://www.googleapis.com/auth/cloud-platform
2549
- selector: google.cloud.billing.v1.CloudCatalog.ListSkus
2650
oauth:
2751
canonical_scopes: |-
52+
https://www.googleapis.com/auth/cloud-billing,
53+
https://www.googleapis.com/auth/cloud-billing.readonly,
2854
https://www.googleapis.com/auth/cloud-platform

0 commit comments

Comments
 (0)