Repository navigation
Expand file tree
/
Copy pathtypes.py
More file actions
53 lines (43 loc) · 2.05 KB
/
Copy pathtypes.py
File metadata and controls
53 lines (43 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from __future__ import annotations
from collections.abc import Mapping, Sequence
from datetime import timedelta
from typing import Literal
from apify_client._models import WebhookCreate, WebhookRepresentation
from apify_client._typeddicts import (
WebhookCreateCamelDict,
WebhookCreateDict,
WebhookRepresentationCamelDict,
WebhookRepresentationDict,
)
HttpCompressionAlgorithm = Literal['brotli', 'gzip']
"""Accepted string literals for the `compression` parameter on `ApifyClient` and `ApifyClientAsync`."""
Timeout = timedelta | Literal['no_timeout', 'short', 'medium', 'long']
"""Type for the `timeout` parameter on resource client methods.
`'short'`, `'medium'`, and `'long'` are tier literals resolved by the HTTP client to configured values.
A `timedelta` overrides the timeout for this call, and `'no_timeout'` disables the timeout entirely.
"""
WebhooksList = (
list[WebhookCreate]
| list[WebhookCreateDict]
| list[WebhookCreateCamelDict]
| list[WebhookRepresentation]
| list[WebhookRepresentationDict]
| list[WebhookRepresentationCamelDict]
)
"""Type for the `webhooks` parameter on resource-client `start`/`call` methods and `from_webhooks`.
`WebhookRepresentation` / `WebhookRepresentationDict` / `WebhookRepresentationCamelDict` are the minimal ad-hoc
webhook shape (only `event_types` and `request_url` required). `WebhookCreate` / `WebhookCreateDict` /
`WebhookCreateCamelDict` are accepted so a persistent-webhook definition can be reused; their fields not relevant
to ad-hoc webhooks (e.g. `condition`) are ignored at runtime. The `*CamelDict` variants accept camelCase keys
matching the Apify API spelling.
"""
JsonSerializable = Mapping[str, 'JsonSerializable'] | Sequence['JsonSerializable'] | str | int | float | bool | None
"""Recursive type for JSON-serializable values - primitives plus objects and arrays with JSON-serializable contents.
Based on the definition discussed in https://github.com/python/typing/issues/182.
"""
__all__ = [
'HttpCompressionAlgorithm',
'JsonSerializable',
'Timeout',
'WebhooksList',
]