Skip to content

Commit

Permalink
feat: Supported project-level-budgets in Public Budget API V1
Browse files Browse the repository at this point in the history
Added `scope` for project scope filter in `ListBudgetsRequest`. When this field is set to a project's resource name, the budgets returned are tracking the costs for the given project.

feat: Added `enable_project_level_recipients` for project owner budget emails

Setting this field to true will enable email notification to project owners for project-level budgets.

PiperOrigin-RevId: 559152052
  • Loading branch information
Google APIs authored and Copybara-Service committed Aug 22, 2023
1 parent 138b0f1 commit 113867b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
5 changes: 3 additions & 2 deletions google/cloud/billing/budgets/v1/BUILD.bazel
Expand Up @@ -205,7 +205,9 @@ php_gapic_library(
rest_numeric_enums = True,
service_yaml = "billingbudgets.yaml",
transport = "grpc+rest",
deps = [":budgets_php_proto"],
deps = [
":budgets_php_proto",
],
)

# Open Source Packages
Expand Down Expand Up @@ -283,7 +285,6 @@ ruby_gapic_assembly_pkg(

csharp_proto_library(
name = "budgets_csharp_proto",
extra_opts = [],
deps = [":budgets_proto"],
)

Expand Down
16 changes: 14 additions & 2 deletions google/cloud/billing/budgets/v1/budget_model.proto
Expand Up @@ -224,6 +224,16 @@ message NotificationsRule {
// account.
bool disable_default_iam_recipients = 4
[(google.api.field_behavior) = OPTIONAL];

// Optional. When set to true, and when the budget has a single project
// configured, notifications will be sent to project level recipients of that
// project. This field will be ignored if the budget has multiple or no
// project configured.
//
// Currently, project level recipients are the users with `Owner` role on a
// cloud project.
bool enable_project_level_recipients = 5
[(google.api.field_behavior) = OPTIONAL];
}

// A filter for a budget, limiting the scope of the cost to calculate.
Expand Down Expand Up @@ -260,8 +270,10 @@ message Filter {
// Optional. A set of folder and organization names of the form
// `folders/{folderId}` or `organizations/{organizationId}`, specifying that
// usage from only this set of folders and organizations should be included in
// the budget. If omitted, the report includes all usage for all
// organizations, regardless of which organization the usage occurred on.
// the budget. If omitted, the budget includes all usage that the billing
// account pays for. If the folder or organization contains projects that are
// paid for by a different Cloud Billing account, the budget *doesn't* apply
// to those projects.
repeated string resource_ancestors = 2
[(google.api.field_behavior) = OPTIONAL];

Expand Down
8 changes: 8 additions & 0 deletions google/cloud/billing/budgets/v1/budget_service.proto
Expand Up @@ -150,6 +150,14 @@ message ListBudgetsRequest {
}
];

// Optional. Set the scope of the budgets to be returned, in the format of the
// resource name. The scope of a budget is the cost that it tracks, such as
// costs for a single project, or the costs for all projects in a folder. Only
// project scope (in the format of "projects/project-id" or "projects/123") is
// supported in this field. When this field is set to a project's resource
// name, the budgets returned are tracking the costs for that project.
string scope = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. The maximum number of budgets to return per page.
// The default and maximum value are 100.
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
Expand Down

0 comments on commit 113867b

Please sign in to comment.