blob: 84a86ce6bb6684c5e20703a314581acbc5dab311 [file] [log] [blame]
Bu Sun Kim65020912020-05-20 12:08:20 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="billingbudgets_v1beta1.html">Cloud Billing Budget API</a> . <a href="billingbudgets_v1beta1.billingAccounts.html">billingAccounts</a> . <a href="billingbudgets_v1beta1.billingAccounts.budgets.html">budgets</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
79<p class="firstline">Creates a new budget. See</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a budget. Returns successfully if already deleted.</p>
83<p class="toc_element">
84 <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
85<p class="firstline">Returns a budget.</p>
86<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p>
Bu Sun Kim65020912020-05-20 12:08:20 -070088<p class="firstline">Returns a list of budgets for a billing account.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93 <code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p>
94<p class="firstline">Updates a budget and returns the updated budget.</p>
95<h3>Method Details</h3>
96<div class="method">
97 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
98 <pre>Creates a new budget. See
99&lt;a href=&quot;https://cloud.google.com/billing/quotas&quot;&gt;Quotas and limits&lt;/a&gt;
100for more information on the limits of the number of budgets you can create.
101
102Args:
103 parent: string, Required. The name of the billing account to create the budget in. Values
104are of the form `billingAccounts/{billingAccountId}`. (required)
105 body: object, The request body.
106 The object takes the form of:
107
108{ # Request for CreateBudget
109 &quot;budget&quot;: { # A budget is a plan that describes what you expect to spend on Cloud # Required. Budget to create.
110 # projects, plus the rules to execute as spend is tracked against that plan,
111 # (for example, send an alert when 90% of the target spend is met).
112 # Currently all plans are monthly budgets so the usage period(s) tracked are
113 # implied (calendar months of usage back-to-back).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700114 &quot;displayName&quot;: &quot;A String&quot;, # User data for display name in UI.
115 # Validation: &lt;= 60 chars.
Bu Sun Kim65020912020-05-20 12:08:20 -0700116 &quot;amount&quot;: { # The budgeted amount for each usage period. # Required. Budgeted amount.
117 &quot;lastPeriodAmount&quot;: { # Describes a budget amount targeted to last period&#x27;s spend. # Use the last period&#x27;s actual spend as the budget for the present period.
118 # At this time, the amount is automatically 100% of last period&#x27;s spend;
119 # that is, there are no other options yet.
120 # Future configuration will be described here (for example, configuring a
121 # percentage of last period&#x27;s spend).
122 },
123 &quot;specifiedAmount&quot;: { # Represents an amount of money with its currency type. # A specified amount to use as the budget.
124 # `currency_code` is optional. If specified, it must match the
125 # currency of the billing account. The `currency_code` is provided on
126 # output.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700127 &quot;currencyCode&quot;: &quot;A String&quot;, # The 3-letter currency code defined in ISO 4217.
Bu Sun Kim65020912020-05-20 12:08:20 -0700128 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
129 # The value must be between -999,999,999 and +999,999,999 inclusive.
130 # If `units` is positive, `nanos` must be positive or zero.
131 # If `units` is zero, `nanos` can be positive, zero, or negative.
132 # If `units` is negative, `nanos` must be negative or zero.
133 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700134 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
135 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
Bu Sun Kim65020912020-05-20 12:08:20 -0700136 },
137 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700138 &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the budget.
139 # The resource name implies the scope of a budget. Values are of the form
140 # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
141 &quot;allUpdatesRule&quot;: { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds.
142 # and thresholds.
143 &quot;monitoringNotificationChannels&quot;: [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in
144 # addition to default recipients who have billing account roles.
145 # The value is the full REST resource name of a monitoring notification
146 # channel with the form
147 # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
148 # channels are allowed. See
149 # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
150 # for more details.
151 &quot;A String&quot;,
152 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 &quot;pubsubTopic&quot;: &quot;A String&quot;, # Required. The name of the Cloud Pub/Sub topic where budget related messages will be
154 # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
155 # are sent at regular intervals to the topic.
156 # The topic needs to be created before the budget is created; see
157 # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
158 # for more details.
159 # Caller is expected to have
160 # `pubsub.topics.setIamPolicy` permission on the topic when it&#x27;s set for a
161 # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700162 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
163 # for more details on Pub/Sub roles and permissions.
164 &quot;schemaVersion&quot;: &quot;A String&quot;, # Required. The schema version of the notification sent to `pubsub_topic`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700165 # Only &quot;1.0&quot; is accepted. It represents the JSON schema as defined in
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700166 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700168 &quot;budgetFilter&quot;: { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute
169 # the actual spend against the budget.
170 &quot;projects&quot;: [ # Optional. A set of projects of the form `projects/{project}`,
171 # specifying that usage from only this set of projects should be
172 # included in the budget. If omitted, the report will include all usage for
173 # the billing account, regardless of which project the usage occurred on.
174 # Only zero or one project can be specified currently.
175 &quot;A String&quot;,
176 ],
177 &quot;subaccounts&quot;: [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
178 # that usage from only this set of subaccounts should be included in the
179 # budget. If a subaccount is set to the name of the parent account,
180 # usage from the parent account will be included. If omitted, the
181 # report will include usage from the parent account and all
182 # subaccounts, if they exist.
183 &quot;A String&quot;,
184 ],
185 &quot;creditTypesTreatment&quot;: &quot;A String&quot;, # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
186 &quot;services&quot;: [ # Optional. A set of services of the form `services/{service_id}`,
187 # specifying that usage from only this set of services should be
188 # included in the budget. If omitted, the report will include usage for
189 # all the services.
190 # The service names are available through the Catalog API:
191 # https://cloud.google.com/billing/v1/how-tos/catalog-api.
192 &quot;A String&quot;,
193 ],
194 &quot;labels&quot;: { # Optional. A single label and value pair specifying that usage from only this set of
195 # labeled resources should be included in the budget. Currently, multiple
196 # entries or multiple values per entry are not allowed. If omitted, the
197 # report will include all labeled and unlabeled usage.
198 &quot;a_key&quot;: [
199 &quot;&quot;,
200 ],
201 },
202 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700203 &quot;thresholdRules&quot;: [ # Optional. Rules that trigger alerts (notifications of thresholds
204 # being crossed) when spend exceeds the specified percentages of the budget.
205 { # ThresholdRule contains a definition of a threshold which triggers
206 # an alert (a notification of a threshold being crossed) to be sent when
207 # spend goes above the specified amount.
208 # Alerts are automatically e-mailed to users with the Billing Account
209 # Administrator role or the Billing Account User role.
210 # The thresholds here have no effect on notifications sent to anything
211 # configured under `Budget.all_updates_rule`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700212 &quot;spendBasis&quot;: &quot;A String&quot;, # Optional. The type of basis used to determine if spend has passed the
213 # threshold. Behavior defaults to CURRENT_SPEND if not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700214 &quot;thresholdPercent&quot;: 3.14, # Required. Send an alert when this threshold is exceeded.
215 # This is a 1.0-based percentage, so 0.5 = 50%.
216 # Validation: non-negative number.
217 },
218 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700219 &quot;etag&quot;: &quot;A String&quot;, # Optional. Etag to validate that the object is unchanged for a
220 # read-modify-write operation.
221 # An empty etag will cause an update to overwrite other changes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700222 },
223 }
224
225 x__xgafv: string, V1 error format.
226 Allowed values
227 1 - v1 error format
228 2 - v2 error format
229
230Returns:
231 An object of the form:
232
233 { # A budget is a plan that describes what you expect to spend on Cloud
234 # projects, plus the rules to execute as spend is tracked against that plan,
235 # (for example, send an alert when 90% of the target spend is met).
236 # Currently all plans are monthly budgets so the usage period(s) tracked are
237 # implied (calendar months of usage back-to-back).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700238 &quot;displayName&quot;: &quot;A String&quot;, # User data for display name in UI.
239 # Validation: &lt;= 60 chars.
Bu Sun Kim65020912020-05-20 12:08:20 -0700240 &quot;amount&quot;: { # The budgeted amount for each usage period. # Required. Budgeted amount.
241 &quot;lastPeriodAmount&quot;: { # Describes a budget amount targeted to last period&#x27;s spend. # Use the last period&#x27;s actual spend as the budget for the present period.
242 # At this time, the amount is automatically 100% of last period&#x27;s spend;
243 # that is, there are no other options yet.
244 # Future configuration will be described here (for example, configuring a
245 # percentage of last period&#x27;s spend).
246 },
247 &quot;specifiedAmount&quot;: { # Represents an amount of money with its currency type. # A specified amount to use as the budget.
248 # `currency_code` is optional. If specified, it must match the
249 # currency of the billing account. The `currency_code` is provided on
250 # output.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700251 &quot;currencyCode&quot;: &quot;A String&quot;, # The 3-letter currency code defined in ISO 4217.
Bu Sun Kim65020912020-05-20 12:08:20 -0700252 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
253 # The value must be between -999,999,999 and +999,999,999 inclusive.
254 # If `units` is positive, `nanos` must be positive or zero.
255 # If `units` is zero, `nanos` can be positive, zero, or negative.
256 # If `units` is negative, `nanos` must be negative or zero.
257 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700258 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
259 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
Bu Sun Kim65020912020-05-20 12:08:20 -0700260 },
261 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700262 &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the budget.
263 # The resource name implies the scope of a budget. Values are of the form
264 # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
265 &quot;allUpdatesRule&quot;: { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds.
266 # and thresholds.
267 &quot;monitoringNotificationChannels&quot;: [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in
268 # addition to default recipients who have billing account roles.
269 # The value is the full REST resource name of a monitoring notification
270 # channel with the form
271 # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
272 # channels are allowed. See
273 # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
274 # for more details.
275 &quot;A String&quot;,
276 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700277 &quot;pubsubTopic&quot;: &quot;A String&quot;, # Required. The name of the Cloud Pub/Sub topic where budget related messages will be
278 # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
279 # are sent at regular intervals to the topic.
280 # The topic needs to be created before the budget is created; see
281 # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
282 # for more details.
283 # Caller is expected to have
284 # `pubsub.topics.setIamPolicy` permission on the topic when it&#x27;s set for a
285 # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700286 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
287 # for more details on Pub/Sub roles and permissions.
288 &quot;schemaVersion&quot;: &quot;A String&quot;, # Required. The schema version of the notification sent to `pubsub_topic`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700289 # Only &quot;1.0&quot; is accepted. It represents the JSON schema as defined in
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700290 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
Bu Sun Kim65020912020-05-20 12:08:20 -0700291 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700292 &quot;budgetFilter&quot;: { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute
293 # the actual spend against the budget.
294 &quot;projects&quot;: [ # Optional. A set of projects of the form `projects/{project}`,
295 # specifying that usage from only this set of projects should be
296 # included in the budget. If omitted, the report will include all usage for
297 # the billing account, regardless of which project the usage occurred on.
298 # Only zero or one project can be specified currently.
299 &quot;A String&quot;,
300 ],
301 &quot;subaccounts&quot;: [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
302 # that usage from only this set of subaccounts should be included in the
303 # budget. If a subaccount is set to the name of the parent account,
304 # usage from the parent account will be included. If omitted, the
305 # report will include usage from the parent account and all
306 # subaccounts, if they exist.
307 &quot;A String&quot;,
308 ],
309 &quot;creditTypesTreatment&quot;: &quot;A String&quot;, # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
310 &quot;services&quot;: [ # Optional. A set of services of the form `services/{service_id}`,
311 # specifying that usage from only this set of services should be
312 # included in the budget. If omitted, the report will include usage for
313 # all the services.
314 # The service names are available through the Catalog API:
315 # https://cloud.google.com/billing/v1/how-tos/catalog-api.
316 &quot;A String&quot;,
317 ],
318 &quot;labels&quot;: { # Optional. A single label and value pair specifying that usage from only this set of
319 # labeled resources should be included in the budget. Currently, multiple
320 # entries or multiple values per entry are not allowed. If omitted, the
321 # report will include all labeled and unlabeled usage.
322 &quot;a_key&quot;: [
323 &quot;&quot;,
324 ],
325 },
326 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700327 &quot;thresholdRules&quot;: [ # Optional. Rules that trigger alerts (notifications of thresholds
328 # being crossed) when spend exceeds the specified percentages of the budget.
329 { # ThresholdRule contains a definition of a threshold which triggers
330 # an alert (a notification of a threshold being crossed) to be sent when
331 # spend goes above the specified amount.
332 # Alerts are automatically e-mailed to users with the Billing Account
333 # Administrator role or the Billing Account User role.
334 # The thresholds here have no effect on notifications sent to anything
335 # configured under `Budget.all_updates_rule`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700336 &quot;spendBasis&quot;: &quot;A String&quot;, # Optional. The type of basis used to determine if spend has passed the
337 # threshold. Behavior defaults to CURRENT_SPEND if not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700338 &quot;thresholdPercent&quot;: 3.14, # Required. Send an alert when this threshold is exceeded.
339 # This is a 1.0-based percentage, so 0.5 = 50%.
340 # Validation: non-negative number.
341 },
342 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700343 &quot;etag&quot;: &quot;A String&quot;, # Optional. Etag to validate that the object is unchanged for a
344 # read-modify-write operation.
345 # An empty etag will cause an update to overwrite other changes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700346 }</pre>
347</div>
348
349<div class="method">
350 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
351 <pre>Deletes a budget. Returns successfully if already deleted.
352
353Args:
354 name: string, Required. Name of the budget to delete. Values are of the form
355`billingAccounts/{billingAccountId}/budgets/{budgetId}`. (required)
356 x__xgafv: string, V1 error format.
357 Allowed values
358 1 - v1 error format
359 2 - v2 error format
360
361Returns:
362 An object of the form:
363
364 { # A generic empty message that you can re-use to avoid defining duplicated
365 # empty messages in your APIs. A typical example is to use it as the request
366 # or the response type of an API method. For instance:
367 #
368 # service Foo {
369 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
370 # }
371 #
372 # The JSON representation for `Empty` is empty JSON object `{}`.
373 }</pre>
374</div>
375
376<div class="method">
377 <code class="details" id="get">get(name, x__xgafv=None)</code>
378 <pre>Returns a budget.
379
380WARNING: There are some fields exposed on the Google Cloud Console that
381aren&#x27;t available on this API. When reading from the API, you will not
382see these fields in the return value, though they may have been set
383in the Cloud Console.
384
385Args:
386 name: string, Required. Name of budget to get. Values are of the form
387`billingAccounts/{billingAccountId}/budgets/{budgetId}`. (required)
388 x__xgafv: string, V1 error format.
389 Allowed values
390 1 - v1 error format
391 2 - v2 error format
392
393Returns:
394 An object of the form:
395
396 { # A budget is a plan that describes what you expect to spend on Cloud
397 # projects, plus the rules to execute as spend is tracked against that plan,
398 # (for example, send an alert when 90% of the target spend is met).
399 # Currently all plans are monthly budgets so the usage period(s) tracked are
400 # implied (calendar months of usage back-to-back).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700401 &quot;displayName&quot;: &quot;A String&quot;, # User data for display name in UI.
402 # Validation: &lt;= 60 chars.
Bu Sun Kim65020912020-05-20 12:08:20 -0700403 &quot;amount&quot;: { # The budgeted amount for each usage period. # Required. Budgeted amount.
404 &quot;lastPeriodAmount&quot;: { # Describes a budget amount targeted to last period&#x27;s spend. # Use the last period&#x27;s actual spend as the budget for the present period.
405 # At this time, the amount is automatically 100% of last period&#x27;s spend;
406 # that is, there are no other options yet.
407 # Future configuration will be described here (for example, configuring a
408 # percentage of last period&#x27;s spend).
409 },
410 &quot;specifiedAmount&quot;: { # Represents an amount of money with its currency type. # A specified amount to use as the budget.
411 # `currency_code` is optional. If specified, it must match the
412 # currency of the billing account. The `currency_code` is provided on
413 # output.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700414 &quot;currencyCode&quot;: &quot;A String&quot;, # The 3-letter currency code defined in ISO 4217.
Bu Sun Kim65020912020-05-20 12:08:20 -0700415 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
416 # The value must be between -999,999,999 and +999,999,999 inclusive.
417 # If `units` is positive, `nanos` must be positive or zero.
418 # If `units` is zero, `nanos` can be positive, zero, or negative.
419 # If `units` is negative, `nanos` must be negative or zero.
420 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700421 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
422 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
Bu Sun Kim65020912020-05-20 12:08:20 -0700423 },
424 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700425 &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the budget.
426 # The resource name implies the scope of a budget. Values are of the form
427 # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
428 &quot;allUpdatesRule&quot;: { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds.
429 # and thresholds.
430 &quot;monitoringNotificationChannels&quot;: [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in
431 # addition to default recipients who have billing account roles.
432 # The value is the full REST resource name of a monitoring notification
433 # channel with the form
434 # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
435 # channels are allowed. See
436 # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
437 # for more details.
438 &quot;A String&quot;,
439 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700440 &quot;pubsubTopic&quot;: &quot;A String&quot;, # Required. The name of the Cloud Pub/Sub topic where budget related messages will be
441 # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
442 # are sent at regular intervals to the topic.
443 # The topic needs to be created before the budget is created; see
444 # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
445 # for more details.
446 # Caller is expected to have
447 # `pubsub.topics.setIamPolicy` permission on the topic when it&#x27;s set for a
448 # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700449 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
450 # for more details on Pub/Sub roles and permissions.
451 &quot;schemaVersion&quot;: &quot;A String&quot;, # Required. The schema version of the notification sent to `pubsub_topic`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700452 # Only &quot;1.0&quot; is accepted. It represents the JSON schema as defined in
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700453 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
Bu Sun Kim65020912020-05-20 12:08:20 -0700454 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700455 &quot;budgetFilter&quot;: { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute
456 # the actual spend against the budget.
457 &quot;projects&quot;: [ # Optional. A set of projects of the form `projects/{project}`,
458 # specifying that usage from only this set of projects should be
459 # included in the budget. If omitted, the report will include all usage for
460 # the billing account, regardless of which project the usage occurred on.
461 # Only zero or one project can be specified currently.
462 &quot;A String&quot;,
463 ],
464 &quot;subaccounts&quot;: [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
465 # that usage from only this set of subaccounts should be included in the
466 # budget. If a subaccount is set to the name of the parent account,
467 # usage from the parent account will be included. If omitted, the
468 # report will include usage from the parent account and all
469 # subaccounts, if they exist.
470 &quot;A String&quot;,
471 ],
472 &quot;creditTypesTreatment&quot;: &quot;A String&quot;, # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
473 &quot;services&quot;: [ # Optional. A set of services of the form `services/{service_id}`,
474 # specifying that usage from only this set of services should be
475 # included in the budget. If omitted, the report will include usage for
476 # all the services.
477 # The service names are available through the Catalog API:
478 # https://cloud.google.com/billing/v1/how-tos/catalog-api.
479 &quot;A String&quot;,
480 ],
481 &quot;labels&quot;: { # Optional. A single label and value pair specifying that usage from only this set of
482 # labeled resources should be included in the budget. Currently, multiple
483 # entries or multiple values per entry are not allowed. If omitted, the
484 # report will include all labeled and unlabeled usage.
485 &quot;a_key&quot;: [
486 &quot;&quot;,
487 ],
488 },
489 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700490 &quot;thresholdRules&quot;: [ # Optional. Rules that trigger alerts (notifications of thresholds
491 # being crossed) when spend exceeds the specified percentages of the budget.
492 { # ThresholdRule contains a definition of a threshold which triggers
493 # an alert (a notification of a threshold being crossed) to be sent when
494 # spend goes above the specified amount.
495 # Alerts are automatically e-mailed to users with the Billing Account
496 # Administrator role or the Billing Account User role.
497 # The thresholds here have no effect on notifications sent to anything
498 # configured under `Budget.all_updates_rule`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700499 &quot;spendBasis&quot;: &quot;A String&quot;, # Optional. The type of basis used to determine if spend has passed the
500 # threshold. Behavior defaults to CURRENT_SPEND if not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700501 &quot;thresholdPercent&quot;: 3.14, # Required. Send an alert when this threshold is exceeded.
502 # This is a 1.0-based percentage, so 0.5 = 50%.
503 # Validation: non-negative number.
504 },
505 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700506 &quot;etag&quot;: &quot;A String&quot;, # Optional. Etag to validate that the object is unchanged for a
507 # read-modify-write operation.
508 # An empty etag will cause an update to overwrite other changes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700509 }</pre>
510</div>
511
512<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700513 <code class="details" id="list">list(parent, pageToken=None, pageSize=None, x__xgafv=None)</code>
Bu Sun Kim65020912020-05-20 12:08:20 -0700514 <pre>Returns a list of budgets for a billing account.
515
516WARNING: There are some fields exposed on the Google Cloud Console that
517aren&#x27;t available on this API. When reading from the API, you will not
518see these fields in the return value, though they may have been set
519in the Cloud Console.
520
521Args:
522 parent: string, Required. Name of billing account to list budgets under. Values
523are of the form `billingAccounts/{billingAccountId}`. (required)
Bu Sun Kim65020912020-05-20 12:08:20 -0700524 pageToken: string, Optional. The value returned by the last `ListBudgetsResponse` which
525indicates that this is a continuation of a prior `ListBudgets` call,
526and that the system should return the next page of data.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700527 pageSize: integer, Optional. The maximum number of budgets to return per page.
528The default and maximum value are 100.
Bu Sun Kim65020912020-05-20 12:08:20 -0700529 x__xgafv: string, V1 error format.
530 Allowed values
531 1 - v1 error format
532 2 - v2 error format
533
534Returns:
535 An object of the form:
536
537 { # Response for ListBudgets
538 &quot;nextPageToken&quot;: &quot;A String&quot;, # If not empty, indicates that there may be more budgets that match the
539 # request; this value should be passed in a new `ListBudgetsRequest`.
540 &quot;budgets&quot;: [ # List of the budgets owned by the requested billing account.
541 { # A budget is a plan that describes what you expect to spend on Cloud
542 # projects, plus the rules to execute as spend is tracked against that plan,
543 # (for example, send an alert when 90% of the target spend is met).
544 # Currently all plans are monthly budgets so the usage period(s) tracked are
545 # implied (calendar months of usage back-to-back).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700546 &quot;displayName&quot;: &quot;A String&quot;, # User data for display name in UI.
547 # Validation: &lt;= 60 chars.
Bu Sun Kim65020912020-05-20 12:08:20 -0700548 &quot;amount&quot;: { # The budgeted amount for each usage period. # Required. Budgeted amount.
549 &quot;lastPeriodAmount&quot;: { # Describes a budget amount targeted to last period&#x27;s spend. # Use the last period&#x27;s actual spend as the budget for the present period.
550 # At this time, the amount is automatically 100% of last period&#x27;s spend;
551 # that is, there are no other options yet.
552 # Future configuration will be described here (for example, configuring a
553 # percentage of last period&#x27;s spend).
554 },
555 &quot;specifiedAmount&quot;: { # Represents an amount of money with its currency type. # A specified amount to use as the budget.
556 # `currency_code` is optional. If specified, it must match the
557 # currency of the billing account. The `currency_code` is provided on
558 # output.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700559 &quot;currencyCode&quot;: &quot;A String&quot;, # The 3-letter currency code defined in ISO 4217.
Bu Sun Kim65020912020-05-20 12:08:20 -0700560 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
561 # The value must be between -999,999,999 and +999,999,999 inclusive.
562 # If `units` is positive, `nanos` must be positive or zero.
563 # If `units` is zero, `nanos` can be positive, zero, or negative.
564 # If `units` is negative, `nanos` must be negative or zero.
565 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700566 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
567 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
Bu Sun Kim65020912020-05-20 12:08:20 -0700568 },
569 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700570 &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the budget.
571 # The resource name implies the scope of a budget. Values are of the form
572 # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
573 &quot;allUpdatesRule&quot;: { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds.
574 # and thresholds.
575 &quot;monitoringNotificationChannels&quot;: [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in
576 # addition to default recipients who have billing account roles.
577 # The value is the full REST resource name of a monitoring notification
578 # channel with the form
579 # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
580 # channels are allowed. See
581 # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
582 # for more details.
583 &quot;A String&quot;,
584 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700585 &quot;pubsubTopic&quot;: &quot;A String&quot;, # Required. The name of the Cloud Pub/Sub topic where budget related messages will be
586 # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
587 # are sent at regular intervals to the topic.
588 # The topic needs to be created before the budget is created; see
589 # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
590 # for more details.
591 # Caller is expected to have
592 # `pubsub.topics.setIamPolicy` permission on the topic when it&#x27;s set for a
593 # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700594 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
595 # for more details on Pub/Sub roles and permissions.
596 &quot;schemaVersion&quot;: &quot;A String&quot;, # Required. The schema version of the notification sent to `pubsub_topic`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700597 # Only &quot;1.0&quot; is accepted. It represents the JSON schema as defined in
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700598 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
Bu Sun Kim65020912020-05-20 12:08:20 -0700599 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700600 &quot;budgetFilter&quot;: { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute
601 # the actual spend against the budget.
602 &quot;projects&quot;: [ # Optional. A set of projects of the form `projects/{project}`,
603 # specifying that usage from only this set of projects should be
604 # included in the budget. If omitted, the report will include all usage for
605 # the billing account, regardless of which project the usage occurred on.
606 # Only zero or one project can be specified currently.
607 &quot;A String&quot;,
608 ],
609 &quot;subaccounts&quot;: [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
610 # that usage from only this set of subaccounts should be included in the
611 # budget. If a subaccount is set to the name of the parent account,
612 # usage from the parent account will be included. If omitted, the
613 # report will include usage from the parent account and all
614 # subaccounts, if they exist.
615 &quot;A String&quot;,
616 ],
617 &quot;creditTypesTreatment&quot;: &quot;A String&quot;, # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
618 &quot;services&quot;: [ # Optional. A set of services of the form `services/{service_id}`,
619 # specifying that usage from only this set of services should be
620 # included in the budget. If omitted, the report will include usage for
621 # all the services.
622 # The service names are available through the Catalog API:
623 # https://cloud.google.com/billing/v1/how-tos/catalog-api.
624 &quot;A String&quot;,
625 ],
626 &quot;labels&quot;: { # Optional. A single label and value pair specifying that usage from only this set of
627 # labeled resources should be included in the budget. Currently, multiple
628 # entries or multiple values per entry are not allowed. If omitted, the
629 # report will include all labeled and unlabeled usage.
630 &quot;a_key&quot;: [
631 &quot;&quot;,
632 ],
633 },
634 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700635 &quot;thresholdRules&quot;: [ # Optional. Rules that trigger alerts (notifications of thresholds
636 # being crossed) when spend exceeds the specified percentages of the budget.
637 { # ThresholdRule contains a definition of a threshold which triggers
638 # an alert (a notification of a threshold being crossed) to be sent when
639 # spend goes above the specified amount.
640 # Alerts are automatically e-mailed to users with the Billing Account
641 # Administrator role or the Billing Account User role.
642 # The thresholds here have no effect on notifications sent to anything
643 # configured under `Budget.all_updates_rule`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700644 &quot;spendBasis&quot;: &quot;A String&quot;, # Optional. The type of basis used to determine if spend has passed the
645 # threshold. Behavior defaults to CURRENT_SPEND if not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700646 &quot;thresholdPercent&quot;: 3.14, # Required. Send an alert when this threshold is exceeded.
647 # This is a 1.0-based percentage, so 0.5 = 50%.
648 # Validation: non-negative number.
649 },
650 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700651 &quot;etag&quot;: &quot;A String&quot;, # Optional. Etag to validate that the object is unchanged for a
652 # read-modify-write operation.
653 # An empty etag will cause an update to overwrite other changes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700654 },
655 ],
656 }</pre>
657</div>
658
659<div class="method">
660 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
661 <pre>Retrieves the next page of results.
662
663Args:
664 previous_request: The request for the previous page. (required)
665 previous_response: The response from the request for the previous page. (required)
666
667Returns:
668 A request object that you can call &#x27;execute()&#x27; on to request the next
669 page. Returns None if there are no more items in the collection.
670 </pre>
671</div>
672
673<div class="method">
674 <code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code>
675 <pre>Updates a budget and returns the updated budget.
676
677WARNING: There are some fields exposed on the Google Cloud Console that
678aren&#x27;t available on this API. Budget fields that are not exposed in
679this API will not be changed by this method.
680
681Args:
682 name: string, Output only. Resource name of the budget.
683The resource name implies the scope of a budget. Values are of the form
684`billingAccounts/{billingAccountId}/budgets/{budgetId}`. (required)
685 body: object, The request body.
686 The object takes the form of:
687
688{ # Request for UpdateBudget
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700689 &quot;updateMask&quot;: &quot;A String&quot;, # Optional. Indicates which fields in the provided budget to update.
690 # Read-only fields (such as `name`) cannot be changed. If this is not
691 # provided, then only fields with non-default values from the request are
692 # updated. See
693 # https://developers.google.com/protocol-buffers/docs/proto3#default for more
694 # details about default values.
Bu Sun Kim65020912020-05-20 12:08:20 -0700695 &quot;budget&quot;: { # A budget is a plan that describes what you expect to spend on Cloud # Required. The updated budget object.
696 # The budget to update is specified by the budget name in the budget.
697 # projects, plus the rules to execute as spend is tracked against that plan,
698 # (for example, send an alert when 90% of the target spend is met).
699 # Currently all plans are monthly budgets so the usage period(s) tracked are
700 # implied (calendar months of usage back-to-back).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700701 &quot;displayName&quot;: &quot;A String&quot;, # User data for display name in UI.
702 # Validation: &lt;= 60 chars.
Bu Sun Kim65020912020-05-20 12:08:20 -0700703 &quot;amount&quot;: { # The budgeted amount for each usage period. # Required. Budgeted amount.
704 &quot;lastPeriodAmount&quot;: { # Describes a budget amount targeted to last period&#x27;s spend. # Use the last period&#x27;s actual spend as the budget for the present period.
705 # At this time, the amount is automatically 100% of last period&#x27;s spend;
706 # that is, there are no other options yet.
707 # Future configuration will be described here (for example, configuring a
708 # percentage of last period&#x27;s spend).
709 },
710 &quot;specifiedAmount&quot;: { # Represents an amount of money with its currency type. # A specified amount to use as the budget.
711 # `currency_code` is optional. If specified, it must match the
712 # currency of the billing account. The `currency_code` is provided on
713 # output.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700714 &quot;currencyCode&quot;: &quot;A String&quot;, # The 3-letter currency code defined in ISO 4217.
Bu Sun Kim65020912020-05-20 12:08:20 -0700715 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
716 # The value must be between -999,999,999 and +999,999,999 inclusive.
717 # If `units` is positive, `nanos` must be positive or zero.
718 # If `units` is zero, `nanos` can be positive, zero, or negative.
719 # If `units` is negative, `nanos` must be negative or zero.
720 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700721 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
722 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
Bu Sun Kim65020912020-05-20 12:08:20 -0700723 },
724 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700725 &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the budget.
726 # The resource name implies the scope of a budget. Values are of the form
727 # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
728 &quot;allUpdatesRule&quot;: { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds.
729 # and thresholds.
730 &quot;monitoringNotificationChannels&quot;: [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in
731 # addition to default recipients who have billing account roles.
732 # The value is the full REST resource name of a monitoring notification
733 # channel with the form
734 # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
735 # channels are allowed. See
736 # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
737 # for more details.
738 &quot;A String&quot;,
739 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700740 &quot;pubsubTopic&quot;: &quot;A String&quot;, # Required. The name of the Cloud Pub/Sub topic where budget related messages will be
741 # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
742 # are sent at regular intervals to the topic.
743 # The topic needs to be created before the budget is created; see
744 # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
745 # for more details.
746 # Caller is expected to have
747 # `pubsub.topics.setIamPolicy` permission on the topic when it&#x27;s set for a
748 # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700749 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
750 # for more details on Pub/Sub roles and permissions.
751 &quot;schemaVersion&quot;: &quot;A String&quot;, # Required. The schema version of the notification sent to `pubsub_topic`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700752 # Only &quot;1.0&quot; is accepted. It represents the JSON schema as defined in
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700753 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
Bu Sun Kim65020912020-05-20 12:08:20 -0700754 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700755 &quot;budgetFilter&quot;: { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute
756 # the actual spend against the budget.
757 &quot;projects&quot;: [ # Optional. A set of projects of the form `projects/{project}`,
758 # specifying that usage from only this set of projects should be
759 # included in the budget. If omitted, the report will include all usage for
760 # the billing account, regardless of which project the usage occurred on.
761 # Only zero or one project can be specified currently.
762 &quot;A String&quot;,
763 ],
764 &quot;subaccounts&quot;: [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
765 # that usage from only this set of subaccounts should be included in the
766 # budget. If a subaccount is set to the name of the parent account,
767 # usage from the parent account will be included. If omitted, the
768 # report will include usage from the parent account and all
769 # subaccounts, if they exist.
770 &quot;A String&quot;,
771 ],
772 &quot;creditTypesTreatment&quot;: &quot;A String&quot;, # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
773 &quot;services&quot;: [ # Optional. A set of services of the form `services/{service_id}`,
774 # specifying that usage from only this set of services should be
775 # included in the budget. If omitted, the report will include usage for
776 # all the services.
777 # The service names are available through the Catalog API:
778 # https://cloud.google.com/billing/v1/how-tos/catalog-api.
779 &quot;A String&quot;,
780 ],
781 &quot;labels&quot;: { # Optional. A single label and value pair specifying that usage from only this set of
782 # labeled resources should be included in the budget. Currently, multiple
783 # entries or multiple values per entry are not allowed. If omitted, the
784 # report will include all labeled and unlabeled usage.
785 &quot;a_key&quot;: [
786 &quot;&quot;,
787 ],
788 },
789 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700790 &quot;thresholdRules&quot;: [ # Optional. Rules that trigger alerts (notifications of thresholds
791 # being crossed) when spend exceeds the specified percentages of the budget.
792 { # ThresholdRule contains a definition of a threshold which triggers
793 # an alert (a notification of a threshold being crossed) to be sent when
794 # spend goes above the specified amount.
795 # Alerts are automatically e-mailed to users with the Billing Account
796 # Administrator role or the Billing Account User role.
797 # The thresholds here have no effect on notifications sent to anything
798 # configured under `Budget.all_updates_rule`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700799 &quot;spendBasis&quot;: &quot;A String&quot;, # Optional. The type of basis used to determine if spend has passed the
800 # threshold. Behavior defaults to CURRENT_SPEND if not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700801 &quot;thresholdPercent&quot;: 3.14, # Required. Send an alert when this threshold is exceeded.
802 # This is a 1.0-based percentage, so 0.5 = 50%.
803 # Validation: non-negative number.
804 },
805 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700806 &quot;etag&quot;: &quot;A String&quot;, # Optional. Etag to validate that the object is unchanged for a
807 # read-modify-write operation.
808 # An empty etag will cause an update to overwrite other changes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700809 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700810 }
811
812 x__xgafv: string, V1 error format.
813 Allowed values
814 1 - v1 error format
815 2 - v2 error format
816
817Returns:
818 An object of the form:
819
820 { # A budget is a plan that describes what you expect to spend on Cloud
821 # projects, plus the rules to execute as spend is tracked against that plan,
822 # (for example, send an alert when 90% of the target spend is met).
823 # Currently all plans are monthly budgets so the usage period(s) tracked are
824 # implied (calendar months of usage back-to-back).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700825 &quot;displayName&quot;: &quot;A String&quot;, # User data for display name in UI.
826 # Validation: &lt;= 60 chars.
Bu Sun Kim65020912020-05-20 12:08:20 -0700827 &quot;amount&quot;: { # The budgeted amount for each usage period. # Required. Budgeted amount.
828 &quot;lastPeriodAmount&quot;: { # Describes a budget amount targeted to last period&#x27;s spend. # Use the last period&#x27;s actual spend as the budget for the present period.
829 # At this time, the amount is automatically 100% of last period&#x27;s spend;
830 # that is, there are no other options yet.
831 # Future configuration will be described here (for example, configuring a
832 # percentage of last period&#x27;s spend).
833 },
834 &quot;specifiedAmount&quot;: { # Represents an amount of money with its currency type. # A specified amount to use as the budget.
835 # `currency_code` is optional. If specified, it must match the
836 # currency of the billing account. The `currency_code` is provided on
837 # output.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700838 &quot;currencyCode&quot;: &quot;A String&quot;, # The 3-letter currency code defined in ISO 4217.
Bu Sun Kim65020912020-05-20 12:08:20 -0700839 &quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount.
840 # The value must be between -999,999,999 and +999,999,999 inclusive.
841 # If `units` is positive, `nanos` must be positive or zero.
842 # If `units` is zero, `nanos` can be positive, zero, or negative.
843 # If `units` is negative, `nanos` must be negative or zero.
844 # For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700845 &quot;units&quot;: &quot;A String&quot;, # The whole units of the amount.
846 # For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
Bu Sun Kim65020912020-05-20 12:08:20 -0700847 },
848 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700849 &quot;name&quot;: &quot;A String&quot;, # Output only. Resource name of the budget.
850 # The resource name implies the scope of a budget. Values are of the form
851 # `billingAccounts/{billingAccountId}/budgets/{budgetId}`.
852 &quot;allUpdatesRule&quot;: { # AllUpdatesRule defines notifications that are sent based on budget spend # Optional. Rules to apply to notifications sent based on budget spend and thresholds.
853 # and thresholds.
854 &quot;monitoringNotificationChannels&quot;: [ # Optional. Targets to send notifications to when a threshold is exceeded. This is in
855 # addition to default recipients who have billing account roles.
856 # The value is the full REST resource name of a monitoring notification
857 # channel with the form
858 # `projects/{project_id}/notificationChannels/{channel_id}`. A maximum of 5
859 # channels are allowed. See
860 # https://cloud.google.com/billing/docs/how-to/budgets-notification-recipients
861 # for more details.
862 &quot;A String&quot;,
863 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700864 &quot;pubsubTopic&quot;: &quot;A String&quot;, # Required. The name of the Cloud Pub/Sub topic where budget related messages will be
865 # published, in the form `projects/{project_id}/topics/{topic_id}`. Updates
866 # are sent at regular intervals to the topic.
867 # The topic needs to be created before the budget is created; see
868 # https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications
869 # for more details.
870 # Caller is expected to have
871 # `pubsub.topics.setIamPolicy` permission on the topic when it&#x27;s set for a
872 # budget, otherwise, the API call will fail with PERMISSION_DENIED. See
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700873 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications
874 # for more details on Pub/Sub roles and permissions.
875 &quot;schemaVersion&quot;: &quot;A String&quot;, # Required. The schema version of the notification sent to `pubsub_topic`.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700876 # Only &quot;1.0&quot; is accepted. It represents the JSON schema as defined in
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700877 # https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format
Bu Sun Kim65020912020-05-20 12:08:20 -0700878 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700879 &quot;budgetFilter&quot;: { # A filter for a budget, limiting the scope of the cost to calculate. # Optional. Filters that define which resources are used to compute
880 # the actual spend against the budget.
881 &quot;projects&quot;: [ # Optional. A set of projects of the form `projects/{project}`,
882 # specifying that usage from only this set of projects should be
883 # included in the budget. If omitted, the report will include all usage for
884 # the billing account, regardless of which project the usage occurred on.
885 # Only zero or one project can be specified currently.
886 &quot;A String&quot;,
887 ],
888 &quot;subaccounts&quot;: [ # Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying
889 # that usage from only this set of subaccounts should be included in the
890 # budget. If a subaccount is set to the name of the parent account,
891 # usage from the parent account will be included. If omitted, the
892 # report will include usage from the parent account and all
893 # subaccounts, if they exist.
894 &quot;A String&quot;,
895 ],
896 &quot;creditTypesTreatment&quot;: &quot;A String&quot;, # Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`.
897 &quot;services&quot;: [ # Optional. A set of services of the form `services/{service_id}`,
898 # specifying that usage from only this set of services should be
899 # included in the budget. If omitted, the report will include usage for
900 # all the services.
901 # The service names are available through the Catalog API:
902 # https://cloud.google.com/billing/v1/how-tos/catalog-api.
903 &quot;A String&quot;,
904 ],
905 &quot;labels&quot;: { # Optional. A single label and value pair specifying that usage from only this set of
906 # labeled resources should be included in the budget. Currently, multiple
907 # entries or multiple values per entry are not allowed. If omitted, the
908 # report will include all labeled and unlabeled usage.
909 &quot;a_key&quot;: [
910 &quot;&quot;,
911 ],
912 },
913 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700914 &quot;thresholdRules&quot;: [ # Optional. Rules that trigger alerts (notifications of thresholds
915 # being crossed) when spend exceeds the specified percentages of the budget.
916 { # ThresholdRule contains a definition of a threshold which triggers
917 # an alert (a notification of a threshold being crossed) to be sent when
918 # spend goes above the specified amount.
919 # Alerts are automatically e-mailed to users with the Billing Account
920 # Administrator role or the Billing Account User role.
921 # The thresholds here have no effect on notifications sent to anything
922 # configured under `Budget.all_updates_rule`.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700923 &quot;spendBasis&quot;: &quot;A String&quot;, # Optional. The type of basis used to determine if spend has passed the
924 # threshold. Behavior defaults to CURRENT_SPEND if not set.
Bu Sun Kim65020912020-05-20 12:08:20 -0700925 &quot;thresholdPercent&quot;: 3.14, # Required. Send an alert when this threshold is exceeded.
926 # This is a 1.0-based percentage, so 0.5 = 50%.
927 # Validation: non-negative number.
928 },
929 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700930 &quot;etag&quot;: &quot;A String&quot;, # Optional. Etag to validate that the object is unchanged for a
931 # read-modify-write operation.
932 # An empty etag will cause an update to overwrite other changes.
Bu Sun Kim65020912020-05-20 12:08:20 -0700933 }</pre>
934</div>
935
936</body></html>