Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit d71d558

Browse files
docs: Add documentation for enums (#257)
* docs: Add documentation for enums fix: Add context manager return types chore: Update gapic-generator-python to v1.8.1 PiperOrigin-RevId: 503210727 Source-Link: googleapis/googleapis@a391fd1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0080f830dec37c3384157082bce279e37079ea58 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDA4MGY4MzBkZWMzN2MzMzg0MTU3MDgyYmNlMjc5ZTM3MDc5ZWE1OCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent a2f3fd3 commit d71d558

File tree

6 files changed

+96
-4
lines changed

6 files changed

+96
-4
lines changed

google/cloud/billing/budgets_v1/services/budget_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def sample_delete_budget():
10121012
metadata=metadata,
10131013
)
10141014

1015-
def __enter__(self):
1015+
def __enter__(self) -> "BudgetServiceClient":
10161016
return self
10171017

10181018
def __exit__(self, type, value, traceback):

google/cloud/billing/budgets_v1/types/budget_model.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ class CalendarPeriod(proto.Enum):
4040
period that has a canonical start. Grammatically, "the start of the
4141
current ``CalendarPeriod``". All calendar times begin at 12 AM US
4242
and Canadian Pacific Time (UTC-8).
43+
44+
Values:
45+
CALENDAR_PERIOD_UNSPECIFIED (0):
46+
47+
MONTH (1):
48+
A month. Month starts on the first day of
49+
each month, such as January 1, February 1, March
50+
1, and so on.
51+
QUARTER (2):
52+
A quarter. Quarters start on dates January 1,
53+
April 1, July 1, and October 1 of each year.
54+
YEAR (3):
55+
A year. Year starts on January 1.
4356
"""
4457
CALENDAR_PERIOD_UNSPECIFIED = 0
4558
MONTH = 1
@@ -201,6 +214,20 @@ class ThresholdRule(proto.Message):
201214
class Basis(proto.Enum):
202215
r"""The type of basis used to determine if spend has passed the
203216
threshold.
217+
218+
Values:
219+
BASIS_UNSPECIFIED (0):
220+
Unspecified threshold basis.
221+
CURRENT_SPEND (1):
222+
Use current spend as the basis for comparison
223+
against the threshold.
224+
FORECASTED_SPEND (2):
225+
Use forecasted spend for the period as the basis for
226+
comparison against the threshold. FORECASTED_SPEND can only
227+
be set when the budget's time period is a
228+
[Filter.calendar_period][google.cloud.billing.budgets.v1.Filter.calendar_period].
229+
It cannot be set in combination with
230+
[Filter.custom_period][google.cloud.billing.budgets.v1.Filter.custom_period].
204231
"""
205232
BASIS_UNSPECIFIED = 0
206233
CURRENT_SPEND = 1
@@ -363,6 +390,24 @@ class CreditTypesTreatment(proto.Enum):
363390
applicable selected credits. `See the documentation for a list of
364391
credit
365392
types <https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type>`__.
393+
394+
Values:
395+
CREDIT_TYPES_TREATMENT_UNSPECIFIED (0):
396+
397+
INCLUDE_ALL_CREDITS (1):
398+
All types of credit are subtracted from the
399+
gross cost to determine the spend for threshold
400+
calculations.
401+
EXCLUDE_ALL_CREDITS (2):
402+
All types of credit are added to the net cost
403+
to determine the spend for threshold
404+
calculations.
405+
INCLUDE_SPECIFIED_CREDITS (3):
406+
`Credit
407+
types <https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type>`__
408+
specified in the credit_types field are subtracted from the
409+
gross cost to determine the spend for threshold
410+
calculations.
366411
"""
367412
CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0
368413
INCLUDE_ALL_CREDITS = 1

google/cloud/billing/budgets_v1beta1/services/budget_service/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ def sample_delete_budget():
879879
metadata=metadata,
880880
)
881881

882-
def __enter__(self):
882+
def __enter__(self) -> "BudgetServiceClient":
883883
return self
884884

885885
def __exit__(self, type, value, traceback):

google/cloud/billing/budgets_v1beta1/types/budget_model.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ class CalendarPeriod(proto.Enum):
4040
period that has a canonical start. Grammatically, "the start of the
4141
current ``CalendarPeriod``". All calendar times begin at 12 AM US
4242
and Canadian Pacific Time (UTC-8).
43+
44+
Values:
45+
CALENDAR_PERIOD_UNSPECIFIED (0):
46+
Calendar period is unset. This is the default
47+
if the budget is for a custom time period
48+
(CustomPeriod).
49+
MONTH (1):
50+
A month. Month starts on the first day of
51+
each month, such as January 1, February 1, March
52+
1, and so on.
53+
QUARTER (2):
54+
A quarter. Quarters start on dates January 1,
55+
April 1, July 1, and October 1 of each year.
56+
YEAR (3):
57+
A year. Year starts on January 1.
4358
"""
4459
CALENDAR_PERIOD_UNSPECIFIED = 0
4560
MONTH = 1
@@ -216,6 +231,20 @@ class ThresholdRule(proto.Message):
216231
class Basis(proto.Enum):
217232
r"""The type of basis used to determine if spend has passed the
218233
threshold.
234+
235+
Values:
236+
BASIS_UNSPECIFIED (0):
237+
Unspecified threshold basis.
238+
CURRENT_SPEND (1):
239+
Use current spend as the basis for comparison
240+
against the threshold.
241+
FORECASTED_SPEND (2):
242+
Use forecasted spend for the period as the basis for
243+
comparison against the threshold. FORECASTED_SPEND can only
244+
be set when the budget's time period is a
245+
[Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period].
246+
It cannot be set in combination with
247+
[Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period].
219248
"""
220249
BASIS_UNSPECIFIED = 0
221250
CURRENT_SPEND = 1
@@ -381,6 +410,24 @@ class CreditTypesTreatment(proto.Enum):
381410
applicable selected credits. `See the documentation for a list of
382411
credit
383412
types <https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type>`__.
413+
414+
Values:
415+
CREDIT_TYPES_TREATMENT_UNSPECIFIED (0):
416+
417+
INCLUDE_ALL_CREDITS (1):
418+
All types of credit are subtracted from the
419+
gross cost to determine the spend for threshold
420+
calculations.
421+
EXCLUDE_ALL_CREDITS (2):
422+
All types of credit are added to the net cost
423+
to determine the spend for threshold
424+
calculations.
425+
INCLUDE_SPECIFIED_CREDITS (3):
426+
`Credit
427+
types <https://cloud.google.com/billing/docs/how-to/export-data-bigquery-tables#credits-type>`__
428+
specified in the credit_types field are subtracted from the
429+
gross cost to determine the spend for threshold
430+
calculations.
384431
"""
385432
CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0
386433
INCLUDE_ALL_CREDITS = 1

samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-billing-budgets",
11-
"version": "1.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-cloud-billing-budgets",
11-
"version": "1.9.0"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)