From 2fc26490d54ed4bc5c2c074188533593fa863bb5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 25 Jun 2020 13:27:57 -0700 Subject: [PATCH] docs: add multiprocessing note (#33) --- .flake8 | 2 + .gitignore | 2 + .kokoro/publish-docs.sh | 2 - .kokoro/release.sh | 2 - .kokoro/samples/lint/common.cfg | 34 ++ .kokoro/samples/lint/continuous.cfg | 6 + .kokoro/samples/lint/periodic.cfg | 6 + .kokoro/samples/lint/presubmit.cfg | 6 + .kokoro/samples/python3.6/common.cfg | 34 ++ .kokoro/samples/python3.6/continuous.cfg | 7 + .kokoro/samples/python3.6/periodic.cfg | 6 + .kokoro/samples/python3.6/presubmit.cfg | 6 + .kokoro/samples/python3.7/common.cfg | 34 ++ .kokoro/samples/python3.7/continuous.cfg | 6 + .kokoro/samples/python3.7/periodic.cfg | 6 + .kokoro/samples/python3.7/presubmit.cfg | 6 + .kokoro/samples/python3.8/common.cfg | 34 ++ .kokoro/samples/python3.8/continuous.cfg | 6 + .kokoro/samples/python3.8/periodic.cfg | 6 + .kokoro/samples/python3.8/presubmit.cfg | 6 + .kokoro/test-samples.sh | 104 +++++ MANIFEST.in | 3 + docs/conf.py | 9 +- docs/index.rst | 2 + docs/multiprocessing.rst | 7 + google/cloud/billing_budgets.py | 6 +- .../cloud/billing_budgets_v1beta1/__init__.py | 10 +- .../gapic/budget_service_client.py | 38 +- .../billing_budgets_v1beta1/gapic/enums.py | 14 + .../budget_service_grpc_transport.py | 18 +- .../proto/budget_model.proto | 23 +- .../proto/budget_model_pb2.py | 382 ++++++++++++------ .../proto/budget_service.proto | 17 +- .../proto/budget_service_pb2.py | 187 ++++----- .../proto/budget_service_pb2_grpc.py | 54 ++- google/cloud/billing_budgets_v1beta1/types.py | 13 +- noxfile.py | 31 +- scripts/decrypt-secrets.sh | 33 ++ scripts/readme-gen/readme_gen.py | 66 +++ scripts/readme-gen/templates/README.tmpl.rst | 87 ++++ scripts/readme-gen/templates/auth.tmpl.rst | 9 + .../templates/auth_api_key.tmpl.rst | 14 + .../templates/install_deps.tmpl.rst | 29 ++ .../templates/install_portaudio.tmpl.rst | 35 ++ synth.metadata | 22 +- synth.py | 4 + testing/.gitignore | 3 + 47 files changed, 1139 insertions(+), 298 deletions(-) create mode 100644 .kokoro/samples/lint/common.cfg create mode 100644 .kokoro/samples/lint/continuous.cfg create mode 100644 .kokoro/samples/lint/periodic.cfg create mode 100644 .kokoro/samples/lint/presubmit.cfg create mode 100644 .kokoro/samples/python3.6/common.cfg create mode 100644 .kokoro/samples/python3.6/continuous.cfg create mode 100644 .kokoro/samples/python3.6/periodic.cfg create mode 100644 .kokoro/samples/python3.6/presubmit.cfg create mode 100644 .kokoro/samples/python3.7/common.cfg create mode 100644 .kokoro/samples/python3.7/continuous.cfg create mode 100644 .kokoro/samples/python3.7/periodic.cfg create mode 100644 .kokoro/samples/python3.7/presubmit.cfg create mode 100644 .kokoro/samples/python3.8/common.cfg create mode 100644 .kokoro/samples/python3.8/continuous.cfg create mode 100644 .kokoro/samples/python3.8/periodic.cfg create mode 100644 .kokoro/samples/python3.8/presubmit.cfg create mode 100755 .kokoro/test-samples.sh create mode 100644 docs/multiprocessing.rst create mode 100755 scripts/decrypt-secrets.sh create mode 100644 scripts/readme-gen/readme_gen.py create mode 100644 scripts/readme-gen/templates/README.tmpl.rst create mode 100644 scripts/readme-gen/templates/auth.tmpl.rst create mode 100644 scripts/readme-gen/templates/auth_api_key.tmpl.rst create mode 100644 scripts/readme-gen/templates/install_deps.tmpl.rst create mode 100644 scripts/readme-gen/templates/install_portaudio.tmpl.rst create mode 100644 testing/.gitignore diff --git a/.flake8 b/.flake8 index 20fe9bd..ed93163 100644 --- a/.flake8 +++ b/.flake8 @@ -21,6 +21,8 @@ exclude = # Exclude generated code. **/proto/** **/gapic/** + **/services/** + **/types/** *_pb2.py # Standard linting exemptions. diff --git a/.gitignore b/.gitignore index 3fb06e0..b87e1ed 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ dist build eggs +.eggs parts bin var @@ -49,6 +50,7 @@ bigquery/docs/generated # Virtual environment env/ coverage.xml +sponge_log.xml # System test environment variables. system_tests/local_test_setup diff --git a/.kokoro/publish-docs.sh b/.kokoro/publish-docs.sh index 5f94ea9..5b0c452 100755 --- a/.kokoro/publish-docs.sh +++ b/.kokoro/publish-docs.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Disable buffering, so that the logs stream through. diff --git a/.kokoro/release.sh b/.kokoro/release.sh index f3f5a97..080e6d1 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Start the releasetool reporter diff --git a/.kokoro/samples/lint/common.cfg b/.kokoro/samples/lint/common.cfg new file mode 100644 index 0000000..6134568 --- /dev/null +++ b/.kokoro/samples/lint/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "lint" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-billingbudgets/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-billingbudgets/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/lint/continuous.cfg b/.kokoro/samples/lint/continuous.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/lint/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/lint/periodic.cfg b/.kokoro/samples/lint/periodic.cfg new file mode 100644 index 0000000..50fec96 --- /dev/null +++ b/.kokoro/samples/lint/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/lint/presubmit.cfg b/.kokoro/samples/lint/presubmit.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/lint/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.6/common.cfg b/.kokoro/samples/python3.6/common.cfg new file mode 100644 index 0000000..0ab1335 --- /dev/null +++ b/.kokoro/samples/python3.6/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.6" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-billingbudgets/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-billingbudgets/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.6/continuous.cfg b/.kokoro/samples/python3.6/continuous.cfg new file mode 100644 index 0000000..7218af1 --- /dev/null +++ b/.kokoro/samples/python3.6/continuous.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} + diff --git a/.kokoro/samples/python3.6/periodic.cfg b/.kokoro/samples/python3.6/periodic.cfg new file mode 100644 index 0000000..50fec96 --- /dev/null +++ b/.kokoro/samples/python3.6/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.6/presubmit.cfg b/.kokoro/samples/python3.6/presubmit.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/python3.6/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg new file mode 100644 index 0000000..49edab1 --- /dev/null +++ b/.kokoro/samples/python3.7/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.7" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-billingbudgets/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-billingbudgets/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.7/continuous.cfg b/.kokoro/samples/python3.7/continuous.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/python3.7/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/periodic.cfg b/.kokoro/samples/python3.7/periodic.cfg new file mode 100644 index 0000000..50fec96 --- /dev/null +++ b/.kokoro/samples/python3.7/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/presubmit.cfg b/.kokoro/samples/python3.7/presubmit.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/python3.7/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/common.cfg b/.kokoro/samples/python3.8/common.cfg new file mode 100644 index 0000000..b9885b0 --- /dev/null +++ b/.kokoro/samples/python3.8/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-billingbudgets/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-billingbudgets/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.8/continuous.cfg b/.kokoro/samples/python3.8/continuous.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/python3.8/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/periodic.cfg b/.kokoro/samples/python3.8/periodic.cfg new file mode 100644 index 0000000..50fec96 --- /dev/null +++ b/.kokoro/samples/python3.8/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/presubmit.cfg b/.kokoro/samples/python3.8/presubmit.cfg new file mode 100644 index 0000000..a1c8d97 --- /dev/null +++ b/.kokoro/samples/python3.8/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/test-samples.sh b/.kokoro/test-samples.sh new file mode 100755 index 0000000..6962321 --- /dev/null +++ b/.kokoro/test-samples.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# Copyright 2020 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 +# +# https://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. + + +# `-e` enables the script to automatically fail when a command fails +# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero +set -eo pipefail +# Enables `**` to include files nested inside sub-folders +shopt -s globstar + +cd github/python-billingbudgets + +# Run periodic samples tests at latest release +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then + LATEST_RELEASE=$(git describe --abbrev=0 --tags) + git checkout $LATEST_RELEASE +fi + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Debug: show build environment +env | grep KOKORO + +# Install nox +python3.6 -m pip install --upgrade --quiet nox + +# Use secrets acessor service account to get secrets +if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then + gcloud auth activate-service-account \ + --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \ + --project="cloud-devrel-kokoro-resources" +fi + +# This script will create 3 files: +# - testing/test-env.sh +# - testing/service-account.json +# - testing/client-secrets.json +./scripts/decrypt-secrets.sh + +source ./testing/test-env.sh +export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json + +# For cloud-run session, we activate the service account for gcloud sdk. +gcloud auth activate-service-account \ + --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" + +export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json + +echo -e "\n******************** TESTING PROJECTS ********************" + +# Switch to 'fail at end' to allow all tests to complete before exiting. +set +e +# Use RTN to return a non-zero value if the test fails. +RTN=0 +ROOT=$(pwd) +# Find all requirements.txt in the samples directory (may break on whitespace). +for file in samples/**/requirements.txt; do + cd "$ROOT" + # Navigate to the project folder. + file=$(dirname "$file") + cd "$file" + + echo "------------------------------------------------------------" + echo "- testing $file" + echo "------------------------------------------------------------" + + # Use nox to execute the tests for the project. + python3.6 -m nox -s "$RUN_TESTS_SESSION" + EXIT=$? + + # If this is a periodic build, send the test log to the Build Cop Bot. + # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop. + if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then + chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop + $KOKORO_GFILE_DIR/linux_amd64/buildcop + fi + + if [[ $EXIT -ne 0 ]]; then + RTN=1 + echo -e "\n Testing failed: Nox returned a non-zero exit code. \n" + else + echo -e "\n Testing completed.\n" + fi + +done +cd "$ROOT" + +# Workaround for Kokoro permissions issue: delete secrets +rm testing/{test-env.sh,client-secrets.json,service-account.json} + +exit "$RTN" \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 68855ab..e9e29d1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -20,3 +20,6 @@ recursive-include google *.json *.proto recursive-include tests * global-exclude *.py[co] global-exclude __pycache__ + +# Exclude scripts for samples readmegen +prune scripts/readme-gen \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 0509a72..f1452e2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,21 +38,18 @@ "sphinx.ext.napoleon", "sphinx.ext.todo", "sphinx.ext.viewcode", + "recommonmark", ] # autodoc/autosummary flags autoclass_content = "both" -autodoc_default_flags = ["members"] +autodoc_default_options = {"members": True} autosummary_generate = True # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] @@ -340,7 +337,7 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None), + "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), "grpc": ("https://grpc.io/grpc/python/", None), } diff --git a/docs/index.rst b/docs/index.rst index 813764f..7f667cc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,7 @@ .. include:: README.rst +.. include:: multiprocessing.rst + Api Reference ------------- .. toctree:: diff --git a/docs/multiprocessing.rst b/docs/multiprocessing.rst new file mode 100644 index 0000000..1cb29d4 --- /dev/null +++ b/docs/multiprocessing.rst @@ -0,0 +1,7 @@ +.. note:: + + Because this client uses :mod:`grpcio` library, it is safe to + share instances across threads. In multiprocessing scenarios, the best + practice is to create client instances *after* the invocation of + :func:`os.fork` by :class:`multiprocessing.Pool` or + :class:`multiprocessing.Process`. diff --git a/google/cloud/billing_budgets.py b/google/cloud/billing_budgets.py index 602f2e8..fecd02b 100644 --- a/google/cloud/billing_budgets.py +++ b/google/cloud/billing_budgets.py @@ -22,4 +22,8 @@ from google.cloud.billing_budgets_v1beta1 import types -__all__ = ("enums", "types", "BudgetServiceClient") +__all__ = ( + "enums", + "types", + "BudgetServiceClient", +) diff --git a/google/cloud/billing_budgets_v1beta1/__init__.py b/google/cloud/billing_budgets_v1beta1/__init__.py index 79ad050..0fcaa72 100644 --- a/google/cloud/billing_budgets_v1beta1/__init__.py +++ b/google/cloud/billing_budgets_v1beta1/__init__.py @@ -26,8 +26,8 @@ if sys.version_info[:2] == (2, 7): message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" + "A future version of this library will drop support for Python 2.7. " + "More details about Python 2 support for Google Cloud Client Libraries " "can be found at https://cloud.google.com/python/docs/python2-sunset/" ) warnings.warn(message, DeprecationWarning) @@ -38,4 +38,8 @@ class BudgetServiceClient(budget_service_client.BudgetServiceClient): enums = enums -__all__ = ("enums", "types", "BudgetServiceClient") +__all__ = ( + "enums", + "types", + "BudgetServiceClient", +) diff --git a/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py b/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py index 10c1361..793935a 100644 --- a/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py +++ b/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py @@ -44,7 +44,7 @@ _GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-billing-budgets" + "google-cloud-billing-budgets", ).version @@ -85,7 +85,7 @@ def from_service_account_file(cls, filename, *args, **kwargs): def billing_account_path(cls, billing_account): """Return a fully-qualified billing_account string.""" return google.api_core.path_template.expand( - "billingAccounts/{billing_account}", billing_account=billing_account + "billingAccounts/{billing_account}", billing_account=billing_account, ) @classmethod @@ -184,12 +184,12 @@ def __init__( self.transport = transport else: self.transport = budget_service_grpc_transport.BudgetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -200,7 +200,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -272,7 +272,7 @@ def create_budget( client_info=self._client_info, ) - request = budget_service_pb2.CreateBudgetRequest(parent=parent, budget=budget) + request = budget_service_pb2.CreateBudgetRequest(parent=parent, budget=budget,) if metadata is None: metadata = [] metadata = list(metadata) @@ -301,6 +301,10 @@ def update_budget( """ Updates a budget and returns the updated budget. + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. Budget fields that are not exposed in + this API will not be changed by this method. + Example: >>> from google.cloud import billing_budgets_v1beta1 >>> @@ -357,7 +361,7 @@ def update_budget( ) request = budget_service_pb2.UpdateBudgetRequest( - budget=budget, update_mask=update_mask + budget=budget, update_mask=update_mask, ) if metadata is None: metadata = [] @@ -386,6 +390,11 @@ def get_budget( """ Returns a budget. + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. When reading from the API, you will not + see these fields in the return value, though they may have been set + in the Cloud Console. + Example: >>> from google.cloud import billing_budgets_v1beta1 >>> @@ -428,7 +437,7 @@ def get_budget( client_info=self._client_info, ) - request = budget_service_pb2.GetBudgetRequest(name=name) + request = budget_service_pb2.GetBudgetRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -457,6 +466,11 @@ def list_budgets( """ Returns a list of budgets for a billing account. + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. When reading from the API, you will not + see these fields in the return value, though they may have been set + in the Cloud Console. + Example: >>> from google.cloud import billing_budgets_v1beta1 >>> @@ -479,8 +493,8 @@ def list_budgets( ... pass Args: - parent (str): Required. Name of billing account to list budgets under. Values are of - the form ``billingAccounts/{billingAccountId}``. + parent (str): Required. Name of billing account to list budgets under. Values are + of the form ``billingAccounts/{billingAccountId}``. page_size (int): The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page @@ -520,7 +534,7 @@ def list_budgets( ) request = budget_service_pb2.ListBudgetsRequest( - parent=parent, page_size=page_size + parent=parent, page_size=page_size, ) if metadata is None: metadata = [] @@ -599,7 +613,7 @@ def delete_budget( client_info=self._client_info, ) - request = budget_service_pb2.DeleteBudgetRequest(name=name) + request = budget_service_pb2.DeleteBudgetRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) diff --git a/google/cloud/billing_budgets_v1beta1/gapic/enums.py b/google/cloud/billing_budgets_v1beta1/gapic/enums.py index 39ead59..5aae84c 100644 --- a/google/cloud/billing_budgets_v1beta1/gapic/enums.py +++ b/google/cloud/billing_budgets_v1beta1/gapic/enums.py @@ -19,6 +19,20 @@ import enum +class NullValue(enum.IntEnum): + """ + ``NullValue`` is a singleton enumeration to represent the null value + for the ``Value`` type union. + + The JSON representation for ``NullValue`` is JSON ``null``. + + Attributes: + NULL_VALUE (int): Null value. + """ + + NULL_VALUE = 0 + + class Filter(object): class CreditTypesTreatment(enum.IntEnum): """ diff --git a/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py b/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py index bf49a4d..f1188de 100644 --- a/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py +++ b/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py @@ -56,7 +56,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -75,7 +75,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "budget_service_stub": budget_service_pb2_grpc.BudgetServiceStub(channel) + "budget_service_stub": budget_service_pb2_grpc.BudgetServiceStub(channel), } @classmethod @@ -131,6 +131,10 @@ def update_budget(self): Updates a budget and returns the updated budget. + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. Budget fields that are not exposed in + this API will not be changed by this method. + Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a @@ -144,6 +148,11 @@ def get_budget(self): Returns a budget. + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. When reading from the API, you will not + see these fields in the return value, though they may have been set + in the Cloud Console. + Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a @@ -157,6 +166,11 @@ def list_budgets(self): Returns a list of budgets for a billing account. + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. When reading from the API, you will not + see these fields in the return value, though they may have been set + in the Cloud Console. + Returns: Callable: A callable which accepts the appropriate deserialized request object and returns a diff --git a/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto b/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto index 89e96be..fb2f1cf 100644 --- a/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto +++ b/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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"; @@ -19,6 +18,7 @@ package google.cloud.billing.budgets.v1beta1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; import "google/type/money.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets"; @@ -52,9 +52,9 @@ message Budget { // Required. Budgeted amount. BudgetAmount amount = 4 [(google.api.field_behavior) = REQUIRED]; - // Required. Rules that trigger alerts (notifications of thresholds + // Optional. Rules that trigger alerts (notifications of thresholds // being crossed) when spend exceeds the specified percentages of the budget. - repeated ThresholdRule threshold_rules = 5 [(google.api.field_behavior) = REQUIRED]; + repeated ThresholdRule threshold_rules = 5 [(google.api.field_behavior) = OPTIONAL]; // Optional. Rules to apply to all updates to the actual spend, regardless // of the thresholds set in `threshold_rules`. @@ -160,7 +160,7 @@ message Filter { EXCLUDE_ALL_CREDITS = 2; } - // Optional. A set of projects of the form `projects/{project_id}`, + // Optional. A set of projects of the form `projects/{project}`, // specifying that usage from only this set of projects should be // included in the budget. If omitted, the report will include all usage for // the billing account, regardless of which project the usage occurred on. @@ -177,4 +177,17 @@ message Filter { // The service names are available through the Catalog API: // https://cloud.google.com/billing/v1/how-tos/catalog-api. repeated string services = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of subaccounts of the form `billingAccounts/{account_id}`, specifying + // that usage from only this set of subaccounts should be included in the + // budget. If a subaccount is set to the name of the master account, usage + // from the master account will be included. If omitted, the report will + // include usage from the master account and all subaccounts, if they exist. + repeated string subaccounts = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A single label and value pair specifying that usage from only this set of + // labeled resources should be included in the budget. Multiple entries or + // multiple values per entry are not allowed. If omitted, the report will + // include all labeled and unlabeled usage. + map labels = 6 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py b/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py index cd0b269..6f8987a 100644 --- a/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py +++ b/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/billing/budgets_v1beta1/proto/budget_model.proto +# source: google/cloud/billing_budgets_v1beta1/proto/budget_model.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -17,22 +14,21 @@ from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from google.type import money_pb2 as google_dot_type_dot_money__pb2 DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/billing/budgets_v1beta1/proto/budget_model.proto", + name="google/cloud/billing_budgets_v1beta1/proto/budget_model.proto", package="google.cloud.billing.budgets.v1beta1", syntax="proto3", - serialized_options=_b( - "\n(com.google.cloud.billing.budgets.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets" - ), - serialized_pb=_b( - '\n=google/cloud/billing/budgets_v1beta1/proto/budget_model.proto\x12$google.cloud.billing.budgets.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/type/money.proto"\xde\x03\n\x06\x42udget\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\rbudget_filter\x18\x03 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.FilterB\x03\xe0\x41\x01\x12G\n\x06\x61mount\x18\x04 \x01(\x0b\x32\x32.google.cloud.billing.budgets.v1beta1.BudgetAmountB\x03\xe0\x41\x02\x12Q\n\x0fthreshold_rules\x18\x05 \x03(\x0b\x32\x33.google.cloud.billing.budgets.v1beta1.ThresholdRuleB\x03\xe0\x41\x02\x12S\n\x10\x61ll_updates_rule\x18\x06 \x01(\x0b\x32\x34.google.cloud.billing.budgets.v1beta1.AllUpdatesRuleB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x07 \x01(\tB\x03\xe0\x41\x01:]\xea\x41Z\n$billingbudgets.googleapis.com/Budget\x12\x32\x62illingAccounts/{billing_account}/budgets/{budget}"\xa5\x01\n\x0c\x42udgetAmount\x12.\n\x10specified_amount\x18\x01 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12T\n\x12last_period_amount\x18\x02 \x01(\x0b\x32\x36.google.cloud.billing.budgets.v1beta1.LastPeriodAmountH\x00\x42\x0f\n\rbudget_amount"\x12\n\x10LastPeriodAmount"\xcd\x01\n\rThresholdRule\x12\x1e\n\x11threshold_percent\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x12S\n\x0bspend_basis\x18\x02 \x01(\x0e\x32\x39.google.cloud.billing.budgets.v1beta1.ThresholdRule.BasisB\x03\xe0\x41\x01"G\n\x05\x42\x61sis\x12\x15\n\x11\x42\x41SIS_UNSPECIFIED\x10\x00\x12\x11\n\rCURRENT_SPEND\x10\x01\x12\x14\n\x10\x46ORECASTED_SPEND\x10\x02"H\n\x0e\x41llUpdatesRule\x12\x19\n\x0cpubsub_topic\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0eschema_version\x18\x02 \x01(\tB\x03\xe0\x41\x02"\x90\x02\n\x06\x46ilter\x12\x15\n\x08projects\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x66\n\x16\x63redit_types_treatment\x18\x04 \x01(\x0e\x32\x41.google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatmentB\x03\xe0\x41\x01\x12\x15\n\x08services\x18\x03 \x03(\tB\x03\xe0\x41\x01"p\n\x14\x43reditTypesTreatment\x12&\n"CREDIT_TYPES_TREATMENT_UNSPECIFIED\x10\x00\x12\x17\n\x13INCLUDE_ALL_CREDITS\x10\x01\x12\x17\n\x13\x45XCLUDE_ALL_CREDITS\x10\x02\x42y\n(com.google.cloud.billing.budgets.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgetsb\x06proto3' - ), + serialized_options=b"\n(com.google.cloud.billing.budgets.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n=google/cloud/billing_budgets_v1beta1/proto/budget_model.proto\x12$google.cloud.billing.budgets.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x17google/type/money.proto"\xde\x03\n\x06\x42udget\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\rbudget_filter\x18\x03 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.FilterB\x03\xe0\x41\x01\x12G\n\x06\x61mount\x18\x04 \x01(\x0b\x32\x32.google.cloud.billing.budgets.v1beta1.BudgetAmountB\x03\xe0\x41\x02\x12Q\n\x0fthreshold_rules\x18\x05 \x03(\x0b\x32\x33.google.cloud.billing.budgets.v1beta1.ThresholdRuleB\x03\xe0\x41\x01\x12S\n\x10\x61ll_updates_rule\x18\x06 \x01(\x0b\x32\x34.google.cloud.billing.budgets.v1beta1.AllUpdatesRuleB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x07 \x01(\tB\x03\xe0\x41\x01:]\xea\x41Z\n$billingbudgets.googleapis.com/Budget\x12\x32\x62illingAccounts/{billing_account}/budgets/{budget}"\xa5\x01\n\x0c\x42udgetAmount\x12.\n\x10specified_amount\x18\x01 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12T\n\x12last_period_amount\x18\x02 \x01(\x0b\x32\x36.google.cloud.billing.budgets.v1beta1.LastPeriodAmountH\x00\x42\x0f\n\rbudget_amount"\x12\n\x10LastPeriodAmount"\xcd\x01\n\rThresholdRule\x12\x1e\n\x11threshold_percent\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x12S\n\x0bspend_basis\x18\x02 \x01(\x0e\x32\x39.google.cloud.billing.budgets.v1beta1.ThresholdRule.BasisB\x03\xe0\x41\x01"G\n\x05\x42\x61sis\x12\x15\n\x11\x42\x41SIS_UNSPECIFIED\x10\x00\x12\x11\n\rCURRENT_SPEND\x10\x01\x12\x14\n\x10\x46ORECASTED_SPEND\x10\x02"H\n\x0e\x41llUpdatesRule\x12\x19\n\x0cpubsub_topic\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0eschema_version\x18\x02 \x01(\tB\x03\xe0\x41\x02"\xc4\x03\n\x06\x46ilter\x12\x15\n\x08projects\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x66\n\x16\x63redit_types_treatment\x18\x04 \x01(\x0e\x32\x41.google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatmentB\x03\xe0\x41\x01\x12\x15\n\x08services\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x18\n\x0bsubaccounts\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12M\n\x06labels\x18\x06 \x03(\x0b\x32\x38.google.cloud.billing.budgets.v1beta1.Filter.LabelsEntryB\x03\xe0\x41\x01\x1aI\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.ListValue:\x02\x38\x01"p\n\x14\x43reditTypesTreatment\x12&\n"CREDIT_TYPES_TREATMENT_UNSPECIFIED\x10\x00\x12\x17\n\x13INCLUDE_ALL_CREDITS\x10\x01\x12\x17\n\x13\x45XCLUDE_ALL_CREDITS\x10\x02\x42y\n(com.google.cloud.billing.budgets.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgetsb\x06proto3', dependencies=[ google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, google_dot_api_dot_resource__pb2.DESCRIPTOR, + google_dot_protobuf_dot_struct__pb2.DESCRIPTOR, google_dot_type_dot_money__pb2.DESCRIPTOR, ], ) @@ -43,6 +39,7 @@ full_name="google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="BASIS_UNSPECIFIED", @@ -50,9 +47,15 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="CURRENT_SPEND", index=1, number=1, serialized_options=None, type=None + name="CURRENT_SPEND", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="FORECASTED_SPEND", @@ -60,12 +63,13 @@ number=2, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, serialized_options=None, - serialized_start=992, - serialized_end=1063, + serialized_start=1022, + serialized_end=1093, ) _sym_db.RegisterEnumDescriptor(_THRESHOLDRULE_BASIS) @@ -74,6 +78,7 @@ full_name="google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="CREDIT_TYPES_TREATMENT_UNSPECIFIED", @@ -81,6 +86,7 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="INCLUDE_ALL_CREDITS", @@ -88,6 +94,7 @@ number=1, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="EXCLUDE_ALL_CREDITS", @@ -95,12 +102,13 @@ number=2, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, serialized_options=None, - serialized_start=1300, - serialized_end=1412, + serialized_start=1510, + serialized_end=1622, ) _sym_db.RegisterEnumDescriptor(_FILTER_CREDITTYPESTREATMENT) @@ -111,6 +119,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -121,14 +130,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\003"), + serialized_options=b"\340A\003", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="display_name", @@ -139,7 +149,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -147,6 +157,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="budget_filter", @@ -163,8 +174,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="amount", @@ -181,8 +193,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="threshold_rules", @@ -199,8 +212,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="all_updates_rule", @@ -217,8 +231,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="etag", @@ -229,28 +244,27 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b( - "\352AZ\n$billingbudgets.googleapis.com/Budget\0222billingAccounts/{billing_account}/budgets/{budget}" - ), + serialized_options=b"\352AZ\n$billingbudgets.googleapis.com/Budget\0222billingAccounts/{billing_account}/budgets/{budget}", is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=189, - serialized_end=667, + serialized_start=219, + serialized_end=697, ) @@ -260,6 +274,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="specified_amount", @@ -278,6 +293,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_period_amount", @@ -296,6 +312,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -311,11 +328,12 @@ full_name="google.cloud.billing.budgets.v1beta1.BudgetAmount.budget_amount", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], - serialized_start=670, - serialized_end=835, + serialized_start=700, + serialized_end=865, ) @@ -325,6 +343,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], extensions=[], nested_types=[], @@ -334,8 +353,8 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=837, - serialized_end=855, + serialized_start=867, + serialized_end=885, ) @@ -345,6 +364,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="threshold_percent", @@ -361,8 +381,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="spend_basis", @@ -379,20 +400,21 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], - enum_types=[_THRESHOLDRULE_BASIS], + enum_types=[_THRESHOLDRULE_BASIS,], serialized_options=None, is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=858, - serialized_end=1063, + serialized_start=888, + serialized_end=1093, ) @@ -402,6 +424,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="pubsub_topic", @@ -412,14 +435,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="schema_version", @@ -430,14 +454,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -448,17 +473,77 @@ syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1065, - serialized_end=1137, + serialized_start=1095, + serialized_end=1167, ) +_FILTER_LABELSENTRY = _descriptor.Descriptor( + name="LabelsEntry", + full_name="google.cloud.billing.budgets.v1beta1.Filter.LabelsEntry", + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name="key", + full_name="google.cloud.billing.budgets.v1beta1.Filter.LabelsEntry.key", + index=0, + number=1, + type=9, + cpp_type=9, + label=1, + has_default_value=False, + default_value=b"".decode("utf-8"), + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="value", + full_name="google.cloud.billing.budgets.v1beta1.Filter.LabelsEntry.value", + index=1, + number=2, + type=11, + cpp_type=10, + label=1, + has_default_value=False, + default_value=None, + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + ], + extensions=[], + nested_types=[], + enum_types=[], + serialized_options=b"8\001", + is_extendable=False, + syntax="proto3", + extension_ranges=[], + oneofs=[], + serialized_start=1435, + serialized_end=1508, +) + _FILTER = _descriptor.Descriptor( name="Filter", full_name="google.cloud.billing.budgets.v1beta1.Filter", filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="projects", @@ -475,8 +560,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="credit_types_treatment", @@ -493,8 +579,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="services", @@ -511,20 +598,59 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="subaccounts", + full_name="google.cloud.billing.budgets.v1beta1.Filter.subaccounts", + index=3, + number=5, + type=9, + cpp_type=9, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + ), + _descriptor.FieldDescriptor( + name="labels", + full_name="google.cloud.billing.budgets.v1beta1.Filter.labels", + index=4, + number=6, + type=11, + cpp_type=10, + label=3, + has_default_value=False, + default_value=[], + message_type=None, + enum_type=None, + containing_type=None, + is_extension=False, + extension_scope=None, + serialized_options=b"\340A\001", + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[], - enum_types=[_FILTER_CREDITTYPESTREATMENT], + nested_types=[_FILTER_LABELSENTRY,], + enum_types=[_FILTER_CREDITTYPESTREATMENT,], serialized_options=None, is_extendable=False, syntax="proto3", extension_ranges=[], oneofs=[], - serialized_start=1140, - serialized_end=1412, + serialized_start=1170, + serialized_end=1622, ) _BUDGET.fields_by_name["budget_filter"].message_type = _FILTER @@ -549,9 +675,14 @@ ].containing_oneof = _BUDGETAMOUNT.oneofs_by_name["budget_amount"] _THRESHOLDRULE.fields_by_name["spend_basis"].enum_type = _THRESHOLDRULE_BASIS _THRESHOLDRULE_BASIS.containing_type = _THRESHOLDRULE +_FILTER_LABELSENTRY.fields_by_name[ + "value" +].message_type = google_dot_protobuf_dot_struct__pb2._LISTVALUE +_FILTER_LABELSENTRY.containing_type = _FILTER _FILTER.fields_by_name[ "credit_types_treatment" ].enum_type = _FILTER_CREDITTYPESTREATMENT +_FILTER.fields_by_name["labels"].message_type = _FILTER_LABELSENTRY _FILTER_CREDITTYPESTREATMENT.containing_type = _FILTER DESCRIPTOR.message_types_by_name["Budget"] = _BUDGET DESCRIPTOR.message_types_by_name["BudgetAmount"] = _BUDGETAMOUNT @@ -564,16 +695,15 @@ Budget = _reflection.GeneratedProtocolMessageType( "Budget", (_message.Message,), - dict( - DESCRIPTOR=_BUDGET, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""A budget is a plan that describes what you expect to spend - on Cloud projects, plus the rules to execute as spend is tracked against - that plan, (for example, send an alert when 90% of the target spend is + { + "DESCRIPTOR": _BUDGET, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2", + "__doc__": """A budget is a plan that describes what you expect to spend on Cloud + projects, plus the rules to execute as spend is tracked against that + plan, (for example, send an alert when 90% of the target spend is met). Currently all plans are monthly budgets so the usage period(s) tracked are implied (calendar months of usage back-to-back). - Attributes: name: Output only. Resource name of the budget. The resource name @@ -587,7 +717,7 @@ amount: Required. Budgeted amount. threshold_rules: - Required. Rules that trigger alerts (notifications of + Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. all_updates_rule: @@ -599,18 +729,17 @@ update to overwrite other changes. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.Budget) - ), + }, ) _sym_db.RegisterMessage(Budget) BudgetAmount = _reflection.GeneratedProtocolMessageType( "BudgetAmount", (_message.Message,), - dict( - DESCRIPTOR=_BUDGETAMOUNT, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""The budgeted amount for each usage period. - + { + "DESCRIPTOR": _BUDGETAMOUNT, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2", + "__doc__": """The budgeted amount for each usage period. Attributes: budget_amount: @@ -620,47 +749,44 @@ optional. If specified, it must match the currency of the billing account. The ``currency_code`` is provided on output. last_period_amount: - Use the last period's actual spend as the budget for the + Use the last period’s actual spend as the budget for the present period. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.BudgetAmount) - ), + }, ) _sym_db.RegisterMessage(BudgetAmount) LastPeriodAmount = _reflection.GeneratedProtocolMessageType( "LastPeriodAmount", (_message.Message,), - dict( - DESCRIPTOR=_LASTPERIODAMOUNT, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""Describes a budget amount targeted to last period's spend. - At this time, the amount is automatically 100% of last period's spend; - that is, there are no other options yet. Future configuration will be - described here (for example, configuring a percentage of last period's - spend). - - """, + { + "DESCRIPTOR": _LASTPERIODAMOUNT, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2", + "__doc__": """Describes a budget amount targeted to last period’s spend. At this + time, the amount is automatically 100% of last period’s spend; that + is, there are no other options yet. Future configuration will be + described here (for example, configuring a percentage of last period’s + spend).""", # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.LastPeriodAmount) - ), + }, ) _sym_db.RegisterMessage(LastPeriodAmount) ThresholdRule = _reflection.GeneratedProtocolMessageType( "ThresholdRule", (_message.Message,), - dict( - DESCRIPTOR=_THRESHOLDRULE, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""ThresholdRule contains a definition of a threshold which - triggers an alert (a notification of a threshold being crossed) to be - sent when spend goes above the specified amount. Alerts are - automatically e-mailed to users with the Billing Account Administrator - role or the Billing Account User role. The thresholds here have no - effect on notifications sent to anything configured under + { + "DESCRIPTOR": _THRESHOLDRULE, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2", + "__doc__": """ThresholdRule contains a definition of a threshold which triggers an + alert (a notification of a threshold being crossed) to be sent when + spend goes above the specified amount. Alerts are automatically + e-mailed to users with the Billing Account Administrator role or the + Billing Account User role. The thresholds here have no effect on + notifications sent to anything configured under ``Budget.all_updates_rule``. - Attributes: threshold_percent: Required. Send an alert when this threshold is exceeded. This @@ -668,24 +794,23 @@ negative number. spend_basis: Optional. The type of basis used to determine if spend has - passed the threshold. Behavior defaults to CURRENT\_SPEND if + passed the threshold. Behavior defaults to CURRENT_SPEND if not set. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.ThresholdRule) - ), + }, ) _sym_db.RegisterMessage(ThresholdRule) AllUpdatesRule = _reflection.GeneratedProtocolMessageType( "AllUpdatesRule", (_message.Message,), - dict( - DESCRIPTOR=_ALLUPDATESRULE, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""AllUpdatesRule defines notifications that are sent on - every update to the billing account's spend, regardless of the - thresholds defined using threshold rules. - + { + "DESCRIPTOR": _ALLUPDATESRULE, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2", + "__doc__": """AllUpdatesRule defines notifications that are sent on every update to + the billing account’s spend, regardless of the thresholds defined + using threshold rules. Attributes: pubsub_topic: @@ -697,39 +822,46 @@ https://cloud.google.com/billing/docs/how-to/budgets#manage- notifications for more details. Caller is expected to have ``pubsub.topics.setIamPolicy`` permission on the topic when - it's set for a budget, otherwise, the API call will fail with - PERMISSION\_DENIED. See + it’s set for a budget, otherwise, the API call will fail with + PERMISSION_DENIED. See https://cloud.google.com/pubsub/docs/access-control for more details on Pub/Sub roles and permissions. schema_version: - Required. The schema version of the notification. Only "1.0" + Required. The schema version of the notification. Only “1.0” is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how- - to/budgets#notification\_format + to/budgets#notification_format """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.AllUpdatesRule) - ), + }, ) _sym_db.RegisterMessage(AllUpdatesRule) Filter = _reflection.GeneratedProtocolMessageType( "Filter", (_message.Message,), - dict( - DESCRIPTOR=_FILTER, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""A filter for a budget, limiting the scope of the cost to - calculate. - + { + "LabelsEntry": _reflection.GeneratedProtocolMessageType( + "LabelsEntry", + (_message.Message,), + { + "DESCRIPTOR": _FILTER_LABELSENTRY, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2" + # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.Filter.LabelsEntry) + }, + ), + "DESCRIPTOR": _FILTER, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_model_pb2", + "__doc__": """A filter for a budget, limiting the scope of the cost to calculate. Attributes: projects: Optional. A set of projects of the form - ``projects/{project_id}``, specifying that usage from only - this set of projects should be included in the budget. If - omitted, the report will include all usage for the billing - account, regardless of which project the usage occurred on. - Only zero or one project can be specified currently. + ``projects/{project}``, specifying that usage from only this + set of projects should be included in the budget. If omitted, + the report will include all usage for the billing account, + regardless of which project the usage occurred on. Only zero + or one project can be specified currently. credit_types_treatment: Optional. If not set, default behavior is ``INCLUDE_ALL_CREDITS``. @@ -740,11 +872,26 @@ omitted, the report will include usage for all the services. The service names are available through the Catalog API: https://cloud.google.com/billing/v1/how-tos/catalog-api. + subaccounts: + Optional. A set of subaccounts of the form + ``billingAccounts/{account_id}``, specifying that usage from + only this set of subaccounts should be included in the budget. + If a subaccount is set to the name of the master account, + usage from the master account will be included. If omitted, + the report will include usage from the master account and all + subaccounts, if they exist. + labels: + Optional. A single label and value pair specifying that usage + from only this set of labeled resources should be included in + the budget. Multiple entries or multiple values per entry are + not allowed. If omitted, the report will include all labeled + and unlabeled usage. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.Filter) - ), + }, ) _sym_db.RegisterMessage(Filter) +_sym_db.RegisterMessage(Filter.LabelsEntry) DESCRIPTOR._options = None @@ -759,7 +906,10 @@ _THRESHOLDRULE.fields_by_name["spend_basis"]._options = None _ALLUPDATESRULE.fields_by_name["pubsub_topic"]._options = None _ALLUPDATESRULE.fields_by_name["schema_version"]._options = None +_FILTER_LABELSENTRY._options = None _FILTER.fields_by_name["projects"]._options = None _FILTER.fields_by_name["credit_types_treatment"]._options = None _FILTER.fields_by_name["services"]._options = None +_FILTER.fields_by_name["subaccounts"]._options = None +_FILTER.fields_by_name["labels"]._options = None # @@protoc_insertion_point(module_scope) diff --git a/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto b/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto index d5e0f4b..e15ecf5 100644 --- a/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto +++ b/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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"; @@ -46,6 +45,10 @@ service BudgetService { } // Updates a budget and returns the updated budget. + // + // WARNING: There are some fields exposed on the Google Cloud Console that + // aren't available on this API. Budget fields that are not exposed in + // this API will not be changed by this method. rpc UpdateBudget(UpdateBudgetRequest) returns (Budget) { option (google.api.http) = { patch: "/v1beta1/{budget.name=billingAccounts/*/budgets/*}" @@ -54,6 +57,11 @@ service BudgetService { } // Returns a budget. + // + // WARNING: There are some fields exposed on the Google Cloud Console that + // aren't available on this API. When reading from the API, you will not + // see these fields in the return value, though they may have been set + // in the Cloud Console. rpc GetBudget(GetBudgetRequest) returns (Budget) { option (google.api.http) = { get: "/v1beta1/{name=billingAccounts/*/budgets/*}" @@ -61,6 +69,11 @@ service BudgetService { } // Returns a list of budgets for a billing account. + // + // WARNING: There are some fields exposed on the Google Cloud Console that + // aren't available on this API. When reading from the API, you will not + // see these fields in the return value, though they may have been set + // in the Cloud Console. rpc ListBudgets(ListBudgetsRequest) returns (ListBudgetsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=billingAccounts/*}/budgets" diff --git a/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py b/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py index 37b3094..9a8f5d9 100644 --- a/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py +++ b/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/billing/budgets_v1beta1/proto/budget_service.proto +# source: google/cloud/billing_budgets_v1beta1/proto/budget_service.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -20,28 +17,25 @@ from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 from google.cloud.billing_budgets_v1beta1.proto import ( - budget_model_pb2 as google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2, + budget_model_pb2 as google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2, ) from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/billing/budgets_v1beta1/proto/budget_service.proto", + name="google/cloud/billing_budgets_v1beta1/proto/budget_service.proto", package="google.cloud.billing.budgets.v1beta1", syntax="proto3", - serialized_options=_b( - "\n(com.google.cloud.billing.budgets.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets" - ), - serialized_pb=_b( - '\n?google/cloud/billing/budgets_v1beta1/proto/budget_service.proto\x12$google.cloud.billing.budgets.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a=google/cloud/billing/budgets_v1beta1/proto/budget_model.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x96\x01\n\x13\x43reateBudgetRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$billingbudgets.googleapis.com/Budget\x12\x41\n\x06\x62udget\x18\x02 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.BudgetB\x03\xe0\x41\x02"\x8e\x01\n\x13UpdateBudgetRequest\x12\x41\n\x06\x62udget\x18\x01 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.BudgetB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01"N\n\x10GetBudgetRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$billingbudgets.googleapis.com/Budget"\x83\x01\n\x12ListBudgetsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$billingbudgets.googleapis.com/Budget\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01"m\n\x13ListBudgetsResponse\x12=\n\x07\x62udgets\x18\x01 \x03(\x0b\x32,.google.cloud.billing.budgets.v1beta1.Budget\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Q\n\x13\x44\x65leteBudgetRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$billingbudgets.googleapis.com/Budget2\xc9\x07\n\rBudgetService\x12\xaf\x01\n\x0c\x43reateBudget\x12\x39.google.cloud.billing.budgets.v1beta1.CreateBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"6\x82\xd3\xe4\x93\x02\x30"+/v1beta1/{parent=billingAccounts/*}/budgets:\x01*\x12\xb6\x01\n\x0cUpdateBudget\x12\x39.google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"=\x82\xd3\xe4\x93\x02\x37\x32\x32/v1beta1/{budget.name=billingAccounts/*/budgets/*}:\x01*\x12\xa6\x01\n\tGetBudget\x12\x36.google.cloud.billing.budgets.v1beta1.GetBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"3\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{name=billingAccounts/*/budgets/*}\x12\xb7\x01\n\x0bListBudgets\x12\x38.google.cloud.billing.budgets.v1beta1.ListBudgetsRequest\x1a\x39.google.cloud.billing.budgets.v1beta1.ListBudgetsResponse"3\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{parent=billingAccounts/*}/budgets\x12\x96\x01\n\x0c\x44\x65leteBudget\x12\x39.google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest\x1a\x16.google.protobuf.Empty"3\x82\xd3\xe4\x93\x02-*+/v1beta1/{name=billingAccounts/*/budgets/*}\x1aQ\xca\x41\x1d\x62illingbudgets.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBy\n(com.google.cloud.billing.budgets.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgetsb\x06proto3' - ), + serialized_options=b"\n(com.google.cloud.billing.budgets.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n?google/cloud/billing_budgets_v1beta1/proto/budget_service.proto\x12$google.cloud.billing.budgets.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a=google/cloud/billing_budgets_v1beta1/proto/budget_model.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x96\x01\n\x13\x43reateBudgetRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$billingbudgets.googleapis.com/Budget\x12\x41\n\x06\x62udget\x18\x02 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.BudgetB\x03\xe0\x41\x02"\x8e\x01\n\x13UpdateBudgetRequest\x12\x41\n\x06\x62udget\x18\x01 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.BudgetB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01"N\n\x10GetBudgetRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$billingbudgets.googleapis.com/Budget"\x83\x01\n\x12ListBudgetsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$billingbudgets.googleapis.com/Budget\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01"m\n\x13ListBudgetsResponse\x12=\n\x07\x62udgets\x18\x01 \x03(\x0b\x32,.google.cloud.billing.budgets.v1beta1.Budget\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Q\n\x13\x44\x65leteBudgetRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$billingbudgets.googleapis.com/Budget2\xc9\x07\n\rBudgetService\x12\xaf\x01\n\x0c\x43reateBudget\x12\x39.google.cloud.billing.budgets.v1beta1.CreateBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"6\x82\xd3\xe4\x93\x02\x30"+/v1beta1/{parent=billingAccounts/*}/budgets:\x01*\x12\xb6\x01\n\x0cUpdateBudget\x12\x39.google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"=\x82\xd3\xe4\x93\x02\x37\x32\x32/v1beta1/{budget.name=billingAccounts/*/budgets/*}:\x01*\x12\xa6\x01\n\tGetBudget\x12\x36.google.cloud.billing.budgets.v1beta1.GetBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"3\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{name=billingAccounts/*/budgets/*}\x12\xb7\x01\n\x0bListBudgets\x12\x38.google.cloud.billing.budgets.v1beta1.ListBudgetsRequest\x1a\x39.google.cloud.billing.budgets.v1beta1.ListBudgetsResponse"3\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{parent=billingAccounts/*}/budgets\x12\x96\x01\n\x0c\x44\x65leteBudget\x12\x39.google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest\x1a\x16.google.protobuf.Empty"3\x82\xd3\xe4\x93\x02-*+/v1beta1/{name=billingAccounts/*/budgets/*}\x1aQ\xca\x41\x1d\x62illingbudgets.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBy\n(com.google.cloud.billing.budgets.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgetsb\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.DESCRIPTOR, + google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.DESCRIPTOR, google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, ], @@ -54,6 +48,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -64,16 +59,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\022$billingbudgets.googleapis.com/Budget" - ), + serialized_options=b"\340A\002\372A&\022$billingbudgets.googleapis.com/Budget", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="budget", @@ -90,8 +84,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -113,6 +108,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="budget", @@ -129,8 +125,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_mask", @@ -147,8 +144,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -170,6 +168,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -180,17 +179,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$billingbudgets.googleapis.com/Budget" - ), + serialized_options=b"\340A\002\372A&\n$billingbudgets.googleapis.com/Budget", file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -211,6 +209,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -221,16 +220,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\022$billingbudgets.googleapis.com/Budget" - ), + serialized_options=b"\340A\002\372A&\022$billingbudgets.googleapis.com/Budget", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -247,8 +245,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -259,14 +258,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\001"), + serialized_options=b"\340A\001", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -288,6 +288,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="budgets", @@ -306,6 +307,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -316,7 +318,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -324,6 +326,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -345,6 +348,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -355,17 +359,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$billingbudgets.googleapis.com/Budget" - ), + serialized_options=b"\340A\002\372A&\n$billingbudgets.googleapis.com/Budget", file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -382,12 +385,12 @@ _CREATEBUDGETREQUEST.fields_by_name[ "budget" ].message_type = ( - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET + google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET ) _UPDATEBUDGETREQUEST.fields_by_name[ "budget" ].message_type = ( - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET + google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET ) _UPDATEBUDGETREQUEST.fields_by_name[ "update_mask" @@ -395,7 +398,7 @@ _LISTBUDGETSRESPONSE.fields_by_name[ "budgets" ].message_type = ( - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET + google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET ) DESCRIPTOR.message_types_by_name["CreateBudgetRequest"] = _CREATEBUDGETREQUEST DESCRIPTOR.message_types_by_name["UpdateBudgetRequest"] = _UPDATEBUDGETREQUEST @@ -408,11 +411,10 @@ CreateBudgetRequest = _reflection.GeneratedProtocolMessageType( "CreateBudgetRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for CreateBudget - + { + "DESCRIPTOR": _CREATEBUDGETREQUEST, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_service_pb2", + "__doc__": """Request for CreateBudget Attributes: parent: @@ -423,18 +425,17 @@ Required. Budget to create. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.CreateBudgetRequest) - ), + }, ) _sym_db.RegisterMessage(CreateBudgetRequest) UpdateBudgetRequest = _reflection.GeneratedProtocolMessageType( "UpdateBudgetRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for UpdateBudget - + { + "DESCRIPTOR": _UPDATEBUDGETREQUEST, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_service_pb2", + "__doc__": """Request for UpdateBudget Attributes: budget: @@ -450,18 +451,17 @@ values. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateBudgetRequest) GetBudgetRequest = _reflection.GeneratedProtocolMessageType( "GetBudgetRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for GetBudget - + { + "DESCRIPTOR": _GETBUDGETREQUEST, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_service_pb2", + "__doc__": """Request for GetBudget Attributes: name: @@ -469,18 +469,17 @@ ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.GetBudgetRequest) - ), + }, ) _sym_db.RegisterMessage(GetBudgetRequest) ListBudgetsRequest = _reflection.GeneratedProtocolMessageType( "ListBudgetsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTBUDGETSREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for ListBudgets - + { + "DESCRIPTOR": _LISTBUDGETSREQUEST, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_service_pb2", + "__doc__": """Request for ListBudgets Attributes: parent: @@ -496,18 +495,17 @@ system should return the next page of data. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.ListBudgetsRequest) - ), + }, ) _sym_db.RegisterMessage(ListBudgetsRequest) ListBudgetsResponse = _reflection.GeneratedProtocolMessageType( "ListBudgetsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTBUDGETSRESPONSE, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Response for ListBudgets - + { + "DESCRIPTOR": _LISTBUDGETSRESPONSE, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_service_pb2", + "__doc__": """Response for ListBudgets Attributes: budgets: @@ -518,18 +516,17 @@ ``ListBudgetsRequest``. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.ListBudgetsResponse) - ), + }, ) _sym_db.RegisterMessage(ListBudgetsResponse) DeleteBudgetRequest = _reflection.GeneratedProtocolMessageType( "DeleteBudgetRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for DeleteBudget - + { + "DESCRIPTOR": _DELETEBUDGETREQUEST, + "__module__": "google.cloud.billing_budgets_v1beta1.proto.budget_service_pb2", + "__doc__": """Request for DeleteBudget Attributes: name: @@ -537,7 +534,7 @@ ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. """, # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteBudgetRequest) @@ -558,9 +555,8 @@ full_name="google.cloud.billing.budgets.v1beta1.BudgetService", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\035billingbudgets.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), + serialized_options=b"\312A\035billingbudgets.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform", + create_key=_descriptor._internal_create_key, serialized_start=1053, serialized_end=2022, methods=[ @@ -570,10 +566,9 @@ index=0, containing_service=None, input_type=_CREATEBUDGETREQUEST, - output_type=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, - serialized_options=_b( - '\202\323\344\223\0020"+/v1beta1/{parent=billingAccounts/*}/budgets:\001*' - ), + output_type=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, + serialized_options=b'\202\323\344\223\0020"+/v1beta1/{parent=billingAccounts/*}/budgets:\001*', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="UpdateBudget", @@ -581,10 +576,9 @@ index=1, containing_service=None, input_type=_UPDATEBUDGETREQUEST, - output_type=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, - serialized_options=_b( - "\202\323\344\223\002722/v1beta1/{budget.name=billingAccounts/*/budgets/*}:\001*" - ), + output_type=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, + serialized_options=b"\202\323\344\223\002722/v1beta1/{budget.name=billingAccounts/*/budgets/*}:\001*", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="GetBudget", @@ -592,10 +586,9 @@ index=2, containing_service=None, input_type=_GETBUDGETREQUEST, - output_type=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1beta1/{name=billingAccounts/*/budgets/*}" - ), + output_type=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, + serialized_options=b"\202\323\344\223\002-\022+/v1beta1/{name=billingAccounts/*/budgets/*}", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListBudgets", @@ -604,9 +597,8 @@ containing_service=None, input_type=_LISTBUDGETSREQUEST, output_type=_LISTBUDGETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1beta1/{parent=billingAccounts/*}/budgets" - ), + serialized_options=b"\202\323\344\223\002-\022+/v1beta1/{parent=billingAccounts/*}/budgets", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="DeleteBudget", @@ -615,9 +607,8 @@ containing_service=None, input_type=_DELETEBUDGETREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002-*+/v1beta1/{name=billingAccounts/*/budgets/*}" - ), + serialized_options=b"\202\323\344\223\002-*+/v1beta1/{name=billingAccounts/*/budgets/*}", + create_key=_descriptor._internal_create_key, ), ], ) diff --git a/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py b/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py index 3cddb58..fbd9c92 100644 --- a/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py +++ b/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py @@ -2,10 +2,10 @@ import grpc from google.cloud.billing_budgets_v1beta1.proto import ( - budget_model_pb2 as google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2, + budget_model_pb2 as google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2, ) from google.cloud.billing_budgets_v1beta1.proto import ( - budget_service_pb2 as google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2, + budget_service_pb2 as google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2, ) from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 @@ -23,27 +23,27 @@ def __init__(self, channel): """ self.CreateBudget = channel.unary_unary( "/google.cloud.billing.budgets.v1beta1.BudgetService/CreateBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.CreateBudgetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, + request_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.CreateBudgetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, ) self.UpdateBudget = channel.unary_unary( "/google.cloud.billing.budgets.v1beta1.BudgetService/UpdateBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.UpdateBudgetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, + request_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.UpdateBudgetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, ) self.GetBudget = channel.unary_unary( "/google.cloud.billing.budgets.v1beta1.BudgetService/GetBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.GetBudgetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, + request_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.GetBudgetRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, ) self.ListBudgets = channel.unary_unary( "/google.cloud.billing.budgets.v1beta1.BudgetService/ListBudgets", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsResponse.FromString, + request_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsRequest.SerializeToString, + response_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsResponse.FromString, ) self.DeleteBudget = channel.unary_unary( "/google.cloud.billing.budgets.v1beta1.BudgetService/DeleteBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.DeleteBudgetRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.DeleteBudgetRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, ) @@ -64,6 +64,10 @@ def CreateBudget(self, request, context): def UpdateBudget(self, request, context): """Updates a budget and returns the updated budget. + + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. Budget fields that are not exposed in + this API will not be changed by this method. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") @@ -71,6 +75,11 @@ def UpdateBudget(self, request, context): def GetBudget(self, request, context): """Returns a budget. + + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. When reading from the API, you will not + see these fields in the return value, though they may have been set + in the Cloud Console. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") @@ -78,6 +87,11 @@ def GetBudget(self, request, context): def ListBudgets(self, request, context): """Returns a list of budgets for a billing account. + + WARNING: There are some fields exposed on the Google Cloud Console that + aren't available on this API. When reading from the API, you will not + see these fields in the return value, though they may have been set + in the Cloud Console. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") @@ -95,27 +109,27 @@ def add_BudgetServiceServicer_to_server(servicer, server): rpc_method_handlers = { "CreateBudget": grpc.unary_unary_rpc_method_handler( servicer.CreateBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.CreateBudgetRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, + request_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.CreateBudgetRequest.FromString, + response_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, ), "UpdateBudget": grpc.unary_unary_rpc_method_handler( servicer.UpdateBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.UpdateBudgetRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, + request_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.UpdateBudgetRequest.FromString, + response_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, ), "GetBudget": grpc.unary_unary_rpc_method_handler( servicer.GetBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.GetBudgetRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, + request_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.GetBudgetRequest.FromString, + response_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, ), "ListBudgets": grpc.unary_unary_rpc_method_handler( servicer.ListBudgets, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsResponse.SerializeToString, + request_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsRequest.FromString, + response_serializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsResponse.SerializeToString, ), "DeleteBudget": grpc.unary_unary_rpc_method_handler( servicer.DeleteBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.DeleteBudgetRequest.FromString, + request_deserializer=google_dot_cloud_dot_billing__budgets__v1beta1_dot_proto_dot_budget__service__pb2.DeleteBudgetRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } diff --git a/google/cloud/billing_budgets_v1beta1/types.py b/google/cloud/billing_budgets_v1beta1/types.py index 6496b80..0d1ee0b 100644 --- a/google/cloud/billing_budgets_v1beta1/types.py +++ b/google/cloud/billing_budgets_v1beta1/types.py @@ -24,12 +24,21 @@ from google.cloud.billing_budgets_v1beta1.proto import budget_service_pb2 from google.protobuf import empty_pb2 from google.protobuf import field_mask_pb2 +from google.protobuf import struct_pb2 from google.type import money_pb2 -_shared_modules = [empty_pb2, field_mask_pb2, money_pb2] +_shared_modules = [ + empty_pb2, + field_mask_pb2, + struct_pb2, + money_pb2, +] -_local_modules = [budget_model_pb2, budget_service_pb2] +_local_modules = [ + budget_model_pb2, + budget_service_pb2, +] names = [] diff --git a/noxfile.py b/noxfile.py index 19d72cf..b6bb282 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,14 +23,15 @@ import nox -BLACK_VERSION = "black==19.3b0" +BLACK_VERSION = "black==19.10b0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] -if os.path.exists("samples"): - BLACK_PATHS.append("samples") +DEFAULT_PYTHON_VERSION = "3.8" +SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"] +UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8"] -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): """Run linters. @@ -38,7 +39,9 @@ def lint(session): serious code quality issues. """ session.install("flake8", BLACK_VERSION) - session.run("black", "--check", *BLACK_PATHS) + session.run( + "black", "--check", *BLACK_PATHS, + ) session.run("flake8", "google", "tests") @@ -53,10 +56,12 @@ def blacken(session): check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) + session.run( + "black", *BLACK_PATHS, + ) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" session.install("docutils", "pygments") @@ -84,13 +89,13 @@ def default(session): ) -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) def unit(session): """Run the unit test suite.""" default(session) -@nox.session(python=["2.7", "3.7"]) +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" system_test_path = os.path.join("tests", "system.py") @@ -110,7 +115,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils") + session.install( + "mock", "pytest", "google-cloud-testutils", + ) session.install("-e", ".") # Run py.test against the system tests. @@ -120,7 +127,7 @@ def system(session): session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -133,7 +140,7 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def docs(session): """Build the docs for this library.""" diff --git a/scripts/decrypt-secrets.sh b/scripts/decrypt-secrets.sh new file mode 100755 index 0000000..ff599eb --- /dev/null +++ b/scripts/decrypt-secrets.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2015 Google Inc. All rights reserved. +# +# 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. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT=$( dirname "$DIR" ) + +# Work from the project root. +cd $ROOT + +# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources. +PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}" + +gcloud secrets versions access latest --secret="python-docs-samples-test-env" \ + > testing/test-env.sh +gcloud secrets versions access latest \ + --secret="python-docs-samples-service-account" \ + > testing/service-account.json +gcloud secrets versions access latest \ + --secret="python-docs-samples-client-secrets" \ + > testing/client-secrets.json \ No newline at end of file diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py new file mode 100644 index 0000000..d309d6e --- /dev/null +++ b/scripts/readme-gen/readme_gen.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Copyright 2016 Google Inc +# +# 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. + +"""Generates READMEs using configuration defined in yaml.""" + +import argparse +import io +import os +import subprocess + +import jinja2 +import yaml + + +jinja_env = jinja2.Environment( + trim_blocks=True, + loader=jinja2.FileSystemLoader( + os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + +README_TMPL = jinja_env.get_template('README.tmpl.rst') + + +def get_help(file): + return subprocess.check_output(['python', file, '--help']).decode() + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('source') + parser.add_argument('--destination', default='README.rst') + + args = parser.parse_args() + + source = os.path.abspath(args.source) + root = os.path.dirname(source) + destination = os.path.join(root, args.destination) + + jinja_env.globals['get_help'] = get_help + + with io.open(source, 'r') as f: + config = yaml.load(f) + + # This allows get_help to execute in the right directory. + os.chdir(root) + + output = README_TMPL.render(config) + + with io.open(destination, 'w') as f: + f.write(output) + + +if __name__ == '__main__': + main() diff --git a/scripts/readme-gen/templates/README.tmpl.rst b/scripts/readme-gen/templates/README.tmpl.rst new file mode 100644 index 0000000..4fd2397 --- /dev/null +++ b/scripts/readme-gen/templates/README.tmpl.rst @@ -0,0 +1,87 @@ +{# The following line is a lie. BUT! Once jinja2 is done with it, it will + become truth! #} +.. This file is automatically generated. Do not edit this file directly. + +{{product.name}} Python Samples +=============================================================================== + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/README.rst + + +This directory contains samples for {{product.name}}. {{product.description}} + +{{description}} + +.. _{{product.name}}: {{product.url}} + +{% if required_api_url %} +To run the sample, you need to enable the API at: {{required_api_url}} +{% endif %} + +{% if required_role %} +To run the sample, you need to have `{{required_role}}` role. +{% endif %} + +{{other_required_steps}} + +{% if setup %} +Setup +------------------------------------------------------------------------------- + +{% for section in setup %} + +{% include section + '.tmpl.rst' %} + +{% endfor %} +{% endif %} + +{% if samples %} +Samples +------------------------------------------------------------------------------- + +{% for sample in samples %} +{{sample.name}} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +{% if not sample.hide_cloudshell_button %} +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/{{sample.file}},{{folder}}/README.rst +{% endif %} + + +{{sample.description}} + +To run this sample: + +.. code-block:: bash + + $ python {{sample.file}} +{% if sample.show_help %} + + {{get_help(sample.file)|indent}} +{% endif %} + + +{% endfor %} +{% endif %} + +{% if cloud_client_library %} + +The client library +------------------------------------------------------------------------------- + +This sample uses the `Google Cloud Client Library for Python`_. +You can read the documentation for more details on API usage and use GitHub +to `browse the source`_ and `report issues`_. + +.. _Google Cloud Client Library for Python: + https://googlecloudplatform.github.io/google-cloud-python/ +.. _browse the source: + https://github.com/GoogleCloudPlatform/google-cloud-python +.. _report issues: + https://github.com/GoogleCloudPlatform/google-cloud-python/issues + +{% endif %} + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/scripts/readme-gen/templates/auth.tmpl.rst b/scripts/readme-gen/templates/auth.tmpl.rst new file mode 100644 index 0000000..1446b94 --- /dev/null +++ b/scripts/readme-gen/templates/auth.tmpl.rst @@ -0,0 +1,9 @@ +Authentication +++++++++++++++ + +This sample requires you to have authentication setup. Refer to the +`Authentication Getting Started Guide`_ for instructions on setting up +credentials for applications. + +.. _Authentication Getting Started Guide: + https://cloud.google.com/docs/authentication/getting-started diff --git a/scripts/readme-gen/templates/auth_api_key.tmpl.rst b/scripts/readme-gen/templates/auth_api_key.tmpl.rst new file mode 100644 index 0000000..11957ce --- /dev/null +++ b/scripts/readme-gen/templates/auth_api_key.tmpl.rst @@ -0,0 +1,14 @@ +Authentication +++++++++++++++ + +Authentication for this service is done via an `API Key`_. To obtain an API +Key: + +1. Open the `Cloud Platform Console`_ +2. Make sure that billing is enabled for your project. +3. From the **Credentials** page, create a new **API Key** or use an existing + one for your project. + +.. _API Key: + https://developers.google.com/api-client-library/python/guide/aaa_apikeys +.. _Cloud Console: https://console.cloud.google.com/project?_ diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst new file mode 100644 index 0000000..a0406db --- /dev/null +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -0,0 +1,29 @@ +Install Dependencies +++++++++++++++++++++ + +#. Clone python-docs-samples and change directory to the sample directory you want to use. + + .. code-block:: bash + + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. + + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup + +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. + + .. code-block:: bash + + $ virtualenv env + $ source env/bin/activate + +#. Install the dependencies needed to run the samples. + + .. code-block:: bash + + $ pip install -r requirements.txt + +.. _pip: https://pip.pypa.io/ +.. _virtualenv: https://virtualenv.pypa.io/ diff --git a/scripts/readme-gen/templates/install_portaudio.tmpl.rst b/scripts/readme-gen/templates/install_portaudio.tmpl.rst new file mode 100644 index 0000000..5ea33d1 --- /dev/null +++ b/scripts/readme-gen/templates/install_portaudio.tmpl.rst @@ -0,0 +1,35 @@ +Install PortAudio ++++++++++++++++++ + +Install `PortAudio`_. This is required by the `PyAudio`_ library to stream +audio from your computer's microphone. PyAudio depends on PortAudio for cross-platform compatibility, and is installed differently depending on the +platform. + +* For Mac OS X, you can use `Homebrew`_:: + + brew install portaudio + + **Note**: if you encounter an error when running `pip install` that indicates + it can't find `portaudio.h`, try running `pip install` with the following + flags:: + + pip install --global-option='build_ext' \ + --global-option='-I/usr/local/include' \ + --global-option='-L/usr/local/lib' \ + pyaudio + +* For Debian / Ubuntu Linux:: + + apt-get install portaudio19-dev python-all-dev + +* Windows may work without having to install PortAudio explicitly (it will get + installed with PyAudio). + +For more details, see the `PyAudio installation`_ page. + + +.. _PyAudio: https://people.csail.mit.edu/hubert/pyaudio/ +.. _PortAudio: http://www.portaudio.com/ +.. _PyAudio installation: + https://people.csail.mit.edu/hubert/pyaudio/#downloads +.. _Homebrew: http://brew.sh diff --git a/synth.metadata b/synth.metadata index 29c840e..6864800 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,32 +1,25 @@ { "sources": [ - { - "generator": { - "name": "artman", - "version": "2.0.0", - "dockerImage": "googleapis/artman@sha256:b3b47805231a305d0f40c4bf069df20f6a2635574e6d4259fac651d3f9f6e098" - } - }, { "git": { "name": ".", - "remote": "git@github.com:googleapis/python-billingbudgets", - "sha": "b2a213ec498e49c764466659728911816f534b65" + "remote": "https://github.com/googleapis/python-billingbudgets.git", + "sha": "d33f57ac857bc218e9059ef27ca193b7c1a53752" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "ee9e8e4e67f06aba881392a1a2956fbe7a42d216", - "internalRef": "309481123" + "sha": "cf41866c6f14f10a07aa1e2a1260fc0a2727d889", + "internalRef": "317812187" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "04cb397eb7590ea1e6c10a39fca3d8fe0fb3d256" + "sha": "cf2eff09d0f5319a4dc5cdce2b6356d85af4a798" } } ], @@ -34,11 +27,10 @@ { "client": { "source": "googleapis", - "apiName": "billingbudgets", + "apiName": "billing_budgets", "apiVersion": "v1beta1", "language": "python", - "generator": "gapic", - "config": "google/cloud/billing/budgets/artman_billingbudgets_v1beta1.yaml" + "generator": "bazel" } } ] diff --git a/synth.py b/synth.py index 5cadf15..f9c9096 100644 --- a/synth.py +++ b/synth.py @@ -62,4 +62,8 @@ templated_files = common.py_library(cov_level=70) s.move(templated_files) +# TODO(busunkim): Use latest sphinx after microgenerator transition +s.replace("noxfile.py", """['"]sphinx['"]""", '"sphinx<3.0.0"') + + s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/testing/.gitignore b/testing/.gitignore new file mode 100644 index 0000000..b05fbd6 --- /dev/null +++ b/testing/.gitignore @@ -0,0 +1,3 @@ +test-env.sh +service-account.json +client-secrets.json \ No newline at end of file