|
34 | 34 | from google.api_core.client_options import ClientOptions |
35 | 35 | from google.auth import credentials as ga_credentials # type: ignore |
36 | 36 | from google.oauth2 import service_account # type: ignore |
37 | | -import pkg_resources |
| 37 | + |
| 38 | +from google.cloud.iot_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try: |
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] |
@@ -232,7 +233,7 @@ async def create_device_registry( |
232 | 233 | parent: Optional[str] = None, |
233 | 234 | device_registry: Optional[resources.DeviceRegistry] = None, |
234 | 235 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
235 | | - timeout: Optional[float] = None, |
| 236 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
236 | 237 | metadata: Sequence[Tuple[str, str]] = (), |
237 | 238 | ) -> resources.DeviceRegistry: |
238 | 239 | r"""Creates a device registry that contains devices. |
@@ -343,7 +344,7 @@ async def get_device_registry( |
343 | 344 | *, |
344 | 345 | name: Optional[str] = None, |
345 | 346 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
346 | | - timeout: Optional[float] = None, |
| 347 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
347 | 348 | metadata: Sequence[Tuple[str, str]] = (), |
348 | 349 | ) -> resources.DeviceRegistry: |
349 | 350 | r"""Gets a device registry configuration. |
@@ -455,7 +456,7 @@ async def update_device_registry( |
455 | 456 | device_registry: Optional[resources.DeviceRegistry] = None, |
456 | 457 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
457 | 458 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
458 | | - timeout: Optional[float] = None, |
| 459 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
459 | 460 | metadata: Sequence[Tuple[str, str]] = (), |
460 | 461 | ) -> resources.DeviceRegistry: |
461 | 462 | r"""Updates a device registry configuration. |
@@ -572,7 +573,7 @@ async def delete_device_registry( |
572 | 573 | *, |
573 | 574 | name: Optional[str] = None, |
574 | 575 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
575 | | - timeout: Optional[float] = None, |
| 576 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
576 | 577 | metadata: Sequence[Tuple[str, str]] = (), |
577 | 578 | ) -> None: |
578 | 579 | r"""Deletes a device registry configuration. |
@@ -673,7 +674,7 @@ async def list_device_registries( |
673 | 674 | *, |
674 | 675 | parent: Optional[str] = None, |
675 | 676 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
676 | | - timeout: Optional[float] = None, |
| 677 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
677 | 678 | metadata: Sequence[Tuple[str, str]] = (), |
678 | 679 | ) -> pagers.ListDeviceRegistriesAsyncPager: |
679 | 680 | r"""Lists device registries. |
@@ -798,7 +799,7 @@ async def create_device( |
798 | 799 | parent: Optional[str] = None, |
799 | 800 | device: Optional[resources.Device] = None, |
800 | 801 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
801 | | - timeout: Optional[float] = None, |
| 802 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
802 | 803 | metadata: Sequence[Tuple[str, str]] = (), |
803 | 804 | ) -> resources.Device: |
804 | 805 | r"""Creates a device in a device registry. |
@@ -909,7 +910,7 @@ async def get_device( |
909 | 910 | *, |
910 | 911 | name: Optional[str] = None, |
911 | 912 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
912 | | - timeout: Optional[float] = None, |
| 913 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
913 | 914 | metadata: Sequence[Tuple[str, str]] = (), |
914 | 915 | ) -> resources.Device: |
915 | 916 | r"""Gets details about a device. |
@@ -1021,7 +1022,7 @@ async def update_device( |
1021 | 1022 | device: Optional[resources.Device] = None, |
1022 | 1023 | update_mask: Optional[field_mask_pb2.FieldMask] = None, |
1023 | 1024 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1024 | | - timeout: Optional[float] = None, |
| 1025 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1025 | 1026 | metadata: Sequence[Tuple[str, str]] = (), |
1026 | 1027 | ) -> resources.Device: |
1027 | 1028 | r"""Updates a device. |
@@ -1136,7 +1137,7 @@ async def delete_device( |
1136 | 1137 | *, |
1137 | 1138 | name: Optional[str] = None, |
1138 | 1139 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1139 | | - timeout: Optional[float] = None, |
| 1140 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1140 | 1141 | metadata: Sequence[Tuple[str, str]] = (), |
1141 | 1142 | ) -> None: |
1142 | 1143 | r"""Deletes a device. |
@@ -1237,7 +1238,7 @@ async def list_devices( |
1237 | 1238 | *, |
1238 | 1239 | parent: Optional[str] = None, |
1239 | 1240 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1240 | | - timeout: Optional[float] = None, |
| 1241 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1241 | 1242 | metadata: Sequence[Tuple[str, str]] = (), |
1242 | 1243 | ) -> pagers.ListDevicesAsyncPager: |
1243 | 1244 | r"""List devices in a device registry. |
@@ -1364,7 +1365,7 @@ async def modify_cloud_to_device_config( |
1364 | 1365 | name: Optional[str] = None, |
1365 | 1366 | binary_data: Optional[bytes] = None, |
1366 | 1367 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1367 | | - timeout: Optional[float] = None, |
| 1368 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1368 | 1369 | metadata: Sequence[Tuple[str, str]] = (), |
1369 | 1370 | ) -> resources.DeviceConfig: |
1370 | 1371 | r"""Modifies the configuration for the device, which is |
@@ -1493,7 +1494,7 @@ async def list_device_config_versions( |
1493 | 1494 | *, |
1494 | 1495 | name: Optional[str] = None, |
1495 | 1496 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1496 | | - timeout: Optional[float] = None, |
| 1497 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1497 | 1498 | metadata: Sequence[Tuple[str, str]] = (), |
1498 | 1499 | ) -> device_manager.ListDeviceConfigVersionsResponse: |
1499 | 1500 | r"""Lists the last few versions of the device |
@@ -1606,7 +1607,7 @@ async def list_device_states( |
1606 | 1607 | *, |
1607 | 1608 | name: Optional[str] = None, |
1608 | 1609 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1609 | | - timeout: Optional[float] = None, |
| 1610 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1610 | 1611 | metadata: Sequence[Tuple[str, str]] = (), |
1611 | 1612 | ) -> device_manager.ListDeviceStatesResponse: |
1612 | 1613 | r"""Lists the last few versions of the device state in |
@@ -1718,7 +1719,7 @@ async def set_iam_policy( |
1718 | 1719 | *, |
1719 | 1720 | resource: Optional[str] = None, |
1720 | 1721 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1721 | | - timeout: Optional[float] = None, |
| 1722 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1722 | 1723 | metadata: Sequence[Tuple[str, str]] = (), |
1723 | 1724 | ) -> policy_pb2.Policy: |
1724 | 1725 | r"""Sets the access control policy on the specified |
@@ -1885,7 +1886,7 @@ async def get_iam_policy( |
1885 | 1886 | *, |
1886 | 1887 | resource: Optional[str] = None, |
1887 | 1888 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
1888 | | - timeout: Optional[float] = None, |
| 1889 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1889 | 1890 | metadata: Sequence[Tuple[str, str]] = (), |
1890 | 1891 | ) -> policy_pb2.Policy: |
1891 | 1892 | r"""Gets the access control policy for a resource. |
@@ -2054,7 +2055,7 @@ async def test_iam_permissions( |
2054 | 2055 | resource: Optional[str] = None, |
2055 | 2056 | permissions: Optional[MutableSequence[str]] = None, |
2056 | 2057 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2057 | | - timeout: Optional[float] = None, |
| 2058 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2058 | 2059 | metadata: Sequence[Tuple[str, str]] = (), |
2059 | 2060 | ) -> iam_policy_pb2.TestIamPermissionsResponse: |
2060 | 2061 | r"""Returns permissions that a caller has on the specified resource. |
@@ -2176,7 +2177,7 @@ async def send_command_to_device( |
2176 | 2177 | binary_data: Optional[bytes] = None, |
2177 | 2178 | subfolder: Optional[str] = None, |
2178 | 2179 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2179 | | - timeout: Optional[float] = None, |
| 2180 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2180 | 2181 | metadata: Sequence[Tuple[str, str]] = (), |
2181 | 2182 | ) -> device_manager.SendCommandToDeviceResponse: |
2182 | 2183 | r"""Sends a command to the specified device. In order for a device |
@@ -2336,7 +2337,7 @@ async def bind_device_to_gateway( |
2336 | 2337 | gateway_id: Optional[str] = None, |
2337 | 2338 | device_id: Optional[str] = None, |
2338 | 2339 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2339 | | - timeout: Optional[float] = None, |
| 2340 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2340 | 2341 | metadata: Sequence[Tuple[str, str]] = (), |
2341 | 2342 | ) -> device_manager.BindDeviceToGatewayResponse: |
2342 | 2343 | r"""Associates the device with the gateway. |
@@ -2460,7 +2461,7 @@ async def unbind_device_from_gateway( |
2460 | 2461 | gateway_id: Optional[str] = None, |
2461 | 2462 | device_id: Optional[str] = None, |
2462 | 2463 | retry: OptionalRetry = gapic_v1.method.DEFAULT, |
2463 | | - timeout: Optional[float] = None, |
| 2464 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2464 | 2465 | metadata: Sequence[Tuple[str, str]] = (), |
2465 | 2466 | ) -> device_manager.UnbindDeviceFromGatewayResponse: |
2466 | 2467 | r"""Deletes the association between the device and the |
@@ -2583,14 +2584,9 @@ async def __aexit__(self, exc_type, exc, tb): |
2583 | 2584 | await self.transport.close() |
2584 | 2585 |
|
2585 | 2586 |
|
2586 | | -try: |
2587 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
2588 | | - gapic_version=pkg_resources.get_distribution( |
2589 | | - "google-cloud-iot", |
2590 | | - ).version, |
2591 | | - ) |
2592 | | -except pkg_resources.DistributionNotFound: |
2593 | | - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 2587 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 2588 | + gapic_version=package_version.__version__ |
| 2589 | +) |
2594 | 2590 |
|
2595 | 2591 |
|
2596 | 2592 | __all__ = ("DeviceManagerAsyncClient",) |
0 commit comments