Skip to content

Commit 52b51a9

Browse files
fix: remove client recv msg limit fix: add enums to types/__init__.py (#10)
PiperOrigin-RevId: 347055288 Source-Author: Google APIs <noreply@google.com> Source-Date: Fri Dec 11 12:44:37 2020 -0800 Source-Repo: googleapis/googleapis Source-Sha: dd372aa22ded7a8ba6f0e03a80e06358a3fa0907 Source-Link: googleapis/googleapis@dd372aa
1 parent 89d3f7b commit 52b51a9

6 files changed

Lines changed: 38 additions & 14 deletions

File tree

packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/transports/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_transport_registry["grpc"] = CertificateAuthorityServiceGrpcTransport
3131
_transport_registry["grpc_asyncio"] = CertificateAuthorityServiceGrpcAsyncIOTransport
3232

33-
3433
__all__ = (
3534
"CertificateAuthorityServiceTransport",
3635
"CertificateAuthorityServiceGrpcTransport",

packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/transports/grpc.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ def __init__(
151151
ssl_credentials=ssl_credentials,
152152
scopes=scopes or self.AUTH_SCOPES,
153153
quota_project_id=quota_project_id,
154+
options=[
155+
("grpc.max_send_message_length", -1),
156+
("grpc.max_receive_message_length", -1),
157+
],
154158
)
155159
self._ssl_channel_credentials = ssl_credentials
156160
else:
@@ -169,9 +173,14 @@ def __init__(
169173
ssl_credentials=ssl_channel_credentials,
170174
scopes=scopes or self.AUTH_SCOPES,
171175
quota_project_id=quota_project_id,
176+
options=[
177+
("grpc.max_send_message_length", -1),
178+
("grpc.max_receive_message_length", -1),
179+
],
172180
)
173181

174182
self._stubs = {} # type: Dict[str, Callable]
183+
self._operations_client = None
175184

176185
# Run the base constructor.
177186
super().__init__(
@@ -195,7 +204,7 @@ def create_channel(
195204
) -> grpc.Channel:
196205
"""Create and return a gRPC channel object.
197206
Args:
198-
address (Optionsl[str]): The host for the channel to use.
207+
address (Optional[str]): The host for the channel to use.
199208
credentials (Optional[~.Credentials]): The
200209
authorization credentials to attach to requests. These
201210
credentials identify this application to the service. If
@@ -242,13 +251,11 @@ def operations_client(self) -> operations_v1.OperationsClient:
242251
client.
243252
"""
244253
# Sanity check: Only create a new client if we do not already have one.
245-
if "operations_client" not in self.__dict__:
246-
self.__dict__["operations_client"] = operations_v1.OperationsClient(
247-
self.grpc_channel
248-
)
254+
if self._operations_client is None:
255+
self._operations_client = operations_v1.OperationsClient(self.grpc_channel)
249256

250257
# Return the client from cache.
251-
return self.__dict__["operations_client"]
258+
return self._operations_client
252259

253260
@property
254261
def create_certificate(

packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/services/certificate_authority_service/transports/grpc_asyncio.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ def __init__(
198198
ssl_credentials=ssl_credentials,
199199
scopes=scopes or self.AUTH_SCOPES,
200200
quota_project_id=quota_project_id,
201+
options=[
202+
("grpc.max_send_message_length", -1),
203+
("grpc.max_receive_message_length", -1),
204+
],
201205
)
202206
self._ssl_channel_credentials = ssl_credentials
203207
else:
@@ -216,6 +220,10 @@ def __init__(
216220
ssl_credentials=ssl_channel_credentials,
217221
scopes=scopes or self.AUTH_SCOPES,
218222
quota_project_id=quota_project_id,
223+
options=[
224+
("grpc.max_send_message_length", -1),
225+
("grpc.max_receive_message_length", -1),
226+
],
219227
)
220228

221229
# Run the base constructor.
@@ -229,6 +237,7 @@ def __init__(
229237
)
230238

231239
self._stubs = {}
240+
self._operations_client = None
232241

233242
@property
234243
def grpc_channel(self) -> aio.Channel:
@@ -248,13 +257,13 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient:
248257
client.
249258
"""
250259
# Sanity check: Only create a new client if we do not already have one.
251-
if "operations_client" not in self.__dict__:
252-
self.__dict__["operations_client"] = operations_v1.OperationsAsyncClient(
260+
if self._operations_client is None:
261+
self._operations_client = operations_v1.OperationsAsyncClient(
253262
self.grpc_channel
254263
)
255264

256265
# Return the client from cache.
257-
return self.__dict__["operations_client"]
266+
return self._operations_client
258267

259268
@property
260269
def create_certificate(

packages/google-cloud-private-ca/google/cloud/security/privateca_v1beta1/types/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
KeyUsage,
3232
Subject,
3333
SubjectAltNames,
34+
RevocationReason,
3435
)
3536
from .service import (
3637
CreateCertificateRequest,
@@ -61,7 +62,6 @@
6162
OperationMetadata,
6263
)
6364

64-
6565
__all__ = (
6666
"CertificateAuthority",
6767
"CertificateRevocationList",
@@ -78,6 +78,7 @@
7878
"KeyUsage",
7979
"Subject",
8080
"SubjectAltNames",
81+
"RevocationReason",
8182
"CreateCertificateRequest",
8283
"GetCertificateRequest",
8384
"ListCertificatesRequest",

packages/google-cloud-private-ca/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-security-private-ca.git",
7-
"sha": "bbe17c13e7af03c68f933bc2405522f227c0522e"
7+
"sha": "c984a7868b5a990d7ef02fd3894aa94ca913a308"
88
}
99
},
1010
{
1111
"git": {
1212
"name": "googleapis",
1313
"remote": "https://github.com/googleapis/googleapis.git",
14-
"sha": "dabe30b45bc86fdaf4126f26cbcfd73babbfa3fe",
15-
"internalRef": "345194337"
14+
"sha": "dd372aa22ded7a8ba6f0e03a80e06358a3fa0907",
15+
"internalRef": "347055288"
1616
}
1717
},
1818
{

packages/google-cloud-private-ca/tests/unit/gapic/privateca_v1beta1/test_certificate_authority_service.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6015,6 +6015,10 @@ def test_certificate_authority_service_transport_channel_mtls_with_client_cert_s
60156015
scopes=("https://www.googleapis.com/auth/cloud-platform",),
60166016
ssl_credentials=mock_ssl_cred,
60176017
quota_project_id=None,
6018+
options=[
6019+
("grpc.max_send_message_length", -1),
6020+
("grpc.max_receive_message_length", -1),
6021+
],
60186022
)
60196023
assert transport.grpc_channel == mock_grpc_channel
60206024
assert transport._ssl_channel_credentials == mock_ssl_cred
@@ -6056,6 +6060,10 @@ def test_certificate_authority_service_transport_channel_mtls_with_adc(transport
60566060
scopes=("https://www.googleapis.com/auth/cloud-platform",),
60576061
ssl_credentials=mock_ssl_cred,
60586062
quota_project_id=None,
6063+
options=[
6064+
("grpc.max_send_message_length", -1),
6065+
("grpc.max_receive_message_length", -1),
6066+
],
60596067
)
60606068
assert transport.grpc_channel == mock_grpc_channel
60616069

0 commit comments

Comments
 (0)