Skip to content

Commit

Permalink
feat: added Sku.geo_taxonomy (#3637)
Browse files Browse the repository at this point in the history
- [ ] 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
  • Loading branch information
gcf-owl-bot[bot] authored Dec 7, 2022
1 parent 91658c5 commit 1d12d89
Show file tree
Hide file tree
Showing 9 changed files with 665 additions and 133 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -30,10 +29,14 @@ option java_multiple_files = true;
option java_outer_classname = "CloudBillingProto";
option java_package = "com.google.cloud.billing.v1";

// Retrieves GCP Console billing accounts and associates them with projects.
// Retrieves the Google Cloud Console billing accounts and associates them with
// projects.
service CloudBilling {
option (google.api.default_host) = "cloudbilling.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-billing,"
"https://www.googleapis.com/auth/cloud-billing.readonly,"
"https://www.googleapis.com/auth/cloud-platform";

// Gets information about a billing account. The current authenticated user
// must be a [viewer of the billing
Expand Down Expand Up @@ -69,15 +72,20 @@ service CloudBilling {
option (google.api.method_signature) = "name,account";
}

// Creates a billing account.
// This method can only be used to create
// [billing subaccounts](https://cloud.google.com/billing/docs/concepts)
// by GCP resellers.
// This method creates [billing
// subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts).
//
// Google Cloud resellers should use the
// Channel Services APIs,
// [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create)
// and
// [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create).
//
// When creating a subaccount, the current authenticated user must have the
// `billing.accounts.update` IAM permission on the master account, which is
// `billing.accounts.update` IAM permission on the parent account, which is
// typically given to billing account
// [administrators](https://cloud.google.com/billing/docs/how-to/billing-access).
// This method will return an error if the master account has not been
// This method will return an error if the parent account has not been
// provisioned as a reseller account.
rpc CreateBillingAccount(CreateBillingAccountRequest) returns (BillingAccount) {
option (google.api.http) = {
Expand All @@ -99,9 +107,10 @@ service CloudBilling {
}

// Gets the billing information for a project. The current authenticated user
// must have [permission to view the
// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo
// ).
// must have the `resourcemanager.projects.get` permission for the project,
// which can be granted by assigning the [Project
// Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles)
// role.
rpc GetProjectBillingInfo(GetProjectBillingInfoRequest) returns (ProjectBillingInfo) {
option (google.api.http) = {
get: "/v1/{name=projects/*}/billingInfo"
Expand All @@ -118,7 +127,7 @@ service CloudBilling {
// usage charges.
//
// *Note:* Incurred charges that have not yet been reported in the transaction
// history of the GCP Console might be billed to the new billing
// history of the Google Cloud Console might be billed to the new billing
// account, even if the charge occurred before the new billing account was
// assigned to the project.
//
Expand Down Expand Up @@ -184,37 +193,41 @@ service CloudBilling {
}
}

// A billing account in [GCP Console](https://console.cloud.google.com/).
// You can assign a billing account to one or more projects.
// A billing account in the
// [Google Cloud Console](https://console.cloud.google.com/). You can assign a
// billing account to one or more projects.
message BillingAccount {
// The resource name of the billing account. The resource name has the form
// Output only. The resource name of the billing account. The resource name has the form
// `billingAccounts/{billing_account_id}`. For example,
// `billingAccounts/012345-567890-ABCDEF` would be the resource name for
// billing account `012345-567890-ABCDEF`.
string name = 1 [(google.api.resource_reference) = {
type: "cloudbilling.googleapis.com/BillingAccount"
}];
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "cloudbilling.googleapis.com/BillingAccount"
}
];

// Output only. True if the billing account is open, and will therefore be charged for any
// usage on associated projects. False if the billing account is closed, and
// therefore projects associated with it will be unable to use paid services.
bool open = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// The display name given to the billing account, such as `My Billing
// Account`. This name is displayed in the GCP Console.
// Account`. This name is displayed in the Google Cloud Console.
string display_name = 3;

// If this account is a
// [subaccount](https://cloud.google.com/billing/docs/concepts), then this
// will be the resource name of the master billing account that it is being
// will be the resource name of the parent billing account that it is being
// resold through.
// Otherwise this will be empty.
string master_billing_account = 4;
}

// Encapsulation of billing information for a GCP Console project. A project
// has at most one associated billing account at a time (but a billing account
// can be assigned to multiple projects).
// Encapsulation of billing information for a Google Cloud Console project. A
// project has at most one associated billing account at a time (but a billing
// account can be assigned to multiple projects).
message ProjectBillingInfo {
// The resource name for the `ProjectBillingInfo`; has the form
// `projects/{project_id}/billingInfo`. For example, the resource name for the
Expand Down Expand Up @@ -285,7 +298,7 @@ message ListBillingAccountsResponse {
message CreateBillingAccountRequest {
// Required. The billing account resource to create.
// Currently CreateBillingAccount only supports subaccount creation, so
// any created billing accounts must be under a provided master billing
// any created billing accounts must be under a provided parent billing
// account.
BillingAccount billing_account = 1 [(google.api.field_behavior) = REQUIRED];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -36,7 +35,10 @@ option objc_class_prefix = "CLDCTLG";
// and SKUs.
service CloudCatalog {
option (google.api.default_host) = "cloudbilling.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-billing,"
"https://www.googleapis.com/auth/cloud-billing.readonly,"
"https://www.googleapis.com/auth/cloud-platform";

// Lists all public cloud services.
rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
Expand Down Expand Up @@ -111,6 +113,9 @@ message Sku {
// Identifies the service provider.
// This is 'Google' for first party services in Google Cloud Platform.
string service_provider_name = 7;

// The geographic taxonomy for this sku.
GeoTaxonomy geo_taxonomy = 8;
}

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

// The recommended quantity of units for displaying pricing info. When
// displaying pricing info it is recommended to display:
// (unit_price * display_quantity) per display_quantity usage_unit.
// This field does not affect the pricing formula and is for display purposes
// only.
// Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and
// the display_quantity is "1000" then the recommended way of displaying the
// pricing info is "0.10 USD per 1000 GB"
double display_quantity = 2;

// The list of tiered rates for this pricing. The total cost is computed by
// applying each of the tiered rates on usage. This repeated list is sorted
// by ascending order of start_usage_amount.
repeated TierRate tiered_rates = 3;

// The unit of usage in human readable form.
// Example: "gibi byte".
string usage_unit_description = 4;
Expand All @@ -205,21 +225,6 @@ message PricingExpression {
// start_usage_amount * base_unit_conversion_factor = start_usage_amount in
// base_unit.
double base_unit_conversion_factor = 7;

// The recommended quantity of units for displaying pricing info. When
// displaying pricing info it is recommended to display:
// (unit_price * display_quantity) per display_quantity usage_unit.
// This field does not affect the pricing formula and is for display purposes
// only.
// Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and
// the display_quantity is "1000" then the recommended way of displaying the
// pricing info is "0.10 USD per 1000 GB"
double display_quantity = 2;

// The list of tiered rates for this pricing. The total cost is computed by
// applying each of the tiered rates on usage. This repeated list is sorted
// by ascending order of start_usage_amount.
repeated TierRate tiered_rates = 3;
}

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

// Encapsulates the geographic taxonomy data for a sku.
message GeoTaxonomy {
// The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL.
enum Type {
// The type is not specified.
TYPE_UNSPECIFIED = 0;

// The sku is global in nature, e.g. a license sku. Global skus are
// available in all regions, and so have an empty region list.
GLOBAL = 1;

// The sku is available in a specific region, e.g. "us-west2".
REGIONAL = 2;

// The sku is associated with multiple regions, e.g. "us-west2" and
// "us-east1".
MULTI_REGIONAL = 3;
}

// The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL.
Type type = 1;

// The list of regions associated with a sku. Empty for Global skus, which are
// associated with all Google Cloud regions.
repeated string regions = 2;
}

// Request message for `ListServices`.
message ListServicesRequest {
// Requested page size. Defaults to 5000.
Expand Down
Loading

0 comments on commit 1d12d89

Please sign in to comment.