-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathproxy_create_params.py
More file actions
123 lines (82 loc) · 3.14 KB
/
Copy pathproxy_create_params.py
File metadata and controls
123 lines (82 loc) · 3.14 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union
from typing_extensions import Literal, Required, TypeAlias, TypedDict
from .._types import SequenceNotStr
__all__ = [
"ProxyCreateParams",
"Config",
"ConfigDatacenterProxyConfig",
"ConfigIspProxyConfig",
"ConfigResidentialProxyConfig",
"ConfigMobileProxyConfig",
"ConfigCreateCustomProxyConfig",
]
class ProxyCreateParams(TypedDict, total=False):
type: Required[Literal["datacenter", "isp", "residential", "mobile", "custom"]]
"""Proxy type to use.
In terms of quality for avoiding bot-detection, from best to worst: `mobile` >
`residential` > `isp` > `datacenter`.
"""
bypass_hosts: SequenceNotStr[str]
"""Hostnames that should bypass the parent proxy and connect directly."""
config: Config
"""Configuration specific to the selected proxy `type`."""
name: str
"""Readable name of the proxy."""
protocol: Literal["http", "https"]
"""Protocol to use for the proxy connection."""
class ConfigDatacenterProxyConfig(TypedDict, total=False):
"""Configuration for a datacenter proxy."""
country: str
"""ISO 3166 country code. Defaults to US if not provided."""
class ConfigIspProxyConfig(TypedDict, total=False):
"""Configuration for an ISP proxy."""
country: str
"""ISO 3166 country code. Defaults to US if not provided."""
class ConfigResidentialProxyConfig(TypedDict, total=False):
"""Configuration for residential proxies."""
asn: str
"""Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html"""
city: str
"""City name (no spaces, e.g.
`sanfrancisco`). If provided, `country` must also be provided.
"""
country: str
"""ISO 3166 country code."""
os: Literal["windows", "macos", "android"]
"""Operating system of the residential device."""
state: str
"""Two-letter state code."""
zip: str
"""US ZIP code."""
class ConfigMobileProxyConfig(TypedDict, total=False):
"""Configuration for mobile proxies."""
city: str
"""Provider city alias. Mobile carrier routing can make observed geo vary."""
country: str
"""ISO 3166 country code"""
state: str
"""US-only state code. Mobile carrier routing can make observed geo vary."""
class ConfigCreateCustomProxyConfig(TypedDict, total=False):
"""Configuration for a custom proxy (e.g., private proxy server)."""
host: Required[str]
"""Proxy host address or IP."""
port: Required[int]
"""Proxy port."""
ca_bundle: str
"""PEM-encoded CA certificate bundle the proxy re-signs upstream TLS with.
Provide when the proxy terminates TLS (MITM) so the browser trusts its
certificates. May contain multiple concatenated certificates.
"""
password: str
"""Password for proxy authentication."""
username: str
"""Username for proxy authentication."""
Config: TypeAlias = Union[
ConfigDatacenterProxyConfig,
ConfigIspProxyConfig,
ConfigResidentialProxyConfig,
ConfigMobileProxyConfig,
ConfigCreateCustomProxyConfig,
]