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

Commit

Permalink
chore: upgrade to gapic-generator 0.35.9
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 339292950

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Oct 27 11:32:46 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 07d41a7e5cade45aba6f0d277c89722b48f2c956
Source-Link: googleapis/googleapis@07d41a7
  • Loading branch information
yoshi-automation committed Oct 28, 2020
1 parent f76edd5 commit e085f08
Show file tree
Hide file tree
Showing 9 changed files with 417 additions and 204 deletions.
1 change: 1 addition & 0 deletions docs/connection_v1/types.rst
Expand Up @@ -3,3 +3,4 @@ Types for Google Cloud Bigquery Connection v1 API

.. automodule:: google.cloud.bigquery.connection_v1.types
:members:
:show-inheritance:
Expand Up @@ -51,9 +51,47 @@ class ConnectionServiceAsyncClient:
connection_path = staticmethod(ConnectionServiceClient.connection_path)
parse_connection_path = staticmethod(ConnectionServiceClient.parse_connection_path)

common_billing_account_path = staticmethod(
ConnectionServiceClient.common_billing_account_path
)
parse_common_billing_account_path = staticmethod(
ConnectionServiceClient.parse_common_billing_account_path
)

common_folder_path = staticmethod(ConnectionServiceClient.common_folder_path)
parse_common_folder_path = staticmethod(
ConnectionServiceClient.parse_common_folder_path
)

common_organization_path = staticmethod(
ConnectionServiceClient.common_organization_path
)
parse_common_organization_path = staticmethod(
ConnectionServiceClient.parse_common_organization_path
)

common_project_path = staticmethod(ConnectionServiceClient.common_project_path)
parse_common_project_path = staticmethod(
ConnectionServiceClient.parse_common_project_path
)

common_location_path = staticmethod(ConnectionServiceClient.common_location_path)
parse_common_location_path = staticmethod(
ConnectionServiceClient.parse_common_location_path
)

from_service_account_file = ConnectionServiceClient.from_service_account_file
from_service_account_json = from_service_account_file

@property
def transport(self) -> ConnectionServiceTransport:
"""Return the transport used by the client instance.
Returns:
ConnectionServiceTransport: The transport used by the client instance.
"""
return self._client.transport

get_transport_class = functools.partial(
type(ConnectionServiceClient).get_transport_class, type(ConnectionServiceClient)
)
Expand Down Expand Up @@ -157,7 +195,8 @@ async def create_connection(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([parent, connection, connection_id]):
has_flattened_params = any([parent, connection, connection_id])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand Down Expand Up @@ -233,7 +272,8 @@ async def get_connection(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([name]):
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand All @@ -256,7 +296,7 @@ async def get_connection(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.ServiceUnavailable, exceptions.DeadlineExceeded,
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -315,7 +355,8 @@ async def list_connections(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([parent]):
has_flattened_params = any([parent])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand All @@ -338,7 +379,7 @@ async def list_connections(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.ServiceUnavailable, exceptions.DeadlineExceeded,
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -417,7 +458,8 @@ async def update_connection(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([name, connection, update_mask]):
has_flattened_params = any([name, connection, update_mask])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand Down Expand Up @@ -486,7 +528,8 @@ async def delete_connection(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([name]):
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand All @@ -509,7 +552,7 @@ async def delete_connection(
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.ServiceUnavailable, exceptions.DeadlineExceeded,
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
),
),
default_timeout=60.0,
Expand Down Expand Up @@ -631,7 +674,8 @@ async def get_iam_policy(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([resource]):
has_flattened_params = any([resource])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand All @@ -643,13 +687,7 @@ async def get_iam_policy(
request = iam_policy.GetIamPolicyRequest(**request)

elif not request:
request = iam_policy.GetIamPolicyRequest()

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if resource is not None:
request.resource = resource
request = iam_policy.GetIamPolicyRequest(resource=resource,)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down Expand Up @@ -777,7 +815,8 @@ async def set_iam_policy(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([resource]):
has_flattened_params = any([resource])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand All @@ -789,13 +828,7 @@ async def set_iam_policy(
request = iam_policy.SetIamPolicyRequest(**request)

elif not request:
request = iam_policy.SetIamPolicyRequest()

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if resource is not None:
request.resource = resource
request = iam_policy.SetIamPolicyRequest(resource=resource,)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down Expand Up @@ -870,7 +903,8 @@ async def test_iam_permissions(
# Create or coerce a protobuf request object.
# Sanity check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
if request is not None and any([resource, permissions]):
has_flattened_params = any([resource, permissions])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
Expand All @@ -882,16 +916,9 @@ async def test_iam_permissions(
request = iam_policy.TestIamPermissionsRequest(**request)

elif not request:
request = iam_policy.TestIamPermissionsRequest()

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if resource is not None:
request.resource = resource

if permissions:
request.permissions.extend(permissions)
request = iam_policy.TestIamPermissionsRequest(
resource=resource, permissions=permissions,
)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down
Expand Up @@ -136,6 +136,15 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):

from_service_account_json = from_service_account_file

@property
def transport(self) -> ConnectionServiceTransport:
"""Return the transport used by the client instance.
Returns:
ConnectionServiceTransport: The transport used by the client instance.
"""
return self._transport

@staticmethod
def connection_path(project: str, location: str, connection: str,) -> str:
"""Return a fully-qualified connection string."""
Expand All @@ -152,6 +161,65 @@ def parse_connection_path(path: str) -> Dict[str, str]:
)
return m.groupdict() if m else {}

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
"""Return a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
)

@staticmethod
def parse_common_billing_account_path(path: str) -> Dict[str, str]:
"""Parse a billing_account path into its component segments."""
m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def common_folder_path(folder: str,) -> str:
"""Return a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)

@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
"""Parse a folder path into its component segments."""
m = re.match(r"^folders/(?P<folder>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def common_organization_path(organization: str,) -> str:
"""Return a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)

@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
"""Parse a organization path into its component segments."""
m = re.match(r"^organizations/(?P<organization>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def common_project_path(project: str,) -> str:
"""Return a fully-qualified project string."""
return "projects/{project}".format(project=project,)

@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
"""Parse a project path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)$", path)
return m.groupdict() if m else {}

@staticmethod
def common_location_path(project: str, location: str,) -> str:
"""Return a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
)

@staticmethod
def parse_common_location_path(path: str) -> Dict[str, str]:
"""Parse a location path into its component segments."""
m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path)
return m.groupdict() if m else {}

def __init__(
self,
*,
Expand Down Expand Up @@ -187,10 +255,10 @@ def __init__(
not provided, the default SSL client certificate will be used if
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
set, no client certificate will be used.
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
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:
Expand Down Expand Up @@ -793,13 +861,7 @@ def get_iam_policy(
request = iam_policy.GetIamPolicyRequest(**request)

elif not request:
request = iam_policy.GetIamPolicyRequest()

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if resource is not None:
request.resource = resource
request = iam_policy.GetIamPolicyRequest(resource=resource,)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down Expand Up @@ -936,13 +998,7 @@ def set_iam_policy(
request = iam_policy.SetIamPolicyRequest(**request)

elif not request:
request = iam_policy.SetIamPolicyRequest()

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if resource is not None:
request.resource = resource
request = iam_policy.SetIamPolicyRequest(resource=resource,)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down Expand Up @@ -1026,16 +1082,9 @@ def test_iam_permissions(
request = iam_policy.TestIamPermissionsRequest(**request)

elif not request:
request = iam_policy.TestIamPermissionsRequest()

# If we have keyword arguments corresponding to fields on the
# request, apply these.

if resource is not None:
request.resource = resource

if permissions:
request.permissions.extend(permissions)
request = iam_policy.TestIamPermissionsRequest(
resource=resource, permissions=permissions,
)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand Down
Expand Up @@ -123,7 +123,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.ServiceUnavailable, exceptions.DeadlineExceeded,
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
),
),
default_timeout=60.0,
Expand All @@ -136,7 +136,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.ServiceUnavailable, exceptions.DeadlineExceeded,
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
),
),
default_timeout=60.0,
Expand All @@ -152,7 +152,7 @@ def _prep_wrapped_messages(self, client_info):
maximum=60.0,
multiplier=1.3,
predicate=retries.if_exception_type(
exceptions.ServiceUnavailable, exceptions.DeadlineExceeded,
exceptions.DeadlineExceeded, exceptions.ServiceUnavailable,
),
),
default_timeout=60.0,
Expand Down

0 comments on commit e085f08

Please sign in to comment.