google-cloud-devicestreaming 0.3.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {google_cloud_devicestreaming-0.3.0/google_cloud_devicestreaming.egg-info → google_cloud_devicestreaming-0.4.0}/PKG-INFO +6 -8
  2. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/README.rst +2 -2
  3. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming/gapic_version.py +1 -1
  4. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/__init__.py +1 -0
  5. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/gapic_version.py +1 -1
  6. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/async_client.py +17 -9
  7. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/client.py +21 -22
  8. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/pagers.py +2 -2
  9. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/transports/__init__.py +1 -3
  10. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/transports/base.py +16 -7
  11. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/transports/grpc.py +12 -8
  12. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/transports/grpc_asyncio.py +11 -7
  13. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/transports/rest.py +15 -19
  14. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/transports/rest_base.py +1 -1
  15. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/types/adb_service.py +1 -0
  16. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/types/service.py +4 -3
  17. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0/google_cloud_devicestreaming.egg-info}/PKG-INFO +6 -8
  18. google_cloud_devicestreaming-0.4.0/google_cloud_devicestreaming.egg-info/requires.txt +11 -0
  19. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/setup.py +3 -5
  20. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/tests/unit/gapic/devicestreaming_v1/test_direct_access_service.py +163 -136
  21. google_cloud_devicestreaming-0.3.0/google_cloud_devicestreaming.egg-info/requires.txt +0 -11
  22. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/LICENSE +0 -0
  23. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/MANIFEST.in +0 -0
  24. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming/__init__.py +0 -0
  25. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming/py.typed +0 -0
  26. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/gapic_metadata.json +0 -0
  27. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/py.typed +0 -0
  28. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/__init__.py +0 -0
  29. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/services/direct_access_service/__init__.py +0 -0
  30. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google/cloud/devicestreaming_v1/types/__init__.py +0 -0
  31. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google_cloud_devicestreaming.egg-info/SOURCES.txt +0 -0
  32. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google_cloud_devicestreaming.egg-info/dependency_links.txt +0 -0
  33. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google_cloud_devicestreaming.egg-info/not-zip-safe +0 -0
  34. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/google_cloud_devicestreaming.egg-info/top_level.txt +0 -0
  35. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/setup.cfg +0 -0
  36. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/tests/__init__.py +0 -0
  37. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/tests/unit/__init__.py +0 -0
  38. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/tests/unit/gapic/__init__.py +0 -0
  39. {google_cloud_devicestreaming-0.3.0 → google_cloud_devicestreaming-0.4.0}/tests/unit/gapic/devicestreaming_v1/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-devicestreaming
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Google Cloud Devicestreaming API client library
5
5
  Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-devicestreaming
6
6
  Author: Google LLC
@@ -12,8 +12,6 @@ Classifier: Intended Audience :: Developers
12
12
  Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Programming Language :: Python
14
14
  Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.7
16
- Classifier: Programming Language :: Python :: 3.8
17
15
  Classifier: Programming Language :: Python :: 3.9
18
16
  Classifier: Programming Language :: Python :: 3.10
19
17
  Classifier: Programming Language :: Python :: 3.11
@@ -22,15 +20,15 @@ Classifier: Programming Language :: Python :: 3.13
22
20
  Classifier: Programming Language :: Python :: 3.14
23
21
  Classifier: Operating System :: OS Independent
24
22
  Classifier: Topic :: Internet
25
- Requires-Python: >=3.7
23
+ Requires-Python: >=3.9
26
24
  License-File: LICENSE
27
- Requires-Dist: google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.10.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,<3.0.0,>=1.34.1
25
+ Requires-Dist: google-api-core[grpc]<3.0.0,>=2.11.0
28
26
  Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
29
27
  Requires-Dist: grpcio<2.0.0,>=1.33.2
30
28
  Requires-Dist: grpcio<2.0.0,>=1.75.1; python_version >= "3.14"
31
29
  Requires-Dist: proto-plus<2.0.0,>=1.22.3
32
30
  Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
33
- Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.20.2
31
+ Requires-Dist: protobuf<8.0.0,>=4.25.8
34
32
  Dynamic: author
35
33
  Dynamic: author-email
36
34
  Dynamic: classifier
@@ -106,14 +104,14 @@ Supported Python Versions
106
104
  Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
107
105
  Python.
108
106
 
109
- Python >= 3.7, including 3.14
107
+ Python >= 3.9, including 3.14
110
108
 
111
109
  .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
112
110
  .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
113
111
 
114
112
  Unsupported Python Versions
115
113
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
116
- Python <= 3.6
114
+ Python <= 3.8
117
115
 
118
116
  If you are using an `end-of-life`_
119
117
  version of Python, we recommend that you update as soon as possible to an actively supported version.
@@ -61,14 +61,14 @@ Supported Python Versions
61
61
  Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
62
62
  Python.
63
63
 
64
- Python >= 3.7, including 3.14
64
+ Python >= 3.9, including 3.14
65
65
 
66
66
  .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
67
67
  .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
68
68
 
69
69
  Unsupported Python Versions
70
70
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
- Python <= 3.6
71
+ Python <= 3.8
72
72
 
73
73
  If you are using an `end-of-life`_
74
74
  version of Python, we recommend that you update as soon as possible to an actively supported version.
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.3.0" # {x-release-please-version}
16
+ __version__ = "0.4.0" # {x-release-please-version}
@@ -28,6 +28,7 @@ else: # pragma: NO COVER
28
28
  # this code path once we drop support for Python 3.7
29
29
  import importlib_metadata as metadata
30
30
 
31
+
31
32
  from .services.direct_access_service import (
32
33
  DirectAccessServiceAsyncClient,
33
34
  DirectAccessServiceClient,
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "0.3.0" # {x-release-please-version}
16
+ __version__ = "0.4.0" # {x-release-please-version}
@@ -13,9 +13,9 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- from collections import OrderedDict
17
16
  import logging as std_logging
18
17
  import re
18
+ from collections import OrderedDict
19
19
  from typing import (
20
20
  AsyncIterable,
21
21
  AsyncIterator,
@@ -32,13 +32,13 @@ from typing import (
32
32
  Union,
33
33
  )
34
34
 
35
+ import google.protobuf
35
36
  from google.api_core import exceptions as core_exceptions
36
37
  from google.api_core import gapic_v1
37
38
  from google.api_core import retry_async as retries
38
39
  from google.api_core.client_options import ClientOptions
39
40
  from google.auth import credentials as ga_credentials # type: ignore
40
41
  from google.oauth2 import service_account # type: ignore
41
- import google.protobuf
42
42
 
43
43
  from google.cloud.devicestreaming_v1 import gapic_version as package_version
44
44
 
@@ -47,9 +47,9 @@ try:
47
47
  except AttributeError: # pragma: NO COVER
48
48
  OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
49
49
 
50
- from google.protobuf import duration_pb2 # type: ignore
51
- from google.protobuf import field_mask_pb2 # type: ignore
52
- from google.protobuf import timestamp_pb2 # type: ignore
50
+ import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
51
+ import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
52
+ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
53
53
 
54
54
  from google.cloud.devicestreaming_v1.services.direct_access_service import pagers
55
55
  from google.cloud.devicestreaming_v1.types import adb_service, service
@@ -133,7 +133,10 @@ class DirectAccessServiceAsyncClient:
133
133
  Returns:
134
134
  DirectAccessServiceAsyncClient: The constructed client.
135
135
  """
136
- return DirectAccessServiceClient.from_service_account_info.__func__(DirectAccessServiceAsyncClient, info, *args, **kwargs) # type: ignore
136
+ sa_info_func = (
137
+ DirectAccessServiceClient.from_service_account_info.__func__ # type: ignore
138
+ )
139
+ return sa_info_func(DirectAccessServiceAsyncClient, info, *args, **kwargs)
137
140
 
138
141
  @classmethod
139
142
  def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -149,7 +152,10 @@ class DirectAccessServiceAsyncClient:
149
152
  Returns:
150
153
  DirectAccessServiceAsyncClient: The constructed client.
151
154
  """
152
- return DirectAccessServiceClient.from_service_account_file.__func__(DirectAccessServiceAsyncClient, filename, *args, **kwargs) # type: ignore
155
+ sa_file_func = (
156
+ DirectAccessServiceClient.from_service_account_file.__func__ # type: ignore
157
+ )
158
+ return sa_file_func(DirectAccessServiceAsyncClient, filename, *args, **kwargs)
153
159
 
154
160
  from_service_account_json = from_service_account_file
155
161
 
@@ -187,7 +193,9 @@ class DirectAccessServiceAsyncClient:
187
193
  Raises:
188
194
  google.auth.exceptions.MutualTLSChannelError: If any errors happen.
189
195
  """
190
- return DirectAccessServiceClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
196
+ return DirectAccessServiceClient.get_mtls_endpoint_and_cert_source(
197
+ client_options
198
+ ) # type: ignore
191
199
 
192
200
  @property
193
201
  def transport(self) -> DirectAccessServiceTransport:
@@ -199,7 +207,7 @@ class DirectAccessServiceAsyncClient:
199
207
  return self._client.transport
200
208
 
201
209
  @property
202
- def api_endpoint(self):
210
+ def api_endpoint(self) -> str:
203
211
  """Return the API endpoint used by the client instance.
204
212
 
205
213
  Returns:
@@ -13,12 +13,13 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- from collections import OrderedDict
17
- from http import HTTPStatus
18
16
  import json
19
17
  import logging as std_logging
20
18
  import os
21
19
  import re
20
+ import warnings
21
+ from collections import OrderedDict
22
+ from http import HTTPStatus
22
23
  from typing import (
23
24
  Callable,
24
25
  Dict,
@@ -34,8 +35,8 @@ from typing import (
34
35
  Union,
35
36
  cast,
36
37
  )
37
- import warnings
38
38
 
39
+ import google.protobuf
39
40
  from google.api_core import client_options as client_options_lib
40
41
  from google.api_core import exceptions as core_exceptions
41
42
  from google.api_core import gapic_v1
@@ -45,7 +46,6 @@ from google.auth.exceptions import MutualTLSChannelError # type: ignore
45
46
  from google.auth.transport import mtls # type: ignore
46
47
  from google.auth.transport.grpc import SslCredentials # type: ignore
47
48
  from google.oauth2 import service_account # type: ignore
48
- import google.protobuf
49
49
 
50
50
  from google.cloud.devicestreaming_v1 import gapic_version as package_version
51
51
 
@@ -63,9 +63,9 @@ except ImportError: # pragma: NO COVER
63
63
 
64
64
  _LOGGER = std_logging.getLogger(__name__)
65
65
 
66
- from google.protobuf import duration_pb2 # type: ignore
67
- from google.protobuf import field_mask_pb2 # type: ignore
68
- from google.protobuf import timestamp_pb2 # type: ignore
66
+ import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
67
+ import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
68
+ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
69
69
 
70
70
  from google.cloud.devicestreaming_v1.services.direct_access_service import pagers
71
71
  from google.cloud.devicestreaming_v1.types import adb_service, service
@@ -84,9 +84,7 @@ class DirectAccessServiceClientMeta(type):
84
84
  objects.
85
85
  """
86
86
 
87
- _transport_registry = (
88
- OrderedDict()
89
- ) # type: Dict[str, Type[DirectAccessServiceTransport]]
87
+ _transport_registry = OrderedDict() # type: Dict[str, Type[DirectAccessServiceTransport]]
90
88
  _transport_registry["grpc"] = DirectAccessServiceGrpcTransport
91
89
  _transport_registry["grpc_asyncio"] = DirectAccessServiceGrpcAsyncIOTransport
92
90
  _transport_registry["rest"] = DirectAccessServiceRestTransport
@@ -128,7 +126,7 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
128
126
  """
129
127
 
130
128
  @staticmethod
131
- def _get_default_mtls_endpoint(api_endpoint):
129
+ def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
132
130
  """Converts api endpoint to mTLS endpoint.
133
131
 
134
132
  Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
@@ -136,7 +134,7 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
136
134
  Args:
137
135
  api_endpoint (Optional[str]): the api endpoint to convert.
138
136
  Returns:
139
- str: converted mTLS api endpoint.
137
+ Optional[str]: converted mTLS api endpoint.
140
138
  """
141
139
  if not api_endpoint:
142
140
  return api_endpoint
@@ -146,6 +144,10 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
146
144
  )
147
145
 
148
146
  m = mtls_endpoint_re.match(api_endpoint)
147
+ if m is None:
148
+ # Could not parse api_endpoint; return as-is.
149
+ return api_endpoint
150
+
149
151
  name, mtls, sandbox, googledomain = m.groups()
150
152
  if mtls or not googledomain:
151
153
  return api_endpoint
@@ -450,7 +452,7 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
450
452
  @staticmethod
451
453
  def _get_api_endpoint(
452
454
  api_override, client_cert_source, universe_domain, use_mtls_endpoint
453
- ):
455
+ ) -> str:
454
456
  """Return the API endpoint used by the client.
455
457
 
456
458
  Args:
@@ -547,7 +549,7 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
547
549
  error._details.append(json.dumps(cred_info))
548
550
 
549
551
  @property
550
- def api_endpoint(self):
552
+ def api_endpoint(self) -> str:
551
553
  """Return the API endpoint used by the client instance.
552
554
 
553
555
  Returns:
@@ -638,18 +640,16 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
638
640
 
639
641
  universe_domain_opt = getattr(self._client_options, "universe_domain", None)
640
642
 
641
- (
642
- self._use_client_cert,
643
- self._use_mtls_endpoint,
644
- self._universe_domain_env,
645
- ) = DirectAccessServiceClient._read_environment_variables()
643
+ self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
644
+ DirectAccessServiceClient._read_environment_variables()
645
+ )
646
646
  self._client_cert_source = DirectAccessServiceClient._get_client_cert_source(
647
647
  self._client_options.client_cert_source, self._use_client_cert
648
648
  )
649
649
  self._universe_domain = DirectAccessServiceClient._get_universe_domain(
650
650
  universe_domain_opt, self._universe_domain_env
651
651
  )
652
- self._api_endpoint = None # updated below, depending on `transport`
652
+ self._api_endpoint: str = "" # updated below, depending on `transport`
653
653
 
654
654
  # Initialize the universe domain validation.
655
655
  self._is_universe_domain_valid = False
@@ -677,8 +677,7 @@ class DirectAccessServiceClient(metaclass=DirectAccessServiceClientMeta):
677
677
  )
678
678
  if self._client_options.scopes:
679
679
  raise ValueError(
680
- "When providing a transport instance, provide its scopes "
681
- "directly."
680
+ "When providing a transport instance, provide its scopes directly."
682
681
  )
683
682
  self._transport = cast(DirectAccessServiceTransport, transport)
684
683
  self._api_endpoint = self._transport.host
@@ -67,7 +67,7 @@ class ListDeviceSessionsPager:
67
67
  *,
68
68
  retry: OptionalRetry = gapic_v1.method.DEFAULT,
69
69
  timeout: Union[float, object] = gapic_v1.method.DEFAULT,
70
- metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
70
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
71
71
  ):
72
72
  """Instantiate the pager.
73
73
 
@@ -143,7 +143,7 @@ class ListDeviceSessionsAsyncPager:
143
143
  *,
144
144
  retry: OptionalAsyncRetry = gapic_v1.method.DEFAULT,
145
145
  timeout: Union[float, object] = gapic_v1.method.DEFAULT,
146
- metadata: Sequence[Tuple[str, Union[str, bytes]]] = ()
146
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
147
147
  ):
148
148
  """Instantiates the pager.
149
149
 
@@ -22,9 +22,7 @@ from .grpc_asyncio import DirectAccessServiceGrpcAsyncIOTransport
22
22
  from .rest import DirectAccessServiceRestInterceptor, DirectAccessServiceRestTransport
23
23
 
24
24
  # Compile a registry of transports.
25
- _transport_registry = (
26
- OrderedDict()
27
- ) # type: Dict[str, Type[DirectAccessServiceTransport]]
25
+ _transport_registry = OrderedDict() # type: Dict[str, Type[DirectAccessServiceTransport]]
28
26
  _transport_registry["grpc"] = DirectAccessServiceGrpcTransport
29
27
  _transport_registry["grpc_asyncio"] = DirectAccessServiceGrpcAsyncIOTransport
30
28
  _transport_registry["rest"] = DirectAccessServiceRestTransport
@@ -17,14 +17,14 @@ import abc
17
17
  from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
18
18
 
19
19
  import google.api_core
20
+ import google.auth # type: ignore
21
+ import google.protobuf
22
+ import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
20
23
  from google.api_core import exceptions as core_exceptions
21
24
  from google.api_core import gapic_v1
22
25
  from google.api_core import retry as retries
23
- import google.auth # type: ignore
24
26
  from google.auth import credentials as ga_credentials # type: ignore
25
27
  from google.oauth2 import service_account # type: ignore
26
- import google.protobuf
27
- from google.protobuf import empty_pb2 # type: ignore
28
28
 
29
29
  from google.cloud.devicestreaming_v1 import gapic_version as package_version
30
30
  from google.cloud.devicestreaming_v1.types import adb_service, service
@@ -81,10 +81,12 @@ class DirectAccessServiceTransport(abc.ABC):
81
81
  your own client library.
82
82
  always_use_jwt_access (Optional[bool]): Whether self signed JWT should
83
83
  be used for service account credentials.
84
+ api_audience (Optional[str]): The intended audience for the API calls
85
+ to the service that will be set when using certain 3rd party
86
+ authentication flows. Audience is typically a resource identifier.
87
+ If not set, the host value will be used as a default.
84
88
  """
85
89
 
86
- scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
87
-
88
90
  # Save the scopes.
89
91
  self._scopes = scopes
90
92
  if not hasattr(self, "_ignore_credentials"):
@@ -99,11 +101,16 @@ class DirectAccessServiceTransport(abc.ABC):
99
101
 
100
102
  if credentials_file is not None:
101
103
  credentials, _ = google.auth.load_credentials_from_file(
102
- credentials_file, **scopes_kwargs, quota_project_id=quota_project_id
104
+ credentials_file,
105
+ scopes=scopes,
106
+ quota_project_id=quota_project_id,
107
+ default_scopes=self.AUTH_SCOPES,
103
108
  )
104
109
  elif credentials is None and not self._ignore_credentials:
105
110
  credentials, _ = google.auth.default(
106
- **scopes_kwargs, quota_project_id=quota_project_id
111
+ scopes=scopes,
112
+ quota_project_id=quota_project_id,
113
+ default_scopes=self.AUTH_SCOPES,
107
114
  )
108
115
  # Don't apply audience if the credentials file passed from user.
109
116
  if hasattr(credentials, "with_gdch_audience"):
@@ -127,6 +134,8 @@ class DirectAccessServiceTransport(abc.ABC):
127
134
  host += ":443"
128
135
  self._host = host
129
136
 
137
+ self._wrapped_methods: Dict[Callable, Callable] = {}
138
+
130
139
  @property
131
140
  def host(self):
132
141
  return self._host
@@ -16,18 +16,18 @@
16
16
  import json
17
17
  import logging as std_logging
18
18
  import pickle
19
- from typing import Callable, Dict, Optional, Sequence, Tuple, Union
20
19
  import warnings
20
+ from typing import Callable, Dict, Optional, Sequence, Tuple, Union
21
21
 
22
- from google.api_core import gapic_v1, grpc_helpers
23
22
  import google.auth # type: ignore
24
- from google.auth import credentials as ga_credentials # type: ignore
25
- from google.auth.transport.grpc import SslCredentials # type: ignore
26
- from google.protobuf import empty_pb2 # type: ignore
27
- from google.protobuf.json_format import MessageToJson
23
+ import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
28
24
  import google.protobuf.message
29
25
  import grpc # type: ignore
30
26
  import proto # type: ignore
27
+ from google.api_core import gapic_v1, grpc_helpers
28
+ from google.auth import credentials as ga_credentials # type: ignore
29
+ from google.auth.transport.grpc import SslCredentials # type: ignore
30
+ from google.protobuf.json_format import MessageToJson
31
31
 
32
32
  from google.cloud.devicestreaming_v1.types import adb_service, service
33
33
 
@@ -55,7 +55,7 @@ class _LoggingClientInterceptor(grpc.UnaryUnaryClientInterceptor): # pragma: NO
55
55
  elif isinstance(request, google.protobuf.message.Message):
56
56
  request_payload = MessageToJson(request)
57
57
  else:
58
- request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
58
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)!r}"
59
59
 
60
60
  request_metadata = {
61
61
  key: value.decode("utf-8") if isinstance(value, bytes) else value
@@ -90,7 +90,7 @@ class _LoggingClientInterceptor(grpc.UnaryUnaryClientInterceptor): # pragma: NO
90
90
  elif isinstance(result, google.protobuf.message.Message):
91
91
  response_payload = MessageToJson(result)
92
92
  else:
93
- response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
93
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)!r}"
94
94
  grpc_response = {
95
95
  "payload": response_payload,
96
96
  "metadata": metadata,
@@ -195,6 +195,10 @@ class DirectAccessServiceGrpcTransport(DirectAccessServiceTransport):
195
195
  your own client library.
196
196
  always_use_jwt_access (Optional[bool]): Whether self signed JWT should
197
197
  be used for service account credentials.
198
+ api_audience (Optional[str]): The intended audience for the API calls
199
+ to the service that will be set when using certain 3rd party
200
+ authentication flows. Audience is typically a resource identifier.
201
+ If not set, the host value will be used as a default.
198
202
 
199
203
  Raises:
200
204
  google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
@@ -17,20 +17,20 @@ import inspect
17
17
  import json
18
18
  import logging as std_logging
19
19
  import pickle
20
- from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
21
20
  import warnings
21
+ from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
22
22
 
23
+ import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
24
+ import google.protobuf.message
25
+ import grpc # type: ignore
26
+ import proto # type: ignore
23
27
  from google.api_core import exceptions as core_exceptions
24
28
  from google.api_core import gapic_v1, grpc_helpers_async
25
29
  from google.api_core import retry_async as retries
26
30
  from google.auth import credentials as ga_credentials # type: ignore
27
31
  from google.auth.transport.grpc import SslCredentials # type: ignore
28
- from google.protobuf import empty_pb2 # type: ignore
29
32
  from google.protobuf.json_format import MessageToJson
30
- import google.protobuf.message
31
- import grpc # type: ignore
32
33
  from grpc.experimental import aio # type: ignore
33
- import proto # type: ignore
34
34
 
35
35
  from google.cloud.devicestreaming_v1.types import adb_service, service
36
36
 
@@ -61,7 +61,7 @@ class _LoggingClientAIOInterceptor(
61
61
  elif isinstance(request, google.protobuf.message.Message):
62
62
  request_payload = MessageToJson(request)
63
63
  else:
64
- request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
64
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)!r}"
65
65
 
66
66
  request_metadata = {
67
67
  key: value.decode("utf-8") if isinstance(value, bytes) else value
@@ -96,7 +96,7 @@ class _LoggingClientAIOInterceptor(
96
96
  elif isinstance(result, google.protobuf.message.Message):
97
97
  response_payload = MessageToJson(result)
98
98
  else:
99
- response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
99
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)!r}"
100
100
  grpc_response = {
101
101
  "payload": response_payload,
102
102
  "metadata": metadata,
@@ -246,6 +246,10 @@ class DirectAccessServiceGrpcAsyncIOTransport(DirectAccessServiceTransport):
246
246
  your own client library.
247
247
  always_use_jwt_access (Optional[bool]): Whether self signed JWT should
248
248
  be used for service account credentials.
249
+ api_audience (Optional[str]): The intended audience for the API calls
250
+ to the service that will be set when using certain 3rd party
251
+ authentication flows. Audience is typically a resource identifier.
252
+ If not set, the host value will be used as a default.
249
253
 
250
254
  Raises:
251
255
  google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
@@ -16,16 +16,16 @@
16
16
  import dataclasses
17
17
  import json # type: ignore
18
18
  import logging
19
- from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
20
19
  import warnings
20
+ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
21
21
 
22
+ import google.protobuf
23
+ import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
22
24
  from google.api_core import exceptions as core_exceptions
23
25
  from google.api_core import gapic_v1, rest_helpers, rest_streaming
24
26
  from google.api_core import retry as retries
25
27
  from google.auth import credentials as ga_credentials # type: ignore
26
28
  from google.auth.transport.requests import AuthorizedSession # type: ignore
27
- import google.protobuf
28
- from google.protobuf import empty_pb2 # type: ignore
29
29
  from google.protobuf import json_format
30
30
  from requests import __version__ as requests_version
31
31
 
@@ -400,6 +400,12 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
400
400
  url_scheme: the protocol scheme for the API endpoint. Normally
401
401
  "https", but for testing or local servers,
402
402
  "http" can be specified.
403
+ interceptor (Optional[DirectAccessServiceRestInterceptor]): Interceptor used
404
+ to manipulate requests, request metadata, and responses.
405
+ api_audience (Optional[str]): The intended audience for the API calls
406
+ to the service that will be set when using certain 3rd party
407
+ authentication flows. Audience is typically a resource identifier.
408
+ If not set, the host value will be used as a default.
403
409
  """
404
410
  # Run the base constructor
405
411
  # TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
@@ -493,9 +499,7 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
493
499
  be of type `bytes`.
494
500
  """
495
501
 
496
- http_options = (
497
- _BaseDirectAccessServiceRestTransport._BaseCancelDeviceSession._get_http_options()
498
- )
502
+ http_options = _BaseDirectAccessServiceRestTransport._BaseCancelDeviceSession._get_http_options()
499
503
 
500
504
  request, metadata = self._interceptor.pre_cancel_device_session(
501
505
  request, metadata
@@ -521,7 +525,7 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
521
525
  )
522
526
  method = transcoded_request["method"]
523
527
  try:
524
- request_payload = json_format.MessageToJson(request)
528
+ request_payload = type(request).to_json(request)
525
529
  except:
526
530
  request_payload = None
527
531
  http_request = {
@@ -617,9 +621,7 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
617
621
 
618
622
  """
619
623
 
620
- http_options = (
621
- _BaseDirectAccessServiceRestTransport._BaseCreateDeviceSession._get_http_options()
622
- )
624
+ http_options = _BaseDirectAccessServiceRestTransport._BaseCreateDeviceSession._get_http_options()
623
625
 
624
626
  request, metadata = self._interceptor.pre_create_device_session(
625
627
  request, metadata
@@ -774,9 +776,7 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
774
776
 
775
777
  """
776
778
 
777
- http_options = (
778
- _BaseDirectAccessServiceRestTransport._BaseGetDeviceSession._get_http_options()
779
- )
779
+ http_options = _BaseDirectAccessServiceRestTransport._BaseGetDeviceSession._get_http_options()
780
780
 
781
781
  request, metadata = self._interceptor.pre_get_device_session(
782
782
  request, metadata
@@ -924,9 +924,7 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
924
924
 
925
925
  """
926
926
 
927
- http_options = (
928
- _BaseDirectAccessServiceRestTransport._BaseListDeviceSessions._get_http_options()
929
- )
927
+ http_options = _BaseDirectAccessServiceRestTransport._BaseListDeviceSessions._get_http_options()
930
928
 
931
929
  request, metadata = self._interceptor.pre_list_device_sessions(
932
930
  request, metadata
@@ -1079,9 +1077,7 @@ class DirectAccessServiceRestTransport(_BaseDirectAccessServiceRestTransport):
1079
1077
 
1080
1078
  """
1081
1079
 
1082
- http_options = (
1083
- _BaseDirectAccessServiceRestTransport._BaseUpdateDeviceSession._get_http_options()
1084
- )
1080
+ http_options = _BaseDirectAccessServiceRestTransport._BaseUpdateDeviceSession._get_http_options()
1085
1081
 
1086
1082
  request, metadata = self._interceptor.pre_update_device_session(
1087
1083
  request, metadata
@@ -17,8 +17,8 @@ import json # type: ignore
17
17
  import re
18
18
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
19
19
 
20
+ import google.protobuf.empty_pb2 as empty_pb2 # type: ignore
20
21
  from google.api_core import gapic_v1, path_template
21
- from google.protobuf import empty_pb2 # type: ignore
22
22
  from google.protobuf import json_format
23
23
 
24
24
  from google.cloud.devicestreaming_v1.types import adb_service, service
@@ -158,6 +158,7 @@ class StatusUpdate(proto.Message):
158
158
  CONNECTING (14):
159
159
  The ADB device is in the "connecting" status.
160
160
  """
161
+
161
162
  DEVICE_STATE_UNSPECIFIED = 0
162
163
  DEVICE = 1
163
164
  RECOVERY = 2
@@ -17,9 +17,9 @@ from __future__ import annotations
17
17
 
18
18
  from typing import MutableMapping, MutableSequence
19
19
 
20
- from google.protobuf import duration_pb2 # type: ignore
21
- from google.protobuf import field_mask_pb2 # type: ignore
22
- from google.protobuf import timestamp_pb2 # type: ignore
20
+ import google.protobuf.duration_pb2 as duration_pb2 # type: ignore
21
+ import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
22
+ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
23
23
  import proto # type: ignore
24
24
 
25
25
  __protobuf__ = proto.module(
@@ -275,6 +275,7 @@ class DeviceSession(proto.Message):
275
275
  internal reason, such as an infrastructure
276
276
  failure.
277
277
  """
278
+
278
279
  SESSION_STATE_UNSPECIFIED = 0
279
280
  REQUESTED = 1
280
281
  PENDING = 2