2121import warnings
2222
2323from google .oauth2 import service_account
24+ import google .api_core .client_options
2425import google .api_core .gapic_v1 .client_info
2526import google .api_core .gapic_v1 .config
2627import google .api_core .gapic_v1 .method
@@ -129,6 +130,7 @@ def __init__(
129130 credentials = None ,
130131 client_config = None ,
131132 client_info = None ,
133+ client_options = None ,
132134 ):
133135 """Constructor.
134136
@@ -159,6 +161,9 @@ def __init__(
159161 API requests. If ``None``, then default info will be used.
160162 Generally, you only need to set this if you're developing
161163 your own client library.
164+ client_options (Union[dict, google.api_core.client_options.ClientOptions]):
165+ Client options used to set user options on the client. API Endpoint
166+ should be set through client_options.
162167 """
163168 # Raise deprecation warnings for things we want to go away.
164169 if client_config is not None :
@@ -177,6 +182,15 @@ def __init__(
177182 stacklevel = 2 ,
178183 )
179184
185+ api_endpoint = self .SERVICE_ADDRESS
186+ if client_options :
187+ if type (client_options ) == dict :
188+ client_options = google .api_core .client_options .from_dict (
189+ client_options
190+ )
191+ if client_options .api_endpoint :
192+ api_endpoint = client_options .api_endpoint
193+
180194 # Instantiate the transport.
181195 # The transport is responsible for handling serialization and
182196 # deserialization and actually sending data to the service.
@@ -185,6 +199,7 @@ def __init__(
185199 self .transport = transport (
186200 credentials = credentials ,
187201 default_class = web_security_scanner_grpc_transport .WebSecurityScannerGrpcTransport ,
202+ address = api_endpoint ,
188203 )
189204 else :
190205 if credentials :
@@ -195,7 +210,7 @@ def __init__(
195210 self .transport = transport
196211 else :
197212 self .transport = web_security_scanner_grpc_transport .WebSecurityScannerGrpcTransport (
198- address = self . SERVICE_ADDRESS , channel = channel , credentials = credentials
213+ address = api_endpoint , channel = channel , credentials = credentials
199214 )
200215
201216 if client_info is None :
@@ -493,10 +508,10 @@ def list_scan_configs(
493508 that is provided to the method.
494509
495510 Returns:
496- A :class:`~google.gax. PageIterator` instance. By default, this
497- is an iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` instances.
498- This object can also be configured to iterate over the pages
499- of the response through the `options` parameter .
511+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
512+ An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanConfig` instances.
513+ You can also iterate over the pages of the response
514+ using its `pages` property .
500515
501516 Raises:
502517 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -830,10 +845,10 @@ def list_scan_runs(
830845 that is provided to the method.
831846
832847 Returns:
833- A :class:`~google.gax. PageIterator` instance. By default, this
834- is an iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanRun` instances.
835- This object can also be configured to iterate over the pages
836- of the response through the `options` parameter .
848+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
849+ An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.ScanRun` instances.
850+ You can also iterate over the pages of the response
851+ using its `pages` property .
837852
838853 Raises:
839854 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -1008,10 +1023,10 @@ def list_crawled_urls(
10081023 that is provided to the method.
10091024
10101025 Returns:
1011- A :class:`~google.gax. PageIterator` instance. By default, this
1012- is an iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.CrawledUrl` instances.
1013- This object can also be configured to iterate over the pages
1014- of the response through the `options` parameter .
1026+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
1027+ An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.CrawledUrl` instances.
1028+ You can also iterate over the pages of the response
1029+ using its `pages` property .
10151030
10161031 Raises:
10171032 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -1192,10 +1207,10 @@ def list_findings(
11921207 that is provided to the method.
11931208
11941209 Returns:
1195- A :class:`~google.gax. PageIterator` instance. By default, this
1196- is an iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.Finding` instances.
1197- This object can also be configured to iterate over the pages
1198- of the response through the `options` parameter .
1210+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
1211+ An iterable of :class:`~google.cloud.websecurityscanner_v1alpha.types.Finding` instances.
1212+ You can also iterate over the pages of the response
1213+ using its `pages` property .
11991214
12001215 Raises:
12011216 google.api_core.exceptions.GoogleAPICallError: If the request
0 commit comments