Skip to content

Commit 1d12d89

Browse files
feat: added Sku.geo_taxonomy (#3637)
- [ ] Regenerate this pull request now. chore: disallow "transport=rest" for services where numeric enums are not confirmed to be supported (except in PHP and Java) PiperOrigin-RevId: 493113566 Source-Link: https://togithub.com/googleapis/googleapis/commit/758f0d1217d9c7fe398aa5efb1057ce4b6409e55 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/78bd8f05e1276363eb14eae70e91fe4bc20703ab Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmcvLk93bEJvdC55YW1sIiwiaCI6Ijc4YmQ4ZjA1ZTEyNzYzNjNlYjE0ZWFlNzBlOTFmZTRiYzIwNzAzYWIifQ== BEGIN_NESTED_COMMIT feat: added Sku.geo_taxonomy fix: more oauth scopes PiperOrigin-RevId: 488493014 Source-Link: https://togithub.com/googleapis/googleapis/commit/8995a8817642b3a209103677012521f953616011 Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/adbfce0c0e59b1b38bb8e81ae9a3d0b408e7f7c0 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmcvLk93bEJvdC55YW1sIiwiaCI6ImFkYmZjZTBjMGU1OWIxYjM4YmI4ZTgxYWU5YTNkMGI0MDhlN2Y3YzAifQ== END_NESTED_COMMIT
1 parent 91658c5 commit 1d12d89

9 files changed

Lines changed: 665 additions & 133 deletions

File tree

packages/google-cloud-billing/protos/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
}

packages/google-cloud-billing/protos/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.

0 commit comments

Comments
 (0)