|
18 | 18 | pagination, and long-running operations to gRPC methods. |
19 | 19 | """ |
20 | 20 |
|
| 21 | +importenum |
21 | 22 | importfunctools |
22 | 23 |
|
23 | 24 | fromgoogle.api_coreimportgrpc_helpers |
24 | 25 | fromgoogle.api_coreimporttimeout |
25 | 26 | fromgoogle.api_core.gapic_v1importclient_info |
26 | 27 |
|
27 | 28 | USE_DEFAULT_METADATA=object() |
28 | | -DEFAULT=object() |
| 29 | + |
| 30 | + |
| 31 | +class_MethodDefault(enum.Enum): |
| 32 | +# Uses enum so that pytype/mypy knows that this is the only possible value. |
| 33 | +# https://stackoverflow.com/a/60605919/101923 |
| 34 | +# |
| 35 | +# Literal[_DEFAULT_VALUE] is an alternative, but only added in Python 3.8. |
| 36 | +# https://docs.python.org/3/library/typing.html#typing.Literal |
| 37 | +_DEFAULT_VALUE=object() |
| 38 | + |
| 39 | + |
| 40 | +DEFAULT=_MethodDefault._DEFAULT_VALUE |
29 | 41 | """Sentinel value indicating that a retry or timeout argument was unspecified, |
30 | 42 | so the default should be used.""" |
31 | 43 |
|
|