Skip to content

Commit

Permalink
feat: [billingbudgets] Supported project-level-budgets in Public Budg…
Browse files Browse the repository at this point in the history
…et API V1 (#9777)

- [ ] Regenerate this pull request now.

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

Source-Link: https://togithub.com/googleapis/googleapis/commit/113867b53b015c1f951e0e4e515756f221abc0a2

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/017d177f51469d150417b7b6a45d99d9963f7813
Copy-Tag: eyJwIjoiamF2YS1iaWxsaW5nYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiMDE3ZDE3N2Y1MTQ2OWQxNTA0MTdiN2I2YTQ1ZDk5ZDk5NjNmNzgxMyJ9

BEGIN_NESTED_COMMIT
feat: [billingbudgets] Supported project-level-budgets in Public Budget API V1Beta
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: 559151636

Source-Link: https://togithub.com/googleapis/googleapis/commit/138b0f1265518d46c9f65403fe6ddd163f2757af

Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/41c0ba899f76cbbfacddeccf7c769747acafe26d
Copy-Tag: eyJwIjoiamF2YS1iaWxsaW5nYnVkZ2V0cy8uT3dsQm90LnlhbWwiLCJoIjoiNDFjMGJhODk5Zjc2Y2JiZmFjZGRlY2NmN2M3Njk3NDdhY2FmZTI2ZCJ9
END_NESTED_COMMIT
  • Loading branch information
gcf-owl-bot[bot] committed Aug 30, 2023
1 parent 12a9af7 commit 5fc8016
Show file tree
Hide file tree
Showing 31 changed files with 1,141 additions and 222 deletions.
4 changes: 2 additions & 2 deletions java-billingbudgets/README.md
Expand Up @@ -20,7 +20,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>26.19.0</version>
<version>26.22.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-billingbudgets.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-billingbudgets/2.21.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-billingbudgets/2.23.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Expand Up @@ -614,6 +614,7 @@ public final ListBudgetsPagedResponse listBudgets(String parent) {
* ListBudgetsRequest request =
* ListBudgetsRequest.newBuilder()
* .setParent(BillingAccountName.of("[BILLING_ACCOUNT]").toString())
* .setScope("scope109264468")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
Expand Down Expand Up @@ -650,6 +651,7 @@ public final ListBudgetsPagedResponse listBudgets(ListBudgetsRequest request) {
* ListBudgetsRequest request =
* ListBudgetsRequest.newBuilder()
* .setParent(BillingAccountName.of("[BILLING_ACCOUNT]").toString())
* .setScope("scope109264468")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
Expand Down Expand Up @@ -686,6 +688,7 @@ public final ListBudgetsPagedResponse listBudgets(ListBudgetsRequest request) {
* ListBudgetsRequest request =
* ListBudgetsRequest.newBuilder()
* .setParent(BillingAccountName.of("[BILLING_ACCOUNT]").toString())
* .setScope("scope109264468")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
Expand Down
Expand Up @@ -192,6 +192,7 @@ public class HttpJsonBudgetServiceStub extends BudgetServiceStub {
ProtoRestSerializer.create();
serializer.putQueryParam(fields, "pageSize", request.getPageSize());
serializer.putQueryParam(fields, "pageToken", request.getPageToken());
serializer.putQueryParam(fields, "scope", request.getScope());
serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int");
return fields;
})
Expand Down
Expand Up @@ -370,6 +370,7 @@ public final UnaryCallable<GetBudgetRequest, Budget> getBudgetCallable() {
* ListBudgetsRequest request =
* ListBudgetsRequest.newBuilder()
* .setParent(BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]").toString())
* .setScope("scope109264468")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
Expand Down Expand Up @@ -406,6 +407,7 @@ public final ListBudgetsPagedResponse listBudgets(ListBudgetsRequest request) {
* ListBudgetsRequest request =
* ListBudgetsRequest.newBuilder()
* .setParent(BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]").toString())
* .setScope("scope109264468")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
Expand Down Expand Up @@ -442,6 +444,7 @@ public final ListBudgetsPagedResponse listBudgets(ListBudgetsRequest request) {
* ListBudgetsRequest request =
* ListBudgetsRequest.newBuilder()
* .setParent(BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]").toString())
* .setScope("scope109264468")
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
Expand Down
Expand Up @@ -250,6 +250,7 @@ public void listBudgetsTest() throws Exception {
ListBudgetsRequest request =
ListBudgetsRequest.newBuilder()
.setParent(BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]").toString())
.setScope("scope109264468")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
Expand All @@ -266,6 +267,7 @@ public void listBudgetsTest() throws Exception {
ListBudgetsRequest actualRequest = ((ListBudgetsRequest) actualRequests.get(0));

Assert.assertEquals(request.getParent(), actualRequest.getParent());
Assert.assertEquals(request.getScope(), actualRequest.getScope());
Assert.assertEquals(request.getPageSize(), actualRequest.getPageSize());
Assert.assertEquals(request.getPageToken(), actualRequest.getPageToken());
Assert.assertTrue(
Expand All @@ -283,6 +285,7 @@ public void listBudgetsExceptionTest() throws Exception {
ListBudgetsRequest request =
ListBudgetsRequest.newBuilder()
.setParent(BudgetName.of("[BILLING_ACCOUNT]", "[BUDGET]").toString())
.setScope("scope109264468")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
Expand Down
Expand Up @@ -95,37 +95,38 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ ".cloud.billing.budgets.v1.ThresholdRule."
+ "BasisB\004\342A\001\001\"G\n\005Basis\022\025\n\021BASIS_UNSPECIFIE"
+ "D\020\000\022\021\n\rCURRENT_SPEND\020\001\022\024\n\020FORECASTED_SPE"
+ "ND\020\002\"\253\001\n\021NotificationsRule\022\032\n\014pubsub_top"
+ "ND\020\002\"\332\001\n\021NotificationsRule\022\032\n\014pubsub_top"
+ "ic\030\001 \001(\tB\004\342A\001\001\022\034\n\016schema_version\030\002 \001(\tB\004"
+ "\342A\001\001\022.\n monitoring_notification_channels"
+ "\030\003 \003(\tB\004\342A\001\001\022,\n\036disable_default_iam_reci"
+ "pients\030\004 \001(\010B\004\342A\001\001\"\315\005\n\006Filter\022\026\n\010project"
+ "s\030\001 \003(\tB\004\342A\001\001\022 \n\022resource_ancestors\030\002 \003("
+ "\tB\004\342A\001\001\022\032\n\014credit_types\030\007 \003(\tB\004\342A\001\001\022b\n\026c"
+ "redit_types_treatment\030\004 \001(\0162<.google.clo"
+ "ud.billing.budgets.v1.Filter.CreditTypes"
+ "TreatmentB\004\342A\001\001\022\026\n\010services\030\003 \003(\tB\004\342A\001\001\022"
+ "\031\n\013subaccounts\030\005 \003(\tB\004\342A\001\001\022I\n\006labels\030\006 \003"
+ "(\01323.google.cloud.billing.budgets.v1.Fil"
+ "ter.LabelsEntryB\004\342A\001\001\022P\n\017calendar_period"
+ "\030\010 \001(\0162/.google.cloud.billing.budgets.v1"
+ ".CalendarPeriodB\004\342A\001\001H\000\022L\n\rcustom_period"
+ "\030\t \001(\0132-.google.cloud.billing.budgets.v1"
+ ".CustomPeriodB\004\342A\001\001H\000\032I\n\013LabelsEntry\022\013\n\003"
+ "key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.google.protob"
+ "uf.ListValue:\0028\001\"\217\001\n\024CreditTypesTreatmen"
+ "t\022&\n\"CREDIT_TYPES_TREATMENT_UNSPECIFIED\020"
+ "\000\022\027\n\023INCLUDE_ALL_CREDITS\020\001\022\027\n\023EXCLUDE_AL"
+ "L_CREDITS\020\002\022\035\n\031INCLUDE_SPECIFIED_CREDITS"
+ "\020\003B\016\n\014usage_period\"f\n\014CustomPeriod\022+\n\nst"
+ "art_date\030\001 \001(\0132\021.google.type.DateB\004\342A\001\002\022"
+ ")\n\010end_date\030\002 \001(\0132\021.google.type.DateB\004\342A"
+ "\001\001*S\n\016CalendarPeriod\022\037\n\033CALENDAR_PERIOD_"
+ "UNSPECIFIED\020\000\022\t\n\005MONTH\020\001\022\013\n\007QUARTER\020\002\022\010\n"
+ "\004YEAR\020\003Bx\n#com.google.cloud.billing.budg"
+ "ets.v1B\020BudgetModelProtoP\001Z=cloud.google"
+ ".com/go/billing/budgets/apiv1/budgetspb;"
+ "budgetspbb\006proto3"
+ "pients\030\004 \001(\010B\004\342A\001\001\022-\n\037enable_project_lev"
+ "el_recipients\030\005 \001(\010B\004\342A\001\001\"\315\005\n\006Filter\022\026\n\010"
+ "projects\030\001 \003(\tB\004\342A\001\001\022 \n\022resource_ancesto"
+ "rs\030\002 \003(\tB\004\342A\001\001\022\032\n\014credit_types\030\007 \003(\tB\004\342A"
+ "\001\001\022b\n\026credit_types_treatment\030\004 \001(\0162<.goo"
+ "gle.cloud.billing.budgets.v1.Filter.Cred"
+ "itTypesTreatmentB\004\342A\001\001\022\026\n\010services\030\003 \003(\t"
+ "B\004\342A\001\001\022\031\n\013subaccounts\030\005 \003(\tB\004\342A\001\001\022I\n\006lab"
+ "els\030\006 \003(\01323.google.cloud.billing.budgets"
+ ".v1.Filter.LabelsEntryB\004\342A\001\001\022P\n\017calendar"
+ "_period\030\010 \001(\0162/.google.cloud.billing.bud"
+ "gets.v1.CalendarPeriodB\004\342A\001\001H\000\022L\n\rcustom"
+ "_period\030\t \001(\0132-.google.cloud.billing.bud"
+ "gets.v1.CustomPeriodB\004\342A\001\001H\000\032I\n\013LabelsEn"
+ "try\022\013\n\003key\030\001 \001(\t\022)\n\005value\030\002 \001(\0132\032.google"
+ ".protobuf.ListValue:\0028\001\"\217\001\n\024CreditTypesT"
+ "reatment\022&\n\"CREDIT_TYPES_TREATMENT_UNSPE"
+ "CIFIED\020\000\022\027\n\023INCLUDE_ALL_CREDITS\020\001\022\027\n\023EXC"
+ "LUDE_ALL_CREDITS\020\002\022\035\n\031INCLUDE_SPECIFIED_"
+ "CREDITS\020\003B\016\n\014usage_period\"f\n\014CustomPerio"
+ "d\022+\n\nstart_date\030\001 \001(\0132\021.google.type.Date"
+ "B\004\342A\001\002\022)\n\010end_date\030\002 \001(\0132\021.google.type.D"
+ "ateB\004\342A\001\001*S\n\016CalendarPeriod\022\037\n\033CALENDAR_"
+ "PERIOD_UNSPECIFIED\020\000\022\t\n\005MONTH\020\001\022\013\n\007QUART"
+ "ER\020\002\022\010\n\004YEAR\020\003Bx\n#com.google.cloud.billi"
+ "ng.budgets.v1B\020BudgetModelProtoP\001Z=cloud"
+ ".google.com/go/billing/budgets/apiv1/bud"
+ "getspb;budgetspbb\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down Expand Up @@ -183,6 +184,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
"SchemaVersion",
"MonitoringNotificationChannels",
"DisableDefaultIamRecipients",
"EnableProjectLevelRecipients",
});
internal_static_google_cloud_billing_budgets_v1_Filter_descriptor =
getDescriptor().getMessageTypes().get(5);
Expand Down
Expand Up @@ -77,44 +77,44 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
+ "date_mask\030\002 \001(\0132\032.google.protobuf.FieldM"
+ "askB\004\342A\001\001\"O\n\020GetBudgetRequest\022;\n\004name\030\001 "
+ "\001(\tB-\342A\001\002\372A&\n$billingbudgets.googleapis."
+ "com/Budget\"\206\001\n\022ListBudgetsRequest\022=\n\006par"
+ "com/Budget\"\233\001\n\022ListBudgetsRequest\022=\n\006par"
+ "ent\030\001 \001(\tB-\342A\001\002\372A&\022$billingbudgets.googl"
+ "eapis.com/Budget\022\027\n\tpage_size\030\002 \001(\005B\004\342A\001"
+ "\001\022\030\n\npage_token\030\003 \001(\tB\004\342A\001\001\"h\n\023ListBudge"
+ "tsResponse\0228\n\007budgets\030\001 \003(\0132\'.google.clo"
+ "ud.billing.budgets.v1.Budget\022\027\n\017next_pag"
+ "e_token\030\002 \001(\t\"R\n\023DeleteBudgetRequest\022;\n\004"
+ "name\030\001 \001(\tB-\342A\001\002\372A&\n$billingbudgets.goog"
+ "leapis.com/Budget2\367\007\n\rBudgetService\022\265\001\n\014"
+ "CreateBudget\0224.google.cloud.billing.budg"
+ "ets.v1.CreateBudgetRequest\032\'.google.clou"
+ "d.billing.budgets.v1.Budget\"F\332A\rparent,b"
+ "udget\202\323\344\223\0020\"&/v1/{parent=billingAccounts"
+ "/*}/budgets:\006budget\022\301\001\n\014UpdateBudget\0224.g"
+ "oogle.cloud.billing.budgets.v1.UpdateBud"
+ "getRequest\032\'.google.cloud.billing.budget"
+ "s.v1.Budget\"R\332A\022budget,update_mask\202\323\344\223\0027"
+ "2-/v1/{budget.name=billingAccounts/*/bud"
+ "gets/*}:\006budget\022\236\001\n\tGetBudget\0221.google.c"
+ "loud.billing.budgets.v1.GetBudgetRequest"
+ "\032\'.google.cloud.billing.budgets.v1.Budge"
+ "t\"5\332A\004name\202\323\344\223\002(\022&/v1/{name=billingAccou"
+ "nts/*/budgets/*}\022\261\001\n\013ListBudgets\0223.googl"
+ "e.cloud.billing.budgets.v1.ListBudgetsRe"
+ "quest\0324.google.cloud.billing.budgets.v1."
+ "ListBudgetsResponse\"7\332A\006parent\202\323\344\223\002(\022&/v"
+ "1/{parent=billingAccounts/*}/budgets\022\223\001\n"
+ "\014DeleteBudget\0224.google.cloud.billing.bud"
+ "gets.v1.DeleteBudgetRequest\032\026.google.pro"
+ "tobuf.Empty\"5\332A\004name\202\323\344\223\002(*&/v1/{name=bi"
+ "llingAccounts/*/budgets/*}\032\177\312A\035billingbu"
+ "dgets.googleapis.com\322A\\https://www.googl"
+ "eapis.com/auth/cloud-billing,https://www"
+ ".googleapis.com/auth/cloud-platformBz\n#c"
+ "om.google.cloud.billing.budgets.v1B\022Budg"
+ "etServiceProtoP\001Z=cloud.google.com/go/bi"
+ "lling/budgets/apiv1/budgetspb;budgetspbb"
+ "\006proto3"
+ "eapis.com/Budget\022\023\n\005scope\030\004 \001(\tB\004\342A\001\001\022\027\n"
+ "\tpage_size\030\002 \001(\005B\004\342A\001\001\022\030\n\npage_token\030\003 \001"
+ "(\tB\004\342A\001\001\"h\n\023ListBudgetsResponse\0228\n\007budge"
+ "ts\030\001 \003(\0132\'.google.cloud.billing.budgets."
+ "v1.Budget\022\027\n\017next_page_token\030\002 \001(\t\"R\n\023De"
+ "leteBudgetRequest\022;\n\004name\030\001 \001(\tB-\342A\001\002\372A&"
+ "\n$billingbudgets.googleapis.com/Budget2\367"
+ "\007\n\rBudgetService\022\265\001\n\014CreateBudget\0224.goog"
+ "le.cloud.billing.budgets.v1.CreateBudget"
+ "Request\032\'.google.cloud.billing.budgets.v"
+ "1.Budget\"F\332A\rparent,budget\202\323\344\223\0020\"&/v1/{p"
+ "arent=billingAccounts/*}/budgets:\006budget"
+ "\022\301\001\n\014UpdateBudget\0224.google.cloud.billing"
+ ".budgets.v1.UpdateBudgetRequest\032\'.google"
+ ".cloud.billing.budgets.v1.Budget\"R\332A\022bud"
+ "get,update_mask\202\323\344\223\00272-/v1/{budget.name="
+ "billingAccounts/*/budgets/*}:\006budget\022\236\001\n"
+ "\tGetBudget\0221.google.cloud.billing.budget"
+ "s.v1.GetBudgetRequest\032\'.google.cloud.bil"
+ "ling.budgets.v1.Budget\"5\332A\004name\202\323\344\223\002(\022&/"
+ "v1/{name=billingAccounts/*/budgets/*}\022\261\001"
+ "\n\013ListBudgets\0223.google.cloud.billing.bud"
+ "gets.v1.ListBudgetsRequest\0324.google.clou"
+ "d.billing.budgets.v1.ListBudgetsResponse"
+ "\"7\332A\006parent\202\323\344\223\002(\022&/v1/{parent=billingAc"
+ "counts/*}/budgets\022\223\001\n\014DeleteBudget\0224.goo"
+ "gle.cloud.billing.budgets.v1.DeleteBudge"
+ "tRequest\032\026.google.protobuf.Empty\"5\332A\004nam"
+ "e\202\323\344\223\002(*&/v1/{name=billingAccounts/*/bud"
+ "gets/*}\032\177\312A\035billingbudgets.googleapis.co"
+ "m\322A\\https://www.googleapis.com/auth/clou"
+ "d-billing,https://www.googleapis.com/aut"
+ "h/cloud-platformBz\n#com.google.cloud.bil"
+ "ling.budgets.v1B\022BudgetServiceProtoP\001Z=c"
+ "loud.google.com/go/billing/budgets/apiv1"
+ "/budgetspb;budgetspbb\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
Expand Down Expand Up @@ -158,7 +158,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_billing_budgets_v1_ListBudgetsRequest_descriptor,
new java.lang.String[] {
"Parent", "PageSize", "PageToken",
"Parent", "Scope", "PageSize", "PageToken",
});
internal_static_google_cloud_billing_budgets_v1_ListBudgetsResponse_descriptor =
getDescriptor().getMessageTypes().get(4);
Expand Down

0 comments on commit 5fc8016

Please sign in to comment.