Skip to main content

cdp_driver/protocol/
network.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! Network domain allows tracking network activities of the page. It exposes
5//! information about http, file, data and other requests and responses, their
6//! headers, bodies, timing, etc.
7//!
8//! Types, command parameters and event payloads for the `Network`
9//! domain. The method-name constants for the same domain are in
10//! [`crate::methods`].
11
12use serde::{Deserialize, Serialize};
13
14/// Resource type as it was perceived by the rendering engine.
15#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
16pub enum ResourceType {
17    /// `Document`
18    Document,
19    /// `Stylesheet`
20    Stylesheet,
21    /// `Image`
22    Image,
23    /// `Media`
24    Media,
25    /// `Font`
26    Font,
27    /// `Script`
28    Script,
29    /// `TextTrack`
30    TextTrack,
31    /// `XHR`
32    #[serde(rename = "XHR")]
33    Xhr,
34    /// `Fetch`
35    Fetch,
36    /// `Prefetch`
37    Prefetch,
38    /// `EventSource`
39    EventSource,
40    /// `WebSocket`
41    WebSocket,
42    /// `Manifest`
43    Manifest,
44    /// `SignedExchange`
45    SignedExchange,
46    /// `Ping`
47    Ping,
48    /// `CSPViolationReport`
49    #[serde(rename = "CSPViolationReport")]
50    CspViolationReport,
51    /// `Preflight`
52    Preflight,
53    /// `FedCM`
54    #[serde(rename = "FedCM")]
55    FedCm,
56    /// `Other`
57    Other,
58    /// A value this vendored schema does not list. Chrome adds values ahead of
59    /// the published protocol, so an unrecognised one is kept as it arrived
60    /// rather than failing the payload it came in.
61    #[serde(untagged)]
62    Unrecognized(String),
63}
64
65/// Unique loader identifier.
66pub type LoaderId = String;
67
68/// Unique network request identifier. Note that this does not identify
69/// individual HTTP requests that are part of a network request.
70pub type RequestId = String;
71
72/// Network level fetch failure reason.
73#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
74pub enum ErrorReason {
75    /// `Failed`
76    Failed,
77    /// `Aborted`
78    Aborted,
79    /// `TimedOut`
80    TimedOut,
81    /// `AccessDenied`
82    AccessDenied,
83    /// `ConnectionClosed`
84    ConnectionClosed,
85    /// `ConnectionReset`
86    ConnectionReset,
87    /// `ConnectionRefused`
88    ConnectionRefused,
89    /// `ConnectionAborted`
90    ConnectionAborted,
91    /// `ConnectionFailed`
92    ConnectionFailed,
93    /// `NameNotResolved`
94    NameNotResolved,
95    /// `InternetDisconnected`
96    InternetDisconnected,
97    /// `AddressUnreachable`
98    AddressUnreachable,
99    /// `BlockedByClient`
100    BlockedByClient,
101    /// `BlockedByResponse`
102    BlockedByResponse,
103    /// A value this vendored schema does not list. Chrome adds values ahead of
104    /// the published protocol, so an unrecognised one is kept as it arrived
105    /// rather than failing the payload it came in.
106    #[serde(untagged)]
107    Unrecognized(String),
108}
109
110/// UTC time in seconds, counted from January 1, 1970.
111pub type TimeSinceEpoch = f64;
112
113/// Monotonically increasing time in seconds since an arbitrary point in the
114/// past.
115pub type MonotonicTime = f64;
116
117/// Request / response headers as keys / values of JSON object.
118pub type Headers = serde_json::Value;
119
120/// The underlying connection technology that the browser is supposedly using.
121#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
122pub enum ConnectionType {
123    /// `none`
124    #[serde(rename = "none")]
125    None,
126    /// `cellular2g`
127    #[serde(rename = "cellular2g")]
128    Cellular2g,
129    /// `cellular3g`
130    #[serde(rename = "cellular3g")]
131    Cellular3g,
132    /// `cellular4g`
133    #[serde(rename = "cellular4g")]
134    Cellular4g,
135    /// `bluetooth`
136    #[serde(rename = "bluetooth")]
137    Bluetooth,
138    /// `ethernet`
139    #[serde(rename = "ethernet")]
140    Ethernet,
141    /// `wifi`
142    #[serde(rename = "wifi")]
143    Wifi,
144    /// `wimax`
145    #[serde(rename = "wimax")]
146    Wimax,
147    /// `other`
148    #[serde(rename = "other")]
149    Other,
150    /// A value this vendored schema does not list. Chrome adds values ahead of
151    /// the published protocol, so an unrecognised one is kept as it arrived
152    /// rather than failing the payload it came in.
153    #[serde(untagged)]
154    Unrecognized(String),
155}
156
157/// Represents the cookie's 'SameSite' status:
158/// <https://tools.ietf.org/html/draft-west-first-party-cookies>
159#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
160pub enum CookieSameSite {
161    /// `Strict`
162    Strict,
163    /// `Lax`
164    Lax,
165    /// `None`
166    None,
167    /// A value this vendored schema does not list. Chrome adds values ahead of
168    /// the published protocol, so an unrecognised one is kept as it arrived
169    /// rather than failing the payload it came in.
170    #[serde(untagged)]
171    Unrecognized(String),
172}
173
174/// Represents the cookie's 'Priority' status:
175/// <https://tools.ietf.org/html/draft-west-cookie-priority-00>
176///
177/// Experimental: may change without notice.
178#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
179pub enum CookiePriority {
180    /// `Low`
181    Low,
182    /// `Medium`
183    Medium,
184    /// `High`
185    High,
186    /// A value this vendored schema does not list. Chrome adds values ahead of
187    /// the published protocol, so an unrecognised one is kept as it arrived
188    /// rather than failing the payload it came in.
189    #[serde(untagged)]
190    Unrecognized(String),
191}
192
193/// Represents the source scheme of the origin that originally set the cookie.
194/// A value of "Unset" allows protocol clients to emulate legacy cookie scope
195/// for the scheme. This is a temporary ability and it will be removed in the
196/// future.
197///
198/// Experimental: may change without notice.
199#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
200pub enum CookieSourceScheme {
201    /// `Unset`
202    Unset,
203    /// `NonSecure`
204    NonSecure,
205    /// `Secure`
206    Secure,
207    /// A value this vendored schema does not list. Chrome adds values ahead of
208    /// the published protocol, so an unrecognised one is kept as it arrived
209    /// rather than failing the payload it came in.
210    #[serde(untagged)]
211    Unrecognized(String),
212}
213
214/// Timing information for the request.
215#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
216pub struct ResourceTiming {
217    /// Timing's requestTime is a baseline in seconds, while the other numbers are
218    /// ticks in milliseconds relatively to this requestTime.
219    #[serde(rename = "requestTime")]
220    pub request_time: f64,
221    /// Started resolving proxy.
222    #[serde(rename = "proxyStart")]
223    pub proxy_start: f64,
224    /// Finished resolving proxy.
225    #[serde(rename = "proxyEnd")]
226    pub proxy_end: f64,
227    /// Started DNS address resolve.
228    #[serde(rename = "dnsStart")]
229    pub dns_start: f64,
230    /// Finished DNS address resolve.
231    #[serde(rename = "dnsEnd")]
232    pub dns_end: f64,
233    /// Started connecting to the remote host.
234    #[serde(rename = "connectStart")]
235    pub connect_start: f64,
236    /// Connected to the remote host.
237    #[serde(rename = "connectEnd")]
238    pub connect_end: f64,
239    /// Started SSL handshake.
240    #[serde(rename = "sslStart")]
241    pub ssl_start: f64,
242    /// Finished SSL handshake.
243    #[serde(rename = "sslEnd")]
244    pub ssl_end: f64,
245    /// Started running ServiceWorker.
246    ///
247    /// Experimental: may change without notice.
248    #[serde(rename = "workerStart")]
249    pub worker_start: f64,
250    /// Finished Starting ServiceWorker.
251    ///
252    /// Experimental: may change without notice.
253    #[serde(rename = "workerReady")]
254    pub worker_ready: f64,
255    /// Started fetch event.
256    ///
257    /// Experimental: may change without notice.
258    #[serde(rename = "workerFetchStart")]
259    pub worker_fetch_start: f64,
260    /// Settled fetch event respondWith promise.
261    ///
262    /// Experimental: may change without notice.
263    #[serde(rename = "workerRespondWithSettled")]
264    pub worker_respond_with_settled: f64,
265    /// Started ServiceWorker static routing source evaluation.
266    ///
267    /// Experimental: may change without notice.
268    #[serde(
269        rename = "workerRouterEvaluationStart",
270        default,
271        skip_serializing_if = "Option::is_none"
272    )]
273    pub worker_router_evaluation_start: Option<f64>,
274    /// Started cache lookup when the source was evaluated to `cache`.
275    ///
276    /// Experimental: may change without notice.
277    #[serde(
278        rename = "workerCacheLookupStart",
279        default,
280        skip_serializing_if = "Option::is_none"
281    )]
282    pub worker_cache_lookup_start: Option<f64>,
283    /// Started sending request.
284    #[serde(rename = "sendStart")]
285    pub send_start: f64,
286    /// Finished sending request.
287    #[serde(rename = "sendEnd")]
288    pub send_end: f64,
289    /// Time the server started pushing request.
290    ///
291    /// Experimental: may change without notice.
292    #[serde(rename = "pushStart")]
293    pub push_start: f64,
294    /// Time the server finished pushing request.
295    ///
296    /// Experimental: may change without notice.
297    #[serde(rename = "pushEnd")]
298    pub push_end: f64,
299    /// Started receiving response headers.
300    ///
301    /// Experimental: may change without notice.
302    #[serde(rename = "receiveHeadersStart")]
303    pub receive_headers_start: f64,
304    /// Finished receiving response headers.
305    #[serde(rename = "receiveHeadersEnd")]
306    pub receive_headers_end: f64,
307}
308
309/// Loading priority of a resource request.
310#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
311pub enum ResourcePriority {
312    /// `VeryLow`
313    VeryLow,
314    /// `Low`
315    Low,
316    /// `Medium`
317    Medium,
318    /// `High`
319    High,
320    /// `VeryHigh`
321    VeryHigh,
322    /// A value this vendored schema does not list. Chrome adds values ahead of
323    /// the published protocol, so an unrecognised one is kept as it arrived
324    /// rather than failing the payload it came in.
325    #[serde(untagged)]
326    Unrecognized(String),
327}
328
329/// The render-blocking behavior of a resource request.
330///
331/// Experimental: may change without notice.
332#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
333pub enum RenderBlockingBehavior {
334    /// `Blocking`
335    Blocking,
336    /// `InBodyParserBlocking`
337    InBodyParserBlocking,
338    /// `NonBlocking`
339    NonBlocking,
340    /// `NonBlockingDynamic`
341    NonBlockingDynamic,
342    /// `PotentiallyBlocking`
343    PotentiallyBlocking,
344    /// A value this vendored schema does not list. Chrome adds values ahead of
345    /// the published protocol, so an unrecognised one is kept as it arrived
346    /// rather than failing the payload it came in.
347    #[serde(untagged)]
348    Unrecognized(String),
349}
350
351/// Post data entry for HTTP request
352#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
353pub struct PostDataEntry {
354    #[serde(default, skip_serializing_if = "Option::is_none")]
355    pub bytes: Option<String>,
356}
357
358/// HTTP request data.
359#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
360pub struct Request {
361    /// Request URL (without fragment).
362    pub url: String,
363    /// Fragment of the requested URL starting with hash, if present.
364    #[serde(
365        rename = "urlFragment",
366        default,
367        skip_serializing_if = "Option::is_none"
368    )]
369    pub url_fragment: Option<String>,
370    /// HTTP request method.
371    pub method: String,
372    /// HTTP request headers.
373    pub headers: Headers,
374    /// HTTP POST request data. Use postDataEntries instead.
375    ///
376    /// Deprecated in the protocol.
377    #[serde(rename = "postData", default, skip_serializing_if = "Option::is_none")]
378    pub post_data: Option<String>,
379    /// True when the request has POST data. Note that postData might still be
380    /// omitted when this flag is true when the data is too long.
381    #[serde(
382        rename = "hasPostData",
383        default,
384        skip_serializing_if = "Option::is_none"
385    )]
386    pub has_post_data: Option<bool>,
387    /// Request body elements (post data broken into individual entries).
388    ///
389    /// Experimental: may change without notice.
390    #[serde(
391        rename = "postDataEntries",
392        default,
393        skip_serializing_if = "Option::is_none"
394    )]
395    pub post_data_entries: Option<Vec<PostDataEntry>>,
396    /// The mixed content type of the request.
397    #[serde(
398        rename = "mixedContentType",
399        default,
400        skip_serializing_if = "Option::is_none"
401    )]
402    pub mixed_content_type: Option<crate::protocol::security::MixedContentType>,
403    /// Priority of the resource request at the time request is sent.
404    #[serde(rename = "initialPriority")]
405    pub initial_priority: ResourcePriority,
406    /// The referrer policy of the request, as defined in
407    /// <https://www.w3.org/TR/referrer-policy/>
408    #[serde(rename = "referrerPolicy")]
409    pub referrer_policy: RequestReferrerPolicy,
410    /// Whether is loaded via link preload.
411    #[serde(
412        rename = "isLinkPreload",
413        default,
414        skip_serializing_if = "Option::is_none"
415    )]
416    pub is_link_preload: Option<bool>,
417    /// Set for requests when the TrustToken API is used. Contains the parameters
418    /// passed by the developer (e.g. via "fetch") as understood by the backend.
419    ///
420    /// Experimental: may change without notice.
421    #[serde(
422        rename = "trustTokenParams",
423        default,
424        skip_serializing_if = "Option::is_none"
425    )]
426    pub trust_token_params: Option<TrustTokenParams>,
427    /// True if this resource request is considered to be the 'same site' as the
428    /// request corresponding to the main frame.
429    ///
430    /// Experimental: may change without notice.
431    #[serde(
432        rename = "isSameSite",
433        default,
434        skip_serializing_if = "Option::is_none"
435    )]
436    pub is_same_site: Option<bool>,
437    /// True when the resource request is ad-related.
438    ///
439    /// Experimental: may change without notice.
440    #[serde(
441        rename = "isAdRelated",
442        default,
443        skip_serializing_if = "Option::is_none"
444    )]
445    pub is_ad_related: Option<bool>,
446}
447
448/// The values `referrerPolicy` accepts on `Request`.
449#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
450pub enum RequestReferrerPolicy {
451    /// `unsafe-url`
452    #[serde(rename = "unsafe-url")]
453    UnsafeUrl,
454    /// `no-referrer-when-downgrade`
455    #[serde(rename = "no-referrer-when-downgrade")]
456    NoReferrerWhenDowngrade,
457    /// `no-referrer`
458    #[serde(rename = "no-referrer")]
459    NoReferrer,
460    /// `origin`
461    #[serde(rename = "origin")]
462    Origin,
463    /// `origin-when-cross-origin`
464    #[serde(rename = "origin-when-cross-origin")]
465    OriginWhenCrossOrigin,
466    /// `same-origin`
467    #[serde(rename = "same-origin")]
468    SameOrigin,
469    /// `strict-origin`
470    #[serde(rename = "strict-origin")]
471    StrictOrigin,
472    /// `strict-origin-when-cross-origin`
473    #[serde(rename = "strict-origin-when-cross-origin")]
474    StrictOriginWhenCrossOrigin,
475    /// A value this vendored schema does not list. Chrome adds values ahead of
476    /// the published protocol, so an unrecognised one is kept as it arrived
477    /// rather than failing the payload it came in.
478    #[serde(untagged)]
479    Unrecognized(String),
480}
481
482/// Details of a signed certificate timestamp (SCT).
483#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
484pub struct SignedCertificateTimestamp {
485    /// Validation status.
486    pub status: String,
487    /// Origin.
488    pub origin: String,
489    /// Log name / description.
490    #[serde(rename = "logDescription")]
491    pub log_description: String,
492    /// Log ID.
493    #[serde(rename = "logId")]
494    pub log_id: String,
495    /// Issuance date. Unlike TimeSinceEpoch, this contains the number of
496    /// milliseconds since January 1, 1970, UTC, not the number of seconds.
497    pub timestamp: f64,
498    /// Hash algorithm.
499    #[serde(rename = "hashAlgorithm")]
500    pub hash_algorithm: String,
501    /// Signature algorithm.
502    #[serde(rename = "signatureAlgorithm")]
503    pub signature_algorithm: String,
504    /// Signature data.
505    #[serde(rename = "signatureData")]
506    pub signature_data: String,
507}
508
509/// Security details about a request.
510#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
511pub struct SecurityDetails {
512    /// Protocol name (e.g. "TLS 1.2" or "QUIC").
513    pub protocol: String,
514    /// Key Exchange used by the connection, or the empty string if not
515    /// applicable.
516    #[serde(rename = "keyExchange")]
517    pub key_exchange: String,
518    /// (EC)DH group used by the connection, if applicable.
519    #[serde(
520        rename = "keyExchangeGroup",
521        default,
522        skip_serializing_if = "Option::is_none"
523    )]
524    pub key_exchange_group: Option<String>,
525    /// Cipher name.
526    pub cipher: String,
527    /// TLS MAC. Note that AEAD ciphers do not have separate MACs.
528    #[serde(default, skip_serializing_if = "Option::is_none")]
529    pub mac: Option<String>,
530    /// Certificate ID value.
531    #[serde(rename = "certificateId")]
532    pub certificate_id: crate::protocol::security::CertificateId,
533    /// Certificate subject name.
534    #[serde(rename = "subjectName")]
535    pub subject_name: String,
536    /// Subject Alternative Name (SAN) DNS names and IP addresses.
537    #[serde(rename = "sanList")]
538    pub san_list: Vec<String>,
539    /// Name of the issuing CA.
540    pub issuer: String,
541    /// Certificate valid from date.
542    #[serde(rename = "validFrom")]
543    pub valid_from: TimeSinceEpoch,
544    /// Certificate valid to (expiration) date
545    #[serde(rename = "validTo")]
546    pub valid_to: TimeSinceEpoch,
547    /// List of signed certificate timestamps (SCTs).
548    #[serde(rename = "signedCertificateTimestampList")]
549    pub signed_certificate_timestamp_list: Vec<SignedCertificateTimestamp>,
550    /// Whether the request complied with Certificate Transparency policy
551    #[serde(rename = "certificateTransparencyCompliance")]
552    pub certificate_transparency_compliance: CertificateTransparencyCompliance,
553    /// The signature algorithm used by the server in the TLS server signature,
554    /// represented as a TLS SignatureScheme code point. Omitted if not applicable
555    /// or not known.
556    #[serde(
557        rename = "serverSignatureAlgorithm",
558        default,
559        skip_serializing_if = "Option::is_none"
560    )]
561    pub server_signature_algorithm: Option<i64>,
562    /// Whether the connection used Encrypted ClientHello
563    #[serde(rename = "encryptedClientHello")]
564    pub encrypted_client_hello: bool,
565}
566
567/// Whether the request complied with Certificate Transparency policy.
568#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
569pub enum CertificateTransparencyCompliance {
570    /// `unknown`
571    #[serde(rename = "unknown")]
572    Unknown,
573    /// `not-compliant`
574    #[serde(rename = "not-compliant")]
575    NotCompliant,
576    /// `compliant`
577    #[serde(rename = "compliant")]
578    Compliant,
579    /// A value this vendored schema does not list. Chrome adds values ahead of
580    /// the published protocol, so an unrecognised one is kept as it arrived
581    /// rather than failing the payload it came in.
582    #[serde(untagged)]
583    Unrecognized(String),
584}
585
586/// The reason why request was blocked.
587#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
588pub enum BlockedReason {
589    /// `other`
590    #[serde(rename = "other")]
591    Other,
592    /// `csp`
593    #[serde(rename = "csp")]
594    Csp,
595    /// `mixed-content`
596    #[serde(rename = "mixed-content")]
597    MixedContent,
598    /// `origin`
599    #[serde(rename = "origin")]
600    Origin,
601    /// `inspector`
602    #[serde(rename = "inspector")]
603    Inspector,
604    /// `integrity`
605    #[serde(rename = "integrity")]
606    Integrity,
607    /// `subresource-filter`
608    #[serde(rename = "subresource-filter")]
609    SubresourceFilter,
610    /// `content-type`
611    #[serde(rename = "content-type")]
612    ContentType,
613    /// `coep-frame-resource-needs-coep-header`
614    #[serde(rename = "coep-frame-resource-needs-coep-header")]
615    CoepFrameResourceNeedsCoepHeader,
616    /// `coop-sandboxed-iframe-cannot-navigate-to-coop-page`
617    #[serde(rename = "coop-sandboxed-iframe-cannot-navigate-to-coop-page")]
618    CoopSandboxedIframeCannotNavigateToCoopPage,
619    /// `corp-not-same-origin`
620    #[serde(rename = "corp-not-same-origin")]
621    CorpNotSameOrigin,
622    /// `corp-not-same-origin-after-defaulted-to-same-origin-by-coep`
623    #[serde(rename = "corp-not-same-origin-after-defaulted-to-same-origin-by-coep")]
624    CorpNotSameOriginAfterDefaultedToSameOriginByCoep,
625    /// `corp-not-same-origin-after-defaulted-to-same-origin-by-dip`
626    #[serde(rename = "corp-not-same-origin-after-defaulted-to-same-origin-by-dip")]
627    CorpNotSameOriginAfterDefaultedToSameOriginByDip,
628    /// `corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip`
629    #[serde(rename = "corp-not-same-origin-after-defaulted-to-same-origin-by-coep-and-dip")]
630    CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip,
631    /// `corp-not-same-site`
632    #[serde(rename = "corp-not-same-site")]
633    CorpNotSameSite,
634    /// `sri-message-signature-mismatch`
635    #[serde(rename = "sri-message-signature-mismatch")]
636    SriMessageSignatureMismatch,
637    /// A value this vendored schema does not list. Chrome adds values ahead of
638    /// the published protocol, so an unrecognised one is kept as it arrived
639    /// rather than failing the payload it came in.
640    #[serde(untagged)]
641    Unrecognized(String),
642}
643
644/// The reason why request was blocked.
645#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
646pub enum CorsError {
647    /// `DisallowedByMode`
648    DisallowedByMode,
649    /// `InvalidResponse`
650    InvalidResponse,
651    /// `WildcardOriginNotAllowed`
652    WildcardOriginNotAllowed,
653    /// `MissingAllowOriginHeader`
654    MissingAllowOriginHeader,
655    /// `MultipleAllowOriginValues`
656    MultipleAllowOriginValues,
657    /// `InvalidAllowOriginValue`
658    InvalidAllowOriginValue,
659    /// `AllowOriginMismatch`
660    AllowOriginMismatch,
661    /// `InvalidAllowCredentials`
662    InvalidAllowCredentials,
663    /// `CorsDisabledScheme`
664    CorsDisabledScheme,
665    /// `PreflightInvalidStatus`
666    PreflightInvalidStatus,
667    /// `PreflightDisallowedRedirect`
668    PreflightDisallowedRedirect,
669    /// `PreflightWildcardOriginNotAllowed`
670    PreflightWildcardOriginNotAllowed,
671    /// `PreflightMissingAllowOriginHeader`
672    PreflightMissingAllowOriginHeader,
673    /// `PreflightMultipleAllowOriginValues`
674    PreflightMultipleAllowOriginValues,
675    /// `PreflightInvalidAllowOriginValue`
676    PreflightInvalidAllowOriginValue,
677    /// `PreflightAllowOriginMismatch`
678    PreflightAllowOriginMismatch,
679    /// `PreflightInvalidAllowCredentials`
680    PreflightInvalidAllowCredentials,
681    /// `PreflightMissingAllowExternal`
682    PreflightMissingAllowExternal,
683    /// `PreflightInvalidAllowExternal`
684    PreflightInvalidAllowExternal,
685    /// `InvalidAllowMethodsPreflightResponse`
686    InvalidAllowMethodsPreflightResponse,
687    /// `InvalidAllowHeadersPreflightResponse`
688    InvalidAllowHeadersPreflightResponse,
689    /// `MethodDisallowedByPreflightResponse`
690    MethodDisallowedByPreflightResponse,
691    /// `HeaderDisallowedByPreflightResponse`
692    HeaderDisallowedByPreflightResponse,
693    /// `RedirectContainsCredentials`
694    RedirectContainsCredentials,
695    /// `InsecureLocalNetwork`
696    InsecureLocalNetwork,
697    /// `InvalidLocalNetworkAccess`
698    InvalidLocalNetworkAccess,
699    /// `NoCorsRedirectModeNotFollow`
700    NoCorsRedirectModeNotFollow,
701    /// `LocalNetworkAccessPermissionDenied`
702    LocalNetworkAccessPermissionDenied,
703    /// A value this vendored schema does not list. Chrome adds values ahead of
704    /// the published protocol, so an unrecognised one is kept as it arrived
705    /// rather than failing the payload it came in.
706    #[serde(untagged)]
707    Unrecognized(String),
708}
709
710#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
711pub struct CorsErrorStatus {
712    #[serde(rename = "corsError")]
713    pub cors_error: CorsError,
714    #[serde(rename = "failedParameter")]
715    pub failed_parameter: String,
716}
717
718/// Source of serviceworker response.
719#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
720pub enum ServiceWorkerResponseSource {
721    /// `cache-storage`
722    #[serde(rename = "cache-storage")]
723    CacheStorage,
724    /// `http-cache`
725    #[serde(rename = "http-cache")]
726    HttpCache,
727    /// `fallback-code`
728    #[serde(rename = "fallback-code")]
729    FallbackCode,
730    /// `network`
731    #[serde(rename = "network")]
732    Network,
733    /// A value this vendored schema does not list. Chrome adds values ahead of
734    /// the published protocol, so an unrecognised one is kept as it arrived
735    /// rather than failing the payload it came in.
736    #[serde(untagged)]
737    Unrecognized(String),
738}
739
740/// Determines what type of Trust Token operation is executed and depending on
741/// the type, some additional parameters. The values are specified in
742/// third_party/blink/renderer/core/fetch/trust_token.idl.
743///
744/// Experimental: may change without notice.
745#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
746pub struct TrustTokenParams {
747    pub operation: TrustTokenOperationType,
748    /// Only set for "token-redemption" operation and determine whether to request
749    /// a fresh SRR or use a still valid cached SRR.
750    #[serde(rename = "refreshPolicy")]
751    pub refresh_policy: TrustTokenParamsRefreshPolicy,
752    /// Origins of issuers from whom to request tokens or redemption records.
753    #[serde(default, skip_serializing_if = "Option::is_none")]
754    pub issuers: Option<Vec<String>>,
755}
756
757/// The values `refreshPolicy` accepts on `TrustTokenParams`.
758#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
759pub enum TrustTokenParamsRefreshPolicy {
760    /// `UseCached`
761    UseCached,
762    /// `Refresh`
763    Refresh,
764    /// A value this vendored schema does not list. Chrome adds values ahead of
765    /// the published protocol, so an unrecognised one is kept as it arrived
766    /// rather than failing the payload it came in.
767    #[serde(untagged)]
768    Unrecognized(String),
769}
770
771/// Experimental: may change without notice.
772#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
773pub enum TrustTokenOperationType {
774    /// `Issuance`
775    Issuance,
776    /// `Redemption`
777    Redemption,
778    /// `Signing`
779    Signing,
780    /// A value this vendored schema does not list. Chrome adds values ahead of
781    /// the published protocol, so an unrecognised one is kept as it arrived
782    /// rather than failing the payload it came in.
783    #[serde(untagged)]
784    Unrecognized(String),
785}
786
787/// The reason why Chrome uses a specific transport protocol for HTTP
788/// semantics.
789///
790/// Experimental: may change without notice.
791#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
792pub enum AlternateProtocolUsage {
793    /// `alternativeJobWonWithoutRace`
794    #[serde(rename = "alternativeJobWonWithoutRace")]
795    AlternativeJobWonWithoutRace,
796    /// `alternativeJobWonRace`
797    #[serde(rename = "alternativeJobWonRace")]
798    AlternativeJobWonRace,
799    /// `mainJobWonRace`
800    #[serde(rename = "mainJobWonRace")]
801    MainJobWonRace,
802    /// `mappingMissing`
803    #[serde(rename = "mappingMissing")]
804    MappingMissing,
805    /// `broken`
806    #[serde(rename = "broken")]
807    Broken,
808    /// `dnsAlpnH3JobWonWithoutRace`
809    #[serde(rename = "dnsAlpnH3JobWonWithoutRace")]
810    DnsAlpnH3JobWonWithoutRace,
811    /// `dnsAlpnH3JobWonRace`
812    #[serde(rename = "dnsAlpnH3JobWonRace")]
813    DnsAlpnH3JobWonRace,
814    /// `unspecifiedReason`
815    #[serde(rename = "unspecifiedReason")]
816    UnspecifiedReason,
817    /// A value this vendored schema does not list. Chrome adds values ahead of
818    /// the published protocol, so an unrecognised one is kept as it arrived
819    /// rather than failing the payload it came in.
820    #[serde(untagged)]
821    Unrecognized(String),
822}
823
824/// Source of service worker router.
825#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
826pub enum ServiceWorkerRouterSource {
827    /// `network`
828    #[serde(rename = "network")]
829    Network,
830    /// `cache`
831    #[serde(rename = "cache")]
832    Cache,
833    /// `fetch-event`
834    #[serde(rename = "fetch-event")]
835    FetchEvent,
836    /// `race-network-and-fetch-handler`
837    #[serde(rename = "race-network-and-fetch-handler")]
838    RaceNetworkAndFetchHandler,
839    /// `race-network-and-cache`
840    #[serde(rename = "race-network-and-cache")]
841    RaceNetworkAndCache,
842    /// A value this vendored schema does not list. Chrome adds values ahead of
843    /// the published protocol, so an unrecognised one is kept as it arrived
844    /// rather than failing the payload it came in.
845    #[serde(untagged)]
846    Unrecognized(String),
847}
848
849/// Experimental: may change without notice.
850#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
851pub struct ServiceWorkerRouterInfo {
852    /// ID of the rule matched. If there is a matched rule, this field will be
853    /// set, otherwiser no value will be set.
854    #[serde(
855        rename = "ruleIdMatched",
856        default,
857        skip_serializing_if = "Option::is_none"
858    )]
859    pub rule_id_matched: Option<i64>,
860    /// The router source of the matched rule. If there is a matched rule, this
861    /// field will be set, otherwise no value will be set.
862    #[serde(
863        rename = "matchedSourceType",
864        default,
865        skip_serializing_if = "Option::is_none"
866    )]
867    pub matched_source_type: Option<ServiceWorkerRouterSource>,
868    /// The actual router source used.
869    #[serde(
870        rename = "actualSourceType",
871        default,
872        skip_serializing_if = "Option::is_none"
873    )]
874    pub actual_source_type: Option<ServiceWorkerRouterSource>,
875}
876
877/// HTTP response data.
878#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
879pub struct Response {
880    /// Response URL. This URL can be different from CachedResource.url in case of
881    /// redirect.
882    pub url: String,
883    /// HTTP response status code.
884    pub status: i64,
885    /// HTTP response status text.
886    #[serde(rename = "statusText")]
887    pub status_text: String,
888    /// HTTP response headers.
889    pub headers: Headers,
890    /// HTTP response headers text. This has been replaced by the headers in
891    /// Network.responseReceivedExtraInfo.
892    ///
893    /// Deprecated in the protocol.
894    #[serde(
895        rename = "headersText",
896        default,
897        skip_serializing_if = "Option::is_none"
898    )]
899    pub headers_text: Option<String>,
900    /// Resource mimeType as determined by the browser.
901    #[serde(rename = "mimeType")]
902    pub mime_type: String,
903    /// Resource charset as determined by the browser (if applicable).
904    pub charset: String,
905    /// Refined HTTP request headers that were actually transmitted over the
906    /// network.
907    #[serde(
908        rename = "requestHeaders",
909        default,
910        skip_serializing_if = "Option::is_none"
911    )]
912    pub request_headers: Option<Headers>,
913    /// HTTP request headers text. This has been replaced by the headers in
914    /// Network.requestWillBeSentExtraInfo.
915    ///
916    /// Deprecated in the protocol.
917    #[serde(
918        rename = "requestHeadersText",
919        default,
920        skip_serializing_if = "Option::is_none"
921    )]
922    pub request_headers_text: Option<String>,
923    /// Specifies whether physical connection was actually reused for this
924    /// request.
925    #[serde(rename = "connectionReused")]
926    pub connection_reused: bool,
927    /// Physical connection id that was actually used for this request.
928    #[serde(rename = "connectionId")]
929    pub connection_id: f64,
930    /// Remote IP address.
931    #[serde(
932        rename = "remoteIPAddress",
933        default,
934        skip_serializing_if = "Option::is_none"
935    )]
936    pub remote_ip_address: Option<String>,
937    /// Remote port.
938    #[serde(
939        rename = "remotePort",
940        default,
941        skip_serializing_if = "Option::is_none"
942    )]
943    pub remote_port: Option<i64>,
944    /// Specifies that the request was served from the disk cache.
945    #[serde(
946        rename = "fromDiskCache",
947        default,
948        skip_serializing_if = "Option::is_none"
949    )]
950    pub from_disk_cache: Option<bool>,
951    /// Specifies that the request was served from the ServiceWorker.
952    #[serde(
953        rename = "fromServiceWorker",
954        default,
955        skip_serializing_if = "Option::is_none"
956    )]
957    pub from_service_worker: Option<bool>,
958    /// Specifies that the request was served from the prefetch cache.
959    #[serde(
960        rename = "fromPrefetchCache",
961        default,
962        skip_serializing_if = "Option::is_none"
963    )]
964    pub from_prefetch_cache: Option<bool>,
965    /// Specifies that the request was served from the prefetch cache.
966    #[serde(
967        rename = "fromEarlyHints",
968        default,
969        skip_serializing_if = "Option::is_none"
970    )]
971    pub from_early_hints: Option<bool>,
972    /// Information about how ServiceWorker Static Router API was used. If this
973    /// field is set with `matchedSourceType` field, a matching rule is found. If
974    /// this field is set without `matchedSource`, no matching rule is found.
975    /// Otherwise, the API is not used.
976    ///
977    /// Experimental: may change without notice.
978    #[serde(
979        rename = "serviceWorkerRouterInfo",
980        default,
981        skip_serializing_if = "Option::is_none"
982    )]
983    pub service_worker_router_info: Option<ServiceWorkerRouterInfo>,
984    /// Total number of bytes received for this request so far.
985    #[serde(rename = "encodedDataLength")]
986    pub encoded_data_length: f64,
987    /// Timing information for the given request.
988    #[serde(default, skip_serializing_if = "Option::is_none")]
989    pub timing: Option<ResourceTiming>,
990    /// Response source of response from ServiceWorker.
991    #[serde(
992        rename = "serviceWorkerResponseSource",
993        default,
994        skip_serializing_if = "Option::is_none"
995    )]
996    pub service_worker_response_source: Option<ServiceWorkerResponseSource>,
997    /// The time at which the returned response was generated.
998    #[serde(
999        rename = "responseTime",
1000        default,
1001        skip_serializing_if = "Option::is_none"
1002    )]
1003    pub response_time: Option<TimeSinceEpoch>,
1004    /// Cache Storage Cache Name.
1005    #[serde(
1006        rename = "cacheStorageCacheName",
1007        default,
1008        skip_serializing_if = "Option::is_none"
1009    )]
1010    pub cache_storage_cache_name: Option<String>,
1011    /// Protocol used to fetch this request.
1012    #[serde(default, skip_serializing_if = "Option::is_none")]
1013    pub protocol: Option<String>,
1014    /// The reason why Chrome uses a specific transport protocol for HTTP
1015    /// semantics.
1016    ///
1017    /// Experimental: may change without notice.
1018    #[serde(
1019        rename = "alternateProtocolUsage",
1020        default,
1021        skip_serializing_if = "Option::is_none"
1022    )]
1023    pub alternate_protocol_usage: Option<AlternateProtocolUsage>,
1024    /// Security state of the request resource.
1025    #[serde(rename = "securityState")]
1026    pub security_state: crate::protocol::security::SecurityState,
1027    /// Security details for the request.
1028    #[serde(
1029        rename = "securityDetails",
1030        default,
1031        skip_serializing_if = "Option::is_none"
1032    )]
1033    pub security_details: Option<SecurityDetails>,
1034}
1035
1036/// WebSocket request data.
1037#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1038pub struct WebSocketRequest {
1039    /// HTTP request headers.
1040    pub headers: Headers,
1041}
1042
1043/// WebSocket response data.
1044#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1045pub struct WebSocketResponse {
1046    /// HTTP response status code.
1047    pub status: i64,
1048    /// HTTP response status text.
1049    #[serde(rename = "statusText")]
1050    pub status_text: String,
1051    /// HTTP response headers.
1052    pub headers: Headers,
1053    /// HTTP response headers text.
1054    #[serde(
1055        rename = "headersText",
1056        default,
1057        skip_serializing_if = "Option::is_none"
1058    )]
1059    pub headers_text: Option<String>,
1060    /// HTTP request headers.
1061    #[serde(
1062        rename = "requestHeaders",
1063        default,
1064        skip_serializing_if = "Option::is_none"
1065    )]
1066    pub request_headers: Option<Headers>,
1067    /// HTTP request headers text.
1068    #[serde(
1069        rename = "requestHeadersText",
1070        default,
1071        skip_serializing_if = "Option::is_none"
1072    )]
1073    pub request_headers_text: Option<String>,
1074}
1075
1076/// WebSocket message data. This represents an entire WebSocket message, not
1077/// just a fragmented frame as the name suggests.
1078#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1079pub struct WebSocketFrame {
1080    /// WebSocket message opcode.
1081    pub opcode: f64,
1082    /// WebSocket message mask.
1083    pub mask: bool,
1084    /// WebSocket message payload data. If the opcode is 1, this is a text message
1085    /// and payloadData is a UTF-8 string. If the opcode isn't 1, then payloadData
1086    /// is a base64 encoded string representing binary data.
1087    #[serde(rename = "payloadData")]
1088    pub payload_data: String,
1089}
1090
1091/// Information about the cached resource.
1092#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1093pub struct CachedResource {
1094    /// Resource URL. This is the url of the original network request.
1095    pub url: String,
1096    /// Type of this resource.
1097    pub r#type: ResourceType,
1098    /// Cached response data.
1099    #[serde(default, skip_serializing_if = "Option::is_none")]
1100    pub response: Option<Response>,
1101    /// Cached response body size.
1102    #[serde(rename = "bodySize")]
1103    pub body_size: f64,
1104}
1105
1106/// Information about the request initiator.
1107#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1108pub struct Initiator {
1109    /// Type of this initiator.
1110    pub r#type: InitiatorType,
1111    /// Initiator JavaScript stack trace, set for Script only. Requires the
1112    /// Debugger domain to be enabled.
1113    #[serde(default, skip_serializing_if = "Option::is_none")]
1114    pub stack: Option<crate::protocol::runtime::StackTrace>,
1115    /// Initiator URL, set for Parser type or for Script type (when script is
1116    /// importing module) or for SignedExchange type.
1117    #[serde(default, skip_serializing_if = "Option::is_none")]
1118    pub url: Option<String>,
1119    /// Initiator line number, set for Parser type or for Script type (when script
1120    /// is importing module) (0-based).
1121    #[serde(
1122        rename = "lineNumber",
1123        default,
1124        skip_serializing_if = "Option::is_none"
1125    )]
1126    pub line_number: Option<f64>,
1127    /// Initiator column number, set for Parser type or for Script type (when
1128    /// script is importing module) (0-based).
1129    #[serde(
1130        rename = "columnNumber",
1131        default,
1132        skip_serializing_if = "Option::is_none"
1133    )]
1134    pub column_number: Option<f64>,
1135    /// Set if another request triggered this request (e.g. preflight).
1136    #[serde(rename = "requestId", default, skip_serializing_if = "Option::is_none")]
1137    pub request_id: Option<RequestId>,
1138}
1139
1140/// The values `type` accepts on `Initiator`.
1141#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1142pub enum InitiatorType {
1143    /// `parser`
1144    #[serde(rename = "parser")]
1145    Parser,
1146    /// `script`
1147    #[serde(rename = "script")]
1148    Script,
1149    /// `preload`
1150    #[serde(rename = "preload")]
1151    Preload,
1152    /// `SignedExchange`
1153    SignedExchange,
1154    /// `preflight`
1155    #[serde(rename = "preflight")]
1156    Preflight,
1157    /// `FedCM`
1158    #[serde(rename = "FedCM")]
1159    FedCm,
1160    /// `other`
1161    #[serde(rename = "other")]
1162    Other,
1163    /// A value this vendored schema does not list. Chrome adds values ahead of
1164    /// the published protocol, so an unrecognised one is kept as it arrived
1165    /// rather than failing the payload it came in.
1166    #[serde(untagged)]
1167    Unrecognized(String),
1168}
1169
1170/// cookiePartitionKey object The representation of the components of the key
1171/// that are created by the cookiePartitionKey class contained in
1172/// net/cookies/cookie_partition_key.h.
1173///
1174/// Experimental: may change without notice.
1175#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1176pub struct CookiePartitionKey {
1177    /// The site of the top-level URL the browser was visiting at the start of the
1178    /// request to the endpoint that set the cookie.
1179    #[serde(rename = "topLevelSite")]
1180    pub top_level_site: String,
1181    /// Indicates if the cookie has any ancestors that are cross-site to the
1182    /// topLevelSite.
1183    #[serde(rename = "hasCrossSiteAncestor")]
1184    pub has_cross_site_ancestor: bool,
1185}
1186
1187/// Cookie object
1188#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1189pub struct Cookie {
1190    /// Cookie name.
1191    pub name: String,
1192    /// Cookie value.
1193    pub value: String,
1194    /// Cookie domain.
1195    pub domain: String,
1196    /// Cookie path.
1197    pub path: String,
1198    /// Cookie expiration date as the number of seconds since the UNIX epoch. The
1199    /// value is set to -1 if the expiry date is not set. The value can be null
1200    /// for values that cannot be represented in JSON (±Inf).
1201    pub expires: f64,
1202    /// Cookie size.
1203    pub size: i64,
1204    /// True if cookie is http-only.
1205    #[serde(rename = "httpOnly")]
1206    pub http_only: bool,
1207    /// True if cookie is secure.
1208    pub secure: bool,
1209    /// True in case of session cookie.
1210    pub session: bool,
1211    /// Cookie SameSite type.
1212    #[serde(rename = "sameSite", default, skip_serializing_if = "Option::is_none")]
1213    pub same_site: Option<CookieSameSite>,
1214    /// Cookie Priority
1215    ///
1216    /// Experimental: may change without notice.
1217    pub priority: CookiePriority,
1218    /// Cookie source scheme type.
1219    ///
1220    /// Experimental: may change without notice.
1221    #[serde(rename = "sourceScheme")]
1222    pub source_scheme: CookieSourceScheme,
1223    /// Cookie source port. Valid values are {-1, \[1, 65535\]}, -1 indicates an
1224    /// unspecified port. An unspecified port value allows protocol clients to
1225    /// emulate legacy cookie scope for the port. This is a temporary ability and
1226    /// it will be removed in the future.
1227    ///
1228    /// Experimental: may change without notice.
1229    #[serde(rename = "sourcePort")]
1230    pub source_port: i64,
1231    /// Cookie partition key.
1232    ///
1233    /// Experimental: may change without notice.
1234    #[serde(
1235        rename = "partitionKey",
1236        default,
1237        skip_serializing_if = "Option::is_none"
1238    )]
1239    pub partition_key: Option<CookiePartitionKey>,
1240    /// True if cookie partition key is opaque.
1241    ///
1242    /// Experimental: may change without notice.
1243    #[serde(
1244        rename = "partitionKeyOpaque",
1245        default,
1246        skip_serializing_if = "Option::is_none"
1247    )]
1248    pub partition_key_opaque: Option<bool>,
1249}
1250
1251/// Types of reasons why a cookie may not be stored from a response.
1252///
1253/// Experimental: may change without notice.
1254#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1255pub enum SetCookieBlockedReason {
1256    /// `SecureOnly`
1257    SecureOnly,
1258    /// `SameSiteStrict`
1259    SameSiteStrict,
1260    /// `SameSiteLax`
1261    SameSiteLax,
1262    /// `SameSiteUnspecifiedTreatedAsLax`
1263    SameSiteUnspecifiedTreatedAsLax,
1264    /// `SameSiteNoneInsecure`
1265    SameSiteNoneInsecure,
1266    /// `UserPreferences`
1267    UserPreferences,
1268    /// `ThirdPartyPhaseout`
1269    ThirdPartyPhaseout,
1270    /// `SyntaxError`
1271    SyntaxError,
1272    /// `SchemeNotSupported`
1273    SchemeNotSupported,
1274    /// `OverwriteSecure`
1275    OverwriteSecure,
1276    /// `InvalidDomain`
1277    InvalidDomain,
1278    /// `InvalidPrefix`
1279    InvalidPrefix,
1280    /// `UnknownError`
1281    UnknownError,
1282    /// `SchemefulSameSiteStrict`
1283    SchemefulSameSiteStrict,
1284    /// `SchemefulSameSiteLax`
1285    SchemefulSameSiteLax,
1286    /// `SchemefulSameSiteUnspecifiedTreatedAsLax`
1287    SchemefulSameSiteUnspecifiedTreatedAsLax,
1288    /// `NameValuePairExceedsMaxSize`
1289    NameValuePairExceedsMaxSize,
1290    /// `DisallowedCharacter`
1291    DisallowedCharacter,
1292    /// `NoCookieContent`
1293    NoCookieContent,
1294    /// A value this vendored schema does not list. Chrome adds values ahead of
1295    /// the published protocol, so an unrecognised one is kept as it arrived
1296    /// rather than failing the payload it came in.
1297    #[serde(untagged)]
1298    Unrecognized(String),
1299}
1300
1301/// Types of reasons why a cookie may not be sent with a request.
1302///
1303/// Experimental: may change without notice.
1304#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1305pub enum CookieBlockedReason {
1306    /// `SecureOnly`
1307    SecureOnly,
1308    /// `NotOnPath`
1309    NotOnPath,
1310    /// `DomainMismatch`
1311    DomainMismatch,
1312    /// `SameSiteStrict`
1313    SameSiteStrict,
1314    /// `SameSiteLax`
1315    SameSiteLax,
1316    /// `SameSiteUnspecifiedTreatedAsLax`
1317    SameSiteUnspecifiedTreatedAsLax,
1318    /// `SameSiteNoneInsecure`
1319    SameSiteNoneInsecure,
1320    /// `UserPreferences`
1321    UserPreferences,
1322    /// `ThirdPartyPhaseout`
1323    ThirdPartyPhaseout,
1324    /// `UnknownError`
1325    UnknownError,
1326    /// `SchemefulSameSiteStrict`
1327    SchemefulSameSiteStrict,
1328    /// `SchemefulSameSiteLax`
1329    SchemefulSameSiteLax,
1330    /// `SchemefulSameSiteUnspecifiedTreatedAsLax`
1331    SchemefulSameSiteUnspecifiedTreatedAsLax,
1332    /// `NameValuePairExceedsMaxSize`
1333    NameValuePairExceedsMaxSize,
1334    /// `PortMismatch`
1335    PortMismatch,
1336    /// `SchemeMismatch`
1337    SchemeMismatch,
1338    /// `AnonymousContext`
1339    AnonymousContext,
1340    /// A value this vendored schema does not list. Chrome adds values ahead of
1341    /// the published protocol, so an unrecognised one is kept as it arrived
1342    /// rather than failing the payload it came in.
1343    #[serde(untagged)]
1344    Unrecognized(String),
1345}
1346
1347/// Types of reasons why a cookie should have been blocked by 3PCD but is
1348/// exempted for the request.
1349///
1350/// Experimental: may change without notice.
1351#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1352pub enum CookieExemptionReason {
1353    /// `None`
1354    None,
1355    /// `UserSetting`
1356    UserSetting,
1357    /// `EnterprisePolicy`
1358    EnterprisePolicy,
1359    /// `StorageAccess`
1360    StorageAccess,
1361    /// `TopLevelStorageAccess`
1362    TopLevelStorageAccess,
1363    /// `Scheme`
1364    Scheme,
1365    /// `SameSiteNoneCookiesInSandbox`
1366    SameSiteNoneCookiesInSandbox,
1367    /// A value this vendored schema does not list. Chrome adds values ahead of
1368    /// the published protocol, so an unrecognised one is kept as it arrived
1369    /// rather than failing the payload it came in.
1370    #[serde(untagged)]
1371    Unrecognized(String),
1372}
1373
1374/// A cookie which was not stored from a response with the corresponding
1375/// reason.
1376///
1377/// Experimental: may change without notice.
1378#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1379pub struct BlockedSetCookieWithReason {
1380    /// The reason(s) this cookie was blocked.
1381    #[serde(rename = "blockedReasons")]
1382    pub blocked_reasons: Vec<SetCookieBlockedReason>,
1383    /// The string representing this individual cookie as it would appear in the
1384    /// header. This is not the entire "cookie" or "set-cookie" header which could
1385    /// have multiple cookies.
1386    #[serde(rename = "cookieLine")]
1387    pub cookie_line: String,
1388    /// The cookie object which represents the cookie which was not stored. It is
1389    /// optional because sometimes complete cookie information is not available,
1390    /// such as in the case of parsing errors.
1391    #[serde(default, skip_serializing_if = "Option::is_none")]
1392    pub cookie: Option<Cookie>,
1393}
1394
1395/// A cookie should have been blocked by 3PCD but is exempted and stored from
1396/// a response with the corresponding reason. A cookie could only have at most
1397/// one exemption reason.
1398///
1399/// Experimental: may change without notice.
1400#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1401pub struct ExemptedSetCookieWithReason {
1402    /// The reason the cookie was exempted.
1403    #[serde(rename = "exemptionReason")]
1404    pub exemption_reason: CookieExemptionReason,
1405    /// The string representing this individual cookie as it would appear in the
1406    /// header.
1407    #[serde(rename = "cookieLine")]
1408    pub cookie_line: String,
1409    /// The cookie object representing the cookie.
1410    pub cookie: Cookie,
1411}
1412
1413/// A cookie associated with the request which may or may not be sent with it.
1414/// Includes the cookies itself and reasons for blocking or exemption.
1415///
1416/// Experimental: may change without notice.
1417#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1418pub struct AssociatedCookie {
1419    /// The cookie object representing the cookie which was not sent.
1420    pub cookie: Cookie,
1421    /// The reason(s) the cookie was blocked. If empty means the cookie is
1422    /// included.
1423    #[serde(rename = "blockedReasons")]
1424    pub blocked_reasons: Vec<CookieBlockedReason>,
1425    /// The reason the cookie should have been blocked by 3PCD but is exempted. A
1426    /// cookie could only have at most one exemption reason.
1427    #[serde(
1428        rename = "exemptionReason",
1429        default,
1430        skip_serializing_if = "Option::is_none"
1431    )]
1432    pub exemption_reason: Option<CookieExemptionReason>,
1433}
1434
1435/// Cookie parameter object
1436#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1437pub struct CookieParam {
1438    /// Cookie name.
1439    pub name: String,
1440    /// Cookie value.
1441    pub value: String,
1442    /// The request-URI to associate with the setting of the cookie. This value
1443    /// can affect the default domain, path, source port, and source scheme values
1444    /// of the created cookie.
1445    #[serde(default, skip_serializing_if = "Option::is_none")]
1446    pub url: Option<String>,
1447    /// Cookie domain.
1448    #[serde(default, skip_serializing_if = "Option::is_none")]
1449    pub domain: Option<String>,
1450    /// Cookie path.
1451    #[serde(default, skip_serializing_if = "Option::is_none")]
1452    pub path: Option<String>,
1453    /// True if cookie is secure.
1454    #[serde(default, skip_serializing_if = "Option::is_none")]
1455    pub secure: Option<bool>,
1456    /// True if cookie is http-only.
1457    #[serde(rename = "httpOnly", default, skip_serializing_if = "Option::is_none")]
1458    pub http_only: Option<bool>,
1459    /// Cookie SameSite type.
1460    #[serde(rename = "sameSite", default, skip_serializing_if = "Option::is_none")]
1461    pub same_site: Option<CookieSameSite>,
1462    /// Cookie expiration date, session cookie if not set
1463    #[serde(default, skip_serializing_if = "Option::is_none")]
1464    pub expires: Option<TimeSinceEpoch>,
1465    /// Cookie Priority.
1466    ///
1467    /// Experimental: may change without notice.
1468    #[serde(default, skip_serializing_if = "Option::is_none")]
1469    pub priority: Option<CookiePriority>,
1470    /// Cookie source scheme type.
1471    ///
1472    /// Experimental: may change without notice.
1473    #[serde(
1474        rename = "sourceScheme",
1475        default,
1476        skip_serializing_if = "Option::is_none"
1477    )]
1478    pub source_scheme: Option<CookieSourceScheme>,
1479    /// Cookie source port. Valid values are {-1, \[1, 65535\]}, -1 indicates an
1480    /// unspecified port. An unspecified port value allows protocol clients to
1481    /// emulate legacy cookie scope for the port. This is a temporary ability and
1482    /// it will be removed in the future.
1483    ///
1484    /// Experimental: may change without notice.
1485    #[serde(
1486        rename = "sourcePort",
1487        default,
1488        skip_serializing_if = "Option::is_none"
1489    )]
1490    pub source_port: Option<i64>,
1491    /// Cookie partition key. If not set, the cookie will be set as not
1492    /// partitioned.
1493    ///
1494    /// Experimental: may change without notice.
1495    #[serde(
1496        rename = "partitionKey",
1497        default,
1498        skip_serializing_if = "Option::is_none"
1499    )]
1500    pub partition_key: Option<CookiePartitionKey>,
1501}
1502
1503/// Authorization challenge for HTTP status code 401 or 407.
1504///
1505/// Experimental: may change without notice.
1506#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1507pub struct AuthChallenge {
1508    /// Source of the authentication challenge.
1509    #[serde(default, skip_serializing_if = "Option::is_none")]
1510    pub source: Option<AuthChallengeSource>,
1511    /// Origin of the challenger.
1512    pub origin: String,
1513    /// The authentication scheme used, such as basic or digest
1514    pub scheme: String,
1515    /// The realm of the challenge. May be empty.
1516    pub realm: String,
1517}
1518
1519/// The values `source` accepts on `AuthChallenge`.
1520#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1521pub enum AuthChallengeSource {
1522    /// `Server`
1523    Server,
1524    /// `Proxy`
1525    Proxy,
1526    /// A value this vendored schema does not list. Chrome adds values ahead of
1527    /// the published protocol, so an unrecognised one is kept as it arrived
1528    /// rather than failing the payload it came in.
1529    #[serde(untagged)]
1530    Unrecognized(String),
1531}
1532
1533/// Response to an AuthChallenge.
1534///
1535/// Experimental: may change without notice.
1536#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1537pub struct AuthChallengeResponse {
1538    /// The decision on what to do in response to the authorization challenge.
1539    /// Default means deferring to the default behavior of the net stack, which
1540    /// will likely either the Cancel authentication or display a popup dialog
1541    /// box.
1542    pub response: AuthChallengeResponseResponse,
1543    /// The username to provide, possibly empty. Should only be set if response is
1544    /// ProvideCredentials.
1545    #[serde(default, skip_serializing_if = "Option::is_none")]
1546    pub username: Option<String>,
1547    /// The password to provide, possibly empty. Should only be set if response is
1548    /// ProvideCredentials.
1549    #[serde(default, skip_serializing_if = "Option::is_none")]
1550    pub password: Option<String>,
1551}
1552
1553/// The values `response` accepts on `AuthChallengeResponse`.
1554#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1555pub enum AuthChallengeResponseResponse {
1556    /// `Default`
1557    Default,
1558    /// `CancelAuth`
1559    CancelAuth,
1560    /// `ProvideCredentials`
1561    ProvideCredentials,
1562    /// A value this vendored schema does not list. Chrome adds values ahead of
1563    /// the published protocol, so an unrecognised one is kept as it arrived
1564    /// rather than failing the payload it came in.
1565    #[serde(untagged)]
1566    Unrecognized(String),
1567}
1568
1569/// Information about a signed exchange signature.
1570/// <https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1>
1571///
1572/// Experimental: may change without notice.
1573#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1574pub struct SignedExchangeSignature {
1575    /// Signed exchange signature label.
1576    pub label: String,
1577    /// The hex string of signed exchange signature.
1578    pub signature: String,
1579    /// Signed exchange signature integrity.
1580    pub integrity: String,
1581    /// Signed exchange signature cert Url.
1582    #[serde(rename = "certUrl", default, skip_serializing_if = "Option::is_none")]
1583    pub cert_url: Option<String>,
1584    /// The hex string of signed exchange signature cert sha256.
1585    #[serde(
1586        rename = "certSha256",
1587        default,
1588        skip_serializing_if = "Option::is_none"
1589    )]
1590    pub cert_sha256: Option<String>,
1591    /// Signed exchange signature validity Url.
1592    #[serde(rename = "validityUrl")]
1593    pub validity_url: String,
1594    /// Signed exchange signature date.
1595    pub date: i64,
1596    /// Signed exchange signature expires.
1597    pub expires: i64,
1598    /// The encoded certificates.
1599    #[serde(default, skip_serializing_if = "Option::is_none")]
1600    pub certificates: Option<Vec<String>>,
1601}
1602
1603/// Information about a signed exchange header.
1604/// <https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation>
1605///
1606/// Experimental: may change without notice.
1607#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1608pub struct SignedExchangeHeader {
1609    /// Signed exchange request URL.
1610    #[serde(rename = "requestUrl")]
1611    pub request_url: String,
1612    /// Signed exchange response code.
1613    #[serde(rename = "responseCode")]
1614    pub response_code: i64,
1615    /// Signed exchange response headers.
1616    #[serde(rename = "responseHeaders")]
1617    pub response_headers: Headers,
1618    /// Signed exchange response signature.
1619    pub signatures: Vec<SignedExchangeSignature>,
1620    /// Signed exchange header integrity hash in the form of
1621    /// `sha256-\<base64-hash-value\>`.
1622    #[serde(rename = "headerIntegrity")]
1623    pub header_integrity: String,
1624}
1625
1626/// Field type for a signed exchange related error.
1627///
1628/// Experimental: may change without notice.
1629#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1630pub enum SignedExchangeErrorField {
1631    /// `signatureSig`
1632    #[serde(rename = "signatureSig")]
1633    SignatureSig,
1634    /// `signatureIntegrity`
1635    #[serde(rename = "signatureIntegrity")]
1636    SignatureIntegrity,
1637    /// `signatureCertUrl`
1638    #[serde(rename = "signatureCertUrl")]
1639    SignatureCertUrl,
1640    /// `signatureCertSha256`
1641    #[serde(rename = "signatureCertSha256")]
1642    SignatureCertSha256,
1643    /// `signatureValidityUrl`
1644    #[serde(rename = "signatureValidityUrl")]
1645    SignatureValidityUrl,
1646    /// `signatureTimestamps`
1647    #[serde(rename = "signatureTimestamps")]
1648    SignatureTimestamps,
1649    /// A value this vendored schema does not list. Chrome adds values ahead of
1650    /// the published protocol, so an unrecognised one is kept as it arrived
1651    /// rather than failing the payload it came in.
1652    #[serde(untagged)]
1653    Unrecognized(String),
1654}
1655
1656/// Information about a signed exchange response.
1657///
1658/// Experimental: may change without notice.
1659#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1660pub struct SignedExchangeError {
1661    /// Error message.
1662    pub message: String,
1663    /// The index of the signature which caused the error.
1664    #[serde(
1665        rename = "signatureIndex",
1666        default,
1667        skip_serializing_if = "Option::is_none"
1668    )]
1669    pub signature_index: Option<i64>,
1670    /// The field which caused the error.
1671    #[serde(
1672        rename = "errorField",
1673        default,
1674        skip_serializing_if = "Option::is_none"
1675    )]
1676    pub error_field: Option<SignedExchangeErrorField>,
1677}
1678
1679/// Information about a signed exchange response.
1680///
1681/// Experimental: may change without notice.
1682#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1683pub struct SignedExchangeInfo {
1684    /// The outer response of signed HTTP exchange which was received from
1685    /// network.
1686    #[serde(rename = "outerResponse")]
1687    pub outer_response: Response,
1688    /// Whether network response for the signed exchange was accompanied by extra
1689    /// headers.
1690    #[serde(rename = "hasExtraInfo")]
1691    pub has_extra_info: bool,
1692    /// Information about the signed exchange header.
1693    #[serde(default, skip_serializing_if = "Option::is_none")]
1694    pub header: Option<SignedExchangeHeader>,
1695    /// Security details for the signed exchange header.
1696    #[serde(
1697        rename = "securityDetails",
1698        default,
1699        skip_serializing_if = "Option::is_none"
1700    )]
1701    pub security_details: Option<SecurityDetails>,
1702    /// Errors occurred while handling the signed exchange.
1703    #[serde(default, skip_serializing_if = "Option::is_none")]
1704    pub errors: Option<Vec<SignedExchangeError>>,
1705}
1706
1707/// Experimental: may change without notice.
1708#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1709pub struct NetworkConditions {
1710    /// Only matching requests will be affected by these conditions. Patterns use
1711    /// the URLPattern constructor string syntax
1712    /// (<https://urlpattern.spec.whatwg.org/>) and must be absolute. If the
1713    /// pattern is empty, all requests are matched (including p2p connections).
1714    #[serde(rename = "urlPattern")]
1715    pub url_pattern: String,
1716    /// Minimum latency from request sent to response headers received (ms).
1717    pub latency: f64,
1718    /// Maximal aggregated download throughput (bytes/sec). -1 disables download
1719    /// throttling.
1720    #[serde(rename = "downloadThroughput")]
1721    pub download_throughput: f64,
1722    /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload
1723    /// throttling.
1724    #[serde(rename = "uploadThroughput")]
1725    pub upload_throughput: f64,
1726    /// Connection type if known.
1727    #[serde(
1728        rename = "connectionType",
1729        default,
1730        skip_serializing_if = "Option::is_none"
1731    )]
1732    pub connection_type: Option<ConnectionType>,
1733    /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100
1734    /// drops all the packets.
1735    #[serde(
1736        rename = "packetLoss",
1737        default,
1738        skip_serializing_if = "Option::is_none"
1739    )]
1740    pub packet_loss: Option<f64>,
1741    /// WebRTC packet queue length (packet). 0 removes any queue length
1742    /// limitations.
1743    #[serde(
1744        rename = "packetQueueLength",
1745        default,
1746        skip_serializing_if = "Option::is_none"
1747    )]
1748    pub packet_queue_length: Option<i64>,
1749    /// WebRTC packetReordering feature.
1750    #[serde(
1751        rename = "packetReordering",
1752        default,
1753        skip_serializing_if = "Option::is_none"
1754    )]
1755    pub packet_reordering: Option<bool>,
1756    /// True to emulate internet disconnection.
1757    #[serde(default, skip_serializing_if = "Option::is_none")]
1758    pub offline: Option<bool>,
1759}
1760
1761/// Experimental: may change without notice.
1762#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1763pub struct BlockPattern {
1764    /// URL pattern to match. Patterns use the URLPattern constructor string
1765    /// syntax (<https://urlpattern.spec.whatwg.org/>) and must be absolute.
1766    /// Example: `*://*:*/*.css`.
1767    #[serde(rename = "urlPattern")]
1768    pub url_pattern: String,
1769    /// Whether or not to block the pattern. If false, a matching request will not
1770    /// be blocked even if it matches a later `BlockPattern`.
1771    pub block: bool,
1772}
1773
1774/// Experimental: may change without notice.
1775#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1776pub enum DirectSocketDnsQueryType {
1777    /// `ipv4`
1778    #[serde(rename = "ipv4")]
1779    Ipv4,
1780    /// `ipv6`
1781    #[serde(rename = "ipv6")]
1782    Ipv6,
1783    /// A value this vendored schema does not list. Chrome adds values ahead of
1784    /// the published protocol, so an unrecognised one is kept as it arrived
1785    /// rather than failing the payload it came in.
1786    #[serde(untagged)]
1787    Unrecognized(String),
1788}
1789
1790/// Experimental: may change without notice.
1791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1792pub struct DirectTcpSocketOptions {
1793    /// TCP_NODELAY option
1794    #[serde(rename = "noDelay")]
1795    pub no_delay: bool,
1796    /// Expected to be unsigned integer.
1797    #[serde(
1798        rename = "keepAliveDelay",
1799        default,
1800        skip_serializing_if = "Option::is_none"
1801    )]
1802    pub keep_alive_delay: Option<f64>,
1803    /// Expected to be unsigned integer.
1804    #[serde(
1805        rename = "sendBufferSize",
1806        default,
1807        skip_serializing_if = "Option::is_none"
1808    )]
1809    pub send_buffer_size: Option<f64>,
1810    /// Expected to be unsigned integer.
1811    #[serde(
1812        rename = "receiveBufferSize",
1813        default,
1814        skip_serializing_if = "Option::is_none"
1815    )]
1816    pub receive_buffer_size: Option<f64>,
1817    #[serde(
1818        rename = "dnsQueryType",
1819        default,
1820        skip_serializing_if = "Option::is_none"
1821    )]
1822    pub dns_query_type: Option<DirectSocketDnsQueryType>,
1823}
1824
1825/// Experimental: may change without notice.
1826#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1827pub struct DirectUdpSocketOptions {
1828    #[serde(
1829        rename = "remoteAddr",
1830        default,
1831        skip_serializing_if = "Option::is_none"
1832    )]
1833    pub remote_addr: Option<String>,
1834    /// Unsigned int 16.
1835    #[serde(
1836        rename = "remotePort",
1837        default,
1838        skip_serializing_if = "Option::is_none"
1839    )]
1840    pub remote_port: Option<i64>,
1841    #[serde(rename = "localAddr", default, skip_serializing_if = "Option::is_none")]
1842    pub local_addr: Option<String>,
1843    /// Unsigned int 16.
1844    #[serde(rename = "localPort", default, skip_serializing_if = "Option::is_none")]
1845    pub local_port: Option<i64>,
1846    #[serde(
1847        rename = "dnsQueryType",
1848        default,
1849        skip_serializing_if = "Option::is_none"
1850    )]
1851    pub dns_query_type: Option<DirectSocketDnsQueryType>,
1852    /// Expected to be unsigned integer.
1853    #[serde(
1854        rename = "sendBufferSize",
1855        default,
1856        skip_serializing_if = "Option::is_none"
1857    )]
1858    pub send_buffer_size: Option<f64>,
1859    /// Expected to be unsigned integer.
1860    #[serde(
1861        rename = "receiveBufferSize",
1862        default,
1863        skip_serializing_if = "Option::is_none"
1864    )]
1865    pub receive_buffer_size: Option<f64>,
1866    #[serde(
1867        rename = "multicastLoopback",
1868        default,
1869        skip_serializing_if = "Option::is_none"
1870    )]
1871    pub multicast_loopback: Option<bool>,
1872    /// Unsigned int 8.
1873    #[serde(
1874        rename = "multicastTimeToLive",
1875        default,
1876        skip_serializing_if = "Option::is_none"
1877    )]
1878    pub multicast_time_to_live: Option<i64>,
1879    #[serde(
1880        rename = "multicastAllowAddressSharing",
1881        default,
1882        skip_serializing_if = "Option::is_none"
1883    )]
1884    pub multicast_allow_address_sharing: Option<bool>,
1885}
1886
1887/// Experimental: may change without notice.
1888#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1889pub struct DirectUdpMessage {
1890    pub data: String,
1891    /// Null for connected mode.
1892    #[serde(
1893        rename = "remoteAddr",
1894        default,
1895        skip_serializing_if = "Option::is_none"
1896    )]
1897    pub remote_addr: Option<String>,
1898    /// Null for connected mode. Expected to be unsigned integer.
1899    #[serde(
1900        rename = "remotePort",
1901        default,
1902        skip_serializing_if = "Option::is_none"
1903    )]
1904    pub remote_port: Option<i64>,
1905}
1906
1907/// Experimental: may change without notice.
1908#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1909pub enum LocalNetworkAccessRequestPolicy {
1910    /// `Allow`
1911    Allow,
1912    /// `BlockFromInsecureToMorePrivate`
1913    BlockFromInsecureToMorePrivate,
1914    /// `WarnFromInsecureToMorePrivate`
1915    WarnFromInsecureToMorePrivate,
1916    /// `PermissionBlock`
1917    PermissionBlock,
1918    /// `PermissionWarn`
1919    PermissionWarn,
1920    /// A value this vendored schema does not list. Chrome adds values ahead of
1921    /// the published protocol, so an unrecognised one is kept as it arrived
1922    /// rather than failing the payload it came in.
1923    #[serde(untagged)]
1924    Unrecognized(String),
1925}
1926
1927/// Experimental: may change without notice.
1928#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1929pub enum IpAddressSpace {
1930    /// `Loopback`
1931    Loopback,
1932    /// `Local`
1933    Local,
1934    /// `Public`
1935    Public,
1936    /// `Unknown`
1937    Unknown,
1938    /// A value this vendored schema does not list. Chrome adds values ahead of
1939    /// the published protocol, so an unrecognised one is kept as it arrived
1940    /// rather than failing the payload it came in.
1941    #[serde(untagged)]
1942    Unrecognized(String),
1943}
1944
1945/// Experimental: may change without notice.
1946#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1947pub struct ConnectTiming {
1948    /// Timing's requestTime is a baseline in seconds, while the other numbers are
1949    /// ticks in milliseconds relatively to this requestTime. Matches
1950    /// ResourceTiming's requestTime for the same request (but not for redirected
1951    /// requests).
1952    #[serde(rename = "requestTime")]
1953    pub request_time: f64,
1954}
1955
1956/// Experimental: may change without notice.
1957#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1958pub struct ClientSecurityState {
1959    #[serde(rename = "initiatorIsSecureContext")]
1960    pub initiator_is_secure_context: bool,
1961    #[serde(rename = "initiatorIPAddressSpace")]
1962    pub initiator_ip_address_space: IpAddressSpace,
1963    #[serde(rename = "localNetworkAccessRequestPolicy")]
1964    pub local_network_access_request_policy: LocalNetworkAccessRequestPolicy,
1965}
1966
1967/// Identifies the script on the stack that caused a resource or element to be
1968/// labeled as an ad. For resources, this indicates the context that triggered
1969/// the fetch. For elements, this indicates the context that caused the
1970/// element to be appended to the DOM.
1971///
1972/// Experimental: may change without notice.
1973#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1974pub struct AdScriptIdentifier {
1975    /// The script's V8 identifier.
1976    #[serde(rename = "scriptId")]
1977    pub script_id: crate::protocol::runtime::ScriptId,
1978    /// V8's debugging ID for the v8::Context.
1979    #[serde(rename = "debuggerId")]
1980    pub debugger_id: crate::protocol::runtime::UniqueDebuggerId,
1981    /// The script's url (or generated name based on id if inline script).
1982    pub name: String,
1983}
1984
1985/// Encapsulates the script ancestry and the root script filter list rule that
1986/// caused the resource or element to be labeled as an ad.
1987///
1988/// Experimental: may change without notice.
1989#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
1990pub struct AdAncestry {
1991    /// A chain of `AdScriptIdentifier`s representing the ancestry of an ad script
1992    /// that led to the creation of a resource or element. The chain is ordered
1993    /// from the script itself (lowest level) up to its root ancestor that was
1994    /// flagged by a filter list.
1995    #[serde(rename = "ancestryChain")]
1996    pub ancestry_chain: Vec<AdScriptIdentifier>,
1997    /// The filter list rule that caused the root (last) script in `ancestryChain`
1998    /// to be tagged as an ad.
1999    #[serde(
2000        rename = "rootScriptFilterlistRule",
2001        default,
2002        skip_serializing_if = "Option::is_none"
2003    )]
2004    pub root_script_filterlist_rule: Option<String>,
2005}
2006
2007/// Represents the provenance of an ad resource or element. Only one of
2008/// `filterlistRule` or `adScriptAncestry` can be set. If `filterlistRule` is
2009/// provided, the resource URL directly matches a filter list rule. If
2010/// `adScriptAncestry` is provided, an ad script initiated the resource fetch
2011/// or appended the element to the DOM. If neither is provided, the entity is
2012/// known to be an ad, but provenance tracking information is unavailable.
2013///
2014/// Experimental: may change without notice.
2015#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2016pub struct AdProvenance {
2017    /// The filterlist rule that matched, if any.
2018    #[serde(
2019        rename = "filterlistRule",
2020        default,
2021        skip_serializing_if = "Option::is_none"
2022    )]
2023    pub filterlist_rule: Option<String>,
2024    /// The script ancestry that created the ad, if any. Note: depending on the
2025    /// context, this may represent the full ancestry up to the root script, or it
2026    /// may contain only one script representing the immediate ancestor.
2027    #[serde(
2028        rename = "adScriptAncestry",
2029        default,
2030        skip_serializing_if = "Option::is_none"
2031    )]
2032    pub ad_script_ancestry: Option<AdAncestry>,
2033}
2034
2035/// Experimental: may change without notice.
2036#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2037pub enum CrossOriginOpenerPolicyValue {
2038    /// `SameOrigin`
2039    SameOrigin,
2040    /// `SameOriginAllowPopups`
2041    SameOriginAllowPopups,
2042    /// `RestrictProperties`
2043    RestrictProperties,
2044    /// `UnsafeNone`
2045    UnsafeNone,
2046    /// `SameOriginPlusCoep`
2047    SameOriginPlusCoep,
2048    /// `RestrictPropertiesPlusCoep`
2049    RestrictPropertiesPlusCoep,
2050    /// `NoopenerAllowPopups`
2051    NoopenerAllowPopups,
2052    /// A value this vendored schema does not list. Chrome adds values ahead of
2053    /// the published protocol, so an unrecognised one is kept as it arrived
2054    /// rather than failing the payload it came in.
2055    #[serde(untagged)]
2056    Unrecognized(String),
2057}
2058
2059/// Experimental: may change without notice.
2060#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2061pub struct CrossOriginOpenerPolicyStatus {
2062    pub value: CrossOriginOpenerPolicyValue,
2063    #[serde(rename = "reportOnlyValue")]
2064    pub report_only_value: CrossOriginOpenerPolicyValue,
2065    #[serde(
2066        rename = "reportingEndpoint",
2067        default,
2068        skip_serializing_if = "Option::is_none"
2069    )]
2070    pub reporting_endpoint: Option<String>,
2071    #[serde(
2072        rename = "reportOnlyReportingEndpoint",
2073        default,
2074        skip_serializing_if = "Option::is_none"
2075    )]
2076    pub report_only_reporting_endpoint: Option<String>,
2077}
2078
2079/// Experimental: may change without notice.
2080#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2081pub enum CrossOriginEmbedderPolicyValue {
2082    /// `None`
2083    None,
2084    /// `Credentialless`
2085    Credentialless,
2086    /// `RequireCorp`
2087    RequireCorp,
2088    /// A value this vendored schema does not list. Chrome adds values ahead of
2089    /// the published protocol, so an unrecognised one is kept as it arrived
2090    /// rather than failing the payload it came in.
2091    #[serde(untagged)]
2092    Unrecognized(String),
2093}
2094
2095/// Experimental: may change without notice.
2096#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2097pub struct CrossOriginEmbedderPolicyStatus {
2098    pub value: CrossOriginEmbedderPolicyValue,
2099    #[serde(rename = "reportOnlyValue")]
2100    pub report_only_value: CrossOriginEmbedderPolicyValue,
2101    #[serde(
2102        rename = "reportingEndpoint",
2103        default,
2104        skip_serializing_if = "Option::is_none"
2105    )]
2106    pub reporting_endpoint: Option<String>,
2107    #[serde(
2108        rename = "reportOnlyReportingEndpoint",
2109        default,
2110        skip_serializing_if = "Option::is_none"
2111    )]
2112    pub report_only_reporting_endpoint: Option<String>,
2113}
2114
2115/// Experimental: may change without notice.
2116#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2117pub enum ContentSecurityPolicySource {
2118    /// `HTTP`
2119    #[serde(rename = "HTTP")]
2120    Http,
2121    /// `Meta`
2122    Meta,
2123    /// A value this vendored schema does not list. Chrome adds values ahead of
2124    /// the published protocol, so an unrecognised one is kept as it arrived
2125    /// rather than failing the payload it came in.
2126    #[serde(untagged)]
2127    Unrecognized(String),
2128}
2129
2130/// Experimental: may change without notice.
2131#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2132pub struct ContentSecurityPolicyStatus {
2133    #[serde(rename = "effectiveDirectives")]
2134    pub effective_directives: String,
2135    #[serde(rename = "isEnforced")]
2136    pub is_enforced: bool,
2137    pub source: ContentSecurityPolicySource,
2138}
2139
2140/// Experimental: may change without notice.
2141#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2142pub struct SecurityIsolationStatus {
2143    #[serde(default, skip_serializing_if = "Option::is_none")]
2144    pub coop: Option<CrossOriginOpenerPolicyStatus>,
2145    #[serde(default, skip_serializing_if = "Option::is_none")]
2146    pub coep: Option<CrossOriginEmbedderPolicyStatus>,
2147    #[serde(default, skip_serializing_if = "Option::is_none")]
2148    pub csp: Option<Vec<ContentSecurityPolicyStatus>>,
2149}
2150
2151/// The status of a Reporting API report.
2152///
2153/// Experimental: may change without notice.
2154#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2155pub enum ReportStatus {
2156    /// `Queued`
2157    Queued,
2158    /// `Pending`
2159    Pending,
2160    /// `MarkedForRemoval`
2161    MarkedForRemoval,
2162    /// `Success`
2163    Success,
2164    /// A value this vendored schema does not list. Chrome adds values ahead of
2165    /// the published protocol, so an unrecognised one is kept as it arrived
2166    /// rather than failing the payload it came in.
2167    #[serde(untagged)]
2168    Unrecognized(String),
2169}
2170
2171/// Experimental: may change without notice.
2172pub type ReportId = String;
2173
2174/// An object representing a report generated by the Reporting API.
2175///
2176/// Experimental: may change without notice.
2177#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2178pub struct ReportingApiReport {
2179    pub id: ReportId,
2180    /// The URL of the document that triggered the report.
2181    #[serde(rename = "initiatorUrl")]
2182    pub initiator_url: String,
2183    /// The name of the endpoint group that should be used to deliver the report.
2184    pub destination: String,
2185    /// The type of the report (specifies the set of data that is contained in the
2186    /// report body).
2187    pub r#type: String,
2188    /// When the report was generated.
2189    pub timestamp: TimeSinceEpoch,
2190    /// How many uploads deep the related request was.
2191    pub depth: i64,
2192    /// The number of delivery attempts made so far, not including an active
2193    /// attempt.
2194    #[serde(rename = "completedAttempts")]
2195    pub completed_attempts: i64,
2196    pub body: serde_json::Value,
2197    pub status: ReportStatus,
2198}
2199
2200/// Experimental: may change without notice.
2201#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2202pub struct ReportingApiEndpoint {
2203    /// The URL of the endpoint to which reports may be delivered.
2204    pub url: String,
2205    /// Name of the endpoint group.
2206    #[serde(rename = "groupName")]
2207    pub group_name: String,
2208}
2209
2210/// Unique identifier for a device bound session.
2211///
2212/// Experimental: may change without notice.
2213#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2214pub struct DeviceBoundSessionKey {
2215    /// The site the session is set up for.
2216    pub site: String,
2217    /// The id of the session.
2218    pub id: String,
2219}
2220
2221/// How a device bound session was used during a request.
2222///
2223/// Experimental: may change without notice.
2224#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2225pub struct DeviceBoundSessionWithUsage {
2226    /// The key for the session.
2227    #[serde(rename = "sessionKey")]
2228    pub session_key: DeviceBoundSessionKey,
2229    /// How the session was used (or not used).
2230    pub usage: DeviceBoundSessionWithUsageUsage,
2231}
2232
2233/// The values `usage` accepts on `DeviceBoundSessionWithUsage`.
2234#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2235pub enum DeviceBoundSessionWithUsageUsage {
2236    /// `NotInScope`
2237    NotInScope,
2238    /// `InScopeRefreshNotYetNeeded`
2239    InScopeRefreshNotYetNeeded,
2240    /// `InScopeRefreshNotAllowed`
2241    InScopeRefreshNotAllowed,
2242    /// `ProactiveRefreshNotPossible`
2243    ProactiveRefreshNotPossible,
2244    /// `ProactiveRefreshAttempted`
2245    ProactiveRefreshAttempted,
2246    /// `Deferred`
2247    Deferred,
2248    /// A value this vendored schema does not list. Chrome adds values ahead of
2249    /// the published protocol, so an unrecognised one is kept as it arrived
2250    /// rather than failing the payload it came in.
2251    #[serde(untagged)]
2252    Unrecognized(String),
2253}
2254
2255/// A device bound session's cookie craving.
2256///
2257/// Experimental: may change without notice.
2258#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2259pub struct DeviceBoundSessionCookieCraving {
2260    /// The name of the craving.
2261    pub name: String,
2262    /// The domain of the craving.
2263    pub domain: String,
2264    /// The path of the craving.
2265    pub path: String,
2266    /// The `Secure` attribute of the craving attributes.
2267    pub secure: bool,
2268    /// The `HttpOnly` attribute of the craving attributes.
2269    #[serde(rename = "httpOnly")]
2270    pub http_only: bool,
2271    /// The `SameSite` attribute of the craving attributes.
2272    #[serde(rename = "sameSite", default, skip_serializing_if = "Option::is_none")]
2273    pub same_site: Option<CookieSameSite>,
2274}
2275
2276/// A device bound session's inclusion URL rule.
2277///
2278/// Experimental: may change without notice.
2279#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2280pub struct DeviceBoundSessionUrlRule {
2281    /// See comments on
2282    /// `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`.
2283    #[serde(rename = "ruleType")]
2284    pub rule_type: DeviceBoundSessionUrlRuleRuleType,
2285    /// See comments on
2286    /// `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`.
2287    #[serde(rename = "hostPattern")]
2288    pub host_pattern: String,
2289    /// See comments on
2290    /// `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`.
2291    #[serde(rename = "pathPrefix")]
2292    pub path_prefix: String,
2293}
2294
2295/// The values `ruleType` accepts on `DeviceBoundSessionUrlRule`.
2296#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2297pub enum DeviceBoundSessionUrlRuleRuleType {
2298    /// `Exclude`
2299    Exclude,
2300    /// `Include`
2301    Include,
2302    /// A value this vendored schema does not list. Chrome adds values ahead of
2303    /// the published protocol, so an unrecognised one is kept as it arrived
2304    /// rather than failing the payload it came in.
2305    #[serde(untagged)]
2306    Unrecognized(String),
2307}
2308
2309/// A device bound session's inclusion rules.
2310///
2311/// Experimental: may change without notice.
2312#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2313pub struct DeviceBoundSessionInclusionRules {
2314    /// See comments on
2315    /// `net::device_bound_sessions::SessionInclusionRules::origin_`.
2316    pub origin: String,
2317    /// Whether the whole site is included. See comments on
2318    /// `net::device_bound_sessions::SessionInclusionRules::include_site_` for
2319    /// more details; this boolean is true if that value is populated.
2320    #[serde(rename = "includeSite")]
2321    pub include_site: bool,
2322    /// See comments on
2323    /// `net::device_bound_sessions::SessionInclusionRules::url_rules_`.
2324    #[serde(rename = "urlRules")]
2325    pub url_rules: Vec<DeviceBoundSessionUrlRule>,
2326}
2327
2328/// A device bound session.
2329///
2330/// Experimental: may change without notice.
2331#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2332pub struct DeviceBoundSession {
2333    /// The site and session ID of the session.
2334    pub key: DeviceBoundSessionKey,
2335    /// See comments on `net::device_bound_sessions::Session::refresh_url_`.
2336    #[serde(rename = "refreshUrl")]
2337    pub refresh_url: String,
2338    /// See comments on `net::device_bound_sessions::Session::inclusion_rules_`.
2339    #[serde(rename = "inclusionRules")]
2340    pub inclusion_rules: DeviceBoundSessionInclusionRules,
2341    /// See comments on `net::device_bound_sessions::Session::cookie_cravings_`.
2342    #[serde(rename = "cookieCravings")]
2343    pub cookie_cravings: Vec<DeviceBoundSessionCookieCraving>,
2344    /// See comments on `net::device_bound_sessions::Session::expiry_date_`.
2345    #[serde(rename = "expiryDate")]
2346    pub expiry_date: TimeSinceEpoch,
2347    /// See comments on `net::device_bound_sessions::Session::cached_challenge__`.
2348    #[serde(
2349        rename = "cachedChallenge",
2350        default,
2351        skip_serializing_if = "Option::is_none"
2352    )]
2353    pub cached_challenge: Option<String>,
2354    /// See comments on
2355    /// `net::device_bound_sessions::Session::allowed_refresh_initiators_`.
2356    #[serde(rename = "allowedRefreshInitiators")]
2357    pub allowed_refresh_initiators: Vec<String>,
2358}
2359
2360/// A unique identifier for a device bound session event.
2361///
2362/// Experimental: may change without notice.
2363pub type DeviceBoundSessionEventId = String;
2364
2365/// A fetch result for a device bound session creation or refresh.
2366/// LINT.IfChange(DeviceBoundSessionFetchResult)
2367///
2368/// Experimental: may change without notice.
2369#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2370pub enum DeviceBoundSessionFetchResult {
2371    /// `Success`
2372    Success,
2373    /// `SigningKeyGenerationError`
2374    SigningKeyGenerationError,
2375    /// `AttestationKeyGenerationError`
2376    AttestationKeyGenerationError,
2377    /// `SigningError`
2378    SigningError,
2379    /// `TransientSigningError`
2380    TransientSigningError,
2381    /// `ServerRequestedTermination`
2382    ServerRequestedTermination,
2383    /// `InvalidSessionId`
2384    InvalidSessionId,
2385    /// `InvalidChallenge`
2386    InvalidChallenge,
2387    /// `TooManyChallenges`
2388    TooManyChallenges,
2389    /// `InvalidFetcherUrl`
2390    InvalidFetcherUrl,
2391    /// `InvalidRefreshUrl`
2392    InvalidRefreshUrl,
2393    /// `TransientHttpError`
2394    TransientHttpError,
2395    /// `ScopeOriginSameSiteMismatch`
2396    ScopeOriginSameSiteMismatch,
2397    /// `RefreshUrlSameSiteMismatch`
2398    RefreshUrlSameSiteMismatch,
2399    /// `MismatchedSessionId`
2400    MismatchedSessionId,
2401    /// `MissingScope`
2402    MissingScope,
2403    /// `NoCredentials`
2404    NoCredentials,
2405    /// `SubdomainRegistrationWellKnownUnavailable`
2406    SubdomainRegistrationWellKnownUnavailable,
2407    /// `SubdomainRegistrationUnauthorized`
2408    SubdomainRegistrationUnauthorized,
2409    /// `SubdomainRegistrationWellKnownMalformed`
2410    SubdomainRegistrationWellKnownMalformed,
2411    /// `SessionProviderWellKnownUnavailable`
2412    SessionProviderWellKnownUnavailable,
2413    /// `RelyingPartyWellKnownUnavailable`
2414    RelyingPartyWellKnownUnavailable,
2415    /// `FederatedKeyThumbprintMismatch`
2416    FederatedKeyThumbprintMismatch,
2417    /// `InvalidFederatedSessionUrl`
2418    InvalidFederatedSessionUrl,
2419    /// `InvalidFederatedKey`
2420    InvalidFederatedKey,
2421    /// `TooManyRelyingOriginLabels`
2422    TooManyRelyingOriginLabels,
2423    /// `BoundCookieSetForbidden`
2424    BoundCookieSetForbidden,
2425    /// `NetError`
2426    NetError,
2427    /// `ProxyError`
2428    ProxyError,
2429    /// `EmptySessionConfig`
2430    EmptySessionConfig,
2431    /// `InvalidCredentialsConfig`
2432    InvalidCredentialsConfig,
2433    /// `InvalidCredentialsType`
2434    InvalidCredentialsType,
2435    /// `InvalidCredentialsEmptyName`
2436    InvalidCredentialsEmptyName,
2437    /// `InvalidCredentialsCookie`
2438    InvalidCredentialsCookie,
2439    /// `PersistentHttpError`
2440    PersistentHttpError,
2441    /// `RegistrationAttemptedChallenge`
2442    RegistrationAttemptedChallenge,
2443    /// `InvalidScopeOrigin`
2444    InvalidScopeOrigin,
2445    /// `ScopeOriginContainsPath`
2446    ScopeOriginContainsPath,
2447    /// `RefreshInitiatorNotString`
2448    RefreshInitiatorNotString,
2449    /// `RefreshInitiatorInvalidHostPattern`
2450    RefreshInitiatorInvalidHostPattern,
2451    /// `InvalidScopeSpecification`
2452    InvalidScopeSpecification,
2453    /// `MissingScopeSpecificationType`
2454    MissingScopeSpecificationType,
2455    /// `EmptyScopeSpecificationDomain`
2456    EmptyScopeSpecificationDomain,
2457    /// `EmptyScopeSpecificationPath`
2458    EmptyScopeSpecificationPath,
2459    /// `InvalidScopeSpecificationType`
2460    InvalidScopeSpecificationType,
2461    /// `InvalidScopeIncludeSite`
2462    InvalidScopeIncludeSite,
2463    /// `MissingScopeIncludeSite`
2464    MissingScopeIncludeSite,
2465    /// `FederatedNotAuthorizedByProvider`
2466    FederatedNotAuthorizedByProvider,
2467    /// `FederatedNotAuthorizedByRelyingParty`
2468    FederatedNotAuthorizedByRelyingParty,
2469    /// `SessionProviderWellKnownMalformed`
2470    SessionProviderWellKnownMalformed,
2471    /// `SessionProviderWellKnownHasProviderOrigin`
2472    SessionProviderWellKnownHasProviderOrigin,
2473    /// `RelyingPartyWellKnownMalformed`
2474    RelyingPartyWellKnownMalformed,
2475    /// `RelyingPartyWellKnownHasRelyingOrigins`
2476    RelyingPartyWellKnownHasRelyingOrigins,
2477    /// `InvalidFederatedSessionProviderSessionMissing`
2478    InvalidFederatedSessionProviderSessionMissing,
2479    /// `InvalidFederatedSessionWrongProviderOrigin`
2480    InvalidFederatedSessionWrongProviderOrigin,
2481    /// `InvalidCredentialsCookieCreationTime`
2482    InvalidCredentialsCookieCreationTime,
2483    /// `InvalidCredentialsCookieName`
2484    InvalidCredentialsCookieName,
2485    /// `InvalidCredentialsCookieParsing`
2486    InvalidCredentialsCookieParsing,
2487    /// `InvalidCredentialsCookieUnpermittedAttribute`
2488    InvalidCredentialsCookieUnpermittedAttribute,
2489    /// `InvalidCredentialsCookieInvalidDomain`
2490    InvalidCredentialsCookieInvalidDomain,
2491    /// `InvalidCredentialsCookiePrefix`
2492    InvalidCredentialsCookiePrefix,
2493    /// `InvalidScopeRulePath`
2494    InvalidScopeRulePath,
2495    /// `InvalidScopeRuleHostPattern`
2496    InvalidScopeRuleHostPattern,
2497    /// `ScopeRuleOriginScopedHostPatternMismatch`
2498    ScopeRuleOriginScopedHostPatternMismatch,
2499    /// `ScopeRuleSiteScopedHostPatternMismatch`
2500    ScopeRuleSiteScopedHostPatternMismatch,
2501    /// `SigningQuotaExceeded`
2502    SigningQuotaExceeded,
2503    /// `InvalidConfigJson`
2504    InvalidConfigJson,
2505    /// `InvalidFederatedSessionProviderFailedToRestoreKey`
2506    InvalidFederatedSessionProviderFailedToRestoreKey,
2507    /// `FailedToUnwrapKey`
2508    FailedToUnwrapKey,
2509    /// `SessionDeletedDuringRefresh`
2510    SessionDeletedDuringRefresh,
2511    /// `CrossOriginRegistrationSiteNotIncluded`
2512    CrossOriginRegistrationSiteNotIncluded,
2513    /// `InvalidPreProvisionedKeyInitiatorMissing`
2514    InvalidPreProvisionedKeyInitiatorMissing,
2515    /// `PreProvisionedKeyAccessNotGranted`
2516    PreProvisionedKeyAccessNotGranted,
2517    /// `PreProvisionedKeyNotFound`
2518    PreProvisionedKeyNotFound,
2519    /// `AttestationCertificationError`
2520    AttestationCertificationError,
2521    /// `AttestationSigningError`
2522    AttestationSigningError,
2523    /// `FederatedRegistrationRedirected`
2524    FederatedRegistrationRedirected,
2525    /// A value this vendored schema does not list. Chrome adds values ahead of
2526    /// the published protocol, so an unrecognised one is kept as it arrived
2527    /// rather than failing the payload it came in.
2528    #[serde(untagged)]
2529    Unrecognized(String),
2530}
2531
2532/// Details about a failed device bound session network request.
2533///
2534/// Experimental: may change without notice.
2535#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2536pub struct DeviceBoundSessionFailedRequest {
2537    /// The failed request URL.
2538    #[serde(rename = "requestUrl")]
2539    pub request_url: String,
2540    /// The net error of the response if it was not OK.
2541    #[serde(rename = "netError", default, skip_serializing_if = "Option::is_none")]
2542    pub net_error: Option<String>,
2543    /// The response code if the net error was OK and the response code was not
2544    /// 200.
2545    #[serde(
2546        rename = "responseError",
2547        default,
2548        skip_serializing_if = "Option::is_none"
2549    )]
2550    pub response_error: Option<i64>,
2551    /// The body of the response if the net error was OK, the response code was
2552    /// not 200, and the response body was not empty.
2553    #[serde(
2554        rename = "responseErrorBody",
2555        default,
2556        skip_serializing_if = "Option::is_none"
2557    )]
2558    pub response_error_body: Option<String>,
2559}
2560
2561/// Session event details specific to creation.
2562///
2563/// Experimental: may change without notice.
2564#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2565pub struct CreationEventDetails {
2566    /// The result of the fetch attempt.
2567    #[serde(rename = "fetchResult")]
2568    pub fetch_result: DeviceBoundSessionFetchResult,
2569    /// The session if there was a newly created session. This is populated for
2570    /// all successful creation events.
2571    #[serde(
2572        rename = "newSession",
2573        default,
2574        skip_serializing_if = "Option::is_none"
2575    )]
2576    pub new_session: Option<DeviceBoundSession>,
2577    /// Details about a failed device bound session network request if there was
2578    /// one.
2579    #[serde(
2580        rename = "failedRequest",
2581        default,
2582        skip_serializing_if = "Option::is_none"
2583    )]
2584    pub failed_request: Option<DeviceBoundSessionFailedRequest>,
2585}
2586
2587/// Session event details specific to refresh.
2588///
2589/// Experimental: may change without notice.
2590#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2591pub struct RefreshEventDetails {
2592    /// The result of a refresh. LINT.IfChange(DeviceBoundSessionRefreshResult)
2593    #[serde(rename = "refreshResult")]
2594    pub refresh_result: RefreshEventDetailsRefreshResult,
2595    /// LINT.ThenChange(//net/device_bound_sessions/refresh_result.h:DeviceBoundSessionRefreshResult,//content/browser/devtools/protocol/network_handler.cc:DeviceBoundSessionRefreshResult)
2596    /// If there was a fetch attempt, the result of that.
2597    #[serde(
2598        rename = "fetchResult",
2599        default,
2600        skip_serializing_if = "Option::is_none"
2601    )]
2602    pub fetch_result: Option<DeviceBoundSessionFetchResult>,
2603    /// The session display if there was a newly created session. This is
2604    /// populated for any refresh event that modifies the session config.
2605    #[serde(
2606        rename = "newSession",
2607        default,
2608        skip_serializing_if = "Option::is_none"
2609    )]
2610    pub new_session: Option<DeviceBoundSession>,
2611    /// See comments on
2612    /// `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`.
2613    #[serde(rename = "wasFullyProactiveRefresh")]
2614    pub was_fully_proactive_refresh: bool,
2615    /// Details about a failed device bound session network request if there was
2616    /// one.
2617    #[serde(
2618        rename = "failedRequest",
2619        default,
2620        skip_serializing_if = "Option::is_none"
2621    )]
2622    pub failed_request: Option<DeviceBoundSessionFailedRequest>,
2623}
2624
2625/// The values `refreshResult` accepts on `RefreshEventDetails`.
2626#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2627pub enum RefreshEventDetailsRefreshResult {
2628    /// `Refreshed`
2629    Refreshed,
2630    /// `InitializedService`
2631    InitializedService,
2632    /// `Unreachable`
2633    Unreachable,
2634    /// `ServerError`
2635    ServerError,
2636    /// `FatalError`
2637    FatalError,
2638    /// `SigningQuotaExceeded`
2639    SigningQuotaExceeded,
2640    /// `RefreshedAsWaiter`
2641    RefreshedAsWaiter,
2642    /// `TransientSigningError`
2643    TransientSigningError,
2644    /// `InScopeRefreshNotYetNeeded`
2645    InScopeRefreshNotYetNeeded,
2646    /// `Canceled`
2647    Canceled,
2648    /// A value this vendored schema does not list. Chrome adds values ahead of
2649    /// the published protocol, so an unrecognised one is kept as it arrived
2650    /// rather than failing the payload it came in.
2651    #[serde(untagged)]
2652    Unrecognized(String),
2653}
2654
2655/// Session event details specific to termination.
2656///
2657/// Experimental: may change without notice.
2658#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2659pub struct TerminationEventDetails {
2660    /// The reason for a session being deleted.
2661    #[serde(rename = "deletionReason")]
2662    pub deletion_reason: TerminationEventDetailsDeletionReason,
2663}
2664
2665/// The values `deletionReason` accepts on `TerminationEventDetails`.
2666#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2667pub enum TerminationEventDetailsDeletionReason {
2668    /// `Expired`
2669    Expired,
2670    /// `FailedToRestoreKey`
2671    FailedToRestoreKey,
2672    /// `FailedToUnwrapKey`
2673    FailedToUnwrapKey,
2674    /// `StoragePartitionCleared`
2675    StoragePartitionCleared,
2676    /// `ClearBrowsingData`
2677    ClearBrowsingData,
2678    /// `ServerRequested`
2679    ServerRequested,
2680    /// `InvalidSessionParams`
2681    InvalidSessionParams,
2682    /// `RefreshFatalError`
2683    RefreshFatalError,
2684    /// `DevTools`
2685    DevTools,
2686    /// `Replaced`
2687    Replaced,
2688    /// A value this vendored schema does not list. Chrome adds values ahead of
2689    /// the published protocol, so an unrecognised one is kept as it arrived
2690    /// rather than failing the payload it came in.
2691    #[serde(untagged)]
2692    Unrecognized(String),
2693}
2694
2695/// Session event details specific to challenges.
2696///
2697/// Experimental: may change without notice.
2698#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2699pub struct ChallengeEventDetails {
2700    /// The result of a challenge.
2701    #[serde(rename = "challengeResult")]
2702    pub challenge_result: ChallengeEventDetailsChallengeResult,
2703    /// The challenge set.
2704    pub challenge: String,
2705}
2706
2707/// The values `challengeResult` accepts on `ChallengeEventDetails`.
2708#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2709pub enum ChallengeEventDetailsChallengeResult {
2710    /// `Success`
2711    Success,
2712    /// `NoSessionId`
2713    NoSessionId,
2714    /// `NoSessionMatch`
2715    NoSessionMatch,
2716    /// `CantSetBoundCookie`
2717    CantSetBoundCookie,
2718    /// A value this vendored schema does not list. Chrome adds values ahead of
2719    /// the published protocol, so an unrecognised one is kept as it arrived
2720    /// rather than failing the payload it came in.
2721    #[serde(untagged)]
2722    Unrecognized(String),
2723}
2724
2725/// An object providing the result of a network resource load.
2726///
2727/// Experimental: may change without notice.
2728#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2729pub struct LoadNetworkResourcePageResult {
2730    pub success: bool,
2731    /// Optional values used for error reporting.
2732    #[serde(rename = "netError", default, skip_serializing_if = "Option::is_none")]
2733    pub net_error: Option<f64>,
2734    #[serde(
2735        rename = "netErrorName",
2736        default,
2737        skip_serializing_if = "Option::is_none"
2738    )]
2739    pub net_error_name: Option<String>,
2740    #[serde(
2741        rename = "httpStatusCode",
2742        default,
2743        skip_serializing_if = "Option::is_none"
2744    )]
2745    pub http_status_code: Option<f64>,
2746    /// If successful, one of the following two fields holds the result.
2747    #[serde(default, skip_serializing_if = "Option::is_none")]
2748    pub stream: Option<crate::protocol::io::StreamHandle>,
2749    /// Response headers.
2750    #[serde(default, skip_serializing_if = "Option::is_none")]
2751    pub headers: Option<Headers>,
2752}
2753
2754/// An options object that may be extended later to better support CORS, CORB
2755/// and streaming.
2756///
2757/// Experimental: may change without notice.
2758#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2759pub struct LoadNetworkResourceOptions {
2760    #[serde(rename = "disableCache")]
2761    pub disable_cache: bool,
2762    #[serde(rename = "includeCredentials")]
2763    pub include_credentials: bool,
2764}
2765
2766/// Tells whether clearing browser cache is supported.
2767///
2768/// Deprecated in the protocol.
2769///
2770/// Parameters of `Network.canClearBrowserCache`.
2771#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2772pub struct CanClearBrowserCacheParams {}
2773
2774/// What `Network.canClearBrowserCache` answers with.
2775#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2776pub struct CanClearBrowserCacheReturns {
2777    /// True if browser cache can be cleared.
2778    pub result: bool,
2779}
2780
2781impl crate::typed::Command for CanClearBrowserCacheParams {
2782    const METHOD: &'static str = "Network.canClearBrowserCache";
2783    type Returns = CanClearBrowserCacheReturns;
2784}
2785
2786/// Tells whether clearing browser cookies is supported.
2787///
2788/// Deprecated in the protocol.
2789///
2790/// Parameters of `Network.canClearBrowserCookies`.
2791#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2792pub struct CanClearBrowserCookiesParams {}
2793
2794/// What `Network.canClearBrowserCookies` answers with.
2795#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2796pub struct CanClearBrowserCookiesReturns {
2797    /// True if browser cookies can be cleared.
2798    pub result: bool,
2799}
2800
2801impl crate::typed::Command for CanClearBrowserCookiesParams {
2802    const METHOD: &'static str = "Network.canClearBrowserCookies";
2803    type Returns = CanClearBrowserCookiesReturns;
2804}
2805
2806/// Tells whether emulation of network conditions is supported.
2807///
2808/// Deprecated in the protocol.
2809///
2810/// Parameters of `Network.canEmulateNetworkConditions`.
2811#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2812pub struct CanEmulateNetworkConditionsParams {}
2813
2814/// What `Network.canEmulateNetworkConditions` answers with.
2815#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2816pub struct CanEmulateNetworkConditionsReturns {
2817    /// True if emulation of network conditions is supported.
2818    pub result: bool,
2819}
2820
2821impl crate::typed::Command for CanEmulateNetworkConditionsParams {
2822    const METHOD: &'static str = "Network.canEmulateNetworkConditions";
2823    type Returns = CanEmulateNetworkConditionsReturns;
2824}
2825
2826/// Clears browser cache.
2827///
2828/// Parameters of `Network.clearBrowserCache`.
2829#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2830pub struct ClearBrowserCacheParams {}
2831
2832impl crate::typed::Command for ClearBrowserCacheParams {
2833    const METHOD: &'static str = "Network.clearBrowserCache";
2834    type Returns = crate::typed::NoReturns;
2835}
2836
2837/// Clears browser cookies.
2838///
2839/// Parameters of `Network.clearBrowserCookies`.
2840#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2841pub struct ClearBrowserCookiesParams {}
2842
2843impl crate::typed::Command for ClearBrowserCookiesParams {
2844    const METHOD: &'static str = "Network.clearBrowserCookies";
2845    type Returns = crate::typed::NoReturns;
2846}
2847
2848/// Deletes browser cookies with matching name and url or
2849/// domain/path/partitionKey pair.
2850///
2851/// Parameters of `Network.deleteCookies`.
2852#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2853pub struct DeleteCookiesParams {
2854    /// Name of the cookies to remove.
2855    pub name: String,
2856    /// If specified, deletes all the cookies with the given name where domain and
2857    /// path match provided URL.
2858    #[serde(default, skip_serializing_if = "Option::is_none")]
2859    pub url: Option<String>,
2860    /// If specified, deletes only cookies with the exact domain.
2861    #[serde(default, skip_serializing_if = "Option::is_none")]
2862    pub domain: Option<String>,
2863    /// If specified, deletes only cookies with the exact path.
2864    #[serde(default, skip_serializing_if = "Option::is_none")]
2865    pub path: Option<String>,
2866    /// If specified, deletes only cookies with the the given name and
2867    /// partitionKey where all partition key attributes match the cookie partition
2868    /// key attribute.
2869    ///
2870    /// Experimental: may change without notice.
2871    #[serde(
2872        rename = "partitionKey",
2873        default,
2874        skip_serializing_if = "Option::is_none"
2875    )]
2876    pub partition_key: Option<CookiePartitionKey>,
2877}
2878
2879impl crate::typed::Command for DeleteCookiesParams {
2880    const METHOD: &'static str = "Network.deleteCookies";
2881    type Returns = crate::typed::NoReturns;
2882}
2883
2884/// Disables network tracking, prevents network events from being sent to the
2885/// client.
2886///
2887/// Parameters of `Network.disable`.
2888#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2889pub struct DisableParams {}
2890
2891impl crate::typed::Command for DisableParams {
2892    const METHOD: &'static str = "Network.disable";
2893    type Returns = crate::typed::NoReturns;
2894}
2895
2896/// Activates emulation of network conditions. This command is deprecated in
2897/// favor of the emulateNetworkConditionsByRule and overrideNetworkState
2898/// commands, which can be used together to the same effect.
2899///
2900/// Deprecated in the protocol.
2901///
2902/// Parameters of `Network.emulateNetworkConditions`.
2903#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2904pub struct EmulateNetworkConditionsParams {
2905    /// True to emulate internet disconnection.
2906    pub offline: bool,
2907    /// Minimum latency from request sent to response headers received (ms).
2908    pub latency: f64,
2909    /// Maximal aggregated download throughput (bytes/sec). -1 disables download
2910    /// throttling.
2911    #[serde(rename = "downloadThroughput")]
2912    pub download_throughput: f64,
2913    /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload
2914    /// throttling.
2915    #[serde(rename = "uploadThroughput")]
2916    pub upload_throughput: f64,
2917    /// Connection type if known.
2918    #[serde(
2919        rename = "connectionType",
2920        default,
2921        skip_serializing_if = "Option::is_none"
2922    )]
2923    pub connection_type: Option<ConnectionType>,
2924    /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100
2925    /// drops all the packets.
2926    ///
2927    /// Experimental: may change without notice.
2928    #[serde(
2929        rename = "packetLoss",
2930        default,
2931        skip_serializing_if = "Option::is_none"
2932    )]
2933    pub packet_loss: Option<f64>,
2934    /// WebRTC packet queue length (packet). 0 removes any queue length
2935    /// limitations.
2936    ///
2937    /// Experimental: may change without notice.
2938    #[serde(
2939        rename = "packetQueueLength",
2940        default,
2941        skip_serializing_if = "Option::is_none"
2942    )]
2943    pub packet_queue_length: Option<i64>,
2944    /// WebRTC packetReordering feature.
2945    ///
2946    /// Experimental: may change without notice.
2947    #[serde(
2948        rename = "packetReordering",
2949        default,
2950        skip_serializing_if = "Option::is_none"
2951    )]
2952    pub packet_reordering: Option<bool>,
2953}
2954
2955impl crate::typed::Command for EmulateNetworkConditionsParams {
2956    const METHOD: &'static str = "Network.emulateNetworkConditions";
2957    type Returns = crate::typed::NoReturns;
2958}
2959
2960/// Activates emulation of network conditions for individual requests using
2961/// URL match patterns. Unlike the deprecated Network.emulateNetworkConditions
2962/// this method does not affect `navigator` state. Use
2963/// Network.overrideNetworkState to explicitly modify `navigator` behavior.
2964///
2965/// Experimental: may change without notice.
2966///
2967/// Parameters of `Network.emulateNetworkConditionsByRule`.
2968#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2969pub struct EmulateNetworkConditionsByRuleParams {
2970    /// True to emulate internet disconnection. Deprecated, use the offline
2971    /// property in matchedNetworkConditions or emulateOfflineServiceWorker
2972    /// instead.
2973    ///
2974    /// Deprecated in the protocol.
2975    #[serde(default, skip_serializing_if = "Option::is_none")]
2976    pub offline: Option<bool>,
2977    /// True to emulate offline service worker.
2978    #[serde(
2979        rename = "emulateOfflineServiceWorker",
2980        default,
2981        skip_serializing_if = "Option::is_none"
2982    )]
2983    pub emulate_offline_service_worker: Option<bool>,
2984    /// Configure conditions for matching requests. If multiple entries match a
2985    /// request, the first entry wins. Global conditions can be configured by
2986    /// leaving the urlPattern for the conditions empty. These global conditions
2987    /// are also applied for throttling of p2p connections.
2988    #[serde(rename = "matchedNetworkConditions")]
2989    pub matched_network_conditions: Vec<NetworkConditions>,
2990}
2991
2992/// What `Network.emulateNetworkConditionsByRule` answers with.
2993#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
2994pub struct EmulateNetworkConditionsByRuleReturns {
2995    /// An id for each entry in matchedNetworkConditions. The id will be included
2996    /// in the requestWillBeSentExtraInfo for requests affected by a rule.
2997    #[serde(rename = "ruleIds")]
2998    pub rule_ids: Vec<String>,
2999}
3000
3001impl crate::typed::Command for EmulateNetworkConditionsByRuleParams {
3002    const METHOD: &'static str = "Network.emulateNetworkConditionsByRule";
3003    type Returns = EmulateNetworkConditionsByRuleReturns;
3004}
3005
3006/// Override the state of navigator.onLine and navigator.connection.
3007///
3008/// Experimental: may change without notice.
3009///
3010/// Parameters of `Network.overrideNetworkState`.
3011#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3012pub struct OverrideNetworkStateParams {
3013    /// True to emulate internet disconnection.
3014    pub offline: bool,
3015    /// Minimum latency from request sent to response headers received (ms).
3016    pub latency: f64,
3017    /// Maximal aggregated download throughput (bytes/sec). -1 disables download
3018    /// throttling.
3019    #[serde(rename = "downloadThroughput")]
3020    pub download_throughput: f64,
3021    /// Maximal aggregated upload throughput (bytes/sec). -1 disables upload
3022    /// throttling.
3023    #[serde(rename = "uploadThroughput")]
3024    pub upload_throughput: f64,
3025    /// Connection type if known.
3026    #[serde(
3027        rename = "connectionType",
3028        default,
3029        skip_serializing_if = "Option::is_none"
3030    )]
3031    pub connection_type: Option<ConnectionType>,
3032}
3033
3034impl crate::typed::Command for OverrideNetworkStateParams {
3035    const METHOD: &'static str = "Network.overrideNetworkState";
3036    type Returns = crate::typed::NoReturns;
3037}
3038
3039/// Enables network tracking, network events will now be delivered to the
3040/// client.
3041///
3042/// Parameters of `Network.enable`.
3043#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3044pub struct EnableParams {
3045    /// Buffer size in bytes to use when preserving network payloads (XHRs, etc).
3046    /// This is the maximum number of bytes that will be collected by this
3047    /// DevTools session.
3048    ///
3049    /// Experimental: may change without notice.
3050    #[serde(
3051        rename = "maxTotalBufferSize",
3052        default,
3053        skip_serializing_if = "Option::is_none"
3054    )]
3055    pub max_total_buffer_size: Option<i64>,
3056    /// Per-resource buffer size in bytes to use when preserving network payloads
3057    /// (XHRs, etc).
3058    ///
3059    /// Experimental: may change without notice.
3060    #[serde(
3061        rename = "maxResourceBufferSize",
3062        default,
3063        skip_serializing_if = "Option::is_none"
3064    )]
3065    pub max_resource_buffer_size: Option<i64>,
3066    /// Longest post body size (in bytes) that would be included in
3067    /// requestWillBeSent notification
3068    #[serde(
3069        rename = "maxPostDataSize",
3070        default,
3071        skip_serializing_if = "Option::is_none"
3072    )]
3073    pub max_post_data_size: Option<i64>,
3074    /// Whether DirectSocket chunk send/receive events should be reported.
3075    ///
3076    /// Experimental: may change without notice.
3077    #[serde(
3078        rename = "reportDirectSocketTraffic",
3079        default,
3080        skip_serializing_if = "Option::is_none"
3081    )]
3082    pub report_direct_socket_traffic: Option<bool>,
3083    /// Enable storing response bodies outside of renderer, so that these survive
3084    /// a cross-process navigation. Requires maxTotalBufferSize to be set.
3085    /// Currently defaults to false. This field is being deprecated in favor of
3086    /// the dedicated configureDurableMessages command, due to the possibility of
3087    /// deadlocks when awaiting Network.enable before issuing
3088    /// Runtime.runIfWaitingForDebugger.
3089    ///
3090    /// Experimental: may change without notice.
3091    #[serde(
3092        rename = "enableDurableMessages",
3093        default,
3094        skip_serializing_if = "Option::is_none"
3095    )]
3096    pub enable_durable_messages: Option<bool>,
3097}
3098
3099impl crate::typed::Command for EnableParams {
3100    const METHOD: &'static str = "Network.enable";
3101    type Returns = crate::typed::NoReturns;
3102}
3103
3104/// Configures storing response bodies outside of renderer, so that these
3105/// survive a cross-process navigation. If maxTotalBufferSize is not set,
3106/// durable messages are disabled.
3107///
3108/// Experimental: may change without notice.
3109///
3110/// Parameters of `Network.configureDurableMessages`.
3111#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3112pub struct ConfigureDurableMessagesParams {
3113    /// Buffer size in bytes to use when preserving network payloads (XHRs, etc).
3114    #[serde(
3115        rename = "maxTotalBufferSize",
3116        default,
3117        skip_serializing_if = "Option::is_none"
3118    )]
3119    pub max_total_buffer_size: Option<i64>,
3120    /// Per-resource buffer size in bytes to use when preserving network payloads
3121    /// (XHRs, etc).
3122    #[serde(
3123        rename = "maxResourceBufferSize",
3124        default,
3125        skip_serializing_if = "Option::is_none"
3126    )]
3127    pub max_resource_buffer_size: Option<i64>,
3128}
3129
3130impl crate::typed::Command for ConfigureDurableMessagesParams {
3131    const METHOD: &'static str = "Network.configureDurableMessages";
3132    type Returns = crate::typed::NoReturns;
3133}
3134
3135/// Returns all browser cookies. Depending on the backend support, will return
3136/// detailed cookie information in the `cookies` field. Deprecated. Use
3137/// Storage.getCookies instead.
3138///
3139/// Deprecated in the protocol.
3140///
3141/// Parameters of `Network.getAllCookies`.
3142#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3143pub struct GetAllCookiesParams {}
3144
3145/// What `Network.getAllCookies` answers with.
3146#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3147pub struct GetAllCookiesReturns {
3148    /// Array of cookie objects.
3149    pub cookies: Vec<Cookie>,
3150}
3151
3152impl crate::typed::Command for GetAllCookiesParams {
3153    const METHOD: &'static str = "Network.getAllCookies";
3154    type Returns = GetAllCookiesReturns;
3155}
3156
3157/// Returns the DER-encoded certificate.
3158///
3159/// Experimental: may change without notice.
3160///
3161/// Parameters of `Network.getCertificate`.
3162#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3163pub struct GetCertificateParams {
3164    /// Origin to get certificate for.
3165    pub origin: String,
3166}
3167
3168/// What `Network.getCertificate` answers with.
3169#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3170pub struct GetCertificateReturns {
3171    #[serde(rename = "tableNames")]
3172    pub table_names: Vec<String>,
3173}
3174
3175impl crate::typed::Command for GetCertificateParams {
3176    const METHOD: &'static str = "Network.getCertificate";
3177    type Returns = GetCertificateReturns;
3178}
3179
3180/// Returns all browser cookies for the current URL. Depending on the backend
3181/// support, will return detailed cookie information in the `cookies` field.
3182///
3183/// Parameters of `Network.getCookies`.
3184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3185pub struct GetCookiesParams {
3186    /// The list of URLs for which applicable cookies will be fetched. If not
3187    /// specified, it's assumed to be set to the list containing the URLs of the
3188    /// page and all of its subframes.
3189    #[serde(default, skip_serializing_if = "Option::is_none")]
3190    pub urls: Option<Vec<String>>,
3191}
3192
3193/// What `Network.getCookies` answers with.
3194#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3195pub struct GetCookiesReturns {
3196    /// Array of cookie objects.
3197    pub cookies: Vec<Cookie>,
3198}
3199
3200impl crate::typed::Command for GetCookiesParams {
3201    const METHOD: &'static str = "Network.getCookies";
3202    type Returns = GetCookiesReturns;
3203}
3204
3205/// Returns content served for the given request.
3206///
3207/// Parameters of `Network.getResponseBody`.
3208#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3209pub struct GetResponseBodyParams {
3210    /// Identifier of the network request to get content for.
3211    #[serde(rename = "requestId")]
3212    pub request_id: RequestId,
3213}
3214
3215/// What `Network.getResponseBody` answers with.
3216#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3217pub struct GetResponseBodyReturns {
3218    /// Response body.
3219    pub body: String,
3220    /// True, if content was sent as base64.
3221    #[serde(rename = "base64Encoded")]
3222    pub base64_encoded: bool,
3223}
3224
3225impl crate::typed::Command for GetResponseBodyParams {
3226    const METHOD: &'static str = "Network.getResponseBody";
3227    type Returns = GetResponseBodyReturns;
3228}
3229
3230/// Returns post data sent with the request. Returns an error when no data was
3231/// sent with the request.
3232///
3233/// Parameters of `Network.getRequestPostData`.
3234#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3235pub struct GetRequestPostDataParams {
3236    /// Identifier of the network request to get content for.
3237    #[serde(rename = "requestId")]
3238    pub request_id: RequestId,
3239}
3240
3241/// What `Network.getRequestPostData` answers with.
3242#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3243pub struct GetRequestPostDataReturns {
3244    /// Request body string, omitting files from multipart requests
3245    #[serde(rename = "postData")]
3246    pub post_data: String,
3247    /// True, if content was sent as base64.
3248    #[serde(rename = "base64Encoded")]
3249    pub base64_encoded: bool,
3250}
3251
3252impl crate::typed::Command for GetRequestPostDataParams {
3253    const METHOD: &'static str = "Network.getRequestPostData";
3254    type Returns = GetRequestPostDataReturns;
3255}
3256
3257/// This method sends a new XMLHttpRequest which is identical to the original
3258/// one. The following parameters should be identical: method, url, async,
3259/// request body, extra headers, withCredentials attribute, user, password.
3260///
3261/// Experimental: may change without notice.
3262///
3263/// Parameters of `Network.replayXHR`.
3264#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3265pub struct ReplayXhrParams {
3266    /// Identifier of XHR to replay.
3267    #[serde(rename = "requestId")]
3268    pub request_id: RequestId,
3269}
3270
3271impl crate::typed::Command for ReplayXhrParams {
3272    const METHOD: &'static str = "Network.replayXHR";
3273    type Returns = crate::typed::NoReturns;
3274}
3275
3276/// Searches for given string in response content.
3277///
3278/// Experimental: may change without notice.
3279///
3280/// Parameters of `Network.searchInResponseBody`.
3281#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3282pub struct SearchInResponseBodyParams {
3283    /// Identifier of the network response to search.
3284    #[serde(rename = "requestId")]
3285    pub request_id: RequestId,
3286    /// String to search for.
3287    pub query: String,
3288    /// If true, search is case sensitive.
3289    #[serde(
3290        rename = "caseSensitive",
3291        default,
3292        skip_serializing_if = "Option::is_none"
3293    )]
3294    pub case_sensitive: Option<bool>,
3295    /// If true, treats string parameter as regex.
3296    #[serde(rename = "isRegex", default, skip_serializing_if = "Option::is_none")]
3297    pub is_regex: Option<bool>,
3298}
3299
3300/// What `Network.searchInResponseBody` answers with.
3301#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3302pub struct SearchInResponseBodyReturns {
3303    /// List of search matches.
3304    pub result: Vec<crate::protocol::debugger::SearchMatch>,
3305}
3306
3307impl crate::typed::Command for SearchInResponseBodyParams {
3308    const METHOD: &'static str = "Network.searchInResponseBody";
3309    type Returns = SearchInResponseBodyReturns;
3310}
3311
3312/// Blocks URLs from loading.
3313///
3314/// Experimental: may change without notice.
3315///
3316/// Parameters of `Network.setBlockedURLs`.
3317#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3318pub struct SetBlockedUrLsParams {
3319    /// Patterns to match in the order in which they are given. These patterns
3320    /// also take precedence over any wildcard patterns defined in `urls`.
3321    #[serde(
3322        rename = "urlPatterns",
3323        default,
3324        skip_serializing_if = "Option::is_none"
3325    )]
3326    pub url_patterns: Option<Vec<BlockPattern>>,
3327    /// URL patterns to block. Wildcards ('*') are allowed.
3328    ///
3329    /// Deprecated in the protocol.
3330    #[serde(default, skip_serializing_if = "Option::is_none")]
3331    pub urls: Option<Vec<String>>,
3332}
3333
3334impl crate::typed::Command for SetBlockedUrLsParams {
3335    const METHOD: &'static str = "Network.setBlockedURLs";
3336    type Returns = crate::typed::NoReturns;
3337}
3338
3339/// Toggles ignoring of service worker for each request.
3340///
3341/// Parameters of `Network.setBypassServiceWorker`.
3342#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3343pub struct SetBypassServiceWorkerParams {
3344    /// Bypass service worker and load from network.
3345    pub bypass: bool,
3346}
3347
3348impl crate::typed::Command for SetBypassServiceWorkerParams {
3349    const METHOD: &'static str = "Network.setBypassServiceWorker";
3350    type Returns = crate::typed::NoReturns;
3351}
3352
3353/// Toggles ignoring cache for each request. If `true`, cache will not be
3354/// used.
3355///
3356/// Parameters of `Network.setCacheDisabled`.
3357#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3358pub struct SetCacheDisabledParams {
3359    /// Cache disabled state.
3360    #[serde(rename = "cacheDisabled")]
3361    pub cache_disabled: bool,
3362}
3363
3364impl crate::typed::Command for SetCacheDisabledParams {
3365    const METHOD: &'static str = "Network.setCacheDisabled";
3366    type Returns = crate::typed::NoReturns;
3367}
3368
3369/// Sets a cookie with the given cookie data; may overwrite equivalent cookies
3370/// if they exist.
3371///
3372/// Parameters of `Network.setCookie`.
3373#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3374pub struct SetCookieParams {
3375    /// Cookie name.
3376    pub name: String,
3377    /// Cookie value.
3378    pub value: String,
3379    /// The request-URI to associate with the setting of the cookie. This value
3380    /// can affect the default domain, path, source port, and source scheme values
3381    /// of the created cookie.
3382    #[serde(default, skip_serializing_if = "Option::is_none")]
3383    pub url: Option<String>,
3384    /// Cookie domain.
3385    #[serde(default, skip_serializing_if = "Option::is_none")]
3386    pub domain: Option<String>,
3387    /// Cookie path.
3388    #[serde(default, skip_serializing_if = "Option::is_none")]
3389    pub path: Option<String>,
3390    /// True if cookie is secure.
3391    #[serde(default, skip_serializing_if = "Option::is_none")]
3392    pub secure: Option<bool>,
3393    /// True if cookie is http-only.
3394    #[serde(rename = "httpOnly", default, skip_serializing_if = "Option::is_none")]
3395    pub http_only: Option<bool>,
3396    /// Cookie SameSite type.
3397    #[serde(rename = "sameSite", default, skip_serializing_if = "Option::is_none")]
3398    pub same_site: Option<CookieSameSite>,
3399    /// Cookie expiration date, session cookie if not set
3400    #[serde(default, skip_serializing_if = "Option::is_none")]
3401    pub expires: Option<TimeSinceEpoch>,
3402    /// Cookie Priority type.
3403    ///
3404    /// Experimental: may change without notice.
3405    #[serde(default, skip_serializing_if = "Option::is_none")]
3406    pub priority: Option<CookiePriority>,
3407    /// Cookie source scheme type.
3408    ///
3409    /// Experimental: may change without notice.
3410    #[serde(
3411        rename = "sourceScheme",
3412        default,
3413        skip_serializing_if = "Option::is_none"
3414    )]
3415    pub source_scheme: Option<CookieSourceScheme>,
3416    /// Cookie source port. Valid values are {-1, \[1, 65535\]}, -1 indicates an
3417    /// unspecified port. An unspecified port value allows protocol clients to
3418    /// emulate legacy cookie scope for the port. This is a temporary ability and
3419    /// it will be removed in the future.
3420    ///
3421    /// Experimental: may change without notice.
3422    #[serde(
3423        rename = "sourcePort",
3424        default,
3425        skip_serializing_if = "Option::is_none"
3426    )]
3427    pub source_port: Option<i64>,
3428    /// Cookie partition key. If not set, the cookie will be set as not
3429    /// partitioned.
3430    ///
3431    /// Experimental: may change without notice.
3432    #[serde(
3433        rename = "partitionKey",
3434        default,
3435        skip_serializing_if = "Option::is_none"
3436    )]
3437    pub partition_key: Option<CookiePartitionKey>,
3438}
3439
3440/// What `Network.setCookie` answers with.
3441#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3442pub struct SetCookieReturns {
3443    /// Always set to true. If an error occurs, the response indicates protocol
3444    /// error.
3445    ///
3446    /// Deprecated in the protocol.
3447    pub success: bool,
3448}
3449
3450impl crate::typed::Command for SetCookieParams {
3451    const METHOD: &'static str = "Network.setCookie";
3452    type Returns = SetCookieReturns;
3453}
3454
3455/// Sets given cookies.
3456///
3457/// Parameters of `Network.setCookies`.
3458#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3459pub struct SetCookiesParams {
3460    /// Cookies to be set.
3461    pub cookies: Vec<CookieParam>,
3462}
3463
3464impl crate::typed::Command for SetCookiesParams {
3465    const METHOD: &'static str = "Network.setCookies";
3466    type Returns = crate::typed::NoReturns;
3467}
3468
3469/// Specifies whether to always send extra HTTP headers with the requests from
3470/// this page.
3471///
3472/// Parameters of `Network.setExtraHTTPHeaders`.
3473#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3474pub struct SetExtraHttpHeadersParams {
3475    /// Map with extra HTTP headers.
3476    pub headers: Headers,
3477}
3478
3479impl crate::typed::Command for SetExtraHttpHeadersParams {
3480    const METHOD: &'static str = "Network.setExtraHTTPHeaders";
3481    type Returns = crate::typed::NoReturns;
3482}
3483
3484/// Specifies whether to attach a page script stack id in requests
3485///
3486/// Experimental: may change without notice.
3487///
3488/// Parameters of `Network.setAttachDebugStack`.
3489#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3490pub struct SetAttachDebugStackParams {
3491    /// Whether to attach a page script stack for debugging purpose.
3492    pub enabled: bool,
3493}
3494
3495impl crate::typed::Command for SetAttachDebugStackParams {
3496    const METHOD: &'static str = "Network.setAttachDebugStack";
3497    type Returns = crate::typed::NoReturns;
3498}
3499
3500/// Allows overriding user agent with the given string.
3501///
3502/// Parameters of `Network.setUserAgentOverride`.
3503#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3504pub struct SetUserAgentOverrideParams {
3505    /// User agent to use.
3506    #[serde(rename = "userAgent")]
3507    pub user_agent: String,
3508    /// Browser language to emulate.
3509    #[serde(
3510        rename = "acceptLanguage",
3511        default,
3512        skip_serializing_if = "Option::is_none"
3513    )]
3514    pub accept_language: Option<String>,
3515    /// The platform navigator.platform should return.
3516    #[serde(default, skip_serializing_if = "Option::is_none")]
3517    pub platform: Option<String>,
3518    /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
3519    ///
3520    /// Experimental: may change without notice.
3521    #[serde(
3522        rename = "userAgentMetadata",
3523        default,
3524        skip_serializing_if = "Option::is_none"
3525    )]
3526    pub user_agent_metadata: Option<crate::protocol::emulation::UserAgentMetadata>,
3527}
3528
3529impl crate::typed::Command for SetUserAgentOverrideParams {
3530    const METHOD: &'static str = "Network.setUserAgentOverride";
3531    type Returns = crate::typed::NoReturns;
3532}
3533
3534/// Enables streaming of the response for the given requestId. If enabled, the
3535/// dataReceived event contains the data that was received during streaming.
3536///
3537/// Experimental: may change without notice.
3538///
3539/// Parameters of `Network.streamResourceContent`.
3540#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3541pub struct StreamResourceContentParams {
3542    /// Identifier of the request to stream.
3543    #[serde(rename = "requestId")]
3544    pub request_id: RequestId,
3545}
3546
3547/// What `Network.streamResourceContent` answers with.
3548#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3549pub struct StreamResourceContentReturns {
3550    /// Data that has been buffered until streaming is enabled. (Encoded as a
3551    /// base64 string when passed over JSON)
3552    #[serde(rename = "bufferedData")]
3553    pub buffered_data: String,
3554}
3555
3556impl crate::typed::Command for StreamResourceContentParams {
3557    const METHOD: &'static str = "Network.streamResourceContent";
3558    type Returns = StreamResourceContentReturns;
3559}
3560
3561/// Returns information about the COEP/COOP isolation status.
3562///
3563/// Experimental: may change without notice.
3564///
3565/// Parameters of `Network.getSecurityIsolationStatus`.
3566#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3567pub struct GetSecurityIsolationStatusParams {
3568    /// If no frameId is provided, the status of the target is provided.
3569    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
3570    pub frame_id: Option<crate::protocol::page::FrameId>,
3571}
3572
3573/// What `Network.getSecurityIsolationStatus` answers with.
3574#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3575pub struct GetSecurityIsolationStatusReturns {
3576    pub status: SecurityIsolationStatus,
3577}
3578
3579impl crate::typed::Command for GetSecurityIsolationStatusParams {
3580    const METHOD: &'static str = "Network.getSecurityIsolationStatus";
3581    type Returns = GetSecurityIsolationStatusReturns;
3582}
3583
3584/// Enables tracking for the Reporting API, events generated by the Reporting
3585/// API will now be delivered to the client. Enabling triggers
3586/// 'reportingApiReportAdded' for all existing reports.
3587///
3588/// Experimental: may change without notice.
3589///
3590/// Parameters of `Network.enableReportingApi`.
3591#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3592pub struct EnableReportingApiParams {
3593    /// Whether to enable or disable events for the Reporting API
3594    pub enable: bool,
3595}
3596
3597impl crate::typed::Command for EnableReportingApiParams {
3598    const METHOD: &'static str = "Network.enableReportingApi";
3599    type Returns = crate::typed::NoReturns;
3600}
3601
3602/// Sets up tracking device bound sessions and fetching of initial set of
3603/// sessions.
3604///
3605/// Experimental: may change without notice.
3606///
3607/// Parameters of `Network.enableDeviceBoundSessions`.
3608#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3609pub struct EnableDeviceBoundSessionsParams {
3610    /// Whether to enable or disable events.
3611    pub enable: bool,
3612}
3613
3614impl crate::typed::Command for EnableDeviceBoundSessionsParams {
3615    const METHOD: &'static str = "Network.enableDeviceBoundSessions";
3616    type Returns = crate::typed::NoReturns;
3617}
3618
3619/// Deletes a device bound session.
3620///
3621/// Experimental: may change without notice.
3622///
3623/// Parameters of `Network.deleteDeviceBoundSession`.
3624#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3625pub struct DeleteDeviceBoundSessionParams {
3626    pub key: DeviceBoundSessionKey,
3627}
3628
3629impl crate::typed::Command for DeleteDeviceBoundSessionParams {
3630    const METHOD: &'static str = "Network.deleteDeviceBoundSession";
3631    type Returns = crate::typed::NoReturns;
3632}
3633
3634/// Fetches the schemeful site for a specific origin.
3635///
3636/// Experimental: may change without notice.
3637///
3638/// Parameters of `Network.fetchSchemefulSite`.
3639#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3640pub struct FetchSchemefulSiteParams {
3641    /// The URL origin.
3642    pub origin: String,
3643}
3644
3645/// What `Network.fetchSchemefulSite` answers with.
3646#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3647pub struct FetchSchemefulSiteReturns {
3648    /// The corresponding schemeful site.
3649    #[serde(rename = "schemefulSite")]
3650    pub schemeful_site: String,
3651}
3652
3653impl crate::typed::Command for FetchSchemefulSiteParams {
3654    const METHOD: &'static str = "Network.fetchSchemefulSite";
3655    type Returns = FetchSchemefulSiteReturns;
3656}
3657
3658/// Fetches the resource and returns the content.
3659///
3660/// Experimental: may change without notice.
3661///
3662/// Parameters of `Network.loadNetworkResource`.
3663#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3664pub struct LoadNetworkResourceParams {
3665    /// Frame id to get the resource for. Mandatory for frame targets, and should
3666    /// be omitted for worker targets.
3667    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
3668    pub frame_id: Option<crate::protocol::page::FrameId>,
3669    /// URL of the resource to get content for.
3670    pub url: String,
3671    /// Options for the request.
3672    pub options: LoadNetworkResourceOptions,
3673}
3674
3675/// What `Network.loadNetworkResource` answers with.
3676#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3677pub struct LoadNetworkResourceReturns {
3678    pub resource: LoadNetworkResourcePageResult,
3679}
3680
3681impl crate::typed::Command for LoadNetworkResourceParams {
3682    const METHOD: &'static str = "Network.loadNetworkResource";
3683    type Returns = LoadNetworkResourceReturns;
3684}
3685
3686/// Sets Controls for third-party cookie access Page reload is required before
3687/// the new cookie behavior will be observed
3688///
3689/// Experimental: may change without notice.
3690///
3691/// Parameters of `Network.setCookieControls`.
3692#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3693pub struct SetCookieControlsParams {
3694    /// Whether 3pc restriction is enabled.
3695    #[serde(rename = "enableThirdPartyCookieRestriction")]
3696    pub enable_third_party_cookie_restriction: bool,
3697}
3698
3699impl crate::typed::Command for SetCookieControlsParams {
3700    const METHOD: &'static str = "Network.setCookieControls";
3701    type Returns = crate::typed::NoReturns;
3702}
3703
3704/// Fired when data chunk was received over the network.
3705///
3706/// Payload of the `Network.dataReceived` event.
3707#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3708pub struct DataReceivedEvent {
3709    /// Request identifier.
3710    #[serde(rename = "requestId")]
3711    pub request_id: RequestId,
3712    /// Timestamp.
3713    pub timestamp: MonotonicTime,
3714    /// Data chunk length.
3715    #[serde(rename = "dataLength")]
3716    pub data_length: i64,
3717    /// Actual bytes received (might be less than dataLength for compressed
3718    /// encodings).
3719    #[serde(rename = "encodedDataLength")]
3720    pub encoded_data_length: i64,
3721    /// Data that was received. (Encoded as a base64 string when passed over JSON)
3722    ///
3723    /// Experimental: may change without notice.
3724    #[serde(default, skip_serializing_if = "Option::is_none")]
3725    pub data: Option<String>,
3726}
3727
3728impl crate::typed::Event for DataReceivedEvent {
3729    const METHOD: &'static str = "Network.dataReceived";
3730}
3731
3732/// Fired when EventSource message is received.
3733///
3734/// Payload of the `Network.eventSourceMessageReceived` event.
3735#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3736pub struct EventSourceMessageReceivedEvent {
3737    /// Request identifier.
3738    #[serde(rename = "requestId")]
3739    pub request_id: RequestId,
3740    /// Timestamp.
3741    pub timestamp: MonotonicTime,
3742    /// Message type.
3743    #[serde(rename = "eventName")]
3744    pub event_name: String,
3745    /// Message identifier.
3746    #[serde(rename = "eventId")]
3747    pub event_id: String,
3748    /// Message content.
3749    pub data: String,
3750}
3751
3752impl crate::typed::Event for EventSourceMessageReceivedEvent {
3753    const METHOD: &'static str = "Network.eventSourceMessageReceived";
3754}
3755
3756/// Fired when HTTP request has failed to load.
3757///
3758/// Payload of the `Network.loadingFailed` event.
3759#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3760pub struct LoadingFailedEvent {
3761    /// Request identifier.
3762    #[serde(rename = "requestId")]
3763    pub request_id: RequestId,
3764    /// Timestamp.
3765    pub timestamp: MonotonicTime,
3766    /// Resource type.
3767    pub r#type: ResourceType,
3768    /// Error message. List of network errors:
3769    /// <https://cs.chromium.org/chromium/src/net/base/net_error_list.h>
3770    #[serde(rename = "errorText")]
3771    pub error_text: String,
3772    /// True if loading was canceled.
3773    #[serde(default, skip_serializing_if = "Option::is_none")]
3774    pub canceled: Option<bool>,
3775    /// The reason why loading was blocked, if any.
3776    #[serde(
3777        rename = "blockedReason",
3778        default,
3779        skip_serializing_if = "Option::is_none"
3780    )]
3781    pub blocked_reason: Option<BlockedReason>,
3782    /// The reason why loading was blocked by CORS, if any.
3783    #[serde(
3784        rename = "corsErrorStatus",
3785        default,
3786        skip_serializing_if = "Option::is_none"
3787    )]
3788    pub cors_error_status: Option<CorsErrorStatus>,
3789}
3790
3791impl crate::typed::Event for LoadingFailedEvent {
3792    const METHOD: &'static str = "Network.loadingFailed";
3793}
3794
3795/// Fired when HTTP request has finished loading.
3796///
3797/// Payload of the `Network.loadingFinished` event.
3798#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3799pub struct LoadingFinishedEvent {
3800    /// Request identifier.
3801    #[serde(rename = "requestId")]
3802    pub request_id: RequestId,
3803    /// Timestamp.
3804    pub timestamp: MonotonicTime,
3805    /// Total number of bytes received for this request.
3806    #[serde(rename = "encodedDataLength")]
3807    pub encoded_data_length: f64,
3808    /// Size of the response body before removing content encodings. Includes
3809    /// cached bodies, but excludes headers and transfer framing.
3810    ///
3811    /// Experimental: may change without notice.
3812    #[serde(
3813        rename = "encodedBodyLength",
3814        default,
3815        skip_serializing_if = "Option::is_none"
3816    )]
3817    pub encoded_body_length: Option<f64>,
3818}
3819
3820impl crate::typed::Event for LoadingFinishedEvent {
3821    const METHOD: &'static str = "Network.loadingFinished";
3822}
3823
3824/// Fired if request ended up loading from cache.
3825///
3826/// Payload of the `Network.requestServedFromCache` event.
3827#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3828pub struct RequestServedFromCacheEvent {
3829    /// Request identifier.
3830    #[serde(rename = "requestId")]
3831    pub request_id: RequestId,
3832}
3833
3834impl crate::typed::Event for RequestServedFromCacheEvent {
3835    const METHOD: &'static str = "Network.requestServedFromCache";
3836}
3837
3838/// Fired when page is about to send HTTP request.
3839///
3840/// Payload of the `Network.requestWillBeSent` event.
3841#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3842pub struct RequestWillBeSentEvent {
3843    /// Request identifier.
3844    #[serde(rename = "requestId")]
3845    pub request_id: RequestId,
3846    /// Loader identifier. Empty string if the request is fetched from worker.
3847    #[serde(rename = "loaderId")]
3848    pub loader_id: LoaderId,
3849    /// URL of the document this request is loaded for.
3850    #[serde(rename = "documentURL")]
3851    pub document_url: String,
3852    /// Request data.
3853    pub request: Request,
3854    /// Timestamp.
3855    pub timestamp: MonotonicTime,
3856    /// Timestamp.
3857    #[serde(rename = "wallTime")]
3858    pub wall_time: TimeSinceEpoch,
3859    /// Request initiator.
3860    pub initiator: Initiator,
3861    /// In the case that redirectResponse is populated, this flag indicates
3862    /// whether requestWillBeSentExtraInfo and responseReceivedExtraInfo events
3863    /// will be or were emitted for the request which was just redirected.
3864    ///
3865    /// Experimental: may change without notice.
3866    #[serde(rename = "redirectHasExtraInfo")]
3867    pub redirect_has_extra_info: bool,
3868    /// Redirect response data.
3869    #[serde(
3870        rename = "redirectResponse",
3871        default,
3872        skip_serializing_if = "Option::is_none"
3873    )]
3874    pub redirect_response: Option<Response>,
3875    /// Type of this resource.
3876    #[serde(default, skip_serializing_if = "Option::is_none")]
3877    pub r#type: Option<ResourceType>,
3878    /// Frame identifier.
3879    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
3880    pub frame_id: Option<crate::protocol::page::FrameId>,
3881    /// Whether the request is initiated by a user gesture. Defaults to false.
3882    #[serde(
3883        rename = "hasUserGesture",
3884        default,
3885        skip_serializing_if = "Option::is_none"
3886    )]
3887    pub has_user_gesture: Option<bool>,
3888    /// The render-blocking behavior of the request.
3889    ///
3890    /// Experimental: may change without notice.
3891    #[serde(
3892        rename = "renderBlockingBehavior",
3893        default,
3894        skip_serializing_if = "Option::is_none"
3895    )]
3896    pub render_blocking_behavior: Option<RenderBlockingBehavior>,
3897}
3898
3899impl crate::typed::Event for RequestWillBeSentEvent {
3900    const METHOD: &'static str = "Network.requestWillBeSent";
3901}
3902
3903/// Fired when resource loading priority is changed
3904///
3905/// Experimental: may change without notice.
3906///
3907/// Payload of the `Network.resourceChangedPriority` event.
3908#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3909pub struct ResourceChangedPriorityEvent {
3910    /// Request identifier.
3911    #[serde(rename = "requestId")]
3912    pub request_id: RequestId,
3913    /// New priority
3914    #[serde(rename = "newPriority")]
3915    pub new_priority: ResourcePriority,
3916    /// Timestamp.
3917    pub timestamp: MonotonicTime,
3918}
3919
3920impl crate::typed::Event for ResourceChangedPriorityEvent {
3921    const METHOD: &'static str = "Network.resourceChangedPriority";
3922}
3923
3924/// Fired when a signed exchange was received over the network
3925///
3926/// Experimental: may change without notice.
3927///
3928/// Payload of the `Network.signedExchangeReceived` event.
3929#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3930pub struct SignedExchangeReceivedEvent {
3931    /// Request identifier.
3932    #[serde(rename = "requestId")]
3933    pub request_id: RequestId,
3934    /// Information about the signed exchange response.
3935    pub info: SignedExchangeInfo,
3936}
3937
3938impl crate::typed::Event for SignedExchangeReceivedEvent {
3939    const METHOD: &'static str = "Network.signedExchangeReceived";
3940}
3941
3942/// Fired when HTTP response is available.
3943///
3944/// Payload of the `Network.responseReceived` event.
3945#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3946pub struct ResponseReceivedEvent {
3947    /// Request identifier.
3948    #[serde(rename = "requestId")]
3949    pub request_id: RequestId,
3950    /// Loader identifier. Empty string if the request is fetched from worker.
3951    #[serde(rename = "loaderId")]
3952    pub loader_id: LoaderId,
3953    /// Timestamp.
3954    pub timestamp: MonotonicTime,
3955    /// Resource type.
3956    pub r#type: ResourceType,
3957    /// Response data.
3958    pub response: Response,
3959    /// Indicates whether requestWillBeSentExtraInfo and responseReceivedExtraInfo
3960    /// events will be or were emitted for this request.
3961    ///
3962    /// Experimental: may change without notice.
3963    #[serde(rename = "hasExtraInfo")]
3964    pub has_extra_info: bool,
3965    /// Frame identifier.
3966    #[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
3967    pub frame_id: Option<crate::protocol::page::FrameId>,
3968}
3969
3970impl crate::typed::Event for ResponseReceivedEvent {
3971    const METHOD: &'static str = "Network.responseReceived";
3972}
3973
3974/// Fired when WebSocket is closed.
3975///
3976/// Payload of the `Network.webSocketClosed` event.
3977#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3978pub struct WebSocketClosedEvent {
3979    /// Request identifier.
3980    #[serde(rename = "requestId")]
3981    pub request_id: RequestId,
3982    /// Timestamp.
3983    pub timestamp: MonotonicTime,
3984}
3985
3986impl crate::typed::Event for WebSocketClosedEvent {
3987    const METHOD: &'static str = "Network.webSocketClosed";
3988}
3989
3990/// Fired upon WebSocket creation.
3991///
3992/// Payload of the `Network.webSocketCreated` event.
3993#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
3994pub struct WebSocketCreatedEvent {
3995    /// Request identifier.
3996    #[serde(rename = "requestId")]
3997    pub request_id: RequestId,
3998    /// WebSocket request URL.
3999    pub url: String,
4000    /// Request initiator.
4001    #[serde(default, skip_serializing_if = "Option::is_none")]
4002    pub initiator: Option<Initiator>,
4003}
4004
4005impl crate::typed::Event for WebSocketCreatedEvent {
4006    const METHOD: &'static str = "Network.webSocketCreated";
4007}
4008
4009/// Fired when WebSocket message error occurs.
4010///
4011/// Payload of the `Network.webSocketFrameError` event.
4012#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4013pub struct WebSocketFrameErrorEvent {
4014    /// Request identifier.
4015    #[serde(rename = "requestId")]
4016    pub request_id: RequestId,
4017    /// Timestamp.
4018    pub timestamp: MonotonicTime,
4019    /// WebSocket error message.
4020    #[serde(rename = "errorMessage")]
4021    pub error_message: String,
4022}
4023
4024impl crate::typed::Event for WebSocketFrameErrorEvent {
4025    const METHOD: &'static str = "Network.webSocketFrameError";
4026}
4027
4028/// Fired when WebSocket message is received.
4029///
4030/// Payload of the `Network.webSocketFrameReceived` event.
4031#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4032pub struct WebSocketFrameReceivedEvent {
4033    /// Request identifier.
4034    #[serde(rename = "requestId")]
4035    pub request_id: RequestId,
4036    /// Timestamp.
4037    pub timestamp: MonotonicTime,
4038    /// WebSocket response data.
4039    pub response: WebSocketFrame,
4040}
4041
4042impl crate::typed::Event for WebSocketFrameReceivedEvent {
4043    const METHOD: &'static str = "Network.webSocketFrameReceived";
4044}
4045
4046/// Fired when WebSocket message is sent.
4047///
4048/// Payload of the `Network.webSocketFrameSent` event.
4049#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4050pub struct WebSocketFrameSentEvent {
4051    /// Request identifier.
4052    #[serde(rename = "requestId")]
4053    pub request_id: RequestId,
4054    /// Timestamp.
4055    pub timestamp: MonotonicTime,
4056    /// WebSocket response data.
4057    pub response: WebSocketFrame,
4058}
4059
4060impl crate::typed::Event for WebSocketFrameSentEvent {
4061    const METHOD: &'static str = "Network.webSocketFrameSent";
4062}
4063
4064/// Fired when WebSocket handshake response becomes available.
4065///
4066/// Payload of the `Network.webSocketHandshakeResponseReceived` event.
4067#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4068pub struct WebSocketHandshakeResponseReceivedEvent {
4069    /// Request identifier.
4070    #[serde(rename = "requestId")]
4071    pub request_id: RequestId,
4072    /// Timestamp.
4073    pub timestamp: MonotonicTime,
4074    /// WebSocket response data.
4075    pub response: WebSocketResponse,
4076}
4077
4078impl crate::typed::Event for WebSocketHandshakeResponseReceivedEvent {
4079    const METHOD: &'static str = "Network.webSocketHandshakeResponseReceived";
4080}
4081
4082/// Fired when WebSocket is about to initiate handshake.
4083///
4084/// Payload of the `Network.webSocketWillSendHandshakeRequest` event.
4085#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4086pub struct WebSocketWillSendHandshakeRequestEvent {
4087    /// Request identifier.
4088    #[serde(rename = "requestId")]
4089    pub request_id: RequestId,
4090    /// Timestamp.
4091    pub timestamp: MonotonicTime,
4092    /// UTC Timestamp.
4093    #[serde(rename = "wallTime")]
4094    pub wall_time: TimeSinceEpoch,
4095    /// WebSocket request data.
4096    pub request: WebSocketRequest,
4097}
4098
4099impl crate::typed::Event for WebSocketWillSendHandshakeRequestEvent {
4100    const METHOD: &'static str = "Network.webSocketWillSendHandshakeRequest";
4101}
4102
4103/// Fired upon WebTransport creation.
4104///
4105/// Payload of the `Network.webTransportCreated` event.
4106#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4107pub struct WebTransportCreatedEvent {
4108    /// WebTransport identifier.
4109    #[serde(rename = "transportId")]
4110    pub transport_id: RequestId,
4111    /// WebTransport request URL.
4112    pub url: String,
4113    /// Timestamp.
4114    pub timestamp: MonotonicTime,
4115    /// Request initiator.
4116    #[serde(default, skip_serializing_if = "Option::is_none")]
4117    pub initiator: Option<Initiator>,
4118}
4119
4120impl crate::typed::Event for WebTransportCreatedEvent {
4121    const METHOD: &'static str = "Network.webTransportCreated";
4122}
4123
4124/// Fired when WebTransport handshake is finished.
4125///
4126/// Payload of the `Network.webTransportConnectionEstablished` event.
4127#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4128pub struct WebTransportConnectionEstablishedEvent {
4129    /// WebTransport identifier.
4130    #[serde(rename = "transportId")]
4131    pub transport_id: RequestId,
4132    /// Timestamp.
4133    pub timestamp: MonotonicTime,
4134}
4135
4136impl crate::typed::Event for WebTransportConnectionEstablishedEvent {
4137    const METHOD: &'static str = "Network.webTransportConnectionEstablished";
4138}
4139
4140/// Fired when WebTransport is disposed.
4141///
4142/// Payload of the `Network.webTransportClosed` event.
4143#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4144pub struct WebTransportClosedEvent {
4145    /// WebTransport identifier.
4146    #[serde(rename = "transportId")]
4147    pub transport_id: RequestId,
4148    /// Timestamp.
4149    pub timestamp: MonotonicTime,
4150}
4151
4152impl crate::typed::Event for WebTransportClosedEvent {
4153    const METHOD: &'static str = "Network.webTransportClosed";
4154}
4155
4156/// Fired upon direct_socket.TCPSocket creation.
4157///
4158/// Experimental: may change without notice.
4159///
4160/// Payload of the `Network.directTCPSocketCreated` event.
4161#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4162pub struct DirectTcpSocketCreatedEvent {
4163    pub identifier: RequestId,
4164    #[serde(rename = "remoteAddr")]
4165    pub remote_addr: String,
4166    /// Unsigned int 16.
4167    #[serde(rename = "remotePort")]
4168    pub remote_port: i64,
4169    pub options: DirectTcpSocketOptions,
4170    pub timestamp: MonotonicTime,
4171    #[serde(default, skip_serializing_if = "Option::is_none")]
4172    pub initiator: Option<Initiator>,
4173}
4174
4175impl crate::typed::Event for DirectTcpSocketCreatedEvent {
4176    const METHOD: &'static str = "Network.directTCPSocketCreated";
4177}
4178
4179/// Fired when direct_socket.TCPSocket connection is opened.
4180///
4181/// Experimental: may change without notice.
4182///
4183/// Payload of the `Network.directTCPSocketOpened` event.
4184#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4185pub struct DirectTcpSocketOpenedEvent {
4186    pub identifier: RequestId,
4187    #[serde(rename = "remoteAddr")]
4188    pub remote_addr: String,
4189    /// Expected to be unsigned integer.
4190    #[serde(rename = "remotePort")]
4191    pub remote_port: i64,
4192    pub timestamp: MonotonicTime,
4193    #[serde(rename = "localAddr", default, skip_serializing_if = "Option::is_none")]
4194    pub local_addr: Option<String>,
4195    /// Expected to be unsigned integer.
4196    #[serde(rename = "localPort", default, skip_serializing_if = "Option::is_none")]
4197    pub local_port: Option<i64>,
4198}
4199
4200impl crate::typed::Event for DirectTcpSocketOpenedEvent {
4201    const METHOD: &'static str = "Network.directTCPSocketOpened";
4202}
4203
4204/// Fired when direct_socket.TCPSocket is aborted.
4205///
4206/// Experimental: may change without notice.
4207///
4208/// Payload of the `Network.directTCPSocketAborted` event.
4209#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4210pub struct DirectTcpSocketAbortedEvent {
4211    pub identifier: RequestId,
4212    #[serde(rename = "errorMessage")]
4213    pub error_message: ErrorReason,
4214    pub timestamp: MonotonicTime,
4215}
4216
4217impl crate::typed::Event for DirectTcpSocketAbortedEvent {
4218    const METHOD: &'static str = "Network.directTCPSocketAborted";
4219}
4220
4221/// Fired when direct_socket.TCPSocket is closed.
4222///
4223/// Experimental: may change without notice.
4224///
4225/// Payload of the `Network.directTCPSocketClosed` event.
4226#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4227pub struct DirectTcpSocketClosedEvent {
4228    pub identifier: RequestId,
4229    pub timestamp: MonotonicTime,
4230}
4231
4232impl crate::typed::Event for DirectTcpSocketClosedEvent {
4233    const METHOD: &'static str = "Network.directTCPSocketClosed";
4234}
4235
4236/// Fired when data is sent to tcp direct socket stream.
4237///
4238/// Experimental: may change without notice.
4239///
4240/// Payload of the `Network.directTCPSocketChunkSent` event.
4241#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4242pub struct DirectTcpSocketChunkSentEvent {
4243    pub identifier: RequestId,
4244    pub data: String,
4245    pub timestamp: MonotonicTime,
4246}
4247
4248impl crate::typed::Event for DirectTcpSocketChunkSentEvent {
4249    const METHOD: &'static str = "Network.directTCPSocketChunkSent";
4250}
4251
4252/// Fired when data is received from tcp direct socket stream.
4253///
4254/// Experimental: may change without notice.
4255///
4256/// Payload of the `Network.directTCPSocketChunkReceived` event.
4257#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4258pub struct DirectTcpSocketChunkReceivedEvent {
4259    pub identifier: RequestId,
4260    pub data: String,
4261    pub timestamp: MonotonicTime,
4262}
4263
4264impl crate::typed::Event for DirectTcpSocketChunkReceivedEvent {
4265    const METHOD: &'static str = "Network.directTCPSocketChunkReceived";
4266}
4267
4268/// Experimental: may change without notice.
4269///
4270/// Payload of the `Network.directUDPSocketJoinedMulticastGroup` event.
4271#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4272pub struct DirectUdpSocketJoinedMulticastGroupEvent {
4273    pub identifier: RequestId,
4274    /// Multicast group address.
4275    #[serde(rename = "IPAddress")]
4276    pub ip_address: String,
4277    /// Source address of a source-specific multicast (SSM) membership. Absent for
4278    /// any-source multicast (ASM) memberships.
4279    #[serde(
4280        rename = "sourceAddress",
4281        default,
4282        skip_serializing_if = "Option::is_none"
4283    )]
4284    pub source_address: Option<String>,
4285}
4286
4287impl crate::typed::Event for DirectUdpSocketJoinedMulticastGroupEvent {
4288    const METHOD: &'static str = "Network.directUDPSocketJoinedMulticastGroup";
4289}
4290
4291/// Experimental: may change without notice.
4292///
4293/// Payload of the `Network.directUDPSocketLeftMulticastGroup` event.
4294#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4295pub struct DirectUdpSocketLeftMulticastGroupEvent {
4296    pub identifier: RequestId,
4297    /// Multicast group address.
4298    #[serde(rename = "IPAddress")]
4299    pub ip_address: String,
4300    /// Source address of a source-specific multicast (SSM) membership. Absent for
4301    /// any-source multicast (ASM) memberships.
4302    #[serde(
4303        rename = "sourceAddress",
4304        default,
4305        skip_serializing_if = "Option::is_none"
4306    )]
4307    pub source_address: Option<String>,
4308}
4309
4310impl crate::typed::Event for DirectUdpSocketLeftMulticastGroupEvent {
4311    const METHOD: &'static str = "Network.directUDPSocketLeftMulticastGroup";
4312}
4313
4314/// Fired upon direct_socket.UDPSocket creation.
4315///
4316/// Experimental: may change without notice.
4317///
4318/// Payload of the `Network.directUDPSocketCreated` event.
4319#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4320pub struct DirectUdpSocketCreatedEvent {
4321    pub identifier: RequestId,
4322    pub options: DirectUdpSocketOptions,
4323    pub timestamp: MonotonicTime,
4324    #[serde(default, skip_serializing_if = "Option::is_none")]
4325    pub initiator: Option<Initiator>,
4326}
4327
4328impl crate::typed::Event for DirectUdpSocketCreatedEvent {
4329    const METHOD: &'static str = "Network.directUDPSocketCreated";
4330}
4331
4332/// Fired when direct_socket.UDPSocket connection is opened.
4333///
4334/// Experimental: may change without notice.
4335///
4336/// Payload of the `Network.directUDPSocketOpened` event.
4337#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4338pub struct DirectUdpSocketOpenedEvent {
4339    pub identifier: RequestId,
4340    #[serde(rename = "localAddr")]
4341    pub local_addr: String,
4342    /// Expected to be unsigned integer.
4343    #[serde(rename = "localPort")]
4344    pub local_port: i64,
4345    pub timestamp: MonotonicTime,
4346    #[serde(
4347        rename = "remoteAddr",
4348        default,
4349        skip_serializing_if = "Option::is_none"
4350    )]
4351    pub remote_addr: Option<String>,
4352    /// Expected to be unsigned integer.
4353    #[serde(
4354        rename = "remotePort",
4355        default,
4356        skip_serializing_if = "Option::is_none"
4357    )]
4358    pub remote_port: Option<i64>,
4359}
4360
4361impl crate::typed::Event for DirectUdpSocketOpenedEvent {
4362    const METHOD: &'static str = "Network.directUDPSocketOpened";
4363}
4364
4365/// Fired when direct_socket.UDPSocket is aborted.
4366///
4367/// Experimental: may change without notice.
4368///
4369/// Payload of the `Network.directUDPSocketAborted` event.
4370#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4371pub struct DirectUdpSocketAbortedEvent {
4372    pub identifier: RequestId,
4373    #[serde(rename = "errorMessage")]
4374    pub error_message: ErrorReason,
4375    pub timestamp: MonotonicTime,
4376}
4377
4378impl crate::typed::Event for DirectUdpSocketAbortedEvent {
4379    const METHOD: &'static str = "Network.directUDPSocketAborted";
4380}
4381
4382/// Fired when direct_socket.UDPSocket is closed.
4383///
4384/// Experimental: may change without notice.
4385///
4386/// Payload of the `Network.directUDPSocketClosed` event.
4387#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4388pub struct DirectUdpSocketClosedEvent {
4389    pub identifier: RequestId,
4390    pub timestamp: MonotonicTime,
4391}
4392
4393impl crate::typed::Event for DirectUdpSocketClosedEvent {
4394    const METHOD: &'static str = "Network.directUDPSocketClosed";
4395}
4396
4397/// Fired when message is sent to udp direct socket stream.
4398///
4399/// Experimental: may change without notice.
4400///
4401/// Payload of the `Network.directUDPSocketChunkSent` event.
4402#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4403pub struct DirectUdpSocketChunkSentEvent {
4404    pub identifier: RequestId,
4405    pub message: DirectUdpMessage,
4406    pub timestamp: MonotonicTime,
4407}
4408
4409impl crate::typed::Event for DirectUdpSocketChunkSentEvent {
4410    const METHOD: &'static str = "Network.directUDPSocketChunkSent";
4411}
4412
4413/// Fired when message is received from udp direct socket stream.
4414///
4415/// Experimental: may change without notice.
4416///
4417/// Payload of the `Network.directUDPSocketChunkReceived` event.
4418#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4419pub struct DirectUdpSocketChunkReceivedEvent {
4420    pub identifier: RequestId,
4421    pub message: DirectUdpMessage,
4422    pub timestamp: MonotonicTime,
4423}
4424
4425impl crate::typed::Event for DirectUdpSocketChunkReceivedEvent {
4426    const METHOD: &'static str = "Network.directUDPSocketChunkReceived";
4427}
4428
4429/// Fired when additional information about a requestWillBeSent event is
4430/// available from the network stack. Not every requestWillBeSent event will
4431/// have an additional requestWillBeSentExtraInfo fired for it, and there is
4432/// no guarantee whether requestWillBeSent or requestWillBeSentExtraInfo will
4433/// be fired first for the same request.
4434///
4435/// Experimental: may change without notice.
4436///
4437/// Payload of the `Network.requestWillBeSentExtraInfo` event.
4438#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4439pub struct RequestWillBeSentExtraInfoEvent {
4440    /// Request identifier. Used to match this information to an existing
4441    /// requestWillBeSent event.
4442    #[serde(rename = "requestId")]
4443    pub request_id: RequestId,
4444    /// A list of cookies potentially associated to the requested URL. This
4445    /// includes both cookies sent with the request and the ones not sent; the
4446    /// latter are distinguished by having blockedReasons field set.
4447    #[serde(rename = "associatedCookies")]
4448    pub associated_cookies: Vec<AssociatedCookie>,
4449    /// Raw request headers as they will be sent over the wire.
4450    pub headers: Headers,
4451    /// Connection timing information for the request.
4452    ///
4453    /// Experimental: may change without notice.
4454    #[serde(rename = "connectTiming")]
4455    pub connect_timing: ConnectTiming,
4456    /// How the request site's device bound sessions were used during this
4457    /// request.
4458    #[serde(
4459        rename = "deviceBoundSessionUsages",
4460        default,
4461        skip_serializing_if = "Option::is_none"
4462    )]
4463    pub device_bound_session_usages: Option<Vec<DeviceBoundSessionWithUsage>>,
4464    /// The client security state set for the request.
4465    #[serde(
4466        rename = "clientSecurityState",
4467        default,
4468        skip_serializing_if = "Option::is_none"
4469    )]
4470    pub client_security_state: Option<ClientSecurityState>,
4471    /// Whether the site has partitioned cookies stored in a partition different
4472    /// than the current one.
4473    #[serde(
4474        rename = "siteHasCookieInOtherPartition",
4475        default,
4476        skip_serializing_if = "Option::is_none"
4477    )]
4478    pub site_has_cookie_in_other_partition: Option<bool>,
4479    /// The network conditions id if this request was affected by network
4480    /// conditions configured via emulateNetworkConditionsByRule.
4481    #[serde(
4482        rename = "appliedNetworkConditionsId",
4483        default,
4484        skip_serializing_if = "Option::is_none"
4485    )]
4486    pub applied_network_conditions_id: Option<String>,
4487}
4488
4489impl crate::typed::Event for RequestWillBeSentExtraInfoEvent {
4490    const METHOD: &'static str = "Network.requestWillBeSentExtraInfo";
4491}
4492
4493/// Fired when additional information about a responseReceived event is
4494/// available from the network stack. Not every responseReceived event will
4495/// have an additional responseReceivedExtraInfo for it, and
4496/// responseReceivedExtraInfo may be fired before or after responseReceived.
4497///
4498/// Experimental: may change without notice.
4499///
4500/// Payload of the `Network.responseReceivedExtraInfo` event.
4501#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4502pub struct ResponseReceivedExtraInfoEvent {
4503    /// Request identifier. Used to match this information to another
4504    /// responseReceived event.
4505    #[serde(rename = "requestId")]
4506    pub request_id: RequestId,
4507    /// A list of cookies which were not stored from the response along with the
4508    /// corresponding reasons for blocking. The cookies here may not be valid due
4509    /// to syntax errors, which are represented by the invalid cookie line string
4510    /// instead of a proper cookie.
4511    #[serde(rename = "blockedCookies")]
4512    pub blocked_cookies: Vec<BlockedSetCookieWithReason>,
4513    /// Raw response headers as they were received over the wire. Duplicate
4514    /// headers in the response are represented as a single key with their values
4515    /// concatentated using `\n` as the separator. See also `headersText` that
4516    /// contains verbatim text for HTTP/1.*.
4517    pub headers: Headers,
4518    /// The IP address space of the resource. The address space can only be
4519    /// determined once the transport established the connection, so we can't send
4520    /// it in `requestWillBeSentExtraInfo`.
4521    #[serde(rename = "resourceIPAddressSpace")]
4522    pub resource_ip_address_space: IpAddressSpace,
4523    /// The status code of the response. This is useful in cases the request
4524    /// failed and no responseReceived event is triggered, which is the case for,
4525    /// e.g., CORS errors. This is also the correct status code for cached
4526    /// requests, where the status in responseReceived is a 200 and this will be
4527    /// 304.
4528    #[serde(rename = "statusCode")]
4529    pub status_code: i64,
4530    /// Raw response header text as it was received over the wire. The raw text
4531    /// may not always be available, such as in the case of HTTP/2 or QUIC.
4532    #[serde(
4533        rename = "headersText",
4534        default,
4535        skip_serializing_if = "Option::is_none"
4536    )]
4537    pub headers_text: Option<String>,
4538    /// The cookie partition key that will be used to store partitioned cookies
4539    /// set in this response. Only sent when partitioned cookies are enabled.
4540    ///
4541    /// Experimental: may change without notice.
4542    #[serde(
4543        rename = "cookiePartitionKey",
4544        default,
4545        skip_serializing_if = "Option::is_none"
4546    )]
4547    pub cookie_partition_key: Option<CookiePartitionKey>,
4548    /// True if partitioned cookies are enabled, but the partition key is not
4549    /// serializable to string.
4550    #[serde(
4551        rename = "cookiePartitionKeyOpaque",
4552        default,
4553        skip_serializing_if = "Option::is_none"
4554    )]
4555    pub cookie_partition_key_opaque: Option<bool>,
4556    /// A list of cookies which should have been blocked by 3PCD but are exempted
4557    /// and stored from the response with the corresponding reason.
4558    #[serde(
4559        rename = "exemptedCookies",
4560        default,
4561        skip_serializing_if = "Option::is_none"
4562    )]
4563    pub exempted_cookies: Option<Vec<ExemptedSetCookieWithReason>>,
4564}
4565
4566impl crate::typed::Event for ResponseReceivedExtraInfoEvent {
4567    const METHOD: &'static str = "Network.responseReceivedExtraInfo";
4568}
4569
4570/// Fired when 103 Early Hints headers is received in addition to the common
4571/// response. Not every responseReceived event will have an
4572/// responseReceivedEarlyHints fired. Only one responseReceivedEarlyHints may
4573/// be fired for eached responseReceived event.
4574///
4575/// Experimental: may change without notice.
4576///
4577/// Payload of the `Network.responseReceivedEarlyHints` event.
4578#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4579pub struct ResponseReceivedEarlyHintsEvent {
4580    /// Request identifier. Used to match this information to another
4581    /// responseReceived event.
4582    #[serde(rename = "requestId")]
4583    pub request_id: RequestId,
4584    /// Raw response headers as they were received over the wire. Duplicate
4585    /// headers in the response are represented as a single key with their values
4586    /// concatentated using `\n` as the separator. See also `headersText` that
4587    /// contains verbatim text for HTTP/1.*.
4588    pub headers: Headers,
4589}
4590
4591impl crate::typed::Event for ResponseReceivedEarlyHintsEvent {
4592    const METHOD: &'static str = "Network.responseReceivedEarlyHints";
4593}
4594
4595/// Fired exactly once for each Trust Token operation. Depending on the type
4596/// of the operation and whether the operation succeeded or failed, the event
4597/// is fired before the corresponding request was sent or after the response
4598/// was received.
4599///
4600/// Experimental: may change without notice.
4601///
4602/// Payload of the `Network.trustTokenOperationDone` event.
4603#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4604pub struct TrustTokenOperationDoneEvent {
4605    /// Detailed success or error status of the operation. 'AlreadyExists' also
4606    /// signifies a successful operation, as the result of the operation already
4607    /// exists und thus, the operation was abort preemptively (e.g. a cache hit).
4608    pub status: TrustTokenOperationDoneStatus,
4609    pub r#type: TrustTokenOperationType,
4610    #[serde(rename = "requestId")]
4611    pub request_id: RequestId,
4612    /// Top level origin. The context in which the operation was attempted.
4613    #[serde(
4614        rename = "topLevelOrigin",
4615        default,
4616        skip_serializing_if = "Option::is_none"
4617    )]
4618    pub top_level_origin: Option<String>,
4619    /// Origin of the issuer in case of a "Issuance" or "Redemption" operation.
4620    #[serde(
4621        rename = "issuerOrigin",
4622        default,
4623        skip_serializing_if = "Option::is_none"
4624    )]
4625    pub issuer_origin: Option<String>,
4626    /// The number of obtained Trust Tokens on a successful "Issuance" operation.
4627    #[serde(
4628        rename = "issuedTokenCount",
4629        default,
4630        skip_serializing_if = "Option::is_none"
4631    )]
4632    pub issued_token_count: Option<i64>,
4633}
4634
4635/// The values `status` accepts on `trustTokenOperationDone`.
4636#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
4637pub enum TrustTokenOperationDoneStatus {
4638    /// `Ok`
4639    Ok,
4640    /// `InvalidArgument`
4641    InvalidArgument,
4642    /// `MissingIssuerKeys`
4643    MissingIssuerKeys,
4644    /// `FailedPrecondition`
4645    FailedPrecondition,
4646    /// `ResourceExhausted`
4647    ResourceExhausted,
4648    /// `AlreadyExists`
4649    AlreadyExists,
4650    /// `ResourceLimited`
4651    ResourceLimited,
4652    /// `Unauthorized`
4653    Unauthorized,
4654    /// `BadResponse`
4655    BadResponse,
4656    /// `InternalError`
4657    InternalError,
4658    /// `UnknownError`
4659    UnknownError,
4660    /// `FulfilledLocally`
4661    FulfilledLocally,
4662    /// `SiteIssuerLimit`
4663    SiteIssuerLimit,
4664    /// A value this vendored schema does not list. Chrome adds values ahead of
4665    /// the published protocol, so an unrecognised one is kept as it arrived
4666    /// rather than failing the payload it came in.
4667    #[serde(untagged)]
4668    Unrecognized(String),
4669}
4670
4671impl crate::typed::Event for TrustTokenOperationDoneEvent {
4672    const METHOD: &'static str = "Network.trustTokenOperationDone";
4673}
4674
4675/// Fired once security policy has been updated.
4676///
4677/// Experimental: may change without notice.
4678///
4679/// Payload of the `Network.policyUpdated` event.
4680#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4681pub struct PolicyUpdatedEvent {}
4682
4683impl crate::typed::Event for PolicyUpdatedEvent {
4684    const METHOD: &'static str = "Network.policyUpdated";
4685}
4686
4687/// Is sent whenever a new report is added. And after 'enableReportingApi' for
4688/// all existing reports.
4689///
4690/// Experimental: may change without notice.
4691///
4692/// Payload of the `Network.reportingApiReportAdded` event.
4693#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4694pub struct ReportingApiReportAddedEvent {
4695    pub report: ReportingApiReport,
4696}
4697
4698impl crate::typed::Event for ReportingApiReportAddedEvent {
4699    const METHOD: &'static str = "Network.reportingApiReportAdded";
4700}
4701
4702/// Experimental: may change without notice.
4703///
4704/// Payload of the `Network.reportingApiReportUpdated` event.
4705#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4706pub struct ReportingApiReportUpdatedEvent {
4707    pub report: ReportingApiReport,
4708}
4709
4710impl crate::typed::Event for ReportingApiReportUpdatedEvent {
4711    const METHOD: &'static str = "Network.reportingApiReportUpdated";
4712}
4713
4714/// Experimental: may change without notice.
4715///
4716/// Payload of the `Network.reportingApiEndpointsChangedForOrigin` event.
4717#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4718pub struct ReportingApiEndpointsChangedForOriginEvent {
4719    /// Origin of the document(s) which configured the endpoints.
4720    pub origin: String,
4721    pub endpoints: Vec<ReportingApiEndpoint>,
4722}
4723
4724impl crate::typed::Event for ReportingApiEndpointsChangedForOriginEvent {
4725    const METHOD: &'static str = "Network.reportingApiEndpointsChangedForOrigin";
4726}
4727
4728/// Triggered when the initial set of device bound sessions is added.
4729///
4730/// Experimental: may change without notice.
4731///
4732/// Payload of the `Network.deviceBoundSessionsAdded` event.
4733#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4734pub struct DeviceBoundSessionsAddedEvent {
4735    /// The device bound sessions.
4736    pub sessions: Vec<DeviceBoundSession>,
4737}
4738
4739impl crate::typed::Event for DeviceBoundSessionsAddedEvent {
4740    const METHOD: &'static str = "Network.deviceBoundSessionsAdded";
4741}
4742
4743/// Triggered when a device bound session event occurs.
4744///
4745/// Experimental: may change without notice.
4746///
4747/// Payload of the `Network.deviceBoundSessionEventOccurred` event.
4748#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
4749pub struct DeviceBoundSessionEventOccurredEvent {
4750    /// A unique identifier for this session event.
4751    #[serde(rename = "eventId")]
4752    pub event_id: DeviceBoundSessionEventId,
4753    /// The site this session event is associated with.
4754    pub site: String,
4755    /// Whether this event was considered successful.
4756    pub succeeded: bool,
4757    /// The session ID this event is associated with. May not be populated for
4758    /// failed events.
4759    #[serde(rename = "sessionId", default, skip_serializing_if = "Option::is_none")]
4760    pub session_id: Option<String>,
4761    /// The below are the different session event type details. Exactly one is
4762    /// populated.
4763    #[serde(
4764        rename = "creationEventDetails",
4765        default,
4766        skip_serializing_if = "Option::is_none"
4767    )]
4768    pub creation_event_details: Option<CreationEventDetails>,
4769    #[serde(
4770        rename = "refreshEventDetails",
4771        default,
4772        skip_serializing_if = "Option::is_none"
4773    )]
4774    pub refresh_event_details: Option<RefreshEventDetails>,
4775    #[serde(
4776        rename = "terminationEventDetails",
4777        default,
4778        skip_serializing_if = "Option::is_none"
4779    )]
4780    pub termination_event_details: Option<TerminationEventDetails>,
4781    #[serde(
4782        rename = "challengeEventDetails",
4783        default,
4784        skip_serializing_if = "Option::is_none"
4785    )]
4786    pub challenge_event_details: Option<ChallengeEventDetails>,
4787}
4788
4789impl crate::typed::Event for DeviceBoundSessionEventOccurredEvent {
4790    const METHOD: &'static str = "Network.deviceBoundSessionEventOccurred";
4791}