Skip to content

Commit

Permalink
deps: update gapic-generator-python to 0.40.11 (#230)
Browse files Browse the repository at this point in the history
* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* docs: update python contributing guide

Adds details about blacken, updates version for system tests,
and shows how to pass through pytest arguments.

Source-Author: Chris Cotter <cjcotter@google.com>
Source-Date: Mon Feb 8 17:13:36 2021 -0500
Source-Repo: googleapis/synthtool
Source-Sha: 4679e7e415221f03ff2a71e3ffad75b9ec41d87e
Source-Link: googleapis/synthtool@4679e7e

* chore: update gapic-generator-python to 0.40.11

PiperOrigin-RevId: 359562873

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Feb 25 10:52:32 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 07932bb995e7dc91b43620ea8402c6668c7d102c
Source-Link: googleapis/googleapis@07932bb

* chore(java): fix gapic target name

PiperOrigin-RevId: 359594504

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Feb 25 13:07:14 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: 80fafbce83f1d95c3616c7b3f50504a4ad251bfd
Source-Link: googleapis/googleapis@80fafbc

* feat: Enable PHP micro-generator beta01

PiperOrigin-RevId: 359620992

Source-Author: Google APIs <noreply@google.com>
Source-Date: Thu Feb 25 15:00:05 2021 -0800
Source-Repo: googleapis/googleapis
Source-Sha: e41506dc28a42bae9b86c7b45e889bdf6d786648
Source-Link: googleapis/googleapis@e41506d
  • Loading branch information
yoshi-automation committed Mar 1, 2021
1 parent fd19db4 commit 47d5dc1
Show file tree
Hide file tree
Showing 12 changed files with 937 additions and 27 deletions.
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.
#

0 comments on commit 47d5dc1

Please sign in to comment.