Skip to content

Commit

Permalink
chore: updates to generated code (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Aug 26, 2020
1 parent f27e339 commit cb72c1a
Show file tree
Hide file tree
Showing 7 changed files with 153 additions and 89 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from google.protobuf import timestamp_pb2 as timestamp # type: ignore
from google.rpc import status_pb2 as status # type: ignore

from .transports.base import ReservationServiceTransport
from .transports.base import ReservationServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc_asyncio import ReservationServiceGrpcAsyncIOTransport
from .client import ReservationServiceClient

Expand Down Expand Up @@ -65,14 +65,14 @@ class ReservationServiceAsyncClient:
DEFAULT_ENDPOINT = ReservationServiceClient.DEFAULT_ENDPOINT
DEFAULT_MTLS_ENDPOINT = ReservationServiceClient.DEFAULT_MTLS_ENDPOINT

assignment_path = staticmethod(ReservationServiceClient.assignment_path)

bi_reservation_path = staticmethod(ReservationServiceClient.bi_reservation_path)

capacity_commitment_path = staticmethod(
ReservationServiceClient.capacity_commitment_path
)

assignment_path = staticmethod(ReservationServiceClient.assignment_path)

reservation_path = staticmethod(ReservationServiceClient.reservation_path)

from_service_account_file = ReservationServiceClient.from_service_account_file
Expand All @@ -89,6 +89,7 @@ def __init__(
credentials: credentials.Credentials = None,
transport: Union[str, ReservationServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the reservation service client.
Expand Down Expand Up @@ -121,7 +122,10 @@ def __init__(
"""

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

async def create_reservation(
Expand Down Expand Up @@ -200,7 +204,7 @@ async def create_reservation(
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.create_reservation,
default_timeout=None,
client_info=_client_info,
client_info=DEFAULT_CLIENT_INFO,
)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# Certain fields should be provided within the metadata header;
Expand All @@ -1807,13 +1811,13 @@ async def update_bi_reservation(


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


__all__ = ("ReservationServiceAsyncClient",)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from google.protobuf import timestamp_pb2 as timestamp # type: ignore
from google.rpc import status_pb2 as status # type: ignore

from .transports.base import ReservationServiceTransport
from .transports.base import ReservationServiceTransport, DEFAULT_CLIENT_INFO
from .transports.grpc import ReservationServiceGrpcTransport
from .transports.grpc_asyncio import ReservationServiceGrpcAsyncIOTransport

Expand Down Expand Up @@ -228,6 +228,7 @@ def __init__(
credentials: credentials.Credentials = None,
transport: Union[str, ReservationServiceTransport] = None,
client_options: ClientOptions = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiate the reservation service client.
Expand All @@ -253,6 +254,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 @@ -310,6 +316,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_reservation(
Expand Down Expand Up @@ -2045,13 +2052,13 @@ def update_bi_reservation(


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


__all__ = ("ReservationServiceClient",)
Loading

0 comments on commit cb72c1a

Please sign in to comment.