aboutsummaryrefslogtreecommitdiff
path: root/google/ads/googleads/v1/resources/account_budget.proto
blob: 20bb29eb1338a58bd6cf4aab499dcf46b3a7899c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.ads.googleads.v1.resources;

import "google/ads/googleads/v1/enums/account_budget_proposal_type.proto";
import "google/ads/googleads/v1/enums/account_budget_status.proto";
import "google/ads/googleads/v1/enums/spending_limit_type.proto";
import "google/ads/googleads/v1/enums/time_type.proto";
import "google/protobuf/wrappers.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Ads.GoogleAds.V1.Resources";
option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v1/resources;resources";
option java_multiple_files = true;
option java_outer_classname = "AccountBudgetProto";
option java_package = "com.google.ads.googleads.v1.resources";
option objc_class_prefix = "GAA";
option php_namespace = "Google\\Ads\\GoogleAds\\V1\\Resources";
option ruby_package = "Google::Ads::GoogleAds::V1::Resources";
// Proto file describing the AccountBudget resource.

// An account-level budget. It contains information about the budget itself,
// as well as the most recently approved changes to the budget and proposed
// changes that are pending approval. The proposed changes that are pending
// approval, if any, are found in 'pending_proposal'.  Effective details about
// the budget are found in fields prefixed 'approved_', 'adjusted_' and those
// without a prefix.  Since some effective details may differ from what the user
// had originally requested (e.g. spending limit), these differences are
// juxtaposed via 'proposed_', 'approved_', and possibly 'adjusted_' fields.
//
// This resource is mutated using AccountBudgetProposal and cannot be mutated
// directly. A budget may have at most one pending proposal at any given time.
// It is read through pending_proposal.
//
// Once approved, a budget may be subject to adjustments, such as credit
// adjustments.  Adjustments create differences between the 'approved' and
// 'adjusted' fields, which would otherwise be identical.
message AccountBudget {
  // A pending proposal associated with the enclosing account-level budget,
  // if applicable.
  message PendingAccountBudgetProposal {
    // The resource name of the proposal.
    // AccountBudgetProposal resource names have the form:
    //
    //
    // `customers/{customer_id}/accountBudgetProposals/{account_budget_proposal_id}`
    google.protobuf.StringValue account_budget_proposal = 1;

    // The type of this proposal, e.g. END to end the budget associated
    // with this proposal.
    google.ads.googleads.v1.enums.AccountBudgetProposalTypeEnum.AccountBudgetProposalType proposal_type = 2;

    // The name to assign to the account-level budget.
    google.protobuf.StringValue name = 3;

    // The start time in yyyy-MM-dd HH:mm:ss format.
    google.protobuf.StringValue start_date_time = 4;

    // A purchase order number is a value that helps users reference this budget
    // in their monthly invoices.
    google.protobuf.StringValue purchase_order_number = 9;

    // Notes associated with this budget.
    google.protobuf.StringValue notes = 10;

    // The time when this account-level budget proposal was created.
    // Formatted as yyyy-MM-dd HH:mm:ss.
    google.protobuf.StringValue creation_date_time = 11;

    // The end time of the account-level budget.
    oneof end_time {
      // The end time in yyyy-MM-dd HH:mm:ss format.
      google.protobuf.StringValue end_date_time = 5;

      // The end time as a well-defined type, e.g. FOREVER.
      google.ads.googleads.v1.enums.TimeTypeEnum.TimeType end_time_type = 6;
    }

    // The spending limit.
    oneof spending_limit {
      // The spending limit in micros.  One million is equivalent to
      // one unit.
      google.protobuf.Int64Value spending_limit_micros = 7;

      // The spending limit as a well-defined type, e.g. INFINITE.
      google.ads.googleads.v1.enums.SpendingLimitTypeEnum.SpendingLimitType spending_limit_type = 8;
    }
  }

  // The resource name of the account-level budget.
  // AccountBudget resource names have the form:
  //
  // `customers/{customer_id}/accountBudgets/{account_budget_id}`
  string resource_name = 1;

  // The ID of the account-level budget.
  google.protobuf.Int64Value id = 2;

  // The resource name of the billing setup associated with this account-level
  // budget.  BillingSetup resource names have the form:
  //
  // `customers/{customer_id}/billingSetups/{billing_setup_id}`
  google.protobuf.StringValue billing_setup = 3;

  // The status of this account-level budget.
  google.ads.googleads.v1.enums.AccountBudgetStatusEnum.AccountBudgetStatus status = 4;

  // The name of the account-level budget.
  google.protobuf.StringValue name = 5;

  // The proposed start time of the account-level budget in
  // yyyy-MM-dd HH:mm:ss format.  If a start time type of NOW was proposed,
  // this is the time of request.
  google.protobuf.StringValue proposed_start_date_time = 6;

  // The approved start time of the account-level budget in yyyy-MM-dd HH:mm:ss
  // format.
  //
  // For example, if a new budget is approved after the proposed start time,
  // the approved start time is the time of approval.
  google.protobuf.StringValue approved_start_date_time = 7;

  // The total adjustments amount.
  //
  // An example of an adjustment is courtesy credits.
  google.protobuf.Int64Value total_adjustments_micros = 18;

  // The value of Ads that have been served, in micros.
  //
  // This includes overdelivery costs, in which case a credit might be
  // automatically applied to the budget (see total_adjustments_micros).
  google.protobuf.Int64Value amount_served_micros = 19;

  // A purchase order number is a value that helps users reference this budget
  // in their monthly invoices.
  google.protobuf.StringValue purchase_order_number = 20;

  // Notes associated with the budget.
  google.protobuf.StringValue notes = 21;

  // The pending proposal to modify this budget, if applicable.
  PendingAccountBudgetProposal pending_proposal = 22;

  // The proposed end time of the account-level budget.
  oneof proposed_end_time {
    // The proposed end time in yyyy-MM-dd HH:mm:ss format.
    google.protobuf.StringValue proposed_end_date_time = 8;

    // The proposed end time as a well-defined type, e.g. FOREVER.
    google.ads.googleads.v1.enums.TimeTypeEnum.TimeType proposed_end_time_type = 9;
  }

  // The approved end time of the account-level budget.
  //
  // For example, if a budget's end time is updated and the proposal is approved
  // after the proposed end time, the approved end time is the time of approval.
  oneof approved_end_time {
    // The approved end time in yyyy-MM-dd HH:mm:ss format.
    google.protobuf.StringValue approved_end_date_time = 10;

    // The approved end time as a well-defined type, e.g. FOREVER.
    google.ads.googleads.v1.enums.TimeTypeEnum.TimeType approved_end_time_type = 11;
  }

  // The proposed spending limit.
  oneof proposed_spending_limit {
    // The proposed spending limit in micros.  One million is equivalent to
    // one unit.
    google.protobuf.Int64Value proposed_spending_limit_micros = 12;

    // The proposed spending limit as a well-defined type, e.g. INFINITE.
    google.ads.googleads.v1.enums.SpendingLimitTypeEnum.SpendingLimitType proposed_spending_limit_type = 13;
  }

  // The approved spending limit.
  //
  // For example, if the amount already spent by the account exceeds the
  // proposed spending limit at the time the proposal is approved, the approved
  // spending limit is set to the amount already spent.
  oneof approved_spending_limit {
    // The approved spending limit in micros.  One million is equivalent to
    // one unit.  This will only be populated if the proposed spending limit
    // is finite, and will always be greater than or equal to the
    // proposed spending limit.
    google.protobuf.Int64Value approved_spending_limit_micros = 14;

    // The approved spending limit as a well-defined type, e.g. INFINITE.  This
    // will only be populated if the approved spending limit is INFINITE.
    google.ads.googleads.v1.enums.SpendingLimitTypeEnum.SpendingLimitType approved_spending_limit_type = 15;
  }

  // The spending limit after adjustments have been applied.  Adjustments are
  // stored in total_adjustments_micros.
  //
  // This value has the final say on how much the account is allowed to spend.
  oneof adjusted_spending_limit {
    // The adjusted spending limit in micros.  One million is equivalent to
    // one unit.
    //
    // If the approved spending limit is finite, the adjusted
    // spending limit may vary depending on the types of adjustments applied
    // to this budget, if applicable.
    //
    // The different kinds of adjustments are described here:
    // https://support.google.com/google-ads/answer/1704323
    //
    // For example, a debit adjustment reduces how much the account is
    // allowed to spend.
    google.protobuf.Int64Value adjusted_spending_limit_micros = 16;

    // The adjusted spending limit as a well-defined type, e.g. INFINITE.
    // This will only be populated if the adjusted spending limit is INFINITE,
    // which is guaranteed to be true if the approved spending limit is
    // INFINITE.
    google.ads.googleads.v1.enums.SpendingLimitTypeEnum.SpendingLimitType adjusted_spending_limit_type = 17;
  }
}