|
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.video.live_stream_v1 import gapic_version as package_version |
38 | 39 |
|
39 | 40 | try:
|
40 | 41 | OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
|
@@ -238,7 +239,7 @@ async def create_channel(
|
238 | 239 | channel: Optional[resources.Channel] = None,
|
239 | 240 | channel_id: Optional[str] = None,
|
240 | 241 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
241 |
| - timeout: Optional[float] = None, |
| 242 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
242 | 243 | metadata: Sequence[Tuple[str, str]] = (),
|
243 | 244 | ) -> operation_async.AsyncOperation:
|
244 | 245 | r"""Creates a channel with the provided unique ID in the
|
@@ -270,7 +271,7 @@ async def sample_create_channel():
|
270 | 271 |
|
271 | 272 | print("Waiting for operation to complete...")
|
272 | 273 |
|
273 |
| - response = await operation.result() |
| 274 | + response = (await operation).result() |
274 | 275 |
|
275 | 276 | # Handle the response
|
276 | 277 | print(response)
|
@@ -379,7 +380,7 @@ async def list_channels(
|
379 | 380 | *,
|
380 | 381 | parent: Optional[str] = None,
|
381 | 382 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
382 |
| - timeout: Optional[float] = None, |
| 383 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
383 | 384 | metadata: Sequence[Tuple[str, str]] = (),
|
384 | 385 | ) -> pagers.ListChannelsAsyncPager:
|
385 | 386 | r"""Returns a list of all channels in the specified
|
@@ -504,7 +505,7 @@ async def get_channel(
|
504 | 505 | *,
|
505 | 506 | name: Optional[str] = None,
|
506 | 507 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
507 |
| - timeout: Optional[float] = None, |
| 508 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
508 | 509 | metadata: Sequence[Tuple[str, str]] = (),
|
509 | 510 | ) -> resources.Channel:
|
510 | 511 | r"""Returns the specified channel.
|
@@ -622,7 +623,7 @@ async def delete_channel(
|
622 | 623 | *,
|
623 | 624 | name: Optional[str] = None,
|
624 | 625 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
625 |
| - timeout: Optional[float] = None, |
| 626 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
626 | 627 | metadata: Sequence[Tuple[str, str]] = (),
|
627 | 628 | ) -> operation_async.AsyncOperation:
|
628 | 629 | r"""Deletes the specified channel.
|
@@ -652,7 +653,7 @@ async def sample_delete_channel():
|
652 | 653 |
|
653 | 654 | print("Waiting for operation to complete...")
|
654 | 655 |
|
655 |
| - response = await operation.result() |
| 656 | + response = (await operation).result() |
656 | 657 |
|
657 | 658 | # Handle the response
|
658 | 659 | print(response)
|
@@ -748,7 +749,7 @@ async def update_channel(
|
748 | 749 | channel: Optional[resources.Channel] = None,
|
749 | 750 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
750 | 751 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
751 |
| - timeout: Optional[float] = None, |
| 752 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
752 | 753 | metadata: Sequence[Tuple[str, str]] = (),
|
753 | 754 | ) -> operation_async.AsyncOperation:
|
754 | 755 | r"""Updates the specified channel.
|
@@ -777,7 +778,7 @@ async def sample_update_channel():
|
777 | 778 |
|
778 | 779 | print("Waiting for operation to complete...")
|
779 | 780 |
|
780 |
| - response = await operation.result() |
| 781 | + response = (await operation).result() |
781 | 782 |
|
782 | 783 | # Handle the response
|
783 | 784 | print(response)
|
@@ -890,7 +891,7 @@ async def start_channel(
|
890 | 891 | *,
|
891 | 892 | name: Optional[str] = None,
|
892 | 893 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
893 |
| - timeout: Optional[float] = None, |
| 894 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
894 | 895 | metadata: Sequence[Tuple[str, str]] = (),
|
895 | 896 | ) -> operation_async.AsyncOperation:
|
896 | 897 | r"""Starts the specified channel. Part of the video
|
@@ -922,7 +923,7 @@ async def sample_start_channel():
|
922 | 923 |
|
923 | 924 | print("Waiting for operation to complete...")
|
924 | 925 |
|
925 |
| - response = await operation.result() |
| 926 | + response = (await operation).result() |
926 | 927 |
|
927 | 928 | # Handle the response
|
928 | 929 | print(response)
|
@@ -1011,7 +1012,7 @@ async def stop_channel(
|
1011 | 1012 | *,
|
1012 | 1013 | name: Optional[str] = None,
|
1013 | 1014 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1014 |
| - timeout: Optional[float] = None, |
| 1015 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1015 | 1016 | metadata: Sequence[Tuple[str, str]] = (),
|
1016 | 1017 | ) -> operation_async.AsyncOperation:
|
1017 | 1018 | r"""Stops the specified channel. Part of the video
|
@@ -1043,7 +1044,7 @@ async def sample_stop_channel():
|
1043 | 1044 |
|
1044 | 1045 | print("Waiting for operation to complete...")
|
1045 | 1046 |
|
1046 |
| - response = await operation.result() |
| 1047 | + response = (await operation).result() |
1047 | 1048 |
|
1048 | 1049 | # Handle the response
|
1049 | 1050 | print(response)
|
@@ -1134,7 +1135,7 @@ async def create_input(
|
1134 | 1135 | input: Optional[resources.Input] = None,
|
1135 | 1136 | input_id: Optional[str] = None,
|
1136 | 1137 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1137 |
| - timeout: Optional[float] = None, |
| 1138 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1138 | 1139 | metadata: Sequence[Tuple[str, str]] = (),
|
1139 | 1140 | ) -> operation_async.AsyncOperation:
|
1140 | 1141 | r"""Creates an input with the provided unique ID in the
|
@@ -1166,7 +1167,7 @@ async def sample_create_input():
|
1166 | 1167 |
|
1167 | 1168 | print("Waiting for operation to complete...")
|
1168 | 1169 |
|
1169 |
| - response = await operation.result() |
| 1170 | + response = (await operation).result() |
1170 | 1171 |
|
1171 | 1172 | # Handle the response
|
1172 | 1173 | print(response)
|
@@ -1271,7 +1272,7 @@ async def list_inputs(
|
1271 | 1272 | *,
|
1272 | 1273 | parent: Optional[str] = None,
|
1273 | 1274 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1274 |
| - timeout: Optional[float] = None, |
| 1275 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1275 | 1276 | metadata: Sequence[Tuple[str, str]] = (),
|
1276 | 1277 | ) -> pagers.ListInputsAsyncPager:
|
1277 | 1278 | r"""Returns a list of all inputs in the specified region.
|
@@ -1395,7 +1396,7 @@ async def get_input(
|
1395 | 1396 | *,
|
1396 | 1397 | name: Optional[str] = None,
|
1397 | 1398 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1398 |
| - timeout: Optional[float] = None, |
| 1399 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1399 | 1400 | metadata: Sequence[Tuple[str, str]] = (),
|
1400 | 1401 | ) -> resources.Input:
|
1401 | 1402 | r"""Returns the specified input.
|
@@ -1508,7 +1509,7 @@ async def delete_input(
|
1508 | 1509 | *,
|
1509 | 1510 | name: Optional[str] = None,
|
1510 | 1511 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1511 |
| - timeout: Optional[float] = None, |
| 1512 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1512 | 1513 | metadata: Sequence[Tuple[str, str]] = (),
|
1513 | 1514 | ) -> operation_async.AsyncOperation:
|
1514 | 1515 | r"""Deletes the specified input.
|
@@ -1538,7 +1539,7 @@ async def sample_delete_input():
|
1538 | 1539 |
|
1539 | 1540 | print("Waiting for operation to complete...")
|
1540 | 1541 |
|
1541 |
| - response = await operation.result() |
| 1542 | + response = (await operation).result() |
1542 | 1543 |
|
1543 | 1544 | # Handle the response
|
1544 | 1545 | print(response)
|
@@ -1634,7 +1635,7 @@ async def update_input(
|
1634 | 1635 | input: Optional[resources.Input] = None,
|
1635 | 1636 | update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
1636 | 1637 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1637 |
| - timeout: Optional[float] = None, |
| 1638 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1638 | 1639 | metadata: Sequence[Tuple[str, str]] = (),
|
1639 | 1640 | ) -> operation_async.AsyncOperation:
|
1640 | 1641 | r"""Updates the specified input.
|
@@ -1663,7 +1664,7 @@ async def sample_update_input():
|
1663 | 1664 |
|
1664 | 1665 | print("Waiting for operation to complete...")
|
1665 | 1666 |
|
1666 |
| - response = await operation.result() |
| 1667 | + response = (await operation).result() |
1667 | 1668 |
|
1668 | 1669 | # Handle the response
|
1669 | 1670 | print(response)
|
@@ -1770,7 +1771,7 @@ async def create_event(
|
1770 | 1771 | event: Optional[resources.Event] = None,
|
1771 | 1772 | event_id: Optional[str] = None,
|
1772 | 1773 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1773 |
| - timeout: Optional[float] = None, |
| 1774 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1774 | 1775 | metadata: Sequence[Tuple[str, str]] = (),
|
1775 | 1776 | ) -> resources.Event:
|
1776 | 1777 | r"""Creates an event with the provided unique ID in the
|
@@ -1896,7 +1897,7 @@ async def list_events(
|
1896 | 1897 | *,
|
1897 | 1898 | parent: Optional[str] = None,
|
1898 | 1899 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
1899 |
| - timeout: Optional[float] = None, |
| 1900 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
1900 | 1901 | metadata: Sequence[Tuple[str, str]] = (),
|
1901 | 1902 | ) -> pagers.ListEventsAsyncPager:
|
1902 | 1903 | r"""Returns a list of all events in the specified
|
@@ -2022,7 +2023,7 @@ async def get_event(
|
2022 | 2023 | *,
|
2023 | 2024 | name: Optional[str] = None,
|
2024 | 2025 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2025 |
| - timeout: Optional[float] = None, |
| 2026 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2026 | 2027 | metadata: Sequence[Tuple[str, str]] = (),
|
2027 | 2028 | ) -> resources.Event:
|
2028 | 2029 | r"""Returns the specified event.
|
@@ -2136,7 +2137,7 @@ async def delete_event(
|
2136 | 2137 | *,
|
2137 | 2138 | name: Optional[str] = None,
|
2138 | 2139 | retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
2139 |
| - timeout: Optional[float] = None, |
| 2140 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
2140 | 2141 | metadata: Sequence[Tuple[str, str]] = (),
|
2141 | 2142 | ) -> None:
|
2142 | 2143 | r"""Deletes the specified event.
|
@@ -2228,14 +2229,9 @@ async def __aexit__(self, exc_type, exc, tb):
|
2228 | 2229 | await self.transport.close()
|
2229 | 2230 |
|
2230 | 2231 |
|
2231 |
| -try: |
2232 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
2233 |
| - gapic_version=pkg_resources.get_distribution( |
2234 |
| - "google-cloud-video-live-stream", |
2235 |
| - ).version, |
2236 |
| - ) |
2237 |
| -except pkg_resources.DistributionNotFound: |
2238 |
| - DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() |
| 2232 | +DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( |
| 2233 | + gapic_version=package_version.__version__ |
| 2234 | +) |
2239 | 2235 |
|
2240 | 2236 |
|
2241 | 2237 | __all__ = ("LivestreamServiceAsyncClient",)
|
0 commit comments