|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from typing import Optional |
| 4 | +from typing_extensions import Literal |
| 5 | + |
| 6 | +from ..._models import BaseModel |
| 7 | +from .browser_event_source import BrowserEventSource |
| 8 | +from .browser_event_context import BrowserEventContext |
| 9 | + |
| 10 | +__all__ = ["BrowserProxyErrorEvent", "Data"] |
| 11 | + |
| 12 | + |
| 13 | +class Data(BrowserEventContext): |
| 14 | + """Browser event context stamped by the browser monitor onto all CDP-sourced events. |
| 15 | +
|
| 16 | + Identifies the target, frame, and navigation epoch in which the event occurred. |
| 17 | + """ |
| 18 | + |
| 19 | + code: Literal[ |
| 20 | + "destination_blocked", |
| 21 | + "provider_blacklisted", |
| 22 | + "provider_unreachable", |
| 23 | + "proxy_unavailable", |
| 24 | + "upstream_timeout", |
| 25 | + "upstream_dns_failure", |
| 26 | + "upstream_connect_failed", |
| 27 | + ] |
| 28 | + """ |
| 29 | + Proxy-layer error code: the X-Kernel-Proxy-Error response header value from a |
| 30 | + branded 5xx error page served by the metro egress host-proxy. Values mirror what |
| 31 | + the proxy emits: destination_blocked, provider_blacklisted, |
| 32 | + provider_unreachable, proxy_unavailable, upstream_timeout, upstream_dns_failure, |
| 33 | + upstream_connect_failed. Unknown header values are dropped. |
| 34 | + """ |
| 35 | + |
| 36 | + request_id: str |
| 37 | + """CDP request identifier matching the originating request.""" |
| 38 | + |
| 39 | + status: int |
| 40 | + """HTTP response status of the branded error page (502).""" |
| 41 | + |
| 42 | + method: Optional[str] = None |
| 43 | + """HTTP method of the failed request, when known.""" |
| 44 | + |
| 45 | + resource_type: Optional[str] = None |
| 46 | + """CDP Network.ResourceType for the request, when known.""" |
| 47 | + |
| 48 | + |
| 49 | +class BrowserProxyErrorEvent(BaseModel): |
| 50 | + """A branded proxy-layer failure observed by the browser. |
| 51 | +
|
| 52 | + Emitted when the metro egress host-proxy serves a branded 5xx error page whose response carries the X-Kernel-Proxy-Error header. Low-volume and carries a typed code. Its value is per-session and per-URL attribution for sessions that already capture the network stream: proxy failures are only observable while the CDP network collector is running, so this is an opt-in refinement of the raw network events rather than a default-on alerting signal. |
| 53 | + """ |
| 54 | + |
| 55 | + category: Literal["network"] |
| 56 | + |
| 57 | + source: BrowserEventSource |
| 58 | + """Provenance metadata identifying which producer emitted the event.""" |
| 59 | + |
| 60 | + ts: int |
| 61 | + """Event timestamp in Unix microseconds.""" |
| 62 | + |
| 63 | + type: Literal["proxy_error"] |
| 64 | + |
| 65 | + data: Optional[Data] = None |
| 66 | + """Browser event context stamped by the browser monitor onto all CDP-sourced |
| 67 | + events. |
| 68 | +
|
| 69 | + Identifies the target, frame, and navigation epoch in which the event occurred. |
| 70 | + """ |
| 71 | + |
| 72 | + truncated: Optional[bool] = None |
| 73 | + """True if the data field was truncated due to size limits.""" |
0 commit comments