From d71d5584d252d2804e12d0b951bf0ec8207dde0d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 11:46:17 -0500 Subject: [PATCH] docs: Add documentation for enums (#257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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: https://github.com/googleapis/googleapis/commit/a391fd1dac18dfdfa00c18c8404f2c3a6ff8e98e 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 --- .../services/budget_service/client.py | 2 +- .../billing/budgets_v1/types/budget_model.py | 45 ++++++++++++++++++ .../services/budget_service/client.py | 2 +- .../budgets_v1beta1/types/budget_model.py | 47 +++++++++++++++++++ ...adata_google.cloud.billing.budgets.v1.json | 2 +- ..._google.cloud.billing.budgets.v1beta1.json | 2 +- 6 files changed, 96 insertions(+), 4 deletions(-) diff --git a/google/cloud/billing/budgets_v1/services/budget_service/client.py b/google/cloud/billing/budgets_v1/services/budget_service/client.py index d1c3c00..685d25e 100644 --- a/google/cloud/billing/budgets_v1/services/budget_service/client.py +++ b/google/cloud/billing/budgets_v1/services/budget_service/client.py @@ -1012,7 +1012,7 @@ def sample_delete_budget(): metadata=metadata, ) - def __enter__(self): + def __enter__(self) -> "BudgetServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/billing/budgets_v1/types/budget_model.py b/google/cloud/billing/budgets_v1/types/budget_model.py index 99593b9..d509a88 100644 --- a/google/cloud/billing/budgets_v1/types/budget_model.py +++ b/google/cloud/billing/budgets_v1/types/budget_model.py @@ -40,6 +40,19 @@ class CalendarPeriod(proto.Enum): period that has a canonical start. Grammatically, "the start of the current ``CalendarPeriod``". All calendar times begin at 12 AM US and Canadian Pacific Time (UTC-8). + + Values: + CALENDAR_PERIOD_UNSPECIFIED (0): + + MONTH (1): + A month. Month starts on the first day of + each month, such as January 1, February 1, March + 1, and so on. + QUARTER (2): + A quarter. Quarters start on dates January 1, + April 1, July 1, and October 1 of each year. + YEAR (3): + A year. Year starts on January 1. """ CALENDAR_PERIOD_UNSPECIFIED = 0 MONTH = 1 @@ -201,6 +214,20 @@ class ThresholdRule(proto.Message): class Basis(proto.Enum): r"""The type of basis used to determine if spend has passed the threshold. + + Values: + BASIS_UNSPECIFIED (0): + Unspecified threshold basis. + CURRENT_SPEND (1): + Use current spend as the basis for comparison + against the threshold. + FORECASTED_SPEND (2): + Use forecasted spend for the period as the basis for + comparison against the threshold. FORECASTED_SPEND can only + be set when the budget's time period is a + [Filter.calendar_period][google.cloud.billing.budgets.v1.Filter.calendar_period]. + It cannot be set in combination with + [Filter.custom_period][google.cloud.billing.budgets.v1.Filter.custom_period]. """ BASIS_UNSPECIFIED = 0 CURRENT_SPEND = 1 @@ -363,6 +390,24 @@ class CreditTypesTreatment(proto.Enum): applicable selected credits. `See the documentation for a list of credit types `__. + + Values: + CREDIT_TYPES_TREATMENT_UNSPECIFIED (0): + + INCLUDE_ALL_CREDITS (1): + All types of credit are subtracted from the + gross cost to determine the spend for threshold + calculations. + EXCLUDE_ALL_CREDITS (2): + All types of credit are added to the net cost + to determine the spend for threshold + calculations. + INCLUDE_SPECIFIED_CREDITS (3): + `Credit + types `__ + specified in the credit_types field are subtracted from the + gross cost to determine the spend for threshold + calculations. """ CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0 INCLUDE_ALL_CREDITS = 1 diff --git a/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py b/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py index a54fd7d..b1473fe 100644 --- a/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py +++ b/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py @@ -879,7 +879,7 @@ def sample_delete_budget(): metadata=metadata, ) - def __enter__(self): + def __enter__(self) -> "BudgetServiceClient": return self def __exit__(self, type, value, traceback): diff --git a/google/cloud/billing/budgets_v1beta1/types/budget_model.py b/google/cloud/billing/budgets_v1beta1/types/budget_model.py index 695a5c7..4ed4362 100644 --- a/google/cloud/billing/budgets_v1beta1/types/budget_model.py +++ b/google/cloud/billing/budgets_v1beta1/types/budget_model.py @@ -40,6 +40,21 @@ class CalendarPeriod(proto.Enum): period that has a canonical start. Grammatically, "the start of the current ``CalendarPeriod``". All calendar times begin at 12 AM US and Canadian Pacific Time (UTC-8). + + Values: + CALENDAR_PERIOD_UNSPECIFIED (0): + Calendar period is unset. This is the default + if the budget is for a custom time period + (CustomPeriod). + MONTH (1): + A month. Month starts on the first day of + each month, such as January 1, February 1, March + 1, and so on. + QUARTER (2): + A quarter. Quarters start on dates January 1, + April 1, July 1, and October 1 of each year. + YEAR (3): + A year. Year starts on January 1. """ CALENDAR_PERIOD_UNSPECIFIED = 0 MONTH = 1 @@ -216,6 +231,20 @@ class ThresholdRule(proto.Message): class Basis(proto.Enum): r"""The type of basis used to determine if spend has passed the threshold. + + Values: + BASIS_UNSPECIFIED (0): + Unspecified threshold basis. + CURRENT_SPEND (1): + Use current spend as the basis for comparison + against the threshold. + FORECASTED_SPEND (2): + Use forecasted spend for the period as the basis for + comparison against the threshold. FORECASTED_SPEND can only + be set when the budget's time period is a + [Filter.calendar_period][google.cloud.billing.budgets.v1beta1.Filter.calendar_period]. + It cannot be set in combination with + [Filter.custom_period][google.cloud.billing.budgets.v1beta1.Filter.custom_period]. """ BASIS_UNSPECIFIED = 0 CURRENT_SPEND = 1 @@ -381,6 +410,24 @@ class CreditTypesTreatment(proto.Enum): applicable selected credits. `See the documentation for a list of credit types `__. + + Values: + CREDIT_TYPES_TREATMENT_UNSPECIFIED (0): + + INCLUDE_ALL_CREDITS (1): + All types of credit are subtracted from the + gross cost to determine the spend for threshold + calculations. + EXCLUDE_ALL_CREDITS (2): + All types of credit are added to the net cost + to determine the spend for threshold + calculations. + INCLUDE_SPECIFIED_CREDITS (3): + `Credit + types `__ + specified in the credit_types field are subtracted from the + gross cost to determine the spend for threshold + calculations. """ CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0 INCLUDE_ALL_CREDITS = 1 diff --git a/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json index 9e8bd99..9f6a8ee 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-billing-budgets", - "version": "1.9.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json index b1e7f94..33b9f5b 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-billing-budgets", - "version": "1.9.0" + "version": "0.1.0" }, "snippets": [ {