Skip to content

Commit 47d5dc1

Browse files
deps: update gapic-generator-python to 0.40.11 (#230)
* 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> Source-Date: Thu Feb 25 15:00:05 2021 -0800 Source-Repo: googleapis/googleapis Source-Sha: e41506dc28a42bae9b86c7b45e889bdf6d786648 Source-Link: googleapis/googleapis@e41506d
1 parent fd19db4 commit 47d5dc1

File tree

12 files changed

+937
-27
lines changed

12 files changed

+937
-27
lines changed

google/cloud/bigtable_admin_v2/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"AppProfile",
8989
"Backup",
9090
"BackupInfo",
91-
"BigtableTableAdminClient",
91+
"BigtableInstanceAdminClient",
9292
"CheckConsistencyRequest",
9393
"CheckConsistencyResponse",
9494
"Cluster",
@@ -151,5 +151,5 @@
151151
"UpdateBackupRequest",
152152
"UpdateClusterMetadata",
153153
"UpdateInstanceMetadata",
154-
"BigtableInstanceAdminClient",
154+
"BigtableTableAdminClient",
155155
)

google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,36 @@ class BigtableInstanceAdminAsyncClient:
100100
BigtableInstanceAdminClient.parse_common_location_path
101101
)
102102

103-
from_service_account_info = BigtableInstanceAdminClient.from_service_account_info
104-
from_service_account_file = BigtableInstanceAdminClient.from_service_account_file
103+
@classmethod
104+
def from_service_account_info(cls, info: dict, *args, **kwargs):
105+
"""Creates an instance of this client using the provided credentials info.
106+
107+
Args:
108+
info (dict): The service account private key info.
109+
args: Additional arguments to pass to the constructor.
110+
kwargs: Additional arguments to pass to the constructor.
111+
112+
Returns:
113+
BigtableInstanceAdminAsyncClient: The constructed client.
114+
"""
115+
return BigtableInstanceAdminClient.from_service_account_info.__func__(BigtableInstanceAdminAsyncClient, info, *args, **kwargs) # type: ignore
116+
117+
@classmethod
118+
def from_service_account_file(cls, filename: str, *args, **kwargs):
119+
"""Creates an instance of this client using the provided credentials
120+
file.
121+
122+
Args:
123+
filename (str): The path to the service account private key json
124+
file.
125+
args: Additional arguments to pass to the constructor.
126+
kwargs: Additional arguments to pass to the constructor.
127+
128+
Returns:
129+
BigtableInstanceAdminAsyncClient: The constructed client.
130+
"""
131+
return BigtableInstanceAdminClient.from_service_account_file.__func__(BigtableInstanceAdminAsyncClient, filename, *args, **kwargs) # type: ignore
132+
105133
from_service_account_json = from_service_account_file
106134

107135
@property

google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1850,7 +1850,7 @@ def get_iam_policy(
18501850
request = iam_policy.GetIamPolicyRequest(**request)
18511851

18521852
elif not request:
1853-
request = iam_policy.GetIamPolicyRequest(resource=resource,)
1853+
request = iam_policy.GetIamPolicyRequest()
18541854

18551855
if resource is not None:
18561856
request.resource = resource
@@ -1978,7 +1978,7 @@ def set_iam_policy(
19781978
request = iam_policy.SetIamPolicyRequest(**request)
19791979

19801980
elif not request:
1981-
request = iam_policy.SetIamPolicyRequest(resource=resource,)
1981+
request = iam_policy.SetIamPolicyRequest()
19821982

19831983
if resource is not None:
19841984
request.resource = resource
@@ -2061,13 +2061,14 @@ def test_iam_permissions(
20612061
request = iam_policy.TestIamPermissionsRequest(**request)
20622062

20632063
elif not request:
2064-
request = iam_policy.TestIamPermissionsRequest(
2065-
resource=resource, permissions=permissions,
2066-
)
2064+
request = iam_policy.TestIamPermissionsRequest()
20672065

20682066
if resource is not None:
20692067
request.resource = resource
20702068

2069+
if permissions:
2070+
request.permissions.extend(permissions)
2071+
20712072
# Wrap the RPC method; this adds retry and timeout information,
20722073
# and friendly error handling.
20732074
rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions]

google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,36 @@ class BigtableTableAdminAsyncClient:
103103
BigtableTableAdminClient.parse_common_location_path
104104
)
105105

106-
from_service_account_info = BigtableTableAdminClient.from_service_account_info
107-
from_service_account_file = BigtableTableAdminClient.from_service_account_file
106+
@classmethod
107+
def from_service_account_info(cls, info: dict, *args, **kwargs):
108+
"""Creates an instance of this client using the provided credentials info.
109+
110+
Args:
111+
info (dict): The service account private key info.
112+
args: Additional arguments to pass to the constructor.
113+
kwargs: Additional arguments to pass to the constructor.
114+
115+
Returns:
116+
BigtableTableAdminAsyncClient: The constructed client.
117+
"""
118+
return BigtableTableAdminClient.from_service_account_info.__func__(BigtableTableAdminAsyncClient, info, *args, **kwargs) # type: ignore
119+
120+
@classmethod
121+
def from_service_account_file(cls, filename: str, *args, **kwargs):
122+
"""Creates an instance of this client using the provided credentials
123+
file.
124+
125+
Args:
126+
filename (str): The path to the service account private key json
127+
file.
128+
args: Additional arguments to pass to the constructor.
129+
kwargs: Additional arguments to pass to the constructor.
130+
131+
Returns:
132+
BigtableTableAdminAsyncClient: The constructed client.
133+
"""
134+
return BigtableTableAdminClient.from_service_account_file.__func__(BigtableTableAdminAsyncClient, filename, *args, **kwargs) # type: ignore
135+
108136
from_service_account_json = from_service_account_file
109137

110138
@property

google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2259,7 +2259,7 @@ def get_iam_policy(
22592259
request = iam_policy.GetIamPolicyRequest(**request)
22602260

22612261
elif not request:
2262-
request = iam_policy.GetIamPolicyRequest(resource=resource,)
2262+
request = iam_policy.GetIamPolicyRequest()
22632263

22642264
if resource is not None:
22652265
request.resource = resource
@@ -2387,7 +2387,7 @@ def set_iam_policy(
23872387
request = iam_policy.SetIamPolicyRequest(**request)
23882388

23892389
elif not request:
2390-
request = iam_policy.SetIamPolicyRequest(resource=resource,)
2390+
request = iam_policy.SetIamPolicyRequest()
23912391

23922392
if resource is not None:
23932393
request.resource = resource
@@ -2470,13 +2470,14 @@ def test_iam_permissions(
24702470
request = iam_policy.TestIamPermissionsRequest(**request)
24712471

24722472
elif not request:
2473-
request = iam_policy.TestIamPermissionsRequest(
2474-
resource=resource, permissions=permissions,
2475-
)
2473+
request = iam_policy.TestIamPermissionsRequest()
24762474

24772475
if resource is not None:
24782476
request.resource = resource
24792477

2478+
if permissions:
2479+
request.permissions.extend(permissions)
2480+
24802481
# Wrap the RPC method; this adds retry and timeout information,
24812482
# and friendly error handling.
24822483
rpc = self._transport._wrapped_methods[self._transport.test_iam_permissions]

google/cloud/bigtable_v2/services/bigtable/async_client.py

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,36 @@ class BigtableAsyncClient:
7070
common_location_path = staticmethod(BigtableClient.common_location_path)
7171
parse_common_location_path = staticmethod(BigtableClient.parse_common_location_path)
7272

73-
from_service_account_info = BigtableClient.from_service_account_info
74-
from_service_account_file = BigtableClient.from_service_account_file
73+
@classmethod
74+
def from_service_account_info(cls, info: dict, *args, **kwargs):
75+
"""Creates an instance of this client using the provided credentials info.
76+
77+
Args:
78+
info (dict): The service account private key info.
79+
args: Additional arguments to pass to the constructor.
80+
kwargs: Additional arguments to pass to the constructor.
81+
82+
Returns:
83+
BigtableAsyncClient: The constructed client.
84+
"""
85+
return BigtableClient.from_service_account_info.__func__(BigtableAsyncClient, info, *args, **kwargs) # type: ignore
86+
87+
@classmethod
88+
def from_service_account_file(cls, filename: str, *args, **kwargs):
89+
"""Creates an instance of this client using the provided credentials
90+
file.
91+
92+
Args:
93+
filename (str): The path to the service account private key json
94+
file.
95+
args: Additional arguments to pass to the constructor.
96+
kwargs: Additional arguments to pass to the constructor.
97+
98+
Returns:
99+
BigtableAsyncClient: The constructed client.
100+
"""
101+
return BigtableClient.from_service_account_file.__func__(BigtableAsyncClient, filename, *args, **kwargs) # type: ignore
102+
75103
from_service_account_json = from_service_account_file
76104

77105
@property

synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-bigtable.git",
7-
"sha": "b7489b65319eabd1dbe01d5d01b24500d013b53f"
7+
"sha": "fd19db49f843514d070e296b3934eb7371b9e2b8"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "c06bbe28cc7287a55bf7926ee48da2565854de7f",
15-
"internalRef": "359364666"
14+
"sha": "e41506dc28a42bae9b86c7b45e889bdf6d786648",
15+
"internalRef": "359620992"
1616
}
1717
},
1818
{
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1+
# -*- coding: utf-8 -*-
12

3+
# Copyright 2020 Google LLC
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#

0 commit comments

Comments
 (0)