budget_service.proto 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. // Copyright 2021 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.v1;
  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/v1/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/v1;budgets";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "BudgetServiceProto";
  26. option java_package = "com.google.cloud.billing.budgets.v1";
  27. // BudgetService stores Cloud Billing budgets, which define a
  28. // budget plan and rules to execute as we track spend against that plan.
  29. service BudgetService {
  30. option (google.api.default_host) = "billingbudgets.googleapis.com";
  31. option (google.api.oauth_scopes) =
  32. "https://www.googleapis.com/auth/cloud-billing,"
  33. "https://www.googleapis.com/auth/cloud-platform";
  34. // Creates a new budget. See
  35. // [Quotas and limits](https://cloud.google.com/billing/quotas)
  36. // for more information on the limits of the number of budgets you can create.
  37. rpc CreateBudget(CreateBudgetRequest) returns (Budget) {
  38. option (google.api.http) = {
  39. post: "/v1/{parent=billingAccounts/*}/budgets"
  40. body: "budget"
  41. };
  42. option (google.api.method_signature) = "parent,budget";
  43. }
  44. // Updates a budget and returns the updated budget.
  45. //
  46. // WARNING: There are some fields exposed on the Google Cloud Console that
  47. // aren't available on this API. Budget fields that are not exposed in
  48. // this API will not be changed by this method.
  49. rpc UpdateBudget(UpdateBudgetRequest) returns (Budget) {
  50. option (google.api.http) = {
  51. patch: "/v1/{budget.name=billingAccounts/*/budgets/*}"
  52. body: "budget"
  53. };
  54. option (google.api.method_signature) = "budget,update_mask";
  55. }
  56. // Returns a budget.
  57. //
  58. // WARNING: There are some fields exposed on the Google Cloud Console that
  59. // aren't available on this API. When reading from the API, you will not
  60. // see these fields in the return value, though they may have been set
  61. // in the Cloud Console.
  62. rpc GetBudget(GetBudgetRequest) returns (Budget) {
  63. option (google.api.http) = {
  64. get: "/v1/{name=billingAccounts/*/budgets/*}"
  65. };
  66. option (google.api.method_signature) = "name";
  67. }
  68. // Returns a list of budgets for a billing account.
  69. //
  70. // WARNING: There are some fields exposed on the Google Cloud Console that
  71. // aren't available on this API. When reading from the API, you will not
  72. // see these fields in the return value, though they may have been set
  73. // in the Cloud Console.
  74. rpc ListBudgets(ListBudgetsRequest) returns (ListBudgetsResponse) {
  75. option (google.api.http) = {
  76. get: "/v1/{parent=billingAccounts/*}/budgets"
  77. };
  78. option (google.api.method_signature) = "parent";
  79. }
  80. // Deletes a budget. Returns successfully if already deleted.
  81. rpc DeleteBudget(DeleteBudgetRequest) returns (google.protobuf.Empty) {
  82. option (google.api.http) = {
  83. delete: "/v1/{name=billingAccounts/*/budgets/*}"
  84. };
  85. option (google.api.method_signature) = "name";
  86. }
  87. }
  88. // Request for CreateBudget
  89. message CreateBudgetRequest {
  90. // Required. The name of the billing account to create the budget in. Values
  91. // are of the form `billingAccounts/{billingAccountId}`.
  92. string parent = 1 [
  93. (google.api.field_behavior) = REQUIRED,
  94. (google.api.resource_reference) = {
  95. child_type: "billingbudgets.googleapis.com/Budget"
  96. }
  97. ];
  98. // Required. Budget to create.
  99. Budget budget = 2 [(google.api.field_behavior) = REQUIRED];
  100. }
  101. // Request for UpdateBudget
  102. message UpdateBudgetRequest {
  103. // Required. The updated budget object.
  104. // The budget to update is specified by the budget name in the budget.
  105. Budget budget = 1 [(google.api.field_behavior) = REQUIRED];
  106. // Optional. Indicates which fields in the provided budget to update.
  107. // Read-only fields (such as `name`) cannot be changed. If this is not
  108. // provided, then only fields with non-default values from the request are
  109. // updated. See
  110. // https://developers.google.com/protocol-buffers/docs/proto3#default for more
  111. // details about default values.
  112. google.protobuf.FieldMask update_mask = 2
  113. [(google.api.field_behavior) = OPTIONAL];
  114. }
  115. // Request for GetBudget
  116. message GetBudgetRequest {
  117. // Required. Name of budget to get. Values are of the form
  118. // `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
  119. string name = 1 [
  120. (google.api.field_behavior) = REQUIRED,
  121. (google.api.resource_reference) = {
  122. type: "billingbudgets.googleapis.com/Budget"
  123. }
  124. ];
  125. }
  126. // Request for ListBudgets
  127. message ListBudgetsRequest {
  128. // Required. Name of billing account to list budgets under. Values
  129. // are of the form `billingAccounts/{billingAccountId}`.
  130. string parent = 1 [
  131. (google.api.field_behavior) = REQUIRED,
  132. (google.api.resource_reference) = {
  133. child_type: "billingbudgets.googleapis.com/Budget"
  134. }
  135. ];
  136. // Optional. The maximum number of budgets to return per page.
  137. // The default and maximum value are 100.
  138. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
  139. // Optional. The value returned by the last `ListBudgetsResponse` which
  140. // indicates that this is a continuation of a prior `ListBudgets` call,
  141. // and that the system should return the next page of data.
  142. string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
  143. }
  144. // Response for ListBudgets
  145. message ListBudgetsResponse {
  146. // List of the budgets owned by the requested billing account.
  147. repeated Budget budgets = 1;
  148. // If not empty, indicates that there may be more budgets that match the
  149. // request; this value should be passed in a new `ListBudgetsRequest`.
  150. string next_page_token = 2;
  151. }
  152. // Request for DeleteBudget
  153. message DeleteBudgetRequest {
  154. // Required. Name of the budget to delete. Values are of the form
  155. // `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
  156. string name = 1 [
  157. (google.api.field_behavior) = REQUIRED,
  158. (google.api.resource_reference) = {
  159. type: "billingbudgets.googleapis.com/Budget"
  160. }
  161. ];
  162. }