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

Commit

Permalink
Websecurityscanner: pick up fixes to GAPIC generator. (#6633)
Browse files Browse the repository at this point in the history
Includes fixes from these PRs:

- googleapis/gapic-generator#2407
- googleapis/gapic-generator#2396

Includes changes to generated tests.

Closes #6476.
  • Loading branch information
tseaver authored Nov 21, 2018
1 parent 125f740 commit fad1da0
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def __init__(self,
credentials=credentials,
)

self._channel = channel

# gRPC uses objects called "stubs" that are bound to the
# channel and provide a basic method for each RPC.
self._stubs = {
Expand Down Expand Up @@ -92,6 +94,15 @@ def create_channel(cls,
scopes=cls._OAUTH_SCOPES,
)

@property
def channel(self):
"""The gRPC channel used by the transport.
Returns:
grpc.Channel: A gRPC channel object.
"""
return self._channel

@property
def create_scan_config(self):
"""Return the gRPC stub for {$apiMethod.name}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self,
transport=None,
channel=None,
credentials=None,
client_config=web_security_scanner_client_config.config,
client_config=None,
client_info=None):
"""Constructor.
Expand Down Expand Up @@ -153,13 +153,20 @@ def __init__(self,
your own client library.
"""
# Raise deprecation warnings for things we want to go away.
if client_config:
warnings.warn('The `client_config` argument is deprecated.',
PendingDeprecationWarning)
if client_config is not None:
warnings.warn(
'The `client_config` argument is deprecated.',
PendingDeprecationWarning,
stacklevel=2)
else:
client_config = web_security_scanner_client_config.config

if channel:
warnings.warn(
'The `channel` argument is deprecated; use '
'`transport` instead.', PendingDeprecationWarning)
'`transport` instead.',
PendingDeprecationWarning,
stacklevel=2)

# Instantiate the transport.
# The transport is responsible for handling serialization and
Expand Down
1 change: 1 addition & 0 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@

s.move(library / 'google/cloud/websecurityscanner_v1alpha/proto')
s.move(library / 'google/cloud/websecurityscanner_v1alpha/gapic')
s.move(library / 'tests/unit/gapic/v1alpha')
Loading

0 comments on commit fad1da0

Please sign in to comment.