Repository: googleapis/google-cloud-python

Issue:
[DO NOT MERGE] Websecurityscanner: order-of-enums only synth
This PR was generated using Autosynth. :rainbow:

Here's the log from Synthtool:
```
synthtool > Cloning googleapis.
synthtool > Running generator for google/cloud/websecurityscanner/artman_websecurityscanner_v1alpha.yaml.
synthtool > Ensuring dependencies.
synthtool > Pulling artman image.
latest: Pulling from googleapis/artman
Digest: sha256:229601142daed005bf56fbaa21a02cf7aa0b261b57677d38306f8013e536de7a
Status: Image is up to date for googleapis/artman:latest
synthtool > Generated code into /home/kbuilder/.cache/synthtool/googleapis/artman-genfiles/python/websecurityscanner-v1alpha.
synthtool > Cleaned up 0 temporary directories.

```


Discussion:

Resolving patch:
diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py
--- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py
+++ b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/transports/web_security_scanner_grpc_transport.py
@@ -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 = {
@@ -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}.
diff --git a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py
--- a/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py
+++ b/websecurityscanner/google/cloud/websecurityscanner_v1alpha/gapic/web_security_scanner_client.py
@@ -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.
 
@@ -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
diff --git a/websecurityscanner/synth.py b/websecurityscanner/synth.py
--- a/websecurityscanner/synth.py
+++ b/websecurityscanner/synth.py
@@ -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')


Test patch:
diff --git a/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py b/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py
--- a/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py
+++ b/websecurityscanner/tests/unit/gapic/v1alpha/test_web_security_scanner_client_v1alpha.py
@@ -1,3 +1,5 @@
+# -*- coding: utf-8 -*-
+#
 # Copyright 2018 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,6 +15,7 @@
 # limitations under the License.
 """Unit tests."""
 
+import mock
 import pytest
 
 from google.cloud import websecurityscanner_v1alpha
@@ -79,8 +82,10 @@ def test_create_scan_config(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         parent = client.project_path('[PROJECT]')
@@ -98,8 +103,10 @@ def test_create_scan_config(self):
     def test_create_scan_config_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         parent = client.project_path('[PROJECT]')
@@ -110,8 +117,10 @@ def test_create_scan_config_exception(self):
 
     def test_delete_scan_config(self):
         channel = ChannelStub()
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -127,8 +136,10 @@ def test_delete_scan_config(self):
     def test_delete_scan_config_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -150,8 +161,10 @@ def test_get_scan_config(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -168,8 +181,10 @@ def test_get_scan_config(self):
     def test_get_scan_config_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -191,8 +206,10 @@ def test_list_scan_configs(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         parent = client.project_path('[PROJECT]')
@@ -211,8 +228,10 @@ def test_list_scan_configs(self):
 
     def test_list_scan_configs_exception(self):
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         parent = client.project_path('[PROJECT]')
@@ -235,8 +254,10 @@ def test_update_scan_config(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         scan_config = {}
@@ -254,8 +275,10 @@ def test_update_scan_config(self):
     def test_update_scan_config_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         scan_config = {}
@@ -282,8 +305,10 @@ def test_start_scan_run(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -300,8 +325,10 @@ def test_start_scan_run(self):
     def test_start_scan_run_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         name = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -327,8 +354,10 @@ def test_get_scan_run(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]')
@@ -345,8 +374,10 @@ def test_get_scan_run(self):
     def test_get_scan_run_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]')
@@ -368,8 +399,10 @@ def test_list_scan_runs(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         parent = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -388,8 +421,10 @@ def test_list_scan_runs(self):
 
     def test_list_scan_runs_exception(self):
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         parent = client.scan_config_path('[PROJECT]', '[SCAN_CONFIG]')
@@ -416,8 +451,10 @@ def test_stop_scan_run(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]')
@@ -434,8 +471,10 @@ def test_stop_scan_run(self):
     def test_stop_scan_run_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         name = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]')
@@ -457,8 +496,10 @@ def test_list_crawled_urls(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]',
@@ -478,8 +519,10 @@ def test_list_crawled_urls(self):
 
     def test_list_crawled_urls_exception(self):
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]',
@@ -515,8 +558,10 @@ def test_get_finding(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         name = client.finding_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]',
@@ -534,8 +579,10 @@ def test_get_finding(self):
     def test_get_finding_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         name = client.finding_path('[PROJECT]', '[SCAN_CONFIG]', '[SCAN_RUN]',
@@ -558,8 +605,10 @@ def test_list_findings(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]',
@@ -580,8 +629,10 @@ def test_list_findings(self):
 
     def test_list_findings_exception(self):
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]',
@@ -600,8 +651,10 @@ def test_list_finding_type_stats(self):
 
         # Mock the API response
         channel = ChannelStub(responses=[expected_response])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup Request
         parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]',
@@ -619,8 +672,10 @@ def test_list_finding_type_stats(self):
     def test_list_finding_type_stats_exception(self):
         # Mock the API response
         channel = ChannelStub(responses=[CustomException()])
-        client = websecurityscanner_v1alpha.WebSecurityScannerClient(
-            channel=channel)
+        patch = mock.patch('google.api_core.grpc_helpers.create_channel')
+        with patch as create_channel:
+            create_channel.return_value = channel
+            client = websecurityscanner_v1alpha.WebSecurityScannerClient()
 
         # Setup request
         parent = client.scan_run_path('[PROJECT]', '[SCAN_CONFIG]',