budget_service.proto 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.billing.budgets.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/billing/budgets/v1beta1/budget_model.proto";
  21. import "google/protobuf/empty.proto";
  22. import "google/protobuf/field_mask.proto";
  23. option go_package = "google.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets";
  24. option java_multiple_files = true;
  25. option java_package = "com.google.cloud.billing.budgets.v1beta1";
  26. // BudgetService stores Cloud Billing budgets, which define a
  27. // budget plan and rules to execute as we track spend against that plan.
  28. service BudgetService {
  29. option (google.api.default_host) = "billingbudgets.googleapis.com";
  30. option (google.api.oauth_scopes) =
  31. "https://www.googleapis.com/auth/cloud-billing,"
  32. "https://www.googleapis.com/auth/cloud-platform";
  33. // Creates a new budget. See
  34. // [Quotas and limits](https://cloud.google.com/billing/quotas)
  35. // for more information on the limits of the number of budgets you can create.
  36. rpc CreateBudget(CreateBudgetRequest) returns (Budget) {
  37. option (google.api.http) = {
  38. post: "/v1beta1/{parent=billingAccounts/*}/budgets"
  39. body: "*"
  40. };
  41. }
  42. // Updates a budget and returns the updated budget.
  43. //
  44. // WARNING: There are some fields exposed on the Google Cloud Console that
  45. // aren't available on this API. Budget fields that are not exposed in
  46. // this API will not be changed by this method.
  47. rpc UpdateBudget(UpdateBudgetRequest) returns (Budget) {
  48. option (google.api.http) = {
  49. patch: "/v1beta1/{budget.name=billingAccounts/*/budgets/*}"
  50. body: "*"
  51. };
  52. }
  53. // Returns a budget.
  54. //
  55. // WARNING: There are some fields exposed on the Google Cloud Console that
  56. // aren't available on this API. When reading from the API, you will not
  57. // see these fields in the return value, though they may have been set
  58. // in the Cloud Console.
  59. rpc GetBudget(GetBudgetRequest) returns (Budget) {
  60. option (google.api.http) = {
  61. get: "/v1beta1/{name=billingAccounts/*/budgets/*}"
  62. };
  63. }
  64. // Returns a list of budgets for a billing account.
  65. //
  66. // WARNING: There are some fields exposed on the Google Cloud Console that
  67. // aren't available on this API. When reading from the API, you will not
  68. // see these fields in the return value, though they may have been set
  69. // in the Cloud Console.
  70. rpc ListBudgets(ListBudgetsRequest) returns (ListBudgetsResponse) {
  71. option (google.api.http) = {
  72. get: "/v1beta1/{parent=billingAccounts/*}/budgets"
  73. };
  74. }
  75. // Deletes a budget. Returns successfully if already deleted.
  76. rpc DeleteBudget(DeleteBudgetRequest) returns (google.protobuf.Empty) {
  77. option (google.api.http) = {
  78. delete: "/v1beta1/{name=billingAccounts/*/budgets/*}"
  79. };
  80. }
  81. }
  82. // Request for CreateBudget
  83. message CreateBudgetRequest {
  84. // Required. The name of the billing account to create the budget in. Values
  85. // are of the form `billingAccounts/{billingAccountId}`.
  86. string parent = 1 [
  87. (google.api.field_behavior) = REQUIRED,
  88. (google.api.resource_reference) = {
  89. child_type: "billingbudgets.googleapis.com/Budget"
  90. }
  91. ];
  92. // Required. Budget to create.
  93. Budget budget = 2 [(google.api.field_behavior) = REQUIRED];
  94. }
  95. // Request for UpdateBudget
  96. message UpdateBudgetRequest {
  97. // Required. The updated budget object.
  98. // The budget to update is specified by the budget name in the budget.
  99. Budget budget = 1 [(google.api.field_behavior) = REQUIRED];
  100. // Optional. Indicates which fields in the provided budget to update.
  101. // Read-only fields (such as `name`) cannot be changed. If this is not
  102. // provided, then only fields with non-default values from the request are
  103. // updated. See
  104. // https://developers.google.com/protocol-buffers/docs/proto3#default for more
  105. // details about default values.
  106. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL];
  107. }
  108. // Request for GetBudget
  109. message GetBudgetRequest {
  110. // Required. Name of budget to get. Values are of the form
  111. // `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
  112. string name = 1 [
  113. (google.api.field_behavior) = REQUIRED,
  114. (google.api.resource_reference) = {
  115. type: "billingbudgets.googleapis.com/Budget"
  116. }
  117. ];
  118. }
  119. // Request for ListBudgets
  120. message ListBudgetsRequest {
  121. // Required. Name of billing account to list budgets under. Values
  122. // are of the form `billingAccounts/{billingAccountId}`.
  123. string parent = 1 [
  124. (google.api.field_behavior) = REQUIRED,
  125. (google.api.resource_reference) = {
  126. child_type: "billingbudgets.googleapis.com/Budget"
  127. }
  128. ];
  129. // Optional. The maximum number of budgets to return per page.
  130. // The default and maximum value are 100.
  131. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  132. // Optional. The value returned by the last `ListBudgetsResponse` which
  133. // indicates that this is a continuation of a prior `ListBudgets` call,
  134. // and that the system should return the next page of data.
  135. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  136. }
  137. // Response for ListBudgets
  138. message ListBudgetsResponse {
  139. // List of the budgets owned by the requested billing account.
  140. repeated Budget budgets = 1;
  141. // If not empty, indicates that there may be more budgets that match the
  142. // request; this value should be passed in a new `ListBudgetsRequest`.
  143. string next_page_token = 2;
  144. }
  145. // Request for DeleteBudget
  146. message DeleteBudgetRequest {
  147. // Required. Name of the budget to delete. Values are of the form
  148. // `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
  149. string name = 1 [
  150. (google.api.field_behavior) = REQUIRED,
  151. (google.api.resource_reference) = {
  152. type: "billingbudgets.googleapis.com/Budget"
  153. }
  154. ];
  155. }