Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
changes without context
Browse files Browse the repository at this point in the history
        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.
  • Loading branch information
yoshi-automation committed Sep 3, 2020
1 parent 66c7af1 commit e192adc
Show file tree
Hide file tree
Showing 50 changed files with 1,016 additions and 315 deletions.
Expand Up @@ -31,7 +31,7 @@
from google.cloud.dataproc_v1.services.autoscaling_policy_service import pagers
from google.cloud.dataproc_v1.types import autoscaling_policies

from .transports.base import AutoscalingPolicyServiceTransport
from .transports.base import AutoscalingPolicyServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import AutoscalingPolicyServiceGrpcAsyncIOTransport
from .client import AutoscalingPolicyServiceClient

Expand Down Expand Up @@ -64,6 +64,7 @@ def __init__(
credentials: credentials.Credentials = None,
transport: Union[str, AutoscalingPolicyServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the autoscaling policy service client.
Expand Down Expand Up @@ -96,7 +97,10 @@ def __init__(
"""

self._client = AutoscalingPolicyServiceClient(
credentials=credentials, transport=transport, client_options=client_options,
credentials=credentials,
transport=transport,
client_options=client_options,
client_info=client_info,
)

async def create_autoscaling_policy(
Expand Down Expand Up @@ -175,7 +179,7 @@ async def create_autoscaling_policy(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.create_autoscaling_policy,
default_timeout=600.0,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -257,7 +261,7 @@ async def update_autoscaling_policy(
),
),
default_timeout=600.0,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -348,7 +352,7 @@ async def get_autoscaling_policy(
),
),
default_timeout=600.0,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -440,7 +444,7 @@ async def list_autoscaling_policies(
),
),
default_timeout=600.0,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand Down Expand Up @@ -527,7 +531,7 @@ async def delete_autoscaling_policy(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.delete_autoscaling_policy,
default_timeout=600.0,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

# Certain fields should be provided within the metadata header;
Expand All @@ -543,11 +547,11 @@ async def delete_autoscaling_policy(


try:
_client_info = gapic_v1.client_info.ClientInfo(
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-dataproc",).version,
)
except pkg_resources.DistributionNotFound:
_client_info = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()


__all__ = ("AutoscalingPolicyServiceAsyncClient",)
Expand Up @@ -33,7 +33,7 @@
from google.cloud.dataproc_v1.services.autoscaling_policy_service import pagers
from google.cloud.dataproc_v1.types import autoscaling_policies

from .transports.base import AutoscalingPolicyServiceTransport
from .transports.base import AutoscalingPolicyServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import AutoscalingPolicyServiceGrpcTransport
from .transports.grpc_asyncio import AutoscalingPolicyServiceGrpcAsyncIOTransport

Expand Down Expand Up @@ -156,6 +156,7 @@ def __init__(
credentials: credentials.Credentials = None,
transport: Union[str, AutoscalingPolicyServiceTransport] = None,
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the autoscaling policy service client.
Expand All @@ -181,6 +182,11 @@ def __init__(
(2) The ``client_cert_source`` property is used to provide client
SSL credentials for mutual TLS transport. If not provided, the
default SSL credentials will be used if present.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
Raises:
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
Expand Down Expand Up @@ -238,6 +244,7 @@ def __init__(
api_mtls_endpoint=client_options.api_endpoint,
client_cert_source=client_options.client_cert_source,
quota_project_id=client_options.quota_project_id,
client_info=client_info,
)

def create_autoscaling_policy(
Expand Down Expand Up @@ -678,11 +685,11 @@ def delete_autoscaling_policy(


try:
_client_info = gapic_v1.client_info.ClientInfo(
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-dataproc",).version,
)
except pkg_resources.DistributionNotFound:
_client_info = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()


__all__ = ("AutoscalingPolicyServiceClient",)
Expand Up @@ -19,7 +19,7 @@
import typing
import pkg_resources

from google import auth
from google import auth # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
Expand All @@ -30,11 +30,11 @@


try:
_client_info = gapic_v1.client_info.ClientInfo(
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution("google-cloud-dataproc",).version,
)
except pkg_resources.DistributionNotFound:
_client_info = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()


class AutoscalingPolicyServiceTransport(abc.ABC):
Expand All @@ -50,6 +50,7 @@ def __init__(
credentials_file: typing.Optional[str] = None,
scopes: typing.Optional[typing.Sequence[str]] = AUTH_SCOPES,
quota_project_id: typing.Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
**kwargs,
) -> None:
"""Instantiate the transport.
Expand All @@ -67,6 +68,11 @@ def __init__(
scope (Optional[Sequence[str]]): A list of scopes.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
"""
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
if ":" not in host:
Expand Down Expand Up @@ -94,15 +100,15 @@ def __init__(
self._credentials = credentials

# Lifted into its own function so it can be stubbed out during tests.
self._prep_wrapped_messages()
self._prep_wrapped_messages(client_info)

def _prep_wrapped_messages(self):
def _prep_wrapped_messages(self, client_info):
# Precompute the wrapped methods.
self._wrapped_methods = {
self.create_autoscaling_policy: gapic_v1.method.wrap_method(
self.create_autoscaling_policy,
default_timeout=600.0,
client_info=_client_info,
client_info=client_info,
),
self.update_autoscaling_policy: gapic_v1.method.wrap_method(
self.update_autoscaling_policy,
Expand All @@ -115,7 +121,7 @@ def _prep_wrapped_messages(self):
),
),
default_timeout=600.0,
client_info=_client_info,
client_info=client_info,
),
self.get_autoscaling_policy: gapic_v1.method.wrap_method(
self.get_autoscaling_policy,
Expand All @@ -128,7 +134,7 @@ def _prep_wrapped_messages(self):
),
),
default_timeout=600.0,
client_info=_client_info,
client_info=client_info,
),
self.list_autoscaling_policies: gapic_v1.method.wrap_method(
self.list_autoscaling_policies,
Expand All @@ -141,12 +147,12 @@ def _prep_wrapped_messages(self):
),
),
default_timeout=600.0,
client_info=_client_info,
client_info=client_info,
),
self.delete_autoscaling_policy: gapic_v1.method.wrap_method(
self.delete_autoscaling_policy,
default_timeout=600.0,
client_info=_client_info,
client_info=client_info,
),
}

Expand Down
Expand Up @@ -18,6 +18,7 @@
from typing import Callable, Dict, Optional, Sequence, Tuple

from google.api_core import grpc_helpers # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google import auth # type: ignore
from google.auth import credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand All @@ -28,7 +29,7 @@
from google.cloud.dataproc_v1.types import autoscaling_policies
from google.protobuf import empty_pb2 as empty # type: ignore

from .base import AutoscalingPolicyServiceTransport
from .base import AutoscalingPolicyServiceTransport, DEFAULT_CLIENT_INFO


class AutoscalingPolicyServiceGrpcTransport(AutoscalingPolicyServiceTransport):
Expand Down Expand Up @@ -57,7 +58,8 @@ def __init__(
channel: grpc.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id: Optional[str] = None
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -86,6 +88,11 @@ def __init__(
is None.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
Raises:
google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
Expand Down Expand Up @@ -141,6 +148,7 @@ def __init__(
credentials_file=credentials_file,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
client_info=client_info,
)

@classmethod
Expand All @@ -151,7 +159,7 @@ def create_channel(
credentials_file: str = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
**kwargs
**kwargs,
) -> grpc.Channel:
"""Create and return a gRPC channel object.
Args:
Expand Down Expand Up @@ -185,7 +193,7 @@ def create_channel(
credentials_file=credentials_file,
scopes=scopes,
quota_project_id=quota_project_id,
**kwargs
**kwargs,
)

@property
Expand Down
Expand Up @@ -17,6 +17,7 @@

from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple

from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.auth import credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand All @@ -27,7 +28,7 @@
from google.cloud.dataproc_v1.types import autoscaling_policies
from google.protobuf import empty_pb2 as empty # type: ignore

from .base import AutoscalingPolicyServiceTransport
from .base import AutoscalingPolicyServiceTransport, DEFAULT_CLIENT_INFO
from .grpc import AutoscalingPolicyServiceGrpcTransport


Expand Down Expand Up @@ -100,6 +101,7 @@ def __init__(
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
quota_project_id=None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the transport.
Expand Down Expand Up @@ -129,6 +131,11 @@ def __init__(
is None.
quota_project_id (Optional[str]): An optional project to use for billing
and quota.
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
The client info used to send a user-agent string along with
API requests. If ``None``, then default info will be used.
Generally, you only need to set this if you're developing
your own client library.
Raises:
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
Expand Down Expand Up @@ -177,6 +184,7 @@ def __init__(
credentials_file=credentials_file,
scopes=scopes or self.AUTH_SCOPES,
quota_project_id=quota_project_id,
client_info=client_info,
)

self._stubs = {}
Expand Down

0 comments on commit e192adc

Please sign in to comment.