|
42 | 42 | except AttributeError: # pragma: NO COVER |
43 | 43 | OptionalRetry = Union[retries.Retry, object] # type: ignore |
44 | 44 |
|
| 45 | +from google.cloud.location import locations_pb2 # type: ignore |
45 | 46 | from google.iam.v1 import iam_policy_pb2 # type: ignore |
46 | 47 | from google.iam.v1 import policy_pb2 # type: ignore |
47 | 48 | from google.protobuf import duration_pb2 # type: ignore |
@@ -282,7 +283,7 @@ async def sample_list_queues(): |
282 | 283 | Returns: |
283 | 284 | google.cloud.tasks_v2.services.cloud_tasks.pagers.ListQueuesAsyncPager: |
284 | 285 | Response message for |
285 | | - [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]. |
| 286 | + [ListQueues][google.cloud.tasks.v2.CloudTasks.ListQueues]. |
286 | 287 |
|
287 | 288 | Iterating over this object will yield results and |
288 | 289 | resolve additional pages automatically. |
@@ -317,9 +318,9 @@ async def sample_list_queues(): |
317 | 318 | core_exceptions.DeadlineExceeded, |
318 | 319 | core_exceptions.ServiceUnavailable, |
319 | 320 | ), |
320 | | - deadline=10.0, |
| 321 | + deadline=20.0, |
321 | 322 | ), |
322 | | - default_timeout=10.0, |
| 323 | + default_timeout=20.0, |
323 | 324 | client_info=DEFAULT_CLIENT_INFO, |
324 | 325 | ) |
325 | 326 |
|
@@ -442,9 +443,9 @@ async def sample_get_queue(): |
442 | 443 | core_exceptions.DeadlineExceeded, |
443 | 444 | core_exceptions.ServiceUnavailable, |
444 | 445 | ), |
445 | | - deadline=10.0, |
| 446 | + deadline=20.0, |
446 | 447 | ), |
447 | | - default_timeout=10.0, |
| 448 | + default_timeout=20.0, |
448 | 449 | client_info=DEFAULT_CLIENT_INFO, |
449 | 450 | ) |
450 | 451 |
|
@@ -577,7 +578,7 @@ async def sample_create_queue(): |
577 | 578 | # and friendly error handling. |
578 | 579 | rpc = gapic_v1.method_async.wrap_method( |
579 | 580 | self._client._transport.create_queue, |
580 | | - default_timeout=10.0, |
| 581 | + default_timeout=20.0, |
581 | 582 | client_info=DEFAULT_CLIENT_INFO, |
582 | 583 | ) |
583 | 584 |
|
@@ -715,7 +716,7 @@ async def sample_update_queue(): |
715 | 716 | # and friendly error handling. |
716 | 717 | rpc = gapic_v1.method_async.wrap_method( |
717 | 718 | self._client._transport.update_queue, |
718 | | - default_timeout=10.0, |
| 719 | + default_timeout=20.0, |
719 | 720 | client_info=DEFAULT_CLIENT_INFO, |
720 | 721 | ) |
721 | 722 |
|
@@ -829,9 +830,9 @@ async def sample_delete_queue(): |
829 | 830 | core_exceptions.DeadlineExceeded, |
830 | 831 | core_exceptions.ServiceUnavailable, |
831 | 832 | ), |
832 | | - deadline=10.0, |
| 833 | + deadline=20.0, |
833 | 834 | ), |
834 | | - default_timeout=10.0, |
| 835 | + default_timeout=20.0, |
835 | 836 | client_info=DEFAULT_CLIENT_INFO, |
836 | 837 | ) |
837 | 838 |
|
@@ -939,7 +940,7 @@ async def sample_purge_queue(): |
939 | 940 | # and friendly error handling. |
940 | 941 | rpc = gapic_v1.method_async.wrap_method( |
941 | 942 | self._client._transport.purge_queue, |
942 | | - default_timeout=10.0, |
| 943 | + default_timeout=20.0, |
943 | 944 | client_info=DEFAULT_CLIENT_INFO, |
944 | 945 | ) |
945 | 946 |
|
@@ -1052,7 +1053,7 @@ async def sample_pause_queue(): |
1052 | 1053 | # and friendly error handling. |
1053 | 1054 | rpc = gapic_v1.method_async.wrap_method( |
1054 | 1055 | self._client._transport.pause_queue, |
1055 | | - default_timeout=10.0, |
| 1056 | + default_timeout=20.0, |
1056 | 1057 | client_info=DEFAULT_CLIENT_INFO, |
1057 | 1058 | ) |
1058 | 1059 |
|
@@ -1172,7 +1173,7 @@ async def sample_resume_queue(): |
1172 | 1173 | # and friendly error handling. |
1173 | 1174 | rpc = gapic_v1.method_async.wrap_method( |
1174 | 1175 | self._client._transport.resume_queue, |
1175 | | - default_timeout=10.0, |
| 1176 | + default_timeout=20.0, |
1176 | 1177 | client_info=DEFAULT_CLIENT_INFO, |
1177 | 1178 | ) |
1178 | 1179 |
|
@@ -1353,9 +1354,9 @@ async def sample_get_iam_policy(): |
1353 | 1354 | core_exceptions.DeadlineExceeded, |
1354 | 1355 | core_exceptions.ServiceUnavailable, |
1355 | 1356 | ), |
1356 | | - deadline=10.0, |
| 1357 | + deadline=20.0, |
1357 | 1358 | ), |
1358 | | - default_timeout=10.0, |
| 1359 | + default_timeout=20.0, |
1359 | 1360 | client_info=DEFAULT_CLIENT_INFO, |
1360 | 1361 | ) |
1361 | 1362 |
|
@@ -1532,7 +1533,7 @@ async def sample_set_iam_policy(): |
1532 | 1533 | # and friendly error handling. |
1533 | 1534 | rpc = gapic_v1.method_async.wrap_method( |
1534 | 1535 | self._client._transport.set_iam_policy, |
1535 | | - default_timeout=10.0, |
| 1536 | + default_timeout=20.0, |
1536 | 1537 | client_info=DEFAULT_CLIENT_INFO, |
1537 | 1538 | ) |
1538 | 1539 |
|
@@ -1664,9 +1665,9 @@ async def sample_test_iam_permissions(): |
1664 | 1665 | core_exceptions.DeadlineExceeded, |
1665 | 1666 | core_exceptions.ServiceUnavailable, |
1666 | 1667 | ), |
1667 | | - deadline=10.0, |
| 1668 | + deadline=20.0, |
1668 | 1669 | ), |
1669 | | - default_timeout=10.0, |
| 1670 | + default_timeout=20.0, |
1670 | 1671 | client_info=DEFAULT_CLIENT_INFO, |
1671 | 1672 | ) |
1672 | 1673 |
|
@@ -1754,7 +1755,7 @@ async def sample_list_tasks(): |
1754 | 1755 | Returns: |
1755 | 1756 | google.cloud.tasks_v2.services.cloud_tasks.pagers.ListTasksAsyncPager: |
1756 | 1757 | Response message for listing tasks using |
1757 | | - [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]. |
| 1758 | + [ListTasks][google.cloud.tasks.v2.CloudTasks.ListTasks]. |
1758 | 1759 |
|
1759 | 1760 | Iterating over this object will yield results and |
1760 | 1761 | resolve additional pages automatically. |
@@ -1789,9 +1790,9 @@ async def sample_list_tasks(): |
1789 | 1790 | core_exceptions.DeadlineExceeded, |
1790 | 1791 | core_exceptions.ServiceUnavailable, |
1791 | 1792 | ), |
1792 | | - deadline=10.0, |
| 1793 | + deadline=20.0, |
1793 | 1794 | ), |
1794 | | - default_timeout=10.0, |
| 1795 | + default_timeout=20.0, |
1795 | 1796 | client_info=DEFAULT_CLIENT_INFO, |
1796 | 1797 | ) |
1797 | 1798 |
|
@@ -1908,9 +1909,9 @@ async def sample_get_task(): |
1908 | 1909 | core_exceptions.DeadlineExceeded, |
1909 | 1910 | core_exceptions.ServiceUnavailable, |
1910 | 1911 | ), |
1911 | | - deadline=10.0, |
| 1912 | + deadline=20.0, |
1912 | 1913 | ), |
1913 | | - default_timeout=10.0, |
| 1914 | + default_timeout=20.0, |
1914 | 1915 | client_info=DEFAULT_CLIENT_INFO, |
1915 | 1916 | ) |
1916 | 1917 |
|
@@ -2066,7 +2067,7 @@ async def sample_create_task(): |
2066 | 2067 | # and friendly error handling. |
2067 | 2068 | rpc = gapic_v1.method_async.wrap_method( |
2068 | 2069 | self._client._transport.create_task, |
2069 | | - default_timeout=10.0, |
| 2070 | + default_timeout=20.0, |
2070 | 2071 | client_info=DEFAULT_CLIENT_INFO, |
2071 | 2072 | ) |
2072 | 2073 |
|
@@ -2170,9 +2171,9 @@ async def sample_delete_task(): |
2170 | 2171 | core_exceptions.DeadlineExceeded, |
2171 | 2172 | core_exceptions.ServiceUnavailable, |
2172 | 2173 | ), |
2173 | | - deadline=10.0, |
| 2174 | + deadline=20.0, |
2174 | 2175 | ), |
2175 | | - default_timeout=10.0, |
| 2176 | + default_timeout=20.0, |
2176 | 2177 | client_info=DEFAULT_CLIENT_INFO, |
2177 | 2178 | ) |
2178 | 2179 |
|
@@ -2295,7 +2296,115 @@ async def sample_run_task(): |
2295 | 2296 | # and friendly error handling. |
2296 | 2297 | rpc = gapic_v1.method_async.wrap_method( |
2297 | 2298 | self._client._transport.run_task, |
2298 | | - default_timeout=10.0, |
| 2299 | + default_timeout=20.0, |
| 2300 | + client_info=DEFAULT_CLIENT_INFO, |
| 2301 | + ) |
| 2302 | + |
| 2303 | + # Certain fields should be provided within the metadata header; |
| 2304 | + # add these here. |
| 2305 | + metadata = tuple(metadata) + ( |
| 2306 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 2307 | + ) |
| 2308 | + |
| 2309 | + # Send the request. |
| 2310 | + response = await rpc( |
| 2311 | + request, |
| 2312 | + retry=retry, |
| 2313 | + timeout=timeout, |
| 2314 | + metadata=metadata, |
| 2315 | + ) |
| 2316 | + |
| 2317 | + # Done; return the response. |
| 2318 | + return response |
| 2319 | + |
| 2320 | + async def get_location( |
| 2321 | + self, |
| 2322 | + request: Optional[locations_pb2.GetLocationRequest] = None, |
| 2323 | + *, |
| 2324 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 2325 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
| 2326 | + metadata: Sequence[Tuple[str, str]] = (), |
| 2327 | + ) -> locations_pb2.Location: |
| 2328 | + r"""Gets information about a location. |
| 2329 | +
|
| 2330 | + Args: |
| 2331 | + request (:class:`~.location_pb2.GetLocationRequest`): |
| 2332 | + The request object. Request message for |
| 2333 | + `GetLocation` method. |
| 2334 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 2335 | + if any, should be retried. |
| 2336 | + timeout (float): The timeout for this request. |
| 2337 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 2338 | + sent along with the request as metadata. |
| 2339 | + Returns: |
| 2340 | + ~.location_pb2.Location: |
| 2341 | + Location object. |
| 2342 | + """ |
| 2343 | + # Create or coerce a protobuf request object. |
| 2344 | + # The request isn't a proto-plus wrapped type, |
| 2345 | + # so it must be constructed via keyword expansion. |
| 2346 | + if isinstance(request, dict): |
| 2347 | + request = locations_pb2.GetLocationRequest(**request) |
| 2348 | + |
| 2349 | + # Wrap the RPC method; this adds retry and timeout information, |
| 2350 | + # and friendly error handling. |
| 2351 | + rpc = gapic_v1.method.wrap_method( |
| 2352 | + self._client._transport.get_location, |
| 2353 | + default_timeout=None, |
| 2354 | + client_info=DEFAULT_CLIENT_INFO, |
| 2355 | + ) |
| 2356 | + |
| 2357 | + # Certain fields should be provided within the metadata header; |
| 2358 | + # add these here. |
| 2359 | + metadata = tuple(metadata) + ( |
| 2360 | + gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)), |
| 2361 | + ) |
| 2362 | + |
| 2363 | + # Send the request. |
| 2364 | + response = await rpc( |
| 2365 | + request, |
| 2366 | + retry=retry, |
| 2367 | + timeout=timeout, |
| 2368 | + metadata=metadata, |
| 2369 | + ) |
| 2370 | + |
| 2371 | + # Done; return the response. |
| 2372 | + return response |
| 2373 | + |
| 2374 | + async def list_locations( |
| 2375 | + self, |
| 2376 | + request: Optional[locations_pb2.ListLocationsRequest] = None, |
| 2377 | + *, |
| 2378 | + retry: OptionalRetry = gapic_v1.method.DEFAULT, |
| 2379 | + timeout: Union[float, object] = gapic_v1.method.DEFAULT, |
| 2380 | + metadata: Sequence[Tuple[str, str]] = (), |
| 2381 | + ) -> locations_pb2.ListLocationsResponse: |
| 2382 | + r"""Lists information about the supported locations for this service. |
| 2383 | +
|
| 2384 | + Args: |
| 2385 | + request (:class:`~.location_pb2.ListLocationsRequest`): |
| 2386 | + The request object. Request message for |
| 2387 | + `ListLocations` method. |
| 2388 | + retry (google.api_core.retry.Retry): Designation of what errors, |
| 2389 | + if any, should be retried. |
| 2390 | + timeout (float): The timeout for this request. |
| 2391 | + metadata (Sequence[Tuple[str, str]]): Strings which should be |
| 2392 | + sent along with the request as metadata. |
| 2393 | + Returns: |
| 2394 | + ~.location_pb2.ListLocationsResponse: |
| 2395 | + Response message for ``ListLocations`` method. |
| 2396 | + """ |
| 2397 | + # Create or coerce a protobuf request object. |
| 2398 | + # The request isn't a proto-plus wrapped type, |
| 2399 | + # so it must be constructed via keyword expansion. |
| 2400 | + if isinstance(request, dict): |
| 2401 | + request = locations_pb2.ListLocationsRequest(**request) |
| 2402 | + |
| 2403 | + # Wrap the RPC method; this adds retry and timeout information, |
| 2404 | + # and friendly error handling. |
| 2405 | + rpc = gapic_v1.method.wrap_method( |
| 2406 | + self._client._transport.list_locations, |
| 2407 | + default_timeout=None, |
2299 | 2408 | client_info=DEFAULT_CLIENT_INFO, |
2300 | 2409 | ) |
2301 | 2410 |
|
|
0 commit comments