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
@@ -154,6 +155,7 @@ def __init__(
154155 credentials = None ,
155156 client_config = None ,
156157 client_info = None ,
158+ client_options = None ,
157159 ):
158160 """Constructor.
159161
@@ -184,6 +186,9 @@ def __init__(
184186 API requests. If ``None``, then default info will be used.
185187 Generally, you only need to set this if you're developing
186188 your own client library.
189+ client_options (Union[dict, google.api_core.client_options.ClientOptions]):
190+ Client options used to set user options on the client. API Endpoint
191+ should be set through client_options.
187192 """
188193 # Raise deprecation warnings for things we want to go away.
189194 if client_config is not None :
@@ -202,6 +207,15 @@ def __init__(
202207 stacklevel = 2 ,
203208 )
204209
210+ api_endpoint = self .SERVICE_ADDRESS
211+ if client_options :
212+ if type (client_options ) == dict :
213+ client_options = google .api_core .client_options .from_dict (
214+ client_options
215+ )
216+ if client_options .api_endpoint :
217+ api_endpoint = client_options .api_endpoint
218+
205219 # Instantiate the transport.
206220 # The transport is responsible for handling serialization and
207221 # deserialization and actually sending data to the service.
@@ -210,6 +224,7 @@ def __init__(
210224 self .transport = transport (
211225 credentials = credentials ,
212226 default_class = incident_service_grpc_transport .IncidentServiceGrpcTransport ,
227+ address = api_endpoint ,
213228 )
214229 else :
215230 if credentials :
@@ -220,7 +235,7 @@ def __init__(
220235 self .transport = transport
221236 else :
222237 self .transport = incident_service_grpc_transport .IncidentServiceGrpcTransport (
223- address = self . SERVICE_ADDRESS , channel = channel , credentials = credentials
238+ address = api_endpoint , channel = channel , credentials = credentials
224239 )
225240
226241 if client_info is None :
@@ -515,10 +530,10 @@ def search_incidents(
515530 that is provided to the method.
516531
517532 Returns:
518- A :class:`~google.gax. PageIterator` instance. By default, this
519- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Incident` instances.
520- This object can also be configured to iterate over the pages
521- of the response through the `options` parameter .
533+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
534+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Incident` instances.
535+ You can also iterate over the pages of the response
536+ using its `pages` property .
522537
523538 Raises:
524539 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -701,10 +716,10 @@ def search_similar_incidents(
701716 that is provided to the method.
702717
703718 Returns:
704- A :class:`~google.gax. PageIterator` instance. By default, this
705- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Result` instances.
706- This object can also be configured to iterate over the pages
707- of the response through the `options` parameter .
719+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
720+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Result` instances.
721+ You can also iterate over the pages of the response
722+ using its `pages` property .
708723
709724 Raises:
710725 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -887,10 +902,10 @@ def list_annotations(
887902 that is provided to the method.
888903
889904 Returns:
890- A :class:`~google.gax. PageIterator` instance. By default, this
891- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Annotation` instances.
892- This object can also be configured to iterate over the pages
893- of the response through the `options` parameter .
905+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
906+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Annotation` instances.
907+ You can also iterate over the pages of the response
908+ using its `pages` property .
894909
895910 Raises:
896911 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -1135,10 +1150,10 @@ def list_tags(
11351150 that is provided to the method.
11361151
11371152 Returns:
1138- A :class:`~google.gax. PageIterator` instance. By default, this
1139- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Tag` instances.
1140- This object can also be configured to iterate over the pages
1141- of the response through the `options` parameter .
1153+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
1154+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Tag` instances.
1155+ You can also iterate over the pages of the response
1156+ using its `pages` property .
11421157
11431158 Raises:
11441159 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -1383,10 +1398,10 @@ def search_signals(
13831398 that is provided to the method.
13841399
13851400 Returns:
1386- A :class:`~google.gax. PageIterator` instance. By default, this
1387- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Signal` instances.
1388- This object can also be configured to iterate over the pages
1389- of the response through the `options` parameter .
1401+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
1402+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Signal` instances.
1403+ You can also iterate over the pages of the response
1404+ using its `pages` property .
13901405
13911406 Raises:
13921407 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -1892,10 +1907,10 @@ def list_artifacts(
18921907 that is provided to the method.
18931908
18941909 Returns:
1895- A :class:`~google.gax. PageIterator` instance. By default, this
1896- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Artifact` instances.
1897- This object can also be configured to iterate over the pages
1898- of the response through the `options` parameter .
1910+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
1911+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Artifact` instances.
1912+ You can also iterate over the pages of the response
1913+ using its `pages` property .
18991914
19001915 Raises:
19011916 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -2409,10 +2424,10 @@ def list_subscriptions(
24092424 that is provided to the method.
24102425
24112426 Returns:
2412- A :class:`~google.gax. PageIterator` instance. By default, this
2413- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.Subscription` instances.
2414- This object can also be configured to iterate over the pages
2415- of the response through the `options` parameter .
2427+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
2428+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.Subscription` instances.
2429+ You can also iterate over the pages of the response
2430+ using its `pages` property .
24162431
24172432 Raises:
24182433 google.api_core.exceptions.GoogleAPICallError: If the request
@@ -2737,10 +2752,10 @@ def list_incident_role_assignments(
27372752 that is provided to the method.
27382753
27392754 Returns:
2740- A :class:`~google.gax. PageIterator` instance. By default, this
2741- is an iterable of :class:`~google.cloud.irm_v1alpha2.types.IncidentRoleAssignment` instances.
2742- This object can also be configured to iterate over the pages
2743- of the response through the `options` parameter .
2755+ A :class:`~google.api_core.page_iterator. PageIterator` instance.
2756+ An iterable of :class:`~google.cloud.irm_v1alpha2.types.IncidentRoleAssignment` instances.
2757+ You can also iterate over the pages of the response
2758+ using its `pages` property .
27442759
27452760 Raises:
27462761 google.api_core.exceptions.GoogleAPICallError: If the request
0 commit comments