-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathproxy_check_response.py
More file actions
131 lines (87 loc) · 3.55 KB
/
Copy pathproxy_check_response.py
File metadata and controls
131 lines (87 loc) · 3.55 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
124
125
126
127
128
129
130
131
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, TypeAlias
from .._models import BaseModel
__all__ = [
"ProxyCheckResponse",
"Config",
"ConfigDatacenterProxyConfig",
"ConfigIspProxyConfig",
"ConfigResidentialProxyConfig",
"ConfigMobileProxyConfig",
"ConfigCustomProxyConfig",
]
class ConfigDatacenterProxyConfig(BaseModel):
"""Configuration for a datacenter proxy."""
country: Optional[str] = None
"""ISO 3166 country code. Defaults to US if not provided."""
class ConfigIspProxyConfig(BaseModel):
"""Configuration for an ISP proxy."""
country: Optional[str] = None
"""ISO 3166 country code. Defaults to US if not provided."""
class ConfigResidentialProxyConfig(BaseModel):
"""Configuration for residential proxies."""
asn: Optional[str] = None
"""Autonomous system number. See https://bgp.potaroo.net/cidr/autnums.html"""
city: Optional[str] = None
"""City name (no spaces, e.g.
`sanfrancisco`). If provided, `country` must also be provided.
"""
country: Optional[str] = None
"""ISO 3166 country code."""
os: Optional[Literal["windows", "macos", "android"]] = None
"""Operating system of the residential device."""
state: Optional[str] = None
"""Two-letter state code."""
zip: Optional[str] = None
"""US ZIP code."""
class ConfigMobileProxyConfig(BaseModel):
"""Configuration for mobile proxies."""
city: Optional[str] = None
"""Provider city alias. Mobile carrier routing can make observed geo vary."""
country: Optional[str] = None
"""ISO 3166 country code"""
state: Optional[str] = None
"""US-only state code. Mobile carrier routing can make observed geo vary."""
class ConfigCustomProxyConfig(BaseModel):
"""Configuration for a custom proxy (e.g., private proxy server)."""
host: str
"""Proxy host address or IP."""
port: int
"""Proxy port."""
has_ca_bundle: Optional[bool] = None
"""Whether the proxy has a custom CA bundle configured."""
has_password: Optional[bool] = None
"""Whether the proxy has a password."""
username: Optional[str] = None
"""Username for proxy authentication."""
Config: TypeAlias = Union[
ConfigDatacenterProxyConfig,
ConfigIspProxyConfig,
ConfigResidentialProxyConfig,
ConfigMobileProxyConfig,
ConfigCustomProxyConfig,
]
class ProxyCheckResponse(BaseModel):
"""Configuration for routing traffic through a proxy."""
type: 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`.
"""
id: Optional[str] = None
bypass_hosts: Optional[List[str]] = None
"""Hostnames that should bypass the parent proxy and connect directly."""
config: Optional[Config] = None
"""Configuration specific to the selected proxy `type`."""
ip_address: Optional[str] = None
"""IP address that the proxy uses when making requests."""
last_checked: Optional[datetime] = None
"""Timestamp of the last health check performed on this proxy."""
name: Optional[str] = None
"""Readable name of the proxy."""
protocol: Optional[Literal["http", "https"]] = None
"""Protocol to use for the proxy connection."""
status: Optional[Literal["available", "unavailable"]] = None
"""Current health status of the proxy."""