diff --git a/packages/google-cloud-billing-budgets/.github/.OwlBot.lock.yaml b/packages/google-cloud-billing-budgets/.github/.OwlBot.lock.yaml index bc893c979e20..7c454abf76f3 100644 --- a/packages/google-cloud-billing-budgets/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-billing-budgets/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/packages/google-cloud-billing-budgets/docs/conf.py b/packages/google-cloud-billing-budgets/docs/conf.py index a9cc0e7d1999..4e253504bf5c 100644 --- a/packages/google-cloud-billing-budgets/docs/conf.py +++ b/packages/google-cloud-billing-budgets/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the 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 efd56c9f66df..10ea21c02540 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 @@ -14,27 +14,30 @@ # limitations under the License. # +from google.cloud.billing.budgets_v1.services.budget_service.async_client import ( + BudgetServiceAsyncClient, +) from google.cloud.billing.budgets_v1.services.budget_service.client import ( BudgetServiceClient, ) -from google.cloud.billing.budgets_v1.services.budget_service.async_client import ( - BudgetServiceAsyncClient, +from google.cloud.billing.budgets_v1.types.budget_model import ( + Budget, + BudgetAmount, + CalendarPeriod, + CustomPeriod, + Filter, + LastPeriodAmount, + NotificationsRule, + ThresholdRule, +) +from google.cloud.billing.budgets_v1.types.budget_service import ( + CreateBudgetRequest, + DeleteBudgetRequest, + GetBudgetRequest, + ListBudgetsRequest, + ListBudgetsResponse, + UpdateBudgetRequest, ) - -from google.cloud.billing.budgets_v1.types.budget_model import Budget -from google.cloud.billing.budgets_v1.types.budget_model import BudgetAmount -from google.cloud.billing.budgets_v1.types.budget_model import CustomPeriod -from google.cloud.billing.budgets_v1.types.budget_model import Filter -from google.cloud.billing.budgets_v1.types.budget_model import LastPeriodAmount -from google.cloud.billing.budgets_v1.types.budget_model import NotificationsRule -from google.cloud.billing.budgets_v1.types.budget_model import ThresholdRule -from google.cloud.billing.budgets_v1.types.budget_model import CalendarPeriod -from google.cloud.billing.budgets_v1.types.budget_service import CreateBudgetRequest -from google.cloud.billing.budgets_v1.types.budget_service import DeleteBudgetRequest -from google.cloud.billing.budgets_v1.types.budget_service import GetBudgetRequest -from google.cloud.billing.budgets_v1.types.budget_service import ListBudgetsRequest -from google.cloud.billing.budgets_v1.types.budget_service import ListBudgetsResponse -from google.cloud.billing.budgets_v1.types.budget_service import UpdateBudgetRequest __all__ = ( "BudgetServiceClient", 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 e997b9500e1e..b8dd76a11973 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 @@ -14,23 +14,25 @@ # limitations under the License. # -from .services.budget_service import BudgetServiceClient -from .services.budget_service import BudgetServiceAsyncClient - -from .types.budget_model import Budget -from .types.budget_model import BudgetAmount -from .types.budget_model import CustomPeriod -from .types.budget_model import Filter -from .types.budget_model import LastPeriodAmount -from .types.budget_model import NotificationsRule -from .types.budget_model import ThresholdRule -from .types.budget_model import CalendarPeriod -from .types.budget_service import CreateBudgetRequest -from .types.budget_service import DeleteBudgetRequest -from .types.budget_service import GetBudgetRequest -from .types.budget_service import ListBudgetsRequest -from .types.budget_service import ListBudgetsResponse -from .types.budget_service import UpdateBudgetRequest +from .services.budget_service import BudgetServiceAsyncClient, BudgetServiceClient +from .types.budget_model import ( + Budget, + BudgetAmount, + CalendarPeriod, + CustomPeriod, + Filter, + LastPeriodAmount, + NotificationsRule, + ThresholdRule, +) +from .types.budget_service import ( + CreateBudgetRequest, + DeleteBudgetRequest, + GetBudgetRequest, + ListBudgetsRequest, + ListBudgetsResponse, + UpdateBudgetRequest, +) __all__ = ( "BudgetServiceAsyncClient", diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/__init__.py index 52de7ea1792a..6ba59695d3cb 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import BudgetServiceClient from .async_client import BudgetServiceAsyncClient +from .client import BudgetServiceClient __all__ = ( "BudgetServiceClient", 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 f0b74a6fe311..0c5c759a7094 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 @@ -17,27 +17,28 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.billing.budgets_v1.services.budget_service import pagers -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service from google.protobuf import field_mask_pb2 # type: ignore -from .transports.base import BudgetServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import BudgetServiceGrpcAsyncIOTransport + +from google.cloud.billing.budgets_v1.services.budget_service import pagers +from google.cloud.billing.budgets_v1.types import budget_model, budget_service + from .client import BudgetServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, BudgetServiceTransport +from .transports.grpc_asyncio import BudgetServiceGrpcAsyncIOTransport class BudgetServiceAsyncClient: 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 ce9308cf18c9..caab374e3ff9 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 @@ -17,28 +17,29 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore -from google.cloud.billing.budgets_v1.services.budget_service import pagers -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service from google.protobuf import field_mask_pb2 # type: ignore -from .transports.base import BudgetServiceTransport, DEFAULT_CLIENT_INFO + +from google.cloud.billing.budgets_v1.services.budget_service import pagers +from google.cloud.billing.budgets_v1.types import budget_model, budget_service + +from .transports.base import DEFAULT_CLIENT_INFO, BudgetServiceTransport from .transports.grpc import BudgetServiceGrpcTransport from .transports.grpc_asyncio import BudgetServiceGrpcAsyncIOTransport diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/pagers.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/pagers.py index 87651315f011..c48a8016a130 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/pagers.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service +from google.cloud.billing.budgets_v1.types import budget_model, budget_service class ListBudgetsPager: diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py index ffb6ed3cf9d2..bf859369e38a 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/services/budget_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import BudgetServiceGrpcTransport from .grpc_asyncio import BudgetServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[BudgetServiceTransport]] _transport_registry["grpc"] = BudgetServiceGrpcTransport 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 601130b4facd..8b77ae32a865 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 @@ -15,19 +15,18 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore - -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service from google.protobuf import empty_pb2 # type: ignore +import pkg_resources + +from google.cloud.billing.budgets_v1.types import budget_model, budget_service try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( 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 d7e8cb175f01..f57a07253b09 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 @@ -13,21 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service -from google.protobuf import empty_pb2 # type: ignore -from .base import BudgetServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.billing.budgets_v1.types import budget_model, budget_service + +from .base import DEFAULT_CLIENT_INFO, BudgetServiceTransport class BudgetServiceGrpcTransport(BudgetServiceTransport): 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 6d8c3ffb761c..318078a3caee 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 @@ -13,21 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service -from google.protobuf import empty_pb2 # type: ignore -from .base import BudgetServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.billing.budgets_v1.types import budget_model, budget_service + +from .base import DEFAULT_CLIENT_INFO, BudgetServiceTransport from .grpc import BudgetServiceGrpcTransport diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py index 1ab6f8e4cc74..534bdc2dd72d 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1/types/__init__.py @@ -16,12 +16,12 @@ from .budget_model import ( Budget, BudgetAmount, + CalendarPeriod, CustomPeriod, Filter, LastPeriodAmount, NotificationsRule, ThresholdRule, - CalendarPeriod, ) from .budget_service import ( CreateBudgetRequest, 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 01483a54cc2c..5bba40233453 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,12 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import struct_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import money_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.billing.budgets.v1", 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 2fb62d98186b..4f0250a6de2b 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,11 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.billing.budgets_v1.types import budget_model -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.billing.budgets.v1", 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 2e1626a576cd..0186b8472c7c 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 @@ -14,23 +14,25 @@ # limitations under the License. # -from .services.budget_service import BudgetServiceClient -from .services.budget_service import BudgetServiceAsyncClient - -from .types.budget_model import AllUpdatesRule -from .types.budget_model import Budget -from .types.budget_model import BudgetAmount -from .types.budget_model import CustomPeriod -from .types.budget_model import Filter -from .types.budget_model import LastPeriodAmount -from .types.budget_model import ThresholdRule -from .types.budget_model import CalendarPeriod -from .types.budget_service import CreateBudgetRequest -from .types.budget_service import DeleteBudgetRequest -from .types.budget_service import GetBudgetRequest -from .types.budget_service import ListBudgetsRequest -from .types.budget_service import ListBudgetsResponse -from .types.budget_service import UpdateBudgetRequest +from .services.budget_service import BudgetServiceAsyncClient, BudgetServiceClient +from .types.budget_model import ( + AllUpdatesRule, + Budget, + BudgetAmount, + CalendarPeriod, + CustomPeriod, + Filter, + LastPeriodAmount, + ThresholdRule, +) +from .types.budget_service import ( + CreateBudgetRequest, + DeleteBudgetRequest, + GetBudgetRequest, + ListBudgetsRequest, + ListBudgetsResponse, + UpdateBudgetRequest, +) __all__ = ( "BudgetServiceAsyncClient", diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/__init__.py index 52de7ea1792a..6ba59695d3cb 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import BudgetServiceClient from .async_client import BudgetServiceAsyncClient +from .client import BudgetServiceClient __all__ = ( "BudgetServiceClient", 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 1965677ca774..4e4091f03eaf 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 @@ -17,14 +17,14 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -32,11 +32,11 @@ OptionalRetry = Union[retries.Retry, object] # type: ignore from google.cloud.billing.budgets_v1beta1.services.budget_service import pagers -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service -from .transports.base import BudgetServiceTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import BudgetServiceGrpcAsyncIOTransport +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service + from .client import BudgetServiceClient +from .transports.base import DEFAULT_CLIENT_INFO, BudgetServiceTransport +from .transports.grpc_asyncio import BudgetServiceGrpcAsyncIOTransport class BudgetServiceAsyncClient: 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 2a813770bd34..71d45dc877bd 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 @@ -17,17 +17,17 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] @@ -35,9 +35,9 @@ OptionalRetry = Union[retries.Retry, object] # type: ignore from google.cloud.billing.budgets_v1beta1.services.budget_service import pagers -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service -from .transports.base import BudgetServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service + +from .transports.base import DEFAULT_CLIENT_INFO, BudgetServiceTransport from .transports.grpc import BudgetServiceGrpcTransport from .transports.grpc_asyncio import BudgetServiceGrpcAsyncIOTransport diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/pagers.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/pagers.py index 971076ce2ffc..897d7ffe578d 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/pagers.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/pagers.py @@ -18,14 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service class ListBudgetsPager: diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py index ffb6ed3cf9d2..bf859369e38a 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/services/budget_service/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import BudgetServiceGrpcTransport from .grpc_asyncio import BudgetServiceGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[BudgetServiceTransport]] _transport_registry["grpc"] = BudgetServiceGrpcTransport 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 bc37c58a9491..d8139abe7d07 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 @@ -15,19 +15,18 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore - -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service from google.protobuf import empty_pb2 # type: ignore +import pkg_resources + +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( 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 da79d88c1bd4..1b8afe287307 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 @@ -13,21 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service -from google.protobuf import empty_pb2 # type: ignore -from .base import BudgetServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service + +from .base import DEFAULT_CLIENT_INFO, BudgetServiceTransport class BudgetServiceGrpcTransport(BudgetServiceTransport): 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 79e52adf51fb..5b35be7c8851 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 @@ -13,21 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service -from google.protobuf import empty_pb2 # type: ignore -from .base import BudgetServiceTransport, DEFAULT_CLIENT_INFO +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service + +from .base import DEFAULT_CLIENT_INFO, BudgetServiceTransport from .grpc import BudgetServiceGrpcTransport diff --git a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py index 49bc43daa4b0..e504f6817d6c 100644 --- a/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py +++ b/packages/google-cloud-billing-budgets/google/cloud/billing/budgets_v1beta1/types/__init__.py @@ -17,11 +17,11 @@ AllUpdatesRule, Budget, BudgetAmount, + CalendarPeriod, CustomPeriod, Filter, LastPeriodAmount, ThresholdRule, - CalendarPeriod, ) from .budget_service import ( CreateBudgetRequest, 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 8081043f8837..1fe507a5ffff 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,12 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - from google.protobuf import struct_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import money_pb2 # type: ignore - +import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.billing.budgets.v1beta1", 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 d775cfc40a1a..ff693f1ee75f 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,11 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.billing.budgets.v1beta1", diff --git a/packages/google-cloud-billing-budgets/noxfile.py b/packages/google-cloud-billing-budgets/noxfile.py index 6ee5e8ab96d9..7c1742d2cc93 100644 --- a/packages/google-cloud-billing-budgets/noxfile.py +++ b/packages/google-cloud-billing-budgets/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/packages/google-cloud-billing-budgets/setup.py b/packages/google-cloud-billing-budgets/setup.py index 9d94fe7e8574..04a6846a0d07 100644 --- a/packages/google-cloud-billing-budgets/setup.py +++ b/packages/google-cloud-billing-budgets/setup.py @@ -19,7 +19,6 @@ import setuptools - name = "google-cloud-billing-budgets" description = "Cloud Billing Budget API API client library" version = "1.6.1" diff --git a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py index fe1ec231ba5e..d7897c34725e 100644 --- a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py +++ b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1/test_budget_service.py @@ -13,38 +13,33 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.billing.budgets_v1.services.budget_service import ( - BudgetServiceAsyncClient, -) -from google.cloud.billing.budgets_v1.services.budget_service import BudgetServiceClient -from google.cloud.billing.budgets_v1.services.budget_service import pagers -from google.cloud.billing.budgets_v1.services.budget_service import transports -from google.cloud.billing.budgets_v1.types import budget_model -from google.cloud.billing.budgets_v1.types import budget_service from google.oauth2 import service_account from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import money_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.billing.budgets_v1.services.budget_service import ( + BudgetServiceAsyncClient, + BudgetServiceClient, + pagers, + transports, +) +from google.cloud.billing.budgets_v1.types import budget_model, budget_service def client_cert_source_callback(): diff --git a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py index 3a5b253f087a..91c41515b65c 100644 --- a/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py +++ b/packages/google-cloud-billing-budgets/tests/unit/gapic/budgets_v1beta1/test_budget_service.py @@ -13,40 +13,33 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.billing.budgets_v1beta1.services.budget_service import ( - BudgetServiceAsyncClient, -) -from google.cloud.billing.budgets_v1beta1.services.budget_service import ( - BudgetServiceClient, -) -from google.cloud.billing.budgets_v1beta1.services.budget_service import pagers -from google.cloud.billing.budgets_v1beta1.services.budget_service import transports -from google.cloud.billing.budgets_v1beta1.types import budget_model -from google.cloud.billing.budgets_v1beta1.types import budget_service from google.oauth2 import service_account from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import struct_pb2 # type: ignore from google.type import date_pb2 # type: ignore from google.type import money_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.billing.budgets_v1beta1.services.budget_service import ( + BudgetServiceAsyncClient, + BudgetServiceClient, + pagers, + transports, +) +from google.cloud.billing.budgets_v1beta1.types import budget_model, budget_service def client_cert_source_callback():