account_budget.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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.ads.googleads.v6.resources;
  16. import "google/ads/googleads/v6/enums/account_budget_proposal_type.proto";
  17. import "google/ads/googleads/v6/enums/account_budget_status.proto";
  18. import "google/ads/googleads/v6/enums/spending_limit_type.proto";
  19. import "google/ads/googleads/v6/enums/time_type.proto";
  20. import "google/api/field_behavior.proto";
  21. import "google/api/resource.proto";
  22. import "google/api/annotations.proto";
  23. option csharp_namespace = "Google.Ads.GoogleAds.V6.Resources";
  24. option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v6/resources;resources";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "AccountBudgetProto";
  27. option java_package = "com.google.ads.googleads.v6.resources";
  28. option objc_class_prefix = "GAA";
  29. option php_namespace = "Google\\Ads\\GoogleAds\\V6\\Resources";
  30. option ruby_package = "Google::Ads::GoogleAds::V6::Resources";
  31. // Proto file describing the AccountBudget resource.
  32. // An account-level budget. It contains information about the budget itself,
  33. // as well as the most recently approved changes to the budget and proposed
  34. // changes that are pending approval. The proposed changes that are pending
  35. // approval, if any, are found in 'pending_proposal'. Effective details about
  36. // the budget are found in fields prefixed 'approved_', 'adjusted_' and those
  37. // without a prefix. Since some effective details may differ from what the user
  38. // had originally requested (e.g. spending limit), these differences are
  39. // juxtaposed via 'proposed_', 'approved_', and possibly 'adjusted_' fields.
  40. //
  41. // This resource is mutated using AccountBudgetProposal and cannot be mutated
  42. // directly. A budget may have at most one pending proposal at any given time.
  43. // It is read through pending_proposal.
  44. //
  45. // Once approved, a budget may be subject to adjustments, such as credit
  46. // adjustments. Adjustments create differences between the 'approved' and
  47. // 'adjusted' fields, which would otherwise be identical.
  48. message AccountBudget {
  49. option (google.api.resource) = {
  50. type: "googleads.googleapis.com/AccountBudget"
  51. pattern: "customers/{customer_id}/accountBudgets/{account_budget_id}"
  52. };
  53. // A pending proposal associated with the enclosing account-level budget,
  54. // if applicable.
  55. message PendingAccountBudgetProposal {
  56. // Output only. The resource name of the proposal.
  57. // AccountBudgetProposal resource names have the form:
  58. //
  59. // `customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}`
  60. optional string account_budget_proposal = 12 [
  61. (google.api.field_behavior) = OUTPUT_ONLY,
  62. (google.api.resource_reference) = {
  63. type: "googleads.googleapis.com/AccountBudgetProposal"
  64. }
  65. ];
  66. // Output only. The type of this proposal, e.g. END to end the budget associated
  67. // with this proposal.
  68. google.ads.googleads.v6.enums.AccountBudgetProposalTypeEnum.AccountBudgetProposalType proposal_type = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  69. // Output only. The name to assign to the account-level budget.
  70. optional string name = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  71. // Output only. The start time in yyyy-MM-dd HH:mm:ss format.
  72. optional string start_date_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  73. // Output only. A purchase order number is a value that helps users reference this budget
  74. // in their monthly invoices.
  75. optional string purchase_order_number = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  76. // Output only. Notes associated with this budget.
  77. optional string notes = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  78. // Output only. The time when this account-level budget proposal was created.
  79. // Formatted as yyyy-MM-dd HH:mm:ss.
  80. optional string creation_date_time = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
  81. // The end time of the account-level budget.
  82. oneof end_time {
  83. // Output only. The end time in yyyy-MM-dd HH:mm:ss format.
  84. string end_date_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  85. // Output only. The end time as a well-defined type, e.g. FOREVER.
  86. google.ads.googleads.v6.enums.TimeTypeEnum.TimeType end_time_type = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  87. }
  88. // The spending limit.
  89. oneof spending_limit {
  90. // Output only. The spending limit in micros. One million is equivalent to
  91. // one unit.
  92. int64 spending_limit_micros = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  93. // Output only. The spending limit as a well-defined type, e.g. INFINITE.
  94. google.ads.googleads.v6.enums.SpendingLimitTypeEnum.SpendingLimitType spending_limit_type = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  95. }
  96. }
  97. // Output only. The resource name of the account-level budget.
  98. // AccountBudget resource names have the form:
  99. //
  100. // `customers/{customer_id}/accountBudgets/{account_budget_id}`
  101. string resource_name = 1 [
  102. (google.api.field_behavior) = OUTPUT_ONLY,
  103. (google.api.resource_reference) = {
  104. type: "googleads.googleapis.com/AccountBudget"
  105. }
  106. ];
  107. // Output only. The ID of the account-level budget.
  108. optional int64 id = 23 [(google.api.field_behavior) = OUTPUT_ONLY];
  109. // Output only. The resource name of the billing setup associated with this account-level
  110. // budget. BillingSetup resource names have the form:
  111. //
  112. // `customers/{customer_id}/billingSetups/{billing_setup_id}`
  113. optional string billing_setup = 24 [
  114. (google.api.field_behavior) = OUTPUT_ONLY,
  115. (google.api.resource_reference) = {
  116. type: "googleads.googleapis.com/BillingSetup"
  117. }
  118. ];
  119. // Output only. The status of this account-level budget.
  120. google.ads.googleads.v6.enums.AccountBudgetStatusEnum.AccountBudgetStatus status = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  121. // Output only. The name of the account-level budget.
  122. optional string name = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
  123. // Output only. The proposed start time of the account-level budget in
  124. // yyyy-MM-dd HH:mm:ss format. If a start time type of NOW was proposed,
  125. // this is the time of request.
  126. optional string proposed_start_date_time = 26 [(google.api.field_behavior) = OUTPUT_ONLY];
  127. // Output only. The approved start time of the account-level budget in yyyy-MM-dd HH:mm:ss
  128. // format.
  129. //
  130. // For example, if a new budget is approved after the proposed start time,
  131. // the approved start time is the time of approval.
  132. optional string approved_start_date_time = 27 [(google.api.field_behavior) = OUTPUT_ONLY];
  133. // Output only. The total adjustments amount.
  134. //
  135. // An example of an adjustment is courtesy credits.
  136. int64 total_adjustments_micros = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
  137. // Output only. The value of Ads that have been served, in micros.
  138. //
  139. // This includes overdelivery costs, in which case a credit might be
  140. // automatically applied to the budget (see total_adjustments_micros).
  141. int64 amount_served_micros = 34 [(google.api.field_behavior) = OUTPUT_ONLY];
  142. // Output only. A purchase order number is a value that helps users reference this budget
  143. // in their monthly invoices.
  144. optional string purchase_order_number = 35 [(google.api.field_behavior) = OUTPUT_ONLY];
  145. // Output only. Notes associated with the budget.
  146. optional string notes = 36 [(google.api.field_behavior) = OUTPUT_ONLY];
  147. // Output only. The pending proposal to modify this budget, if applicable.
  148. PendingAccountBudgetProposal pending_proposal = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  149. // The proposed end time of the account-level budget.
  150. oneof proposed_end_time {
  151. // Output only. The proposed end time in yyyy-MM-dd HH:mm:ss format.
  152. string proposed_end_date_time = 28 [(google.api.field_behavior) = OUTPUT_ONLY];
  153. // Output only. The proposed end time as a well-defined type, e.g. FOREVER.
  154. google.ads.googleads.v6.enums.TimeTypeEnum.TimeType proposed_end_time_type = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  155. }
  156. // The approved end time of the account-level budget.
  157. //
  158. // For example, if a budget's end time is updated and the proposal is approved
  159. // after the proposed end time, the approved end time is the time of approval.
  160. oneof approved_end_time {
  161. // Output only. The approved end time in yyyy-MM-dd HH:mm:ss format.
  162. string approved_end_date_time = 29 [(google.api.field_behavior) = OUTPUT_ONLY];
  163. // Output only. The approved end time as a well-defined type, e.g. FOREVER.
  164. google.ads.googleads.v6.enums.TimeTypeEnum.TimeType approved_end_time_type = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  165. }
  166. // The proposed spending limit.
  167. oneof proposed_spending_limit {
  168. // Output only. The proposed spending limit in micros. One million is equivalent to
  169. // one unit.
  170. int64 proposed_spending_limit_micros = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
  171. // Output only. The proposed spending limit as a well-defined type, e.g. INFINITE.
  172. google.ads.googleads.v6.enums.SpendingLimitTypeEnum.SpendingLimitType proposed_spending_limit_type = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  173. }
  174. // The approved spending limit.
  175. //
  176. // For example, if the amount already spent by the account exceeds the
  177. // proposed spending limit at the time the proposal is approved, the approved
  178. // spending limit is set to the amount already spent.
  179. oneof approved_spending_limit {
  180. // Output only. The approved spending limit in micros. One million is equivalent to
  181. // one unit. This will only be populated if the proposed spending limit
  182. // is finite, and will always be greater than or equal to the
  183. // proposed spending limit.
  184. int64 approved_spending_limit_micros = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
  185. // Output only. The approved spending limit as a well-defined type, e.g. INFINITE. This
  186. // will only be populated if the approved spending limit is INFINITE.
  187. google.ads.googleads.v6.enums.SpendingLimitTypeEnum.SpendingLimitType approved_spending_limit_type = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  188. }
  189. // The spending limit after adjustments have been applied. Adjustments are
  190. // stored in total_adjustments_micros.
  191. //
  192. // This value has the final say on how much the account is allowed to spend.
  193. oneof adjusted_spending_limit {
  194. // Output only. The adjusted spending limit in micros. One million is equivalent to
  195. // one unit.
  196. //
  197. // If the approved spending limit is finite, the adjusted
  198. // spending limit may vary depending on the types of adjustments applied
  199. // to this budget, if applicable.
  200. //
  201. // The different kinds of adjustments are described here:
  202. // https://support.google.com/google-ads/answer/1704323
  203. //
  204. // For example, a debit adjustment reduces how much the account is
  205. // allowed to spend.
  206. int64 adjusted_spending_limit_micros = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
  207. // Output only. The adjusted spending limit as a well-defined type, e.g. INFINITE.
  208. // This will only be populated if the adjusted spending limit is INFINITE,
  209. // which is guaranteed to be true if the approved spending limit is
  210. // INFINITE.
  211. google.ads.googleads.v6.enums.SpendingLimitTypeEnum.SpendingLimitType adjusted_spending_limit_type = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
  212. }
  213. }