From 8ffd9112f3e433f4410ce6aa2664db6cf50f5175 Mon Sep 17 00:00:00 2001
From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com>
Date: Tue, 6 Jun 2023 06:28:13 +0000
Subject: [PATCH] feat: [billing-budgets] Add resource_ancestors field to
support filtering by folders & organizations (#4321)
- [ ] Regenerate this pull request now.
PiperOrigin-RevId: 537933008
Source-Link: https://togithub.com/googleapis/googleapis/commit/04294122e99eef013b6ee0faff7be2e5e0297041
Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/82dfed01a0f18b25ac061c56555a5a066c9d3db3
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmctYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiODJkZmVkMDFhMGYxOGIyNWFjMDYxYzU2NTU1YTVhMDY2YzlkM2RiMyJ9
BEGIN_NESTED_COMMIT
feat: [billing-budgets] Add resource_ancestors field to support filtering by folders & organizations
PiperOrigin-RevId: 537931957
Source-Link: https://togithub.com/googleapis/googleapis/commit/521a7a6acb3dc742e16a28eab0d1de258d83a23c
Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/afb9a0c029dd8047950189db30b2743af177e276
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpbGxpbmctYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiYWZiOWEwYzAyOWRkODA0Nzk1MDE4OWRiMzBiMjc0M2FmMTc3ZTI3NiJ9
END_NESTED_COMMIT
---
.../google-cloud-billing-budgets/README.md | 27 ++--
.../billing/budgets/v1/budget_model.proto | 142 +++++++++++++-----
.../budgets/v1beta1/budget_model.proto | 118 +++++++++------
.../budgets/v1beta1/budget_service.proto | 3 +-
.../protos/protos.d.ts | 12 ++
.../protos/protos.js | 78 ++++++++++
.../protos/protos.json | 16 ++
.../samples/README.md | 18 ---
...adata.google.cloud.billing.budgets.v1.json | 2 +-
....google.cloud.billing.budgets.v1beta1.json | 2 +-
10 files changed, 293 insertions(+), 125 deletions(-)
diff --git a/packages/google-cloud-billing-budgets/README.md b/packages/google-cloud-billing-budgets/README.md
index 835610da778..58aacdc1aa6 100644
--- a/packages/google-cloud-billing-budgets/README.md
+++ b/packages/google-cloud-billing-budgets/README.md
@@ -2,7 +2,7 @@
[//]: # "To regenerate it, use `python -m synthtool`."
-# [Billing Budgets: Node.js Client](https://github.com/googleapis/google-cloud-node)
+# [Billing Budgets: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing-budgets)
[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
[![npm version](https://img.shields.io/npm/v/@google-cloud/billing-budgets.svg)](https://www.npmjs.org/package/@google-cloud/billing-budgets)
@@ -82,22 +82,21 @@ quickstart();
## Samples
-Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
+Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing-budgets/samples) directory. Each sample's `README.md` has instructions for running its sample.
| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
-| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js,samples/README.md) |
-| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js,samples/README.md) |
-| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js,samples/README.md) |
-| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js,samples/README.md) |
-| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js,samples/README.md) |
-| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js,samples/README.md) |
-| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js,samples/README.md) |
-| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js,samples/README.md) |
-| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js,samples/README.md) |
-| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js,samples/README.md) |
-| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/quickstart.js,samples/README.md) |
-| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/test/quickstart.test.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/test/quickstart.test.js,samples/README.md) |
+| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.create_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.delete_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.get_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.list_budgets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Budget_service.update_budget | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js,packages/google-cloud-billing-budgets/samples/README.md) |
+| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/quickstart.js,packages/google-cloud-billing-budgets/samples/README.md) |
diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto
index 43ab7b3ffdb..8c2bbcaa4cd 100644
--- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto
+++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto
@@ -57,6 +57,10 @@ message Budget {
// Optional. Rules that trigger alerts (notifications of thresholds
// being crossed) when spend exceeds the specified percentages of the budget.
+ //
+ // Optional for `pubsubTopic` notifications.
+ //
+ // Required if using email notifications.
repeated ThresholdRule threshold_rules = 5
[(google.api.field_behavior) = OPTIONAL];
@@ -67,7 +71,7 @@ message Budget {
// Optional. Etag to validate that the object is unchanged for a
// read-modify-write operation.
- // An empty etag will cause an update to overwrite other changes.
+ // An empty etag causes an update to overwrite other changes.
string etag = 7 [(google.api.field_behavior) = OPTIONAL];
}
@@ -95,20 +99,33 @@ message BudgetAmount {
// [Filter.calendar_period][google.cloud.billing.budgets.v1.Filter.calendar_period]
// spend. At this time, the amount is automatically 100% of the last calendar
// period's spend; that is, there are no other options yet.
-// Future configuration options will be described here (for example, configuring
-// a percentage of last period's spend).
// LastPeriodAmount cannot be set for a budget configured with
// a
// [Filter.custom_period][google.cloud.billing.budgets.v1.Filter.custom_period].
message LastPeriodAmount {}
-// ThresholdRule contains a definition of a threshold which triggers
-// an alert (a notification of a threshold being crossed) to be sent when
-// spend goes above the specified amount.
-// Alerts are automatically e-mailed to users with the Billing Account
-// Administrator role or the Billing Account User role.
-// The thresholds here have no effect on notifications sent to anything
-// configured under `Budget.all_updates_rule`.
+// ThresholdRule contains the definition of a threshold. Threshold rules define
+// the triggering events used to generate a budget notification email. When a
+// threshold is crossed (spend exceeds the specified percentages of the
+// budget), budget alert emails are sent to the email recipients you specify
+// in the
+// [NotificationsRule](#notificationsrule).
+//
+// Threshold rules also affect the fields included in the
+// [JSON data
+// object](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format)
+// sent to a Pub/Sub topic.
+//
+// Threshold rules are _required_ if using email notifications.
+//
+// Threshold rules are _optional_ if only setting a
+// [`pubsubTopic` NotificationsRule](#NotificationsRule),
+// unless you want your JSON data object to include data about the thresholds
+// you set.
+//
+// For more information, see
+// [set budget threshold rules and
+// actions](https://cloud.google.com/billing/docs/how-to/budgets#budget-actions).
message ThresholdRule {
// The type of basis used to determine if spend has passed the threshold.
enum Basis {
@@ -140,17 +157,32 @@ message ThresholdRule {
// NotificationsRule defines notifications that are sent based on budget spend
// and thresholds.
message NotificationsRule {
- // Optional. The name of the Pub/Sub topic where budget related messages will
- // be published, in the form `projects/{project_id}/topics/{topic_id}`.
- // Updates are sent at regular intervals to the topic. The topic needs to be
- // created before the budget is created; see
- // https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
- // for more details.
- // Caller is expected to have
- // `pubsub.topics.setIamPolicy` permission on the topic when it's set for a
- // budget, otherwise, the API call will fail with PERMISSION_DENIED. See
- // https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
- // for more details on Pub/Sub roles and permissions.
+ // Optional. The name of the Pub/Sub topic where budget-related messages are
+ // published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
+ // are sent to the topic at regular intervals; the timing of the updates is
+ // not dependent on the [threshold rules](#thresholdrule) you've set.
+ //
+ // Note that if you want your
+ // [Pub/Sub JSON
+ // object](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format)
+ // to contain data for `alertThresholdExceeded`, you need at least one
+ // [alert threshold rule](#thresholdrule). When you set threshold rules, you
+ // must also enable at least one of the email notification options, either
+ // using the default IAM recipients or Cloud Monitoring email notification
+ // channels.
+ //
+ // To use Pub/Sub topics with budgets, you must do the following:
+ //
+ // 1. Create the Pub/Sub topic
+ // before connecting it to your budget. For guidance, see
+ // [Manage programmatic budget alert
+ // notifications](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications).
+ //
+ // 2. Grant the API caller the `pubsub.topics.setIamPolicy` permission on
+ // the Pub/Sub topic. If not set, the API call fails with PERMISSION_DENIED.
+ // For additional details on Pub/Sub roles and permissions, see
+ // [Permissions required for this
+ // task](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#permissions_required_for_this_task).
string pubsub_topic = 1 [(google.api.field_behavior) = OPTIONAL];
// Optional. Required when
@@ -161,14 +193,28 @@ message NotificationsRule {
// https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
string schema_version = 2 [(google.api.field_behavior) = OPTIONAL];
- // Optional. Targets to send notifications to when a threshold is exceeded.
- // This is in addition to default recipients who have billing account IAM
- // roles. The value is the full REST resource name of a monitoring
- // notification channel with the form
- // `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
- // channels are allowed. See
- // https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
- // for more details.
+ // Optional. Email targets to send notifications to when a threshold is
+ // exceeded. This is in addition to the `DefaultIamRecipients` who receive
+ // alert emails based on their billing account IAM role. The value is the full
+ // REST resource name of a Cloud Monitoring email notification channel with
+ // the form `projects/{project_id}/notificationChannels/{channel_id}`. A
+ // maximum of 5 email notifications are allowed.
+ //
+ // To customize budget alert email recipients with monitoring notification
+ // channels, you _must create the monitoring notification channels before
+ // you link them to a budget_. For guidance on setting up notification
+ // channels to use with budgets, see
+ // [Customize budget alert email
+ // recipients](https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients).
+ //
+ // For Cloud Billing budget alerts, you _must use email notification
+ // channels_. The other types of notification channels are _not_
+ // supported, such as Slack, SMS, or PagerDuty. If you want to
+ // [send budget notifications to
+ // Slack](https://cloud.google.com/billing/docs/how-to/notify#send_notifications_to_slack),
+ // use a pubsubTopic and configure
+ // [programmatic
+ // notifications](https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications).
repeated string monitoring_notification_channels = 3
[(google.api.field_behavior) = OPTIONAL];
@@ -207,11 +253,18 @@ message Filter {
// Optional. A set of projects of the form `projects/{project}`,
// specifying that usage from only this set of projects should be
- // included in the budget. If omitted, the report will include all usage for
+ // included in the budget. If omitted, the report includes all usage for
// the billing account, regardless of which project the usage occurred on.
- // Only zero or one project can be specified currently.
repeated string projects = 1 [(google.api.field_behavior) = OPTIONAL];
+ // 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.
+ repeated string resource_ancestors = 2
+ [(google.api.field_behavior) = OPTIONAL];
+
// Optional. If
// [Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment]
// is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be
@@ -230,7 +283,7 @@ message Filter {
// Optional. A set of services of the form `services/{service_id}`,
// specifying that usage from only this set of services should be
- // included in the budget. If omitted, the report will include usage for
+ // included in the budget. If omitted, the report includes usage for
// all the services.
// The service names are available through the Catalog API:
// https://cloud.google.com/billing/v1/how-tos/catalog-api.
@@ -239,26 +292,31 @@ message Filter {
// Optional. A set of subaccounts of the form `billingAccounts/{account_id}`,
// specifying that usage from only this set of subaccounts should be included
// in the budget. If a subaccount is set to the name of the parent account,
- // usage from the parent account will be included. If the field is omitted,
- // the report will include usage from the parent account and all subaccounts,
+ // usage from the parent account is included. If the field is omitted,
+ // the report includes usage from the parent account and all subaccounts,
// if they exist.
repeated string subaccounts = 5 [(google.api.field_behavior) = OPTIONAL];
// Optional. A single label and value pair specifying that usage from only
- // this set of labeled resources should be included in the budget. Currently,
- // multiple entries or multiple values per entry are not allowed. If omitted,
- // the report will include all labeled and unlabeled usage.
+ // this set of labeled resources should be included in the budget. If omitted,
+ // the report includes all labeled and unlabeled usage.
+ //
+ // An object containing a single `"key": value` pair. Example: `{ "name":
+ // "wrench" }`.
+ //
+ // _Currently, multiple entries or multiple values per entry are not
+ // allowed._
map labels = 6
[(google.api.field_behavior) = OPTIONAL];
// Multiple options to choose the budget's time period, specifying that only
// usage that occurs during this time period should be included in the budget.
- // If not set, the `usage_period` defaults to CalendarPeriod.MONTH.
+ // If not set, the usage_period
defaults to CalendarPeriod.MONTH.
oneof usage_period {
// Optional. Specifies to track usage for recurring calendar period.
- // For example, assume that CalendarPeriod.QUARTER is set. The budget will
- // track usage from April 1 to June 30, when the current calendar month is
- // April, May, June. After that, it will track usage from July 1 to
+ // For example, assume that CalendarPeriod.QUARTER is set. The budget
+ // tracks usage from April 1 to June 30, when the current calendar month is
+ // April, May, June. After that, it tracks usage from July 1 to
// September 30 when the current calendar month is July, August, September,
// so on.
CalendarPeriod calendar_period = 8 [(google.api.field_behavior) = OPTIONAL];
@@ -285,6 +343,8 @@ message CustomPeriod {
// `CalendarPeriod`". All calendar times begin at 12 AM US and Canadian
// Pacific Time (UTC-8).
enum CalendarPeriod {
+ // Calendar period is unset. This is the default if the budget is for a
+ // custom time period (CustomPeriod).
CALENDAR_PERIOD_UNSPECIFIED = 0;
// A month. Month starts on the first day of each month, such as January 1,
diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto
index 5a17d800940..d9f2d595654 100644
--- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto
+++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto
@@ -46,9 +46,9 @@ message Budget {
// Validation: <= 60 chars.
string display_name = 2;
- // Optional. Filters that define which resources are used to compute the actual spend
- // against the budget amount, such as projects, services, and the budget's
- // time period, as well as other filters.
+ // Optional. Filters that define which resources are used to compute the
+ // actual spend against the budget amount, such as projects, services, and the
+ // budget's time period, as well as other filters.
Filter budget_filter = 3 [(google.api.field_behavior) = OPTIONAL];
// Required. Budgeted amount.
@@ -60,9 +60,11 @@ message Budget {
// Optional for `pubsubTopic` notifications.
//
// Required if using email notifications.
- repeated ThresholdRule threshold_rules = 5 [(google.api.field_behavior) = OPTIONAL];
+ repeated ThresholdRule threshold_rules = 5
+ [(google.api.field_behavior) = OPTIONAL];
- // Optional. Rules to apply to notifications sent based on budget spend and thresholds.
+ // Optional. Rules to apply to notifications sent based on budget spend and
+ // thresholds.
AllUpdatesRule all_updates_rule = 6 [(google.api.field_behavior) = OPTIONAL];
// Optional. Etag to validate that the object is unchanged for a
@@ -84,22 +86,23 @@ message BudgetAmount {
// Use the last period's actual spend as the budget for the present period.
// LastPeriodAmount can only be set when the budget's time period is a
- // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. It cannot be set in combination with
+ // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period].
+ // It cannot be set in combination with
// [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period].
LastPeriodAmount last_period_amount = 2;
}
}
-// Describes a budget amount targeted to the last [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]
+// Describes a budget amount targeted to the last
+// [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]
// spend. At this time, the amount is automatically 100% of the last calendar
// period's spend; that is, there are no other options yet.
// Future configuration options will be described here (for example, configuring
// a percentage of last period's spend).
// LastPeriodAmount cannot be set for a budget configured with
-// a [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period].
-message LastPeriodAmount {
-
-}
+// a
+// [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period].
+message LastPeriodAmount {}
// ThresholdRule contains the definition of a threshold. Threshold rules define
// the triggering events used to generate a budget notification email. When a
@@ -135,7 +138,8 @@ message ThresholdRule {
// Use forecasted spend for the period as the basis for comparison against
// the threshold.
// FORECASTED_SPEND can only be set when the budget's time period is a
- // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. It cannot be set in combination with
+ // [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period].
+ // It cannot be set in combination with
// [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period].
FORECASTED_SPEND = 2;
}
@@ -153,10 +157,10 @@ message ThresholdRule {
// AllUpdatesRule defines notifications that are sent based on budget spend
// and thresholds.
message AllUpdatesRule {
- // Optional. The name of the Pub/Sub topic where budget related messages will be
- // published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
- // are sent at regular intervals to the topic.
- // The topic needs to be created before the budget is created; see
+ // Optional. The name of the Pub/Sub topic where budget related messages will
+ // be published, in the form `projects/{project_id}/topics/{topic_id}`.
+ // Updates are sent at regular intervals to the topic. The topic needs to be
+ // created before the budget is created; see
// https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
// for more details.
// Caller is expected to have
@@ -166,26 +170,31 @@ message AllUpdatesRule {
// for more details on Pub/Sub roles and permissions.
string pubsub_topic = 1 [(google.api.field_behavior) = OPTIONAL];
- // Optional. Required when [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic] is set. The schema version of
- // the notification sent to [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic]. Only "1.0" is
- // accepted. It represents the JSON schema as defined in
+ // Optional. Required when
+ // [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic]
+ // is set. The schema version of the notification sent to
+ // [AllUpdatesRule.pubsub_topic][google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic].
+ // Only "1.0" is accepted. It represents the JSON schema as defined in
// https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format.
string schema_version = 2 [(google.api.field_behavior) = OPTIONAL];
- // Optional. Targets to send notifications to when a threshold is exceeded. This is in
- // addition to default recipients who have billing account IAM roles.
- // The value is the full REST resource name of a monitoring notification
- // channel with the form
+ // Optional. Targets to send notifications to when a threshold is exceeded.
+ // This is in addition to default recipients who have billing account IAM
+ // roles. The value is the full REST resource name of a monitoring
+ // notification channel with the form
// `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
// channels are allowed. See
// https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
// for more details.
- repeated string monitoring_notification_channels = 3 [(google.api.field_behavior) = OPTIONAL];
-
- // Optional. When set to true, disables default notifications sent when a threshold is
- // exceeded. Default notifications are sent to those with Billing Account
- // Administrator and Billing Account User IAM roles for the target account.
- bool disable_default_iam_recipients = 4 [(google.api.field_behavior) = OPTIONAL];
+ repeated string monitoring_notification_channels = 3
+ [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. When set to true, disables default notifications sent when a
+ // threshold is exceeded. Default notifications are sent to those with Billing
+ // Account Administrator and Billing Account User IAM roles for the target
+ // account.
+ bool disable_default_iam_recipients = 4
+ [(google.api.field_behavior) = OPTIONAL];
}
// A filter for a budget, limiting the scope of the cost to calculate.
@@ -217,21 +226,31 @@ message Filter {
// specifying that usage from only this set of projects should be
// included in the budget. If omitted, the report will include all usage for
// the billing account, regardless of which project the usage occurred on.
- // Only zero or one project can be specified currently.
repeated string projects = 1 [(google.api.field_behavior) = OPTIONAL];
- // Optional. If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] is INCLUDE_SPECIFIED_CREDITS, this is
- // a list of credit types to be subtracted from gross cost to determine the
- // spend for threshold calculations. See
- // [a list of acceptable credit type
+ // 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.
+ repeated string resource_ancestors = 2
+ [(google.api.field_behavior) = OPTIONAL];
+
+ // Optional. If
+ // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment]
+ // is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types to be
+ // subtracted from gross cost to determine the spend for threshold
+ // calculations. See [a list of acceptable credit type
// values](https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type).
//
- // If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] is **not** INCLUDE_SPECIFIED_CREDITS,
- // this field must be empty.
+ // If
+ // [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment]
+ // is **not** INCLUDE_SPECIFIED_CREDITS, this field must be empty.
repeated string credit_types = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
- CreditTypesTreatment credit_types_treatment = 4 [(google.api.field_behavior) = OPTIONAL];
+ CreditTypesTreatment credit_types_treatment = 4
+ [(google.api.field_behavior) = OPTIONAL];
// Optional. A set of services of the form `services/{service_id}`,
// specifying that usage from only this set of services should be
@@ -241,24 +260,25 @@ message Filter {
// https://cloud.google.com/billing/v1/how-tos/catalog-api.
repeated string services = 3 [(google.api.field_behavior) = OPTIONAL];
- // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
- // that usage from only this set of subaccounts should be included in the
- // budget. If a subaccount is set to the name of the parent account,
+ // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`,
+ // specifying that usage from only this set of subaccounts should be included
+ // in the budget. If a subaccount is set to the name of the parent account,
// usage from the parent account will be included. If omitted, the
// report will include usage from the parent account and all
// subaccounts, if they exist.
repeated string subaccounts = 5 [(google.api.field_behavior) = OPTIONAL];
- // Optional. A single label and value pair specifying that usage from only this set of
- // labeled resources should be included in the budget. If omitted, the
- // report will include all labeled and unlabeled usage.
+ // Optional. A single label and value pair specifying that usage from only
+ // this set of labeled resources should be included in the budget. If omitted,
+ // the report will include all labeled and unlabeled usage.
//
// An object containing a single `"key": value` pair. Example: `{ "name":
// "wrench" }`.
//
// _Currently, multiple entries or multiple values per entry are not
// allowed._
- map labels = 6 [(google.api.field_behavior) = OPTIONAL];
+ map labels = 6
+ [(google.api.field_behavior) = OPTIONAL];
// Multiple options to choose the budget's time period, specifying that only
// usage that occurs during this time period should be included in the budget.
@@ -272,8 +292,8 @@ message Filter {
// so on.
CalendarPeriod calendar_period = 8 [(google.api.field_behavior) = OPTIONAL];
- // Optional. Specifies to track usage from any start date (required) to any end date
- // (optional). This time period is static, it does not recur.
+ // Optional. Specifies to track usage from any start date (required) to any
+ // end date (optional). This time period is static, it does not recur.
CustomPeriod custom_period = 9 [(google.api.field_behavior) = OPTIONAL];
}
}
@@ -283,9 +303,9 @@ message CustomPeriod {
// Required. The start date must be after January 1, 2017.
google.type.Date start_date = 1 [(google.api.field_behavior) = REQUIRED];
- // Optional. The end date of the time period. Budgets with elapsed end date won't be
- // processed. If unset, specifies to track all usage
- // incurred since the start_date.
+ // Optional. The end date of the time period. Budgets with elapsed end date
+ // won't be processed. If unset, specifies to track all usage incurred since
+ // the start_date.
google.type.Date end_date = 2 [(google.api.field_behavior) = OPTIONAL];
}
diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto
index 674e0a39e70..fd376185da4 100644
--- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto
+++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto
@@ -117,7 +117,8 @@ message UpdateBudgetRequest {
// updated. See
// https://developers.google.com/protocol-buffers/docs/proto3#default for more
// details about default values.
- google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
+ google.protobuf.FieldMask update_mask = 2
+ [(google.api.field_behavior) = OPTIONAL];
}
// Request for GetBudget
diff --git a/packages/google-cloud-billing-budgets/protos/protos.d.ts b/packages/google-cloud-billing-budgets/protos/protos.d.ts
index df36f582aab..e5981d55b1c 100644
--- a/packages/google-cloud-billing-budgets/protos/protos.d.ts
+++ b/packages/google-cloud-billing-budgets/protos/protos.d.ts
@@ -593,6 +593,9 @@ export namespace google {
/** Filter projects */
projects?: (string[]|null);
+ /** Filter resourceAncestors */
+ resourceAncestors?: (string[]|null);
+
/** Filter creditTypes */
creditTypes?: (string[]|null);
@@ -627,6 +630,9 @@ export namespace google {
/** Filter projects. */
public projects: string[];
+ /** Filter resourceAncestors. */
+ public resourceAncestors: string[];
+
/** Filter creditTypes. */
public creditTypes: string[];
@@ -2160,6 +2166,9 @@ export namespace google {
/** Filter projects */
projects?: (string[]|null);
+ /** Filter resourceAncestors */
+ resourceAncestors?: (string[]|null);
+
/** Filter creditTypes */
creditTypes?: (string[]|null);
@@ -2194,6 +2203,9 @@ export namespace google {
/** Filter projects. */
public projects: string[];
+ /** Filter resourceAncestors. */
+ public resourceAncestors: string[];
+
/** Filter creditTypes. */
public creditTypes: string[];
diff --git a/packages/google-cloud-billing-budgets/protos/protos.js b/packages/google-cloud-billing-budgets/protos/protos.js
index 7a57fc7819f..d175895b4e4 100644
--- a/packages/google-cloud-billing-budgets/protos/protos.js
+++ b/packages/google-cloud-billing-budgets/protos/protos.js
@@ -1455,6 +1455,7 @@
* @memberof google.cloud.billing.budgets.v1
* @interface IFilter
* @property {Array.|null} [projects] Filter projects
+ * @property {Array.|null} [resourceAncestors] Filter resourceAncestors
* @property {Array.|null} [creditTypes] Filter creditTypes
* @property {google.cloud.billing.budgets.v1.Filter.CreditTypesTreatment|null} [creditTypesTreatment] Filter creditTypesTreatment
* @property {Array.|null} [services] Filter services
@@ -1474,6 +1475,7 @@
*/
function Filter(properties) {
this.projects = [];
+ this.resourceAncestors = [];
this.creditTypes = [];
this.services = [];
this.subaccounts = [];
@@ -1492,6 +1494,14 @@
*/
Filter.prototype.projects = $util.emptyArray;
+ /**
+ * Filter resourceAncestors.
+ * @member {Array.} resourceAncestors
+ * @memberof google.cloud.billing.budgets.v1.Filter
+ * @instance
+ */
+ Filter.prototype.resourceAncestors = $util.emptyArray;
+
/**
* Filter creditTypes.
* @member {Array.} creditTypes
@@ -1589,6 +1599,9 @@
if (message.projects != null && message.projects.length)
for (var i = 0; i < message.projects.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).string(message.projects[i]);
+ if (message.resourceAncestors != null && message.resourceAncestors.length)
+ for (var i = 0; i < message.resourceAncestors.length; ++i)
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAncestors[i]);
if (message.services != null && message.services.length)
for (var i = 0; i < message.services.length; ++i)
writer.uint32(/* id 3, wireType 2 =*/26).string(message.services[i]);
@@ -1649,6 +1662,12 @@
message.projects.push(reader.string());
break;
}
+ case 2: {
+ if (!(message.resourceAncestors && message.resourceAncestors.length))
+ message.resourceAncestors = [];
+ message.resourceAncestors.push(reader.string());
+ break;
+ }
case 7: {
if (!(message.creditTypes && message.creditTypes.length))
message.creditTypes = [];
@@ -1745,6 +1764,13 @@
if (!$util.isString(message.projects[i]))
return "projects: string[] expected";
}
+ if (message.resourceAncestors != null && message.hasOwnProperty("resourceAncestors")) {
+ if (!Array.isArray(message.resourceAncestors))
+ return "resourceAncestors: array expected";
+ for (var i = 0; i < message.resourceAncestors.length; ++i)
+ if (!$util.isString(message.resourceAncestors[i]))
+ return "resourceAncestors: string[] expected";
+ }
if (message.creditTypes != null && message.hasOwnProperty("creditTypes")) {
if (!Array.isArray(message.creditTypes))
return "creditTypes: array expected";
@@ -1830,6 +1856,13 @@
for (var i = 0; i < object.projects.length; ++i)
message.projects[i] = String(object.projects[i]);
}
+ if (object.resourceAncestors) {
+ if (!Array.isArray(object.resourceAncestors))
+ throw TypeError(".google.cloud.billing.budgets.v1.Filter.resourceAncestors: array expected");
+ message.resourceAncestors = [];
+ for (var i = 0; i < object.resourceAncestors.length; ++i)
+ message.resourceAncestors[i] = String(object.resourceAncestors[i]);
+ }
if (object.creditTypes) {
if (!Array.isArray(object.creditTypes))
throw TypeError(".google.cloud.billing.budgets.v1.Filter.creditTypes: array expected");
@@ -1932,6 +1965,7 @@
var object = {};
if (options.arrays || options.defaults) {
object.projects = [];
+ object.resourceAncestors = [];
object.services = [];
object.subaccounts = [];
object.creditTypes = [];
@@ -1945,6 +1979,11 @@
for (var j = 0; j < message.projects.length; ++j)
object.projects[j] = message.projects[j];
}
+ if (message.resourceAncestors && message.resourceAncestors.length) {
+ object.resourceAncestors = [];
+ for (var j = 0; j < message.resourceAncestors.length; ++j)
+ object.resourceAncestors[j] = message.resourceAncestors[j];
+ }
if (message.services && message.services.length) {
object.services = [];
for (var j = 0; j < message.services.length; ++j)
@@ -5248,6 +5287,7 @@
* @memberof google.cloud.billing.budgets.v1beta1
* @interface IFilter
* @property {Array.|null} [projects] Filter projects
+ * @property {Array.|null} [resourceAncestors] Filter resourceAncestors
* @property {Array.|null} [creditTypes] Filter creditTypes
* @property {google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment|null} [creditTypesTreatment] Filter creditTypesTreatment
* @property {Array.|null} [services] Filter services
@@ -5267,6 +5307,7 @@
*/
function Filter(properties) {
this.projects = [];
+ this.resourceAncestors = [];
this.creditTypes = [];
this.services = [];
this.subaccounts = [];
@@ -5285,6 +5326,14 @@
*/
Filter.prototype.projects = $util.emptyArray;
+ /**
+ * Filter resourceAncestors.
+ * @member {Array.} resourceAncestors
+ * @memberof google.cloud.billing.budgets.v1beta1.Filter
+ * @instance
+ */
+ Filter.prototype.resourceAncestors = $util.emptyArray;
+
/**
* Filter creditTypes.
* @member {Array.} creditTypes
@@ -5382,6 +5431,9 @@
if (message.projects != null && message.projects.length)
for (var i = 0; i < message.projects.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).string(message.projects[i]);
+ if (message.resourceAncestors != null && message.resourceAncestors.length)
+ for (var i = 0; i < message.resourceAncestors.length; ++i)
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceAncestors[i]);
if (message.services != null && message.services.length)
for (var i = 0; i < message.services.length; ++i)
writer.uint32(/* id 3, wireType 2 =*/26).string(message.services[i]);
@@ -5442,6 +5494,12 @@
message.projects.push(reader.string());
break;
}
+ case 2: {
+ if (!(message.resourceAncestors && message.resourceAncestors.length))
+ message.resourceAncestors = [];
+ message.resourceAncestors.push(reader.string());
+ break;
+ }
case 7: {
if (!(message.creditTypes && message.creditTypes.length))
message.creditTypes = [];
@@ -5538,6 +5596,13 @@
if (!$util.isString(message.projects[i]))
return "projects: string[] expected";
}
+ if (message.resourceAncestors != null && message.hasOwnProperty("resourceAncestors")) {
+ if (!Array.isArray(message.resourceAncestors))
+ return "resourceAncestors: array expected";
+ for (var i = 0; i < message.resourceAncestors.length; ++i)
+ if (!$util.isString(message.resourceAncestors[i]))
+ return "resourceAncestors: string[] expected";
+ }
if (message.creditTypes != null && message.hasOwnProperty("creditTypes")) {
if (!Array.isArray(message.creditTypes))
return "creditTypes: array expected";
@@ -5623,6 +5688,13 @@
for (var i = 0; i < object.projects.length; ++i)
message.projects[i] = String(object.projects[i]);
}
+ if (object.resourceAncestors) {
+ if (!Array.isArray(object.resourceAncestors))
+ throw TypeError(".google.cloud.billing.budgets.v1beta1.Filter.resourceAncestors: array expected");
+ message.resourceAncestors = [];
+ for (var i = 0; i < object.resourceAncestors.length; ++i)
+ message.resourceAncestors[i] = String(object.resourceAncestors[i]);
+ }
if (object.creditTypes) {
if (!Array.isArray(object.creditTypes))
throw TypeError(".google.cloud.billing.budgets.v1beta1.Filter.creditTypes: array expected");
@@ -5725,6 +5797,7 @@
var object = {};
if (options.arrays || options.defaults) {
object.projects = [];
+ object.resourceAncestors = [];
object.services = [];
object.subaccounts = [];
object.creditTypes = [];
@@ -5738,6 +5811,11 @@
for (var j = 0; j < message.projects.length; ++j)
object.projects[j] = message.projects[j];
}
+ if (message.resourceAncestors && message.resourceAncestors.length) {
+ object.resourceAncestors = [];
+ for (var j = 0; j < message.resourceAncestors.length; ++j)
+ object.resourceAncestors[j] = message.resourceAncestors[j];
+ }
if (message.services && message.services.length) {
object.services = [];
for (var j = 0; j < message.services.length; ++j)
diff --git a/packages/google-cloud-billing-budgets/protos/protos.json b/packages/google-cloud-billing-budgets/protos/protos.json
index c4df91f27c2..534119db772 100644
--- a/packages/google-cloud-billing-budgets/protos/protos.json
+++ b/packages/google-cloud-billing-budgets/protos/protos.json
@@ -172,6 +172,14 @@
"(google.api.field_behavior)": "OPTIONAL"
}
},
+ "resourceAncestors": {
+ "rule": "repeated",
+ "type": "string",
+ "id": 2,
+ "options": {
+ "(google.api.field_behavior)": "OPTIONAL"
+ }
+ },
"creditTypes": {
"rule": "repeated",
"type": "string",
@@ -630,6 +638,14 @@
"(google.api.field_behavior)": "OPTIONAL"
}
},
+ "resourceAncestors": {
+ "rule": "repeated",
+ "type": "string",
+ "id": 2,
+ "options": {
+ "(google.api.field_behavior)": "OPTIONAL"
+ }
+ },
"creditTypes": {
"rule": "repeated",
"type": "string",
diff --git a/packages/google-cloud-billing-budgets/samples/README.md b/packages/google-cloud-billing-budgets/samples/README.md
index a0b7c639501..8a486b2533c 100644
--- a/packages/google-cloud-billing-budgets/samples/README.md
+++ b/packages/google-cloud-billing-budgets/samples/README.md
@@ -23,7 +23,6 @@
* [Budget_service.list_budgets](#budget_service.list_budgets)
* [Budget_service.update_budget](#budget_service.update_budget)
* [Quickstart](#quickstart)
- * [Quickstart.test](#quickstart.test)
## Before you begin
@@ -222,23 +221,6 @@ __Usage:__
`node packages/google-cloud-billing-budgets/samples/quickstart.js`
------
-
-
-
-
-### Quickstart.test
-
-View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-billing-budgets/samples/test/quickstart.test.js).
-
-[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-billing-budgets/samples/test/quickstart.test.js,samples/README.md)
-
-__Usage:__
-
-
-`node packages/google-cloud-billing-budgets/samples/test/quickstart.test.js`
-
-
diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json b/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json
index 16e159d67a9..04fe96bb576 100644
--- a/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json
+++ b/packages/google-cloud-billing-budgets/samples/generated/v1/snippet_metadata.google.cloud.billing.budgets.v1.json
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-budgets",
- "version": "4.2.1",
+ "version": "4.2.2",
"language": "TYPESCRIPT",
"apis": [
{
diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json
index 30a311c8cf4..d7b9d449e1c 100644
--- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json
+++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/snippet_metadata.google.cloud.billing.budgets.v1beta1.json
@@ -1,7 +1,7 @@
{
"clientLibrary": {
"name": "nodejs-budgets",
- "version": "4.2.1",
+ "version": "4.2.2",
"language": "TYPESCRIPT",
"apis": [
{