diff --git a/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py b/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py index 608c50863d0e..b2f84dff38c9 100644 --- a/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py +++ b/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_instance_admin_client.py @@ -21,6 +21,7 @@ import warnings from google.oauth2 import service_account +import google.api_core.client_options import google.api_core.gapic_v1.client_info import google.api_core.gapic_v1.config import google.api_core.gapic_v1.method @@ -136,6 +137,7 @@ def __init__( credentials=None, client_config=None, client_info=None, + client_options=None, ): """Constructor. @@ -166,6 +168,9 @@ def __init__( API requests. If ``None``, then default info will be used. Generally, you only need to set this if you're developing your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. """ # Raise deprecation warnings for things we want to go away. if client_config is not None: @@ -184,6 +189,15 @@ def __init__( stacklevel=2, ) + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + # Instantiate the transport. # The transport is responsible for handling serialization and # deserialization and actually sending data to the service. @@ -192,6 +206,7 @@ def __init__( self.transport = transport( credentials=credentials, default_class=bigtable_instance_admin_grpc_transport.BigtableInstanceAdminGrpcTransport, + address=api_endpoint, ) else: if credentials: @@ -202,7 +217,7 @@ def __init__( self.transport = transport else: self.transport = bigtable_instance_admin_grpc_transport.BigtableInstanceAdminGrpcTransport( - address=self.SERVICE_ADDRESS, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials ) if client_info is None: @@ -1392,10 +1407,10 @@ def list_app_profiles( that is provided to the method. Returns: - A :class:`~google.gax.PageIterator` instance. By default, this - is an iterable of :class:`~google.cloud.bigtable_admin_v2.types.AppProfile` instances. - This object can also be configured to iterate over the pages - of the response through the `options` parameter. + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.bigtable_admin_v2.types.AppProfile` instances. + You can also iterate over the pages of the response + using its `pages` property. Raises: google.api_core.exceptions.GoogleAPICallError: If the request diff --git a/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py b/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py index f2a7b983deaa..57734d90cef5 100644 --- a/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py +++ b/bigtable/google/cloud/bigtable_admin_v2/gapic/bigtable_table_admin_client.py @@ -21,6 +21,7 @@ import warnings from google.oauth2 import service_account +import google.api_core.client_options import google.api_core.gapic_v1.client_info import google.api_core.gapic_v1.config import google.api_core.gapic_v1.method @@ -138,6 +139,7 @@ def __init__( credentials=None, client_config=None, client_info=None, + client_options=None, ): """Constructor. @@ -168,6 +170,9 @@ def __init__( API requests. If ``None``, then default info will be used. Generally, you only need to set this if you're developing your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. """ # Raise deprecation warnings for things we want to go away. if client_config is not None: @@ -186,6 +191,15 @@ def __init__( stacklevel=2, ) + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + # Instantiate the transport. # The transport is responsible for handling serialization and # deserialization and actually sending data to the service. @@ -194,6 +208,7 @@ def __init__( self.transport = transport( credentials=credentials, default_class=bigtable_table_admin_grpc_transport.BigtableTableAdminGrpcTransport, + address=api_endpoint, ) else: if credentials: @@ -204,7 +219,7 @@ def __init__( self.transport = transport else: self.transport = bigtable_table_admin_grpc_transport.BigtableTableAdminGrpcTransport( - address=self.SERVICE_ADDRESS, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials ) if client_info is None: @@ -498,10 +513,10 @@ def list_tables( that is provided to the method. Returns: - A :class:`~google.gax.PageIterator` instance. By default, this - is an iterable of :class:`~google.cloud.bigtable_admin_v2.types.Table` instances. - This object can also be configured to iterate over the pages - of the response through the `options` parameter. + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.bigtable_admin_v2.types.Table` instances. + You can also iterate over the pages of the response + using its `pages` property. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -1282,10 +1297,10 @@ def list_snapshots( that is provided to the method. Returns: - A :class:`~google.gax.PageIterator` instance. By default, this - is an iterable of :class:`~google.cloud.bigtable_admin_v2.types.Snapshot` instances. - This object can also be configured to iterate over the pages - of the response through the `options` parameter. + A :class:`~google.api_core.page_iterator.PageIterator` instance. + An iterable of :class:`~google.cloud.bigtable_admin_v2.types.Snapshot` instances. + You can also iterate over the pages of the response + using its `pages` property. Raises: google.api_core.exceptions.GoogleAPICallError: If the request diff --git a/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py b/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py index f588203e565e..8b9a8dedccfb 100644 --- a/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py +++ b/bigtable/google/cloud/bigtable_v2/gapic/bigtable_client.py @@ -20,6 +20,7 @@ import warnings from google.oauth2 import service_account +import google.api_core.client_options import google.api_core.gapic_v1.client_info import google.api_core.gapic_v1.config import google.api_core.gapic_v1.method @@ -85,6 +86,7 @@ def __init__( credentials=None, client_config=None, client_info=None, + client_options=None, ): """Constructor. @@ -115,6 +117,9 @@ def __init__( API requests. If ``None``, then default info will be used. Generally, you only need to set this if you're developing your own client library. + client_options (Union[dict, google.api_core.client_options.ClientOptions]): + Client options used to set user options on the client. API Endpoint + should be set through client_options. """ # Raise deprecation warnings for things we want to go away. if client_config is not None: @@ -133,6 +138,15 @@ def __init__( stacklevel=2, ) + api_endpoint = self.SERVICE_ADDRESS + if client_options: + if type(client_options) == dict: + client_options = google.api_core.client_options.from_dict( + client_options + ) + if client_options.api_endpoint: + api_endpoint = client_options.api_endpoint + # Instantiate the transport. # The transport is responsible for handling serialization and # deserialization and actually sending data to the service. @@ -141,6 +155,7 @@ def __init__( self.transport = transport( credentials=credentials, default_class=bigtable_grpc_transport.BigtableGrpcTransport, + address=api_endpoint, ) else: if credentials: @@ -151,7 +166,7 @@ def __init__( self.transport = transport else: self.transport = bigtable_grpc_transport.BigtableGrpcTransport( - address=self.SERVICE_ADDRESS, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials ) if client_info is None: diff --git a/bigtable/synth.metadata b/bigtable/synth.metadata index 4e173e27ec69..655414469389 100644 --- a/bigtable/synth.metadata +++ b/bigtable/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-06-21T12:13:56.910269Z", + "updateTime": "2019-06-28T12:14:28.794480Z", "sources": [ { "generator": { "name": "artman", - "version": "0.29.0", - "dockerImage": "googleapis/artman@sha256:b79c8c20ee51e5302686c9d1294672d59290df1489be93749ef17d0172cc508d" + "version": "0.29.2", + "dockerImage": "googleapis/artman@sha256:45263333b058a4b3c26a8b7680a2710f43eae3d250f791a6cb66423991dcb2df" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c9546320bb83441a5a49b13a22d5552eef352105", - "internalRef": "254331898" + "sha": "84c8ad4e52f8eec8f08a60636cfa597b86969b5c", + "internalRef": "255474859" } }, {