From 113867b53b015c1f951e0e4e515756f221abc0a2 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Tue, 22 Aug 2023 10:25:16 -0700 Subject: [PATCH] feat: Supported project-level-budgets in Public Budget API V1 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 --- google/cloud/billing/budgets/v1/BUILD.bazel | 5 +++-- .../cloud/billing/budgets/v1/budget_model.proto | 16 ++++++++++++++-- .../billing/budgets/v1/budget_service.proto | 8 ++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/google/cloud/billing/budgets/v1/BUILD.bazel b/google/cloud/billing/budgets/v1/BUILD.bazel index 913348f279f90..697b173c6cc04 100644 --- a/google/cloud/billing/budgets/v1/BUILD.bazel +++ b/google/cloud/billing/budgets/v1/BUILD.bazel @@ -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 @@ -283,7 +285,6 @@ ruby_gapic_assembly_pkg( csharp_proto_library( name = "budgets_csharp_proto", - extra_opts = [], deps = [":budgets_proto"], ) diff --git a/google/cloud/billing/budgets/v1/budget_model.proto b/google/cloud/billing/budgets/v1/budget_model.proto index 8c2bbcaa4cdee..559f0e4f41044 100644 --- a/google/cloud/billing/budgets/v1/budget_model.proto +++ b/google/cloud/billing/budgets/v1/budget_model.proto @@ -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. @@ -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]; diff --git a/google/cloud/billing/budgets/v1/budget_service.proto b/google/cloud/billing/budgets/v1/budget_service.proto index b9d6e3df36a16..b892dc255d02f 100644 --- a/google/cloud/billing/budgets/v1/budget_service.proto +++ b/google/cloud/billing/budgets/v1/budget_service.proto @@ -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];