Repository navigation
Expand file tree
/
Copy pathproxy_retrieve_response.py
More file actions
124 lines (81 loc) · 3.31 KB
/
Copy pathproxy_retrieve_response.py
File metadata and controls
124 lines (81 loc) · 3.31 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
# 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__ = [
"ProxyRetrieveResponse",
"Config",
"ConfigIspProxyConfig",
"ConfigResidentialProxyConfig",
"ConfigMobileProxyConfig",
"ConfigCustomProxyConfig",
]
class ConfigIspProxyConfig(BaseModel):
"""Configuration for an ISP proxy."""
country: Optional[str] = None
"""ISO 3166 country code.
Supported countries are US, GB, FR, DE, SG, and KR. 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.
If omitted, the proxy uses the global pool without country targeting.
"""
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.
If omitted, the proxy uses the global pool without country targeting.
"""
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[
ConfigIspProxyConfig, ConfigResidentialProxyConfig, ConfigMobileProxyConfig, ConfigCustomProxyConfig
]
class ProxyRetrieveResponse(BaseModel):
"""Configuration for routing traffic through a proxy."""
type: Literal["isp", "residential", "mobile", "custom"]
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 for an ISP proxy."""
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."""