Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update gapic-generator-python to 0.40.11 #230

Merged
merged 5 commits into from Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/cloud/bigtable_admin_v2/__init__.py
Expand Up @@ -88,7 +88,7 @@
"AppProfile",
"Backup",
"BackupInfo",
"BigtableTableAdminClient",
"BigtableInstanceAdminClient",
"CheckConsistencyRequest",
"CheckConsistencyResponse",
"Cluster",
Expand Down Expand Up @@ -151,5 +151,5 @@
"UpdateBackupRequest",
"UpdateClusterMetadata",
"UpdateInstanceMetadata",
"BigtableInstanceAdminClient",
"BigtableTableAdminClient",
)
Expand Up @@ -100,8 +100,36 @@ class BigtableInstanceAdminAsyncClient:
BigtableInstanceAdminClient.parse_common_location_path
)

from_service_account_info = BigtableInstanceAdminClient.from_service_account_info
from_service_account_file = BigtableInstanceAdminClient.from_service_account_file
@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.

Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.

Returns:
BigtableInstanceAdminAsyncClient: The constructed client.
"""
return BigtableInstanceAdminClient.from_service_account_info.__func__(BigtableInstanceAdminAsyncClient, info, *args, **kwargs) # type: ignore

@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.

Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.

Returns:
BigtableInstanceAdminAsyncClient: The constructed client.
"""
return BigtableInstanceAdminClient.from_service_account_file.__func__(BigtableInstanceAdminAsyncClient, filename, *args, **kwargs) # type: ignore

from_service_account_json = from_service_account_file

@property
Expand Down
Expand Up @@ -1850,7 +1850,7 @@ def get_iam_policy(
request = iam_policy.GetIamPolicyRequest(**request)

elif not request:
request = iam_policy.GetIamPolicyRequest(resource=resource,)
request = iam_policy.GetIamPolicyRequest()

if resource is not None:
request.resource = resource
Expand Down Expand Up @@ -1978,7 +1978,7 @@ def set_iam_policy(
request = iam_policy.SetIamPolicyRequest(**request)

elif not request:
request = iam_policy.SetIamPolicyRequest(resource=resource,)
request = iam_policy.SetIamPolicyRequest()

if resource is not None:
request.resource = resource
Expand Down Expand Up @@ -2061,13 +2061,14 @@ def test_iam_permissions(
request = iam_policy.TestIamPermissionsRequest(**request)

elif not request:
request = iam_policy.TestIamPermissionsRequest(
resource=resource, permissions=permissions,
)
request = iam_policy.TestIamPermissionsRequest()

if resource is not None:
request.resource = resource

if permissions:
request.permissions.extend(permissions)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions]
Expand Down
Expand Up @@ -103,8 +103,36 @@ class BigtableTableAdminAsyncClient:
BigtableTableAdminClient.parse_common_location_path
)

from_service_account_info = BigtableTableAdminClient.from_service_account_info
from_service_account_file = BigtableTableAdminClient.from_service_account_file
@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.

Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.

Returns:
BigtableTableAdminAsyncClient: The constructed client.
"""
return BigtableTableAdminClient.from_service_account_info.__func__(BigtableTableAdminAsyncClient, info, *args, **kwargs) # type: ignore

@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.

Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.

Returns:
BigtableTableAdminAsyncClient: The constructed client.
"""
return BigtableTableAdminClient.from_service_account_file.__func__(BigtableTableAdminAsyncClient, filename, *args, **kwargs) # type: ignore

from_service_account_json = from_service_account_file

@property
Expand Down
Expand Up @@ -2259,7 +2259,7 @@ def get_iam_policy(
request = iam_policy.GetIamPolicyRequest(**request)

elif not request:
request = iam_policy.GetIamPolicyRequest(resource=resource,)
request = iam_policy.GetIamPolicyRequest()

if resource is not None:
request.resource = resource
Expand Down Expand Up @@ -2387,7 +2387,7 @@ def set_iam_policy(
request = iam_policy.SetIamPolicyRequest(**request)

elif not request:
request = iam_policy.SetIamPolicyRequest(resource=resource,)
request = iam_policy.SetIamPolicyRequest()

if resource is not None:
request.resource = resource
Expand Down Expand Up @@ -2470,13 +2470,14 @@ def test_iam_permissions(
request = iam_policy.TestIamPermissionsRequest(**request)

elif not request:
request = iam_policy.TestIamPermissionsRequest(
resource=resource, permissions=permissions,
)
request = iam_policy.TestIamPermissionsRequest()

if resource is not None:
request.resource = resource

if permissions:
request.permissions.extend(permissions)

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions]
Expand Down
32 changes: 30 additions & 2 deletions google/cloud/bigtable_v2/services/bigtable/async_client.py
Expand Up @@ -70,8 +70,36 @@ class BigtableAsyncClient:
common_location_path = staticmethod(BigtableClient.common_location_path)
parse_common_location_path = staticmethod(BigtableClient.parse_common_location_path)

from_service_account_info = BigtableClient.from_service_account_info
from_service_account_file = BigtableClient.from_service_account_file
@classmethod
def from_service_account_info(cls, info: dict, *args, **kwargs):
"""Creates an instance of this client using the provided credentials info.

Args:
info (dict): The service account private key info.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.

Returns:
BigtableAsyncClient: The constructed client.
"""
return BigtableClient.from_service_account_info.__func__(BigtableAsyncClient, info, *args, **kwargs) # type: ignore

@classmethod
def from_service_account_file(cls, filename: str, *args, **kwargs):
"""Creates an instance of this client using the provided credentials
file.

Args:
filename (str): The path to the service account private key json
file.
args: Additional arguments to pass to the constructor.
kwargs: Additional arguments to pass to the constructor.

Returns:
BigtableAsyncClient: The constructed client.
"""
return BigtableClient.from_service_account_file.__func__(BigtableAsyncClient, filename, *args, **kwargs) # type: ignore

from_service_account_json = from_service_account_file

@property
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,15 +4,15 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-bigtable.git",
"sha": "b7489b65319eabd1dbe01d5d01b24500d013b53f"
"sha": "fd19db49f843514d070e296b3934eb7371b9e2b8"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "c06bbe28cc7287a55bf7926ee48da2565854de7f",
"internalRef": "359364666"
"sha": "e41506dc28a42bae9b86c7b45e889bdf6d786648",
"internalRef": "359620992"
}
},
{
Expand Down
15 changes: 15 additions & 0 deletions tests/unit/gapic/bigtable_admin_v2/__init__.py
@@ -1 +1,16 @@
# -*- coding: utf-8 -*-

# Copyright 2020 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.
#