Skip to main content

browser_protocol/network/
mod.rs

1//! Network domain allows tracking network activities of the page. It exposes information about http,
2//! file, data and other requests and responses, their headers, bodies, timing, etc.
3use serde::{Serialize, Deserialize};
4use serde_json::Value as JsonValue;
5
6/// Resource type as it was perceived by the rendering engine.
7
8#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
9pub enum ResourceType {
10    #[default]
11    Document,
12    Stylesheet,
13    Image,
14    Media,
15    Font,
16    Script,
17    TextTrack,
18    XHR,
19    Fetch,
20    Prefetch,
21    EventSource,
22    WebSocket,
23    Manifest,
24    SignedExchange,
25    Ping,
26    CSPViolationReport,
27    Preflight,
28    FedCM,
29    Other,
30}
31
32/// Unique loader identifier.
33
34pub type LoaderId = String;
35
36/// Unique network request identifier.
37/// Note that this does not identify individual HTTP requests that are part of
38/// a network request.
39
40pub type RequestId = String;
41
42/// Unique intercepted request identifier.
43
44pub type InterceptionId = String;
45
46/// Network level fetch failure reason.
47
48#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
49pub enum ErrorReason {
50    #[default]
51    Failed,
52    Aborted,
53    TimedOut,
54    AccessDenied,
55    ConnectionClosed,
56    ConnectionReset,
57    ConnectionRefused,
58    ConnectionAborted,
59    ConnectionFailed,
60    NameNotResolved,
61    InternetDisconnected,
62    AddressUnreachable,
63    BlockedByClient,
64    BlockedByResponse,
65}
66
67/// UTC time in seconds, counted from January 1, 1970.
68
69pub type TimeSinceEpoch = f64;
70
71/// Monotonically increasing time in seconds since an arbitrary point in the past.
72
73pub type MonotonicTime = f64;
74
75/// Request / response headers as keys / values of JSON object.
76
77pub type Headers = serde_json::Map<String, JsonValue>;
78
79/// The underlying connection technology that the browser is supposedly using.
80
81#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
82pub enum ConnectionType {
83    #[default]
84    None,
85    Cellular2g,
86    Cellular3g,
87    Cellular4g,
88    Bluetooth,
89    Ethernet,
90    Wifi,
91    Wimax,
92    Other,
93}
94
95/// Represents the cookie's 'SameSite' status:
96/// https://tools.ietf.org/html/draft-west-first-party-cookies
97
98#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
99pub enum CookieSameSite {
100    #[default]
101    Strict,
102    Lax,
103    None,
104}
105
106/// Represents the cookie's 'Priority' status:
107/// https://tools.ietf.org/html/draft-west-cookie-priority-00
108
109#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
110pub enum CookiePriority {
111    #[default]
112    Low,
113    Medium,
114    High,
115}
116
117/// Represents the source scheme of the origin that originally set the cookie.
118/// A value of "Unset" allows protocol clients to emulate legacy cookie scope for the scheme.
119/// This is a temporary ability and it will be removed in the future.
120
121#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
122pub enum CookieSourceScheme {
123    #[default]
124    Unset,
125    NonSecure,
126    Secure,
127}
128
129/// Timing information for the request.
130
131#[derive(Debug, Clone, Serialize, Deserialize, Default)]
132#[serde(rename_all = "camelCase")]
133pub struct ResourceTiming {
134    /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in
135    /// milliseconds relatively to this requestTime.
136
137    pub requestTime: f64,
138    /// Started resolving proxy.
139
140    pub proxyStart: f64,
141    /// Finished resolving proxy.
142
143    pub proxyEnd: f64,
144    /// Started DNS address resolve.
145
146    pub dnsStart: f64,
147    /// Finished DNS address resolve.
148
149    pub dnsEnd: f64,
150    /// Started connecting to the remote host.
151
152    pub connectStart: f64,
153    /// Connected to the remote host.
154
155    pub connectEnd: f64,
156    /// Started SSL handshake.
157
158    pub sslStart: f64,
159    /// Finished SSL handshake.
160
161    pub sslEnd: f64,
162    /// Started running ServiceWorker.
163
164    pub workerStart: f64,
165    /// Finished Starting ServiceWorker.
166
167    pub workerReady: f64,
168    /// Started fetch event.
169
170    pub workerFetchStart: f64,
171    /// Settled fetch event respondWith promise.
172
173    pub workerRespondWithSettled: f64,
174    /// Started ServiceWorker static routing source evaluation.
175
176    #[serde(skip_serializing_if = "Option::is_none")]
177    pub workerRouterEvaluationStart: Option<f64>,
178    /// Started cache lookup when the source was evaluated to 'cache'.
179
180    #[serde(skip_serializing_if = "Option::is_none")]
181    pub workerCacheLookupStart: Option<f64>,
182    /// Started sending request.
183
184    pub sendStart: f64,
185    /// Finished sending request.
186
187    pub sendEnd: f64,
188    /// Time the server started pushing request.
189
190    pub pushStart: f64,
191    /// Time the server finished pushing request.
192
193    pub pushEnd: f64,
194    /// Started receiving response headers.
195
196    pub receiveHeadersStart: f64,
197    /// Finished receiving response headers.
198
199    pub receiveHeadersEnd: f64,
200}
201
202/// Loading priority of a resource request.
203
204#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
205pub enum ResourcePriority {
206    #[default]
207    VeryLow,
208    Low,
209    Medium,
210    High,
211    VeryHigh,
212}
213
214/// The render-blocking behavior of a resource request.
215
216#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
217pub enum RenderBlockingBehavior {
218    #[default]
219    Blocking,
220    InBodyParserBlocking,
221    NonBlocking,
222    NonBlockingDynamic,
223    PotentiallyBlocking,
224}
225
226/// Post data entry for HTTP request
227
228#[derive(Debug, Clone, Serialize, Deserialize, Default)]
229#[serde(rename_all = "camelCase")]
230pub struct PostDataEntry {
231
232    #[serde(skip_serializing_if = "Option::is_none")]
233    pub bytes: Option<String>,
234}
235
236/// HTTP request data.
237
238#[derive(Debug, Clone, Serialize, Deserialize, Default)]
239#[serde(rename_all = "camelCase")]
240pub struct Request {
241    /// Request URL (without fragment).
242
243    pub url: String,
244    /// Fragment of the requested URL starting with hash, if present.
245
246    #[serde(skip_serializing_if = "Option::is_none")]
247    pub urlFragment: Option<String>,
248    /// HTTP request method.
249
250    pub method: String,
251    /// HTTP request headers.
252
253    pub headers: Headers,
254    /// HTTP POST request data.
255    /// Use postDataEntries instead.
256
257    #[serde(skip_serializing_if = "Option::is_none")]
258    pub postData: Option<String>,
259    /// True when the request has POST data. Note that postData might still be omitted when this flag is true when the data is too long.
260
261    #[serde(skip_serializing_if = "Option::is_none")]
262    pub hasPostData: Option<bool>,
263    /// Request body elements (post data broken into individual entries).
264
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub postDataEntries: Option<Vec<PostDataEntry>>,
267    /// The mixed content type of the request.
268
269    #[serde(skip_serializing_if = "Option::is_none")]
270    pub mixedContentType: Option<crate::security::MixedContentType>,
271    /// Priority of the resource request at the time request is sent.
272
273    pub initialPriority: ResourcePriority,
274    /// The referrer policy of the request, as defined in https://www.w3.org/TR/referrer-policy/
275
276    pub referrerPolicy: String,
277    /// Whether is loaded via link preload.
278
279    #[serde(skip_serializing_if = "Option::is_none")]
280    pub isLinkPreload: Option<bool>,
281    /// Set for requests when the TrustToken API is used. Contains the parameters
282    /// passed by the developer (e.g. via "fetch") as understood by the backend.
283
284    #[serde(skip_serializing_if = "Option::is_none")]
285    pub trustTokenParams: Option<TrustTokenParams>,
286    /// True if this resource request is considered to be the 'same site' as the
287    /// request corresponding to the main frame.
288
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub isSameSite: Option<bool>,
291    /// True when the resource request is ad-related.
292
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub isAdRelated: Option<bool>,
295}
296
297/// Details of a signed certificate timestamp (SCT).
298
299#[derive(Debug, Clone, Serialize, Deserialize, Default)]
300#[serde(rename_all = "camelCase")]
301pub struct SignedCertificateTimestamp {
302    /// Validation status.
303
304    pub status: String,
305    /// Origin.
306
307    pub origin: String,
308    /// Log name / description.
309
310    pub logDescription: String,
311    /// Log ID.
312
313    pub logId: String,
314    /// Issuance date. Unlike TimeSinceEpoch, this contains the number of
315    /// milliseconds since January 1, 1970, UTC, not the number of seconds.
316
317    pub timestamp: f64,
318    /// Hash algorithm.
319
320    pub hashAlgorithm: String,
321    /// Signature algorithm.
322
323    pub signatureAlgorithm: String,
324    /// Signature data.
325
326    pub signatureData: String,
327}
328
329/// Security details about a request.
330
331#[derive(Debug, Clone, Serialize, Deserialize, Default)]
332#[serde(rename_all = "camelCase")]
333pub struct SecurityDetails {
334    /// Protocol name (e.g. "TLS 1.2" or "QUIC").
335
336    pub protocol: String,
337    /// Key Exchange used by the connection, or the empty string if not applicable.
338
339    pub keyExchange: String,
340    /// (EC)DH group used by the connection, if applicable.
341
342    #[serde(skip_serializing_if = "Option::is_none")]
343    pub keyExchangeGroup: Option<String>,
344    /// Cipher name.
345
346    pub cipher: String,
347    /// TLS MAC. Note that AEAD ciphers do not have separate MACs.
348
349    #[serde(skip_serializing_if = "Option::is_none")]
350    pub mac: Option<String>,
351    /// Certificate ID value.
352
353    pub certificateId: crate::security::CertificateId,
354    /// Certificate subject name.
355
356    pub subjectName: String,
357    /// Subject Alternative Name (SAN) DNS names and IP addresses.
358
359    pub sanList: Vec<String>,
360    /// Name of the issuing CA.
361
362    pub issuer: String,
363    /// Certificate valid from date.
364
365    pub validFrom: TimeSinceEpoch,
366    /// Certificate valid to (expiration) date
367
368    pub validTo: TimeSinceEpoch,
369    /// List of signed certificate timestamps (SCTs).
370
371    pub signedCertificateTimestampList: Vec<SignedCertificateTimestamp>,
372    /// Whether the request complied with Certificate Transparency policy
373
374    pub certificateTransparencyCompliance: CertificateTransparencyCompliance,
375    /// The signature algorithm used by the server in the TLS server signature,
376    /// represented as a TLS SignatureScheme code point. Omitted if not
377    /// applicable or not known.
378
379    #[serde(skip_serializing_if = "Option::is_none")]
380    pub serverSignatureAlgorithm: Option<i64>,
381    /// Whether the connection used Encrypted ClientHello
382
383    pub encryptedClientHello: bool,
384}
385
386/// Whether the request complied with Certificate Transparency policy.
387
388#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
389pub enum CertificateTransparencyCompliance {
390    #[default]
391    Unknown,
392    NotCompliant,
393    Compliant,
394}
395
396/// The reason why request was blocked.
397
398#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
399pub enum BlockedReason {
400    #[default]
401    Other,
402    Csp,
403    MixedContent,
404    Origin,
405    Inspector,
406    Integrity,
407    SubresourceFilter,
408    ContentType,
409    CoepFrameResourceNeedsCoepHeader,
410    CoopSandboxedIframeCannotNavigateToCoopPage,
411    CorpNotSameOrigin,
412    CorpNotSameOriginAfterDefaultedToSameOriginByCoep,
413    CorpNotSameOriginAfterDefaultedToSameOriginByDip,
414    CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip,
415    CorpNotSameSite,
416    SriMessageSignatureMismatch,
417}
418
419/// The reason why request was blocked.
420
421#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
422pub enum CorsError {
423    #[default]
424    DisallowedByMode,
425    InvalidResponse,
426    WildcardOriginNotAllowed,
427    MissingAllowOriginHeader,
428    MultipleAllowOriginValues,
429    InvalidAllowOriginValue,
430    AllowOriginMismatch,
431    InvalidAllowCredentials,
432    CorsDisabledScheme,
433    PreflightInvalidStatus,
434    PreflightDisallowedRedirect,
435    PreflightWildcardOriginNotAllowed,
436    PreflightMissingAllowOriginHeader,
437    PreflightMultipleAllowOriginValues,
438    PreflightInvalidAllowOriginValue,
439    PreflightAllowOriginMismatch,
440    PreflightInvalidAllowCredentials,
441    PreflightMissingAllowExternal,
442    PreflightInvalidAllowExternal,
443    InvalidAllowMethodsPreflightResponse,
444    InvalidAllowHeadersPreflightResponse,
445    MethodDisallowedByPreflightResponse,
446    HeaderDisallowedByPreflightResponse,
447    RedirectContainsCredentials,
448    InsecureLocalNetwork,
449    InvalidLocalNetworkAccess,
450    NoCorsRedirectModeNotFollow,
451    LocalNetworkAccessPermissionDenied,
452}
453
454
455#[derive(Debug, Clone, Serialize, Deserialize, Default)]
456#[serde(rename_all = "camelCase")]
457pub struct CorsErrorStatus {
458
459    pub corsError: CorsError,
460
461    pub failedParameter: String,
462}
463
464/// Source of serviceworker response.
465
466#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
467pub enum ServiceWorkerResponseSource {
468    #[default]
469    CacheStorage,
470    HttpCache,
471    FallbackCode,
472    Network,
473}
474
475/// Determines what type of Trust Token operation is executed and
476/// depending on the type, some additional parameters. The values
477/// are specified in third_party/blink/renderer/core/fetch/trust_token.idl.
478
479#[derive(Debug, Clone, Serialize, Deserialize, Default)]
480#[serde(rename_all = "camelCase")]
481pub struct TrustTokenParams {
482
483    pub operation: TrustTokenOperationType,
484    /// Only set for "token-redemption" operation and determine whether
485    /// to request a fresh SRR or use a still valid cached SRR.
486
487    pub refreshPolicy: String,
488    /// Origins of issuers from whom to request tokens or redemption
489    /// records.
490
491    #[serde(skip_serializing_if = "Option::is_none")]
492    pub issuers: Option<Vec<String>>,
493}
494
495
496#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
497pub enum TrustTokenOperationType {
498    #[default]
499    Issuance,
500    Redemption,
501    Signing,
502}
503
504/// The reason why Chrome uses a specific transport protocol for HTTP semantics.
505
506#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
507pub enum AlternateProtocolUsage {
508    #[default]
509    AlternativeJobWonWithoutRace,
510    AlternativeJobWonRace,
511    MainJobWonRace,
512    MappingMissing,
513    Broken,
514    DnsAlpnH3JobWonWithoutRace,
515    DnsAlpnH3JobWonRace,
516    UnspecifiedReason,
517}
518
519/// Source of service worker router.
520
521#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
522pub enum ServiceWorkerRouterSource {
523    #[default]
524    Network,
525    Cache,
526    FetchEvent,
527    RaceNetworkAndFetchHandler,
528    RaceNetworkAndCache,
529}
530
531
532#[derive(Debug, Clone, Serialize, Deserialize, Default)]
533#[serde(rename_all = "camelCase")]
534pub struct ServiceWorkerRouterInfo {
535    /// ID of the rule matched. If there is a matched rule, this field will
536    /// be set, otherwiser no value will be set.
537
538    #[serde(skip_serializing_if = "Option::is_none")]
539    pub ruleIdMatched: Option<u64>,
540    /// The router source of the matched rule. If there is a matched rule, this
541    /// field will be set, otherwise no value will be set.
542
543    #[serde(skip_serializing_if = "Option::is_none")]
544    pub matchedSourceType: Option<ServiceWorkerRouterSource>,
545    /// The actual router source used.
546
547    #[serde(skip_serializing_if = "Option::is_none")]
548    pub actualSourceType: Option<ServiceWorkerRouterSource>,
549}
550
551/// HTTP response data.
552
553#[derive(Debug, Clone, Serialize, Deserialize, Default)]
554#[serde(rename_all = "camelCase")]
555pub struct Response {
556    /// Response URL. This URL can be different from CachedResource.url in case of redirect.
557
558    pub url: String,
559    /// HTTP response status code.
560
561    pub status: i64,
562    /// HTTP response status text.
563
564    pub statusText: String,
565    /// HTTP response headers.
566
567    pub headers: Headers,
568    /// HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.
569
570    #[serde(skip_serializing_if = "Option::is_none")]
571    pub headersText: Option<String>,
572    /// Resource mimeType as determined by the browser.
573
574    pub mimeType: String,
575    /// Resource charset as determined by the browser (if applicable).
576
577    pub charset: String,
578    /// Refined HTTP request headers that were actually transmitted over the network.
579
580    #[serde(skip_serializing_if = "Option::is_none")]
581    pub requestHeaders: Option<Headers>,
582    /// HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.
583
584    #[serde(skip_serializing_if = "Option::is_none")]
585    pub requestHeadersText: Option<String>,
586    /// Specifies whether physical connection was actually reused for this request.
587
588    pub connectionReused: bool,
589    /// Physical connection id that was actually used for this request.
590
591    pub connectionId: f64,
592    /// Remote IP address.
593
594    #[serde(skip_serializing_if = "Option::is_none")]
595    pub remoteIPAddress: Option<String>,
596    /// Remote port.
597
598    #[serde(skip_serializing_if = "Option::is_none")]
599    pub remotePort: Option<i64>,
600    /// Specifies that the request was served from the disk cache.
601
602    #[serde(skip_serializing_if = "Option::is_none")]
603    pub fromDiskCache: Option<bool>,
604    /// Specifies that the request was served from the ServiceWorker.
605
606    #[serde(skip_serializing_if = "Option::is_none")]
607    pub fromServiceWorker: Option<bool>,
608    /// Specifies that the request was served from the prefetch cache.
609
610    #[serde(skip_serializing_if = "Option::is_none")]
611    pub fromPrefetchCache: Option<bool>,
612    /// Specifies that the request was served from the prefetch cache.
613
614    #[serde(skip_serializing_if = "Option::is_none")]
615    pub fromEarlyHints: Option<bool>,
616    /// Information about how ServiceWorker Static Router API was used. If this
617    /// field is set with 'matchedSourceType' field, a matching rule is found.
618    /// If this field is set without 'matchedSource', no matching rule is found.
619    /// Otherwise, the API is not used.
620
621    #[serde(skip_serializing_if = "Option::is_none")]
622    pub serviceWorkerRouterInfo: Option<ServiceWorkerRouterInfo>,
623    /// Total number of bytes received for this request so far.
624
625    pub encodedDataLength: f64,
626    /// Timing information for the given request.
627
628    #[serde(skip_serializing_if = "Option::is_none")]
629    pub timing: Option<ResourceTiming>,
630    /// Response source of response from ServiceWorker.
631
632    #[serde(skip_serializing_if = "Option::is_none")]
633    pub serviceWorkerResponseSource: Option<ServiceWorkerResponseSource>,
634    /// The time at which the returned response was generated.
635
636    #[serde(skip_serializing_if = "Option::is_none")]
637    pub responseTime: Option<TimeSinceEpoch>,
638    /// Cache Storage Cache Name.
639
640    #[serde(skip_serializing_if = "Option::is_none")]
641    pub cacheStorageCacheName: Option<String>,
642    /// Protocol used to fetch this request.
643
644    #[serde(skip_serializing_if = "Option::is_none")]
645    pub protocol: Option<String>,
646    /// The reason why Chrome uses a specific transport protocol for HTTP semantics.
647
648    #[serde(skip_serializing_if = "Option::is_none")]
649    pub alternateProtocolUsage: Option<AlternateProtocolUsage>,
650    /// Security state of the request resource.
651
652    pub securityState: crate::security::SecurityState,
653    /// Security details for the request.
654
655    #[serde(skip_serializing_if = "Option::is_none")]
656    pub securityDetails: Option<SecurityDetails>,
657}
658
659/// WebSocket request data.
660
661#[derive(Debug, Clone, Serialize, Deserialize, Default)]
662#[serde(rename_all = "camelCase")]
663pub struct WebSocketRequest {
664    /// HTTP request headers.
665
666    pub headers: Headers,
667}
668
669/// WebSocket response data.
670
671#[derive(Debug, Clone, Serialize, Deserialize, Default)]
672#[serde(rename_all = "camelCase")]
673pub struct WebSocketResponse {
674    /// HTTP response status code.
675
676    pub status: i64,
677    /// HTTP response status text.
678
679    pub statusText: String,
680    /// HTTP response headers.
681
682    pub headers: Headers,
683    /// HTTP response headers text.
684
685    #[serde(skip_serializing_if = "Option::is_none")]
686    pub headersText: Option<String>,
687    /// HTTP request headers.
688
689    #[serde(skip_serializing_if = "Option::is_none")]
690    pub requestHeaders: Option<Headers>,
691    /// HTTP request headers text.
692
693    #[serde(skip_serializing_if = "Option::is_none")]
694    pub requestHeadersText: Option<String>,
695}
696
697/// WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.
698
699#[derive(Debug, Clone, Serialize, Deserialize, Default)]
700#[serde(rename_all = "camelCase")]
701pub struct WebSocketFrame {
702    /// WebSocket message opcode.
703
704    pub opcode: f64,
705    /// WebSocket message mask.
706
707    pub mask: bool,
708    /// WebSocket message payload data.
709    /// If the opcode is 1, this is a text message and payloadData is a UTF-8 string.
710    /// If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data.
711
712    pub payloadData: String,
713}
714
715/// Information about the cached resource.
716
717#[derive(Debug, Clone, Serialize, Deserialize, Default)]
718#[serde(rename_all = "camelCase")]
719pub struct CachedResource {
720    /// Resource URL. This is the url of the original network request.
721
722    pub url: String,
723    /// Type of this resource.
724
725    #[serde(rename = "type")]
726    pub type_: ResourceType,
727    /// Cached response data.
728
729    #[serde(skip_serializing_if = "Option::is_none")]
730    pub response: Option<Response>,
731    /// Cached response body size.
732
733    pub bodySize: f64,
734}
735
736/// Information about the request initiator.
737
738#[derive(Debug, Clone, Serialize, Deserialize, Default)]
739#[serde(rename_all = "camelCase")]
740pub struct Initiator {
741    /// Type of this initiator.
742
743    #[serde(rename = "type")]
744    pub type_: String,
745    /// Initiator JavaScript stack trace, set for Script only.
746    /// Requires the Debugger domain to be enabled.
747
748    #[serde(skip_serializing_if = "Option::is_none")]
749    pub stack: Option<crate::runtime::StackTrace>,
750    /// Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
751
752    #[serde(skip_serializing_if = "Option::is_none")]
753    pub url: Option<String>,
754    /// Initiator line number, set for Parser type or for Script type (when script is importing
755    /// module) (0-based).
756
757    #[serde(skip_serializing_if = "Option::is_none")]
758    pub lineNumber: Option<f64>,
759    /// Initiator column number, set for Parser type or for Script type (when script is importing
760    /// module) (0-based).
761
762    #[serde(skip_serializing_if = "Option::is_none")]
763    pub columnNumber: Option<f64>,
764    /// Set if another request triggered this request (e.g. preflight).
765
766    #[serde(skip_serializing_if = "Option::is_none")]
767    pub requestId: Option<RequestId>,
768}
769
770/// cookiePartitionKey object
771/// The representation of the components of the key that are created by the cookiePartitionKey class contained in net/cookies/cookie_partition_key.h.
772
773#[derive(Debug, Clone, Serialize, Deserialize, Default)]
774#[serde(rename_all = "camelCase")]
775pub struct CookiePartitionKey {
776    /// The site of the top-level URL the browser was visiting at the start
777    /// of the request to the endpoint that set the cookie.
778
779    pub topLevelSite: String,
780    /// Indicates if the cookie has any ancestors that are cross-site to the topLevelSite.
781
782    pub hasCrossSiteAncestor: bool,
783}
784
785/// Cookie object
786
787#[derive(Debug, Clone, Serialize, Deserialize, Default)]
788#[serde(rename_all = "camelCase")]
789pub struct Cookie {
790    /// Cookie name.
791
792    pub name: String,
793    /// Cookie value.
794
795    pub value: String,
796    /// Cookie domain.
797
798    pub domain: String,
799    /// Cookie path.
800
801    pub path: String,
802    /// Cookie expiration date as the number of seconds since the UNIX epoch.
803    /// The value is set to -1 if the expiry date is not set.
804    /// The value can be null for values that cannot be represented in
805    /// JSON (±Inf).
806
807    pub expires: f64,
808    /// Cookie size.
809
810    pub size: u64,
811    /// True if cookie is http-only.
812
813    pub httpOnly: bool,
814    /// True if cookie is secure.
815
816    pub secure: bool,
817    /// True in case of session cookie.
818
819    pub session: bool,
820    /// Cookie SameSite type.
821
822    #[serde(skip_serializing_if = "Option::is_none")]
823    pub sameSite: Option<CookieSameSite>,
824    /// Cookie Priority
825
826    pub priority: CookiePriority,
827    /// Cookie source scheme type.
828
829    pub sourceScheme: CookieSourceScheme,
830    /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.
831    /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
832    /// This is a temporary ability and it will be removed in the future.
833
834    pub sourcePort: i64,
835    /// Cookie partition key.
836
837    #[serde(skip_serializing_if = "Option::is_none")]
838    pub partitionKey: Option<CookiePartitionKey>,
839    /// True if cookie partition key is opaque.
840
841    #[serde(skip_serializing_if = "Option::is_none")]
842    pub partitionKeyOpaque: Option<bool>,
843}
844
845/// Types of reasons why a cookie may not be stored from a response.
846
847#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
848pub enum SetCookieBlockedReason {
849    #[default]
850    SecureOnly,
851    SameSiteStrict,
852    SameSiteLax,
853    SameSiteUnspecifiedTreatedAsLax,
854    SameSiteNoneInsecure,
855    UserPreferences,
856    ThirdPartyPhaseout,
857    ThirdPartyBlockedInFirstPartySet,
858    SyntaxError,
859    SchemeNotSupported,
860    OverwriteSecure,
861    InvalidDomain,
862    InvalidPrefix,
863    UnknownError,
864    SchemefulSameSiteStrict,
865    SchemefulSameSiteLax,
866    SchemefulSameSiteUnspecifiedTreatedAsLax,
867    NameValuePairExceedsMaxSize,
868    DisallowedCharacter,
869    NoCookieContent,
870}
871
872/// Types of reasons why a cookie may not be sent with a request.
873
874#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
875pub enum CookieBlockedReason {
876    #[default]
877    SecureOnly,
878    NotOnPath,
879    DomainMismatch,
880    SameSiteStrict,
881    SameSiteLax,
882    SameSiteUnspecifiedTreatedAsLax,
883    SameSiteNoneInsecure,
884    UserPreferences,
885    ThirdPartyPhaseout,
886    ThirdPartyBlockedInFirstPartySet,
887    UnknownError,
888    SchemefulSameSiteStrict,
889    SchemefulSameSiteLax,
890    SchemefulSameSiteUnspecifiedTreatedAsLax,
891    NameValuePairExceedsMaxSize,
892    PortMismatch,
893    SchemeMismatch,
894    AnonymousContext,
895}
896
897/// Types of reasons why a cookie should have been blocked by 3PCD but is exempted for the request.
898
899#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
900pub enum CookieExemptionReason {
901    #[default]
902    None,
903    UserSetting,
904    TPCDMetadata,
905    TPCDDeprecationTrial,
906    TopLevelTPCDDeprecationTrial,
907    TPCDHeuristics,
908    EnterprisePolicy,
909    StorageAccess,
910    TopLevelStorageAccess,
911    Scheme,
912    SameSiteNoneCookiesInSandbox,
913}
914
915/// A cookie which was not stored from a response with the corresponding reason.
916
917#[derive(Debug, Clone, Serialize, Deserialize, Default)]
918#[serde(rename_all = "camelCase")]
919pub struct BlockedSetCookieWithReason {
920    /// The reason(s) this cookie was blocked.
921
922    pub blockedReasons: Vec<SetCookieBlockedReason>,
923    /// The string representing this individual cookie as it would appear in the header.
924    /// This is not the entire "cookie" or "set-cookie" header which could have multiple cookies.
925
926    pub cookieLine: String,
927    /// The cookie object which represents the cookie which was not stored. It is optional because
928    /// sometimes complete cookie information is not available, such as in the case of parsing
929    /// errors.
930
931    #[serde(skip_serializing_if = "Option::is_none")]
932    pub cookie: Option<Cookie>,
933}
934
935/// A cookie should have been blocked by 3PCD but is exempted and stored from a response with the
936/// corresponding reason. A cookie could only have at most one exemption reason.
937
938#[derive(Debug, Clone, Serialize, Deserialize, Default)]
939#[serde(rename_all = "camelCase")]
940pub struct ExemptedSetCookieWithReason {
941    /// The reason the cookie was exempted.
942
943    pub exemptionReason: CookieExemptionReason,
944    /// The string representing this individual cookie as it would appear in the header.
945
946    pub cookieLine: String,
947    /// The cookie object representing the cookie.
948
949    pub cookie: Cookie,
950}
951
952/// A cookie associated with the request which may or may not be sent with it.
953/// Includes the cookies itself and reasons for blocking or exemption.
954
955#[derive(Debug, Clone, Serialize, Deserialize, Default)]
956#[serde(rename_all = "camelCase")]
957pub struct AssociatedCookie {
958    /// The cookie object representing the cookie which was not sent.
959
960    pub cookie: Cookie,
961    /// The reason(s) the cookie was blocked. If empty means the cookie is included.
962
963    pub blockedReasons: Vec<CookieBlockedReason>,
964    /// The reason the cookie should have been blocked by 3PCD but is exempted. A cookie could
965    /// only have at most one exemption reason.
966
967    #[serde(skip_serializing_if = "Option::is_none")]
968    pub exemptionReason: Option<CookieExemptionReason>,
969}
970
971/// Cookie parameter object
972
973#[derive(Debug, Clone, Serialize, Deserialize, Default)]
974#[serde(rename_all = "camelCase")]
975pub struct CookieParam {
976    /// Cookie name.
977
978    pub name: String,
979    /// Cookie value.
980
981    pub value: String,
982    /// The request-URI to associate with the setting of the cookie. This value can affect the
983    /// default domain, path, source port, and source scheme values of the created cookie.
984
985    #[serde(skip_serializing_if = "Option::is_none")]
986    pub url: Option<String>,
987    /// Cookie domain.
988
989    #[serde(skip_serializing_if = "Option::is_none")]
990    pub domain: Option<String>,
991    /// Cookie path.
992
993    #[serde(skip_serializing_if = "Option::is_none")]
994    pub path: Option<String>,
995    /// True if cookie is secure.
996
997    #[serde(skip_serializing_if = "Option::is_none")]
998    pub secure: Option<bool>,
999    /// True if cookie is http-only.
1000
1001    #[serde(skip_serializing_if = "Option::is_none")]
1002    pub httpOnly: Option<bool>,
1003    /// Cookie SameSite type.
1004
1005    #[serde(skip_serializing_if = "Option::is_none")]
1006    pub sameSite: Option<CookieSameSite>,
1007    /// Cookie expiration date, session cookie if not set
1008
1009    #[serde(skip_serializing_if = "Option::is_none")]
1010    pub expires: Option<TimeSinceEpoch>,
1011    /// Cookie Priority.
1012
1013    #[serde(skip_serializing_if = "Option::is_none")]
1014    pub priority: Option<CookiePriority>,
1015    /// Cookie source scheme type.
1016
1017    #[serde(skip_serializing_if = "Option::is_none")]
1018    pub sourceScheme: Option<CookieSourceScheme>,
1019    /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.
1020    /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
1021    /// This is a temporary ability and it will be removed in the future.
1022
1023    #[serde(skip_serializing_if = "Option::is_none")]
1024    pub sourcePort: Option<i64>,
1025    /// Cookie partition key. If not set, the cookie will be set as not partitioned.
1026
1027    #[serde(skip_serializing_if = "Option::is_none")]
1028    pub partitionKey: Option<CookiePartitionKey>,
1029}
1030
1031/// Authorization challenge for HTTP status code 401 or 407.
1032
1033#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1034#[serde(rename_all = "camelCase")]
1035pub struct AuthChallenge {
1036    /// Source of the authentication challenge.
1037
1038    #[serde(skip_serializing_if = "Option::is_none")]
1039    pub source: Option<String>,
1040    /// Origin of the challenger.
1041
1042    pub origin: String,
1043    /// The authentication scheme used, such as basic or digest
1044
1045    pub scheme: String,
1046    /// The realm of the challenge. May be empty.
1047
1048    pub realm: String,
1049}
1050
1051/// Response to an AuthChallenge.
1052
1053#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1054#[serde(rename_all = "camelCase")]
1055pub struct AuthChallengeResponse {
1056    /// The decision on what to do in response to the authorization challenge.  Default means
1057    /// deferring to the default behavior of the net stack, which will likely either the Cancel
1058    /// authentication or display a popup dialog box.
1059
1060    pub response: String,
1061    /// The username to provide, possibly empty. Should only be set if response is
1062    /// ProvideCredentials.
1063
1064    #[serde(skip_serializing_if = "Option::is_none")]
1065    pub username: Option<String>,
1066    /// The password to provide, possibly empty. Should only be set if response is
1067    /// ProvideCredentials.
1068
1069    #[serde(skip_serializing_if = "Option::is_none")]
1070    pub password: Option<String>,
1071}
1072
1073/// Stages of the interception to begin intercepting. Request will intercept before the request is
1074/// sent. Response will intercept after the response is received.
1075
1076#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1077pub enum InterceptionStage {
1078    #[default]
1079    Request,
1080    HeadersReceived,
1081}
1082
1083/// Request pattern for interception.
1084
1085#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1086#[serde(rename_all = "camelCase")]
1087pub struct RequestPattern {
1088    /// Wildcards (''*'' -> zero or more, ''?'' -> exactly one) are allowed. Escape character is
1089    /// backslash. Omitting is equivalent to '"*"'.
1090
1091    #[serde(skip_serializing_if = "Option::is_none")]
1092    pub urlPattern: Option<String>,
1093    /// If set, only requests for matching resource types will be intercepted.
1094
1095    #[serde(skip_serializing_if = "Option::is_none")]
1096    pub resourceType: Option<ResourceType>,
1097    /// Stage at which to begin intercepting requests. Default is Request.
1098
1099    #[serde(skip_serializing_if = "Option::is_none")]
1100    pub interceptionStage: Option<InterceptionStage>,
1101}
1102
1103/// Information about a signed exchange signature.
1104/// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#rfc.section.3.1
1105
1106#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1107#[serde(rename_all = "camelCase")]
1108pub struct SignedExchangeSignature {
1109    /// Signed exchange signature label.
1110
1111    pub label: String,
1112    /// The hex string of signed exchange signature.
1113
1114    pub signature: String,
1115    /// Signed exchange signature integrity.
1116
1117    pub integrity: String,
1118    /// Signed exchange signature cert Url.
1119
1120    #[serde(skip_serializing_if = "Option::is_none")]
1121    pub certUrl: Option<String>,
1122    /// The hex string of signed exchange signature cert sha256.
1123
1124    #[serde(skip_serializing_if = "Option::is_none")]
1125    pub certSha256: Option<String>,
1126    /// Signed exchange signature validity Url.
1127
1128    pub validityUrl: String,
1129    /// Signed exchange signature date.
1130
1131    pub date: i64,
1132    /// Signed exchange signature expires.
1133
1134    pub expires: i64,
1135    /// The encoded certificates.
1136
1137    #[serde(skip_serializing_if = "Option::is_none")]
1138    pub certificates: Option<Vec<String>>,
1139}
1140
1141/// Information about a signed exchange header.
1142/// https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cbor-representation
1143
1144#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1145#[serde(rename_all = "camelCase")]
1146pub struct SignedExchangeHeader {
1147    /// Signed exchange request URL.
1148
1149    pub requestUrl: String,
1150    /// Signed exchange response code.
1151
1152    pub responseCode: i64,
1153    /// Signed exchange response headers.
1154
1155    pub responseHeaders: Headers,
1156    /// Signed exchange response signature.
1157
1158    pub signatures: Vec<SignedExchangeSignature>,
1159    /// Signed exchange header integrity hash in the form of 'sha256-<base64-hash-value>'.
1160
1161    pub headerIntegrity: String,
1162}
1163
1164/// Field type for a signed exchange related error.
1165
1166#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1167pub enum SignedExchangeErrorField {
1168    #[default]
1169    SignatureSig,
1170    SignatureIntegrity,
1171    SignatureCertUrl,
1172    SignatureCertSha256,
1173    SignatureValidityUrl,
1174    SignatureTimestamps,
1175}
1176
1177/// Information about a signed exchange response.
1178
1179#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1180#[serde(rename_all = "camelCase")]
1181pub struct SignedExchangeError {
1182    /// Error message.
1183
1184    pub message: String,
1185    /// The index of the signature which caused the error.
1186
1187    #[serde(skip_serializing_if = "Option::is_none")]
1188    pub signatureIndex: Option<u64>,
1189    /// The field which caused the error.
1190
1191    #[serde(skip_serializing_if = "Option::is_none")]
1192    pub errorField: Option<SignedExchangeErrorField>,
1193}
1194
1195/// Information about a signed exchange response.
1196
1197#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1198#[serde(rename_all = "camelCase")]
1199pub struct SignedExchangeInfo {
1200    /// The outer response of signed HTTP exchange which was received from network.
1201
1202    pub outerResponse: Response,
1203    /// Whether network response for the signed exchange was accompanied by
1204    /// extra headers.
1205
1206    pub hasExtraInfo: bool,
1207    /// Information about the signed exchange header.
1208
1209    #[serde(skip_serializing_if = "Option::is_none")]
1210    pub header: Option<SignedExchangeHeader>,
1211    /// Security details for the signed exchange header.
1212
1213    #[serde(skip_serializing_if = "Option::is_none")]
1214    pub securityDetails: Option<SecurityDetails>,
1215    /// Errors occurred while handling the signed exchange.
1216
1217    #[serde(skip_serializing_if = "Option::is_none")]
1218    pub errors: Option<Vec<SignedExchangeError>>,
1219}
1220
1221/// List of content encodings supported by the backend.
1222
1223#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1224pub enum ContentEncoding {
1225    #[default]
1226    Deflate,
1227    Gzip,
1228    Br,
1229    Zstd,
1230}
1231
1232
1233#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1234#[serde(rename_all = "camelCase")]
1235pub struct NetworkConditions {
1236    /// Only matching requests will be affected by these conditions. Patterns use the URLPattern constructor string
1237    /// syntax (https://urlpattern.spec.whatwg.org/) and must be absolute. If the pattern is empty, all requests are
1238    /// matched (including p2p connections).
1239
1240    pub urlPattern: String,
1241    /// Minimum latency from request sent to response headers received (ms).
1242
1243    pub latency: f64,
1244    /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
1245
1246    pub downloadThroughput: f64,
1247    /// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.
1248
1249    pub uploadThroughput: f64,
1250    /// Connection type if known.
1251
1252    #[serde(skip_serializing_if = "Option::is_none")]
1253    pub connectionType: Option<ConnectionType>,
1254    /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
1255
1256    #[serde(skip_serializing_if = "Option::is_none")]
1257    pub packetLoss: Option<f64>,
1258    /// WebRTC packet queue length (packet). 0 removes any queue length limitations.
1259
1260    #[serde(skip_serializing_if = "Option::is_none")]
1261    pub packetQueueLength: Option<u64>,
1262    /// WebRTC packetReordering feature.
1263
1264    #[serde(skip_serializing_if = "Option::is_none")]
1265    pub packetReordering: Option<bool>,
1266    /// True to emulate internet disconnection.
1267
1268    #[serde(skip_serializing_if = "Option::is_none")]
1269    pub offline: Option<bool>,
1270}
1271
1272
1273#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1274#[serde(rename_all = "camelCase")]
1275pub struct BlockPattern {
1276    /// URL pattern to match. Patterns use the URLPattern constructor string syntax
1277    /// (https://urlpattern.spec.whatwg.org/) and must be absolute. Example: '*://*:*/*.css'.
1278
1279    pub urlPattern: String,
1280    /// Whether or not to block the pattern. If false, a matching request will not be blocked even if it matches a later
1281    /// 'BlockPattern'.
1282
1283    pub block: bool,
1284}
1285
1286
1287#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1288pub enum DirectSocketDnsQueryType {
1289    #[default]
1290    Ipv4,
1291    Ipv6,
1292}
1293
1294
1295#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1296#[serde(rename_all = "camelCase")]
1297pub struct DirectTCPSocketOptions {
1298    /// TCP_NODELAY option
1299
1300    pub noDelay: bool,
1301    /// Expected to be unsigned integer.
1302
1303    #[serde(skip_serializing_if = "Option::is_none")]
1304    pub keepAliveDelay: Option<f64>,
1305    /// Expected to be unsigned integer.
1306
1307    #[serde(skip_serializing_if = "Option::is_none")]
1308    pub sendBufferSize: Option<f64>,
1309    /// Expected to be unsigned integer.
1310
1311    #[serde(skip_serializing_if = "Option::is_none")]
1312    pub receiveBufferSize: Option<f64>,
1313
1314    #[serde(skip_serializing_if = "Option::is_none")]
1315    pub dnsQueryType: Option<DirectSocketDnsQueryType>,
1316}
1317
1318
1319#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1320#[serde(rename_all = "camelCase")]
1321pub struct DirectUDPSocketOptions {
1322
1323    #[serde(skip_serializing_if = "Option::is_none")]
1324    pub remoteAddr: Option<String>,
1325    /// Unsigned int 16.
1326
1327    #[serde(skip_serializing_if = "Option::is_none")]
1328    pub remotePort: Option<i64>,
1329
1330    #[serde(skip_serializing_if = "Option::is_none")]
1331    pub localAddr: Option<String>,
1332    /// Unsigned int 16.
1333
1334    #[serde(skip_serializing_if = "Option::is_none")]
1335    pub localPort: Option<i64>,
1336
1337    #[serde(skip_serializing_if = "Option::is_none")]
1338    pub dnsQueryType: Option<DirectSocketDnsQueryType>,
1339    /// Expected to be unsigned integer.
1340
1341    #[serde(skip_serializing_if = "Option::is_none")]
1342    pub sendBufferSize: Option<f64>,
1343    /// Expected to be unsigned integer.
1344
1345    #[serde(skip_serializing_if = "Option::is_none")]
1346    pub receiveBufferSize: Option<f64>,
1347
1348    #[serde(skip_serializing_if = "Option::is_none")]
1349    pub multicastLoopback: Option<bool>,
1350    /// Unsigned int 8.
1351
1352    #[serde(skip_serializing_if = "Option::is_none")]
1353    pub multicastTimeToLive: Option<i64>,
1354
1355    #[serde(skip_serializing_if = "Option::is_none")]
1356    pub multicastAllowAddressSharing: Option<bool>,
1357}
1358
1359
1360#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1361#[serde(rename_all = "camelCase")]
1362pub struct DirectUDPMessage {
1363
1364    pub data: String,
1365    /// Null for connected mode.
1366
1367    #[serde(skip_serializing_if = "Option::is_none")]
1368    pub remoteAddr: Option<String>,
1369    /// Null for connected mode.
1370    /// Expected to be unsigned integer.
1371
1372    #[serde(skip_serializing_if = "Option::is_none")]
1373    pub remotePort: Option<i64>,
1374}
1375
1376
1377#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1378pub enum LocalNetworkAccessRequestPolicy {
1379    #[default]
1380    Allow,
1381    BlockFromInsecureToMorePrivate,
1382    WarnFromInsecureToMorePrivate,
1383    PermissionBlock,
1384    PermissionWarn,
1385}
1386
1387
1388#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1389pub enum IPAddressSpace {
1390    #[default]
1391    Loopback,
1392    Local,
1393    Public,
1394    Unknown,
1395}
1396
1397
1398#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1399#[serde(rename_all = "camelCase")]
1400pub struct ConnectTiming {
1401    /// Timing's requestTime is a baseline in seconds, while the other numbers are ticks in
1402    /// milliseconds relatively to this requestTime. Matches ResourceTiming's requestTime for
1403    /// the same request (but not for redirected requests).
1404
1405    pub requestTime: f64,
1406}
1407
1408
1409#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1410#[serde(rename_all = "camelCase")]
1411pub struct ClientSecurityState {
1412
1413    pub initiatorIsSecureContext: bool,
1414
1415    pub initiatorIPAddressSpace: IPAddressSpace,
1416
1417    pub localNetworkAccessRequestPolicy: LocalNetworkAccessRequestPolicy,
1418}
1419
1420/// Identifies the script on the stack that caused a resource or element to be
1421/// labeled as an ad. For resources, this indicates the context that triggered
1422/// the fetch. For elements, this indicates the context that caused the element
1423/// to be appended to the DOM.
1424
1425#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1426#[serde(rename_all = "camelCase")]
1427pub struct AdScriptIdentifier {
1428    /// The script's V8 identifier.
1429
1430    pub scriptId: crate::runtime::ScriptId,
1431    /// V8's debugging ID for the v8::Context.
1432
1433    pub debuggerId: crate::runtime::UniqueDebuggerId,
1434    /// The script's url (or generated name based on id if inline script).
1435
1436    pub name: String,
1437}
1438
1439/// Encapsulates the script ancestry and the root script filter list rule that
1440/// caused the resource or element to be labeled as an ad.
1441
1442#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1443#[serde(rename_all = "camelCase")]
1444pub struct AdAncestry {
1445    /// A chain of 'AdScriptIdentifier's representing the ancestry of an ad
1446    /// script that led to the creation of a resource or element. The chain is
1447    /// ordered from the script itself (lowest level) up to its root ancestor
1448    /// that was flagged by a filter list.
1449
1450    pub ancestryChain: Vec<AdScriptIdentifier>,
1451    /// The filter list rule that caused the root (last) script in
1452    /// 'ancestryChain' to be tagged as an ad.
1453
1454    #[serde(skip_serializing_if = "Option::is_none")]
1455    pub rootScriptFilterlistRule: Option<String>,
1456}
1457
1458/// Represents the provenance of an ad resource or element. Only one of
1459/// 'filterlistRule' or 'adScriptAncestry' can be set. If 'filterlistRule'
1460/// is provided, the resource URL directly matches a filter list rule. If
1461/// 'adScriptAncestry' is provided, an ad script initiated the resource fetch or
1462/// appended the element to the DOM. If neither is provided, the entity is
1463/// known to be an ad, but provenance tracking information is unavailable.
1464
1465#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1466#[serde(rename_all = "camelCase")]
1467pub struct AdProvenance {
1468    /// The filterlist rule that matched, if any.
1469
1470    #[serde(skip_serializing_if = "Option::is_none")]
1471    pub filterlistRule: Option<String>,
1472    /// The script ancestry that created the ad, if any.
1473
1474    #[serde(skip_serializing_if = "Option::is_none")]
1475    pub adScriptAncestry: Option<AdAncestry>,
1476}
1477
1478
1479#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1480pub enum CrossOriginOpenerPolicyValue {
1481    #[default]
1482    SameOrigin,
1483    SameOriginAllowPopups,
1484    RestrictProperties,
1485    UnsafeNone,
1486    SameOriginPlusCoep,
1487    RestrictPropertiesPlusCoep,
1488    NoopenerAllowPopups,
1489}
1490
1491
1492#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1493#[serde(rename_all = "camelCase")]
1494pub struct CrossOriginOpenerPolicyStatus {
1495
1496    pub value: CrossOriginOpenerPolicyValue,
1497
1498    pub reportOnlyValue: CrossOriginOpenerPolicyValue,
1499
1500    #[serde(skip_serializing_if = "Option::is_none")]
1501    pub reportingEndpoint: Option<String>,
1502
1503    #[serde(skip_serializing_if = "Option::is_none")]
1504    pub reportOnlyReportingEndpoint: Option<String>,
1505}
1506
1507
1508#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1509pub enum CrossOriginEmbedderPolicyValue {
1510    #[default]
1511    None,
1512    Credentialless,
1513    RequireCorp,
1514}
1515
1516
1517#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1518#[serde(rename_all = "camelCase")]
1519pub struct CrossOriginEmbedderPolicyStatus {
1520
1521    pub value: CrossOriginEmbedderPolicyValue,
1522
1523    pub reportOnlyValue: CrossOriginEmbedderPolicyValue,
1524
1525    #[serde(skip_serializing_if = "Option::is_none")]
1526    pub reportingEndpoint: Option<String>,
1527
1528    #[serde(skip_serializing_if = "Option::is_none")]
1529    pub reportOnlyReportingEndpoint: Option<String>,
1530}
1531
1532
1533#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1534pub enum ContentSecurityPolicySource {
1535    #[default]
1536    HTTP,
1537    Meta,
1538}
1539
1540
1541#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1542#[serde(rename_all = "camelCase")]
1543pub struct ContentSecurityPolicyStatus {
1544
1545    pub effectiveDirectives: String,
1546
1547    pub isEnforced: bool,
1548
1549    pub source: ContentSecurityPolicySource,
1550}
1551
1552
1553#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1554#[serde(rename_all = "camelCase")]
1555pub struct SecurityIsolationStatus {
1556
1557    #[serde(skip_serializing_if = "Option::is_none")]
1558    pub coop: Option<CrossOriginOpenerPolicyStatus>,
1559
1560    #[serde(skip_serializing_if = "Option::is_none")]
1561    pub coep: Option<CrossOriginEmbedderPolicyStatus>,
1562
1563    #[serde(skip_serializing_if = "Option::is_none")]
1564    pub csp: Option<Vec<ContentSecurityPolicyStatus>>,
1565}
1566
1567/// The status of a Reporting API report.
1568
1569#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1570pub enum ReportStatus {
1571    #[default]
1572    Queued,
1573    Pending,
1574    MarkedForRemoval,
1575    Success,
1576}
1577
1578
1579pub type ReportId = String;
1580
1581/// An object representing a report generated by the Reporting API.
1582
1583#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1584#[serde(rename_all = "camelCase")]
1585pub struct ReportingApiReport {
1586
1587    pub id: ReportId,
1588    /// The URL of the document that triggered the report.
1589
1590    pub initiatorUrl: String,
1591    /// The name of the endpoint group that should be used to deliver the report.
1592
1593    pub destination: String,
1594    /// The type of the report (specifies the set of data that is contained in the report body).
1595
1596    #[serde(rename = "type")]
1597    pub type_: String,
1598    /// When the report was generated.
1599
1600    pub timestamp: crate::network::TimeSinceEpoch,
1601    /// How many uploads deep the related request was.
1602
1603    pub depth: i64,
1604    /// The number of delivery attempts made so far, not including an active attempt.
1605
1606    pub completedAttempts: i64,
1607
1608    pub body: serde_json::Map<String, JsonValue>,
1609
1610    pub status: ReportStatus,
1611}
1612
1613
1614#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1615#[serde(rename_all = "camelCase")]
1616pub struct ReportingApiEndpoint {
1617    /// The URL of the endpoint to which reports may be delivered.
1618
1619    pub url: String,
1620    /// Name of the endpoint group.
1621
1622    pub groupName: String,
1623}
1624
1625/// Unique identifier for a device bound session.
1626
1627#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1628#[serde(rename_all = "camelCase")]
1629pub struct DeviceBoundSessionKey {
1630    /// The site the session is set up for.
1631
1632    pub site: String,
1633    /// The id of the session.
1634
1635    pub id: String,
1636}
1637
1638/// How a device bound session was used during a request.
1639
1640#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1641#[serde(rename_all = "camelCase")]
1642pub struct DeviceBoundSessionWithUsage {
1643    /// The key for the session.
1644
1645    pub sessionKey: DeviceBoundSessionKey,
1646    /// How the session was used (or not used).
1647
1648    pub usage: String,
1649}
1650
1651/// A device bound session's cookie craving.
1652
1653#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1654#[serde(rename_all = "camelCase")]
1655pub struct DeviceBoundSessionCookieCraving {
1656    /// The name of the craving.
1657
1658    pub name: String,
1659    /// The domain of the craving.
1660
1661    pub domain: String,
1662    /// The path of the craving.
1663
1664    pub path: String,
1665    /// The 'Secure' attribute of the craving attributes.
1666
1667    pub secure: bool,
1668    /// The 'HttpOnly' attribute of the craving attributes.
1669
1670    pub httpOnly: bool,
1671    /// The 'SameSite' attribute of the craving attributes.
1672
1673    #[serde(skip_serializing_if = "Option::is_none")]
1674    pub sameSite: Option<CookieSameSite>,
1675}
1676
1677/// A device bound session's inclusion URL rule.
1678
1679#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1680#[serde(rename_all = "camelCase")]
1681pub struct DeviceBoundSessionUrlRule {
1682    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type'.
1683
1684    pub ruleType: String,
1685    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern'.
1686
1687    pub hostPattern: String,
1688    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix'.
1689
1690    pub pathPrefix: String,
1691}
1692
1693/// A device bound session's inclusion rules.
1694
1695#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1696#[serde(rename_all = "camelCase")]
1697pub struct DeviceBoundSessionInclusionRules {
1698    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::origin_'.
1699
1700    pub origin: String,
1701    /// Whether the whole site is included. See comments on
1702    /// 'net::device_bound_sessions::SessionInclusionRules::include_site_' for more
1703    /// details; this boolean is true if that value is populated.
1704
1705    pub includeSite: bool,
1706    /// See comments on 'net::device_bound_sessions::SessionInclusionRules::url_rules_'.
1707
1708    pub urlRules: Vec<DeviceBoundSessionUrlRule>,
1709}
1710
1711/// A device bound session.
1712
1713#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1714#[serde(rename_all = "camelCase")]
1715pub struct DeviceBoundSession {
1716    /// The site and session ID of the session.
1717
1718    pub key: DeviceBoundSessionKey,
1719    /// See comments on 'net::device_bound_sessions::Session::refresh_url_'.
1720
1721    pub refreshUrl: String,
1722    /// See comments on 'net::device_bound_sessions::Session::inclusion_rules_'.
1723
1724    pub inclusionRules: DeviceBoundSessionInclusionRules,
1725    /// See comments on 'net::device_bound_sessions::Session::cookie_cravings_'.
1726
1727    pub cookieCravings: Vec<DeviceBoundSessionCookieCraving>,
1728    /// See comments on 'net::device_bound_sessions::Session::expiry_date_'.
1729
1730    pub expiryDate: crate::network::TimeSinceEpoch,
1731    /// See comments on 'net::device_bound_sessions::Session::cached_challenge__'.
1732
1733    #[serde(skip_serializing_if = "Option::is_none")]
1734    pub cachedChallenge: Option<String>,
1735    /// See comments on 'net::device_bound_sessions::Session::allowed_refresh_initiators_'.
1736
1737    pub allowedRefreshInitiators: Vec<String>,
1738}
1739
1740/// A unique identifier for a device bound session event.
1741
1742pub type DeviceBoundSessionEventId = String;
1743
1744/// A fetch result for a device bound session creation or refresh.
1745
1746#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1747pub enum DeviceBoundSessionFetchResult {
1748    #[default]
1749    Success,
1750    KeyError,
1751    SigningError,
1752    ServerRequestedTermination,
1753    InvalidSessionId,
1754    InvalidChallenge,
1755    TooManyChallenges,
1756    InvalidFetcherUrl,
1757    InvalidRefreshUrl,
1758    TransientHttpError,
1759    ScopeOriginSameSiteMismatch,
1760    RefreshUrlSameSiteMismatch,
1761    MismatchedSessionId,
1762    MissingScope,
1763    NoCredentials,
1764    SubdomainRegistrationWellKnownUnavailable,
1765    SubdomainRegistrationUnauthorized,
1766    SubdomainRegistrationWellKnownMalformed,
1767    SessionProviderWellKnownUnavailable,
1768    RelyingPartyWellKnownUnavailable,
1769    FederatedKeyThumbprintMismatch,
1770    InvalidFederatedSessionUrl,
1771    InvalidFederatedKey,
1772    TooManyRelyingOriginLabels,
1773    BoundCookieSetForbidden,
1774    NetError,
1775    ProxyError,
1776    EmptySessionConfig,
1777    InvalidCredentialsConfig,
1778    InvalidCredentialsType,
1779    InvalidCredentialsEmptyName,
1780    InvalidCredentialsCookie,
1781    PersistentHttpError,
1782    RegistrationAttemptedChallenge,
1783    InvalidScopeOrigin,
1784    ScopeOriginContainsPath,
1785    RefreshInitiatorNotString,
1786    RefreshInitiatorInvalidHostPattern,
1787    InvalidScopeSpecification,
1788    MissingScopeSpecificationType,
1789    EmptyScopeSpecificationDomain,
1790    EmptyScopeSpecificationPath,
1791    InvalidScopeSpecificationType,
1792    InvalidScopeIncludeSite,
1793    MissingScopeIncludeSite,
1794    FederatedNotAuthorizedByProvider,
1795    FederatedNotAuthorizedByRelyingParty,
1796    SessionProviderWellKnownMalformed,
1797    SessionProviderWellKnownHasProviderOrigin,
1798    RelyingPartyWellKnownMalformed,
1799    RelyingPartyWellKnownHasRelyingOrigins,
1800    InvalidFederatedSessionProviderSessionMissing,
1801    InvalidFederatedSessionWrongProviderOrigin,
1802    InvalidCredentialsCookieCreationTime,
1803    InvalidCredentialsCookieName,
1804    InvalidCredentialsCookieParsing,
1805    InvalidCredentialsCookieUnpermittedAttribute,
1806    InvalidCredentialsCookieInvalidDomain,
1807    InvalidCredentialsCookiePrefix,
1808    InvalidScopeRulePath,
1809    InvalidScopeRuleHostPattern,
1810    ScopeRuleOriginScopedHostPatternMismatch,
1811    ScopeRuleSiteScopedHostPatternMismatch,
1812    SigningQuotaExceeded,
1813    InvalidConfigJson,
1814    InvalidFederatedSessionProviderFailedToRestoreKey,
1815    FailedToUnwrapKey,
1816    SessionDeletedDuringRefresh,
1817}
1818
1819/// Details about a failed device bound session network request.
1820
1821#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1822#[serde(rename_all = "camelCase")]
1823pub struct DeviceBoundSessionFailedRequest {
1824    /// The failed request URL.
1825
1826    pub requestUrl: String,
1827    /// The net error of the response if it was not OK.
1828
1829    #[serde(skip_serializing_if = "Option::is_none")]
1830    pub netError: Option<String>,
1831    /// The response code if the net error was OK and the response code was not
1832    /// 200.
1833
1834    #[serde(skip_serializing_if = "Option::is_none")]
1835    pub responseError: Option<i64>,
1836    /// The body of the response if the net error was OK, the response code was
1837    /// not 200, and the response body was not empty.
1838
1839    #[serde(skip_serializing_if = "Option::is_none")]
1840    pub responseErrorBody: Option<String>,
1841}
1842
1843/// Session event details specific to creation.
1844
1845#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1846#[serde(rename_all = "camelCase")]
1847pub struct CreationEventDetails {
1848    /// The result of the fetch attempt.
1849
1850    pub fetchResult: DeviceBoundSessionFetchResult,
1851    /// The session if there was a newly created session. This is populated for
1852    /// all successful creation events.
1853
1854    #[serde(skip_serializing_if = "Option::is_none")]
1855    pub newSession: Option<DeviceBoundSession>,
1856    /// Details about a failed device bound session network request if there was
1857    /// one.
1858
1859    #[serde(skip_serializing_if = "Option::is_none")]
1860    pub failedRequest: Option<DeviceBoundSessionFailedRequest>,
1861}
1862
1863/// Session event details specific to refresh.
1864
1865#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1866#[serde(rename_all = "camelCase")]
1867pub struct RefreshEventDetails {
1868    /// The result of a refresh.
1869
1870    pub refreshResult: String,
1871    /// If there was a fetch attempt, the result of that.
1872
1873    #[serde(skip_serializing_if = "Option::is_none")]
1874    pub fetchResult: Option<DeviceBoundSessionFetchResult>,
1875    /// The session display if there was a newly created session. This is populated
1876    /// for any refresh event that modifies the session config.
1877
1878    #[serde(skip_serializing_if = "Option::is_none")]
1879    pub newSession: Option<DeviceBoundSession>,
1880    /// See comments on 'net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh'.
1881
1882    pub wasFullyProactiveRefresh: bool,
1883    /// Details about a failed device bound session network request if there was
1884    /// one.
1885
1886    #[serde(skip_serializing_if = "Option::is_none")]
1887    pub failedRequest: Option<DeviceBoundSessionFailedRequest>,
1888}
1889
1890/// Session event details specific to termination.
1891
1892#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1893#[serde(rename_all = "camelCase")]
1894pub struct TerminationEventDetails {
1895    /// The reason for a session being deleted.
1896
1897    pub deletionReason: String,
1898}
1899
1900/// Session event details specific to challenges.
1901
1902#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1903#[serde(rename_all = "camelCase")]
1904pub struct ChallengeEventDetails {
1905    /// The result of a challenge.
1906
1907    pub challengeResult: String,
1908    /// The challenge set.
1909
1910    pub challenge: String,
1911}
1912
1913/// An object providing the result of a network resource load.
1914
1915#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1916#[serde(rename_all = "camelCase")]
1917pub struct LoadNetworkResourcePageResult {
1918
1919    pub success: bool,
1920    /// Optional values used for error reporting.
1921
1922    #[serde(skip_serializing_if = "Option::is_none")]
1923    pub netError: Option<f64>,
1924
1925    #[serde(skip_serializing_if = "Option::is_none")]
1926    pub netErrorName: Option<String>,
1927
1928    #[serde(skip_serializing_if = "Option::is_none")]
1929    pub httpStatusCode: Option<f64>,
1930    /// If successful, one of the following two fields holds the result.
1931
1932    #[serde(skip_serializing_if = "Option::is_none")]
1933    pub stream: Option<crate::io::StreamHandle>,
1934    /// Response headers.
1935
1936    #[serde(skip_serializing_if = "Option::is_none")]
1937    pub headers: Option<crate::network::Headers>,
1938}
1939
1940/// An options object that may be extended later to better support CORS,
1941/// CORB and streaming.
1942
1943#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1944#[serde(rename_all = "camelCase")]
1945pub struct LoadNetworkResourceOptions {
1946
1947    pub disableCache: bool,
1948
1949    pub includeCredentials: bool,
1950}
1951
1952/// Sets a list of content encodings that will be accepted. Empty list means no encoding is accepted.
1953
1954#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1955#[serde(rename_all = "camelCase")]
1956pub struct SetAcceptedEncodingsParams {
1957    /// List of accepted content encodings.
1958
1959    pub encodings: Vec<ContentEncoding>,
1960}
1961
1962impl SetAcceptedEncodingsParams { pub const METHOD: &'static str = "Network.setAcceptedEncodings"; }
1963
1964impl crate::CdpCommand for SetAcceptedEncodingsParams {
1965    const METHOD: &'static str = "Network.setAcceptedEncodings";
1966    type Response = crate::EmptyReturns;
1967}
1968
1969#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1970pub struct ClearAcceptedEncodingsOverrideParams {}
1971
1972impl ClearAcceptedEncodingsOverrideParams { pub const METHOD: &'static str = "Network.clearAcceptedEncodingsOverride"; }
1973
1974impl crate::CdpCommand for ClearAcceptedEncodingsOverrideParams {
1975    const METHOD: &'static str = "Network.clearAcceptedEncodingsOverride";
1976    type Response = crate::EmptyReturns;
1977}
1978
1979/// Tells whether clearing browser cache is supported.
1980
1981#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1982#[serde(rename_all = "camelCase")]
1983pub struct CanClearBrowserCacheReturns {
1984    /// True if browser cache can be cleared.
1985
1986    pub result: bool,
1987}
1988
1989#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1990pub struct CanClearBrowserCacheParams {}
1991
1992impl CanClearBrowserCacheParams { pub const METHOD: &'static str = "Network.canClearBrowserCache"; }
1993
1994impl crate::CdpCommand for CanClearBrowserCacheParams {
1995    const METHOD: &'static str = "Network.canClearBrowserCache";
1996    type Response = CanClearBrowserCacheReturns;
1997}
1998
1999/// Tells whether clearing browser cookies is supported.
2000
2001#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2002#[serde(rename_all = "camelCase")]
2003pub struct CanClearBrowserCookiesReturns {
2004    /// True if browser cookies can be cleared.
2005
2006    pub result: bool,
2007}
2008
2009#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2010pub struct CanClearBrowserCookiesParams {}
2011
2012impl CanClearBrowserCookiesParams { pub const METHOD: &'static str = "Network.canClearBrowserCookies"; }
2013
2014impl crate::CdpCommand for CanClearBrowserCookiesParams {
2015    const METHOD: &'static str = "Network.canClearBrowserCookies";
2016    type Response = CanClearBrowserCookiesReturns;
2017}
2018
2019/// Tells whether emulation of network conditions is supported.
2020
2021#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2022#[serde(rename_all = "camelCase")]
2023pub struct CanEmulateNetworkConditionsReturns {
2024    /// True if emulation of network conditions is supported.
2025
2026    pub result: bool,
2027}
2028
2029#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2030pub struct CanEmulateNetworkConditionsParams {}
2031
2032impl CanEmulateNetworkConditionsParams { pub const METHOD: &'static str = "Network.canEmulateNetworkConditions"; }
2033
2034impl crate::CdpCommand for CanEmulateNetworkConditionsParams {
2035    const METHOD: &'static str = "Network.canEmulateNetworkConditions";
2036    type Response = CanEmulateNetworkConditionsReturns;
2037}
2038
2039#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2040pub struct ClearBrowserCacheParams {}
2041
2042impl ClearBrowserCacheParams { pub const METHOD: &'static str = "Network.clearBrowserCache"; }
2043
2044impl crate::CdpCommand for ClearBrowserCacheParams {
2045    const METHOD: &'static str = "Network.clearBrowserCache";
2046    type Response = crate::EmptyReturns;
2047}
2048
2049#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2050pub struct ClearBrowserCookiesParams {}
2051
2052impl ClearBrowserCookiesParams { pub const METHOD: &'static str = "Network.clearBrowserCookies"; }
2053
2054impl crate::CdpCommand for ClearBrowserCookiesParams {
2055    const METHOD: &'static str = "Network.clearBrowserCookies";
2056    type Response = crate::EmptyReturns;
2057}
2058
2059/// Response to Network.requestIntercepted which either modifies the request to continue with any
2060/// modifications, or blocks it, or completes it with the provided response bytes. If a network
2061/// fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted
2062/// event will be sent with the same InterceptionId.
2063/// Deprecated, use Fetch.continueRequest, Fetch.fulfillRequest and Fetch.failRequest instead.
2064
2065#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2066#[serde(rename_all = "camelCase")]
2067pub struct ContinueInterceptedRequestParams {
2068
2069    pub interceptionId: InterceptionId,
2070    /// If set this causes the request to fail with the given reason. Passing 'Aborted' for requests
2071    /// marked with 'isNavigationRequest' also cancels the navigation. Must not be set in response
2072    /// to an authChallenge.
2073
2074    #[serde(skip_serializing_if = "Option::is_none")]
2075    pub errorReason: Option<ErrorReason>,
2076    /// If set the requests completes using with the provided base64 encoded raw response, including
2077    /// HTTP status line and headers etc... Must not be set in response to an authChallenge. (Encoded as a base64 string when passed over JSON)
2078
2079    #[serde(skip_serializing_if = "Option::is_none")]
2080    pub rawResponse: Option<String>,
2081    /// If set the request url will be modified in a way that's not observable by page. Must not be
2082    /// set in response to an authChallenge.
2083
2084    #[serde(skip_serializing_if = "Option::is_none")]
2085    pub url: Option<String>,
2086    /// If set this allows the request method to be overridden. Must not be set in response to an
2087    /// authChallenge.
2088
2089    #[serde(skip_serializing_if = "Option::is_none")]
2090    pub method: Option<String>,
2091    /// If set this allows postData to be set. Must not be set in response to an authChallenge.
2092
2093    #[serde(skip_serializing_if = "Option::is_none")]
2094    pub postData: Option<String>,
2095    /// If set this allows the request headers to be changed. Must not be set in response to an
2096    /// authChallenge.
2097
2098    #[serde(skip_serializing_if = "Option::is_none")]
2099    pub headers: Option<Headers>,
2100    /// Response to a requestIntercepted with an authChallenge. Must not be set otherwise.
2101
2102    #[serde(skip_serializing_if = "Option::is_none")]
2103    pub authChallengeResponse: Option<AuthChallengeResponse>,
2104}
2105
2106impl ContinueInterceptedRequestParams { pub const METHOD: &'static str = "Network.continueInterceptedRequest"; }
2107
2108impl crate::CdpCommand for ContinueInterceptedRequestParams {
2109    const METHOD: &'static str = "Network.continueInterceptedRequest";
2110    type Response = crate::EmptyReturns;
2111}
2112
2113/// Deletes browser cookies with matching name and url or domain/path/partitionKey pair.
2114
2115#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2116#[serde(rename_all = "camelCase")]
2117pub struct DeleteCookiesParams {
2118    /// Name of the cookies to remove.
2119
2120    pub name: String,
2121    /// If specified, deletes all the cookies with the given name where domain and path match
2122    /// provided URL.
2123
2124    #[serde(skip_serializing_if = "Option::is_none")]
2125    pub url: Option<String>,
2126    /// If specified, deletes only cookies with the exact domain.
2127
2128    #[serde(skip_serializing_if = "Option::is_none")]
2129    pub domain: Option<String>,
2130    /// If specified, deletes only cookies with the exact path.
2131
2132    #[serde(skip_serializing_if = "Option::is_none")]
2133    pub path: Option<String>,
2134    /// If specified, deletes only cookies with the the given name and partitionKey where
2135    /// all partition key attributes match the cookie partition key attribute.
2136
2137    #[serde(skip_serializing_if = "Option::is_none")]
2138    pub partitionKey: Option<CookiePartitionKey>,
2139}
2140
2141impl DeleteCookiesParams { pub const METHOD: &'static str = "Network.deleteCookies"; }
2142
2143impl crate::CdpCommand for DeleteCookiesParams {
2144    const METHOD: &'static str = "Network.deleteCookies";
2145    type Response = crate::EmptyReturns;
2146}
2147
2148#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2149pub struct DisableParams {}
2150
2151impl DisableParams { pub const METHOD: &'static str = "Network.disable"; }
2152
2153impl crate::CdpCommand for DisableParams {
2154    const METHOD: &'static str = "Network.disable";
2155    type Response = crate::EmptyReturns;
2156}
2157
2158/// Activates emulation of network conditions. This command is deprecated in favor of the emulateNetworkConditionsByRule
2159/// and overrideNetworkState commands, which can be used together to the same effect.
2160
2161#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2162#[serde(rename_all = "camelCase")]
2163pub struct EmulateNetworkConditionsParams {
2164    /// True to emulate internet disconnection.
2165
2166    pub offline: bool,
2167    /// Minimum latency from request sent to response headers received (ms).
2168
2169    pub latency: f64,
2170    /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
2171
2172    pub downloadThroughput: f64,
2173    /// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.
2174
2175    pub uploadThroughput: f64,
2176    /// Connection type if known.
2177
2178    #[serde(skip_serializing_if = "Option::is_none")]
2179    pub connectionType: Option<ConnectionType>,
2180    /// WebRTC packet loss (percent, 0-100). 0 disables packet loss emulation, 100 drops all the packets.
2181
2182    #[serde(skip_serializing_if = "Option::is_none")]
2183    pub packetLoss: Option<f64>,
2184    /// WebRTC packet queue length (packet). 0 removes any queue length limitations.
2185
2186    #[serde(skip_serializing_if = "Option::is_none")]
2187    pub packetQueueLength: Option<u64>,
2188    /// WebRTC packetReordering feature.
2189
2190    #[serde(skip_serializing_if = "Option::is_none")]
2191    pub packetReordering: Option<bool>,
2192}
2193
2194impl EmulateNetworkConditionsParams { pub const METHOD: &'static str = "Network.emulateNetworkConditions"; }
2195
2196impl crate::CdpCommand for EmulateNetworkConditionsParams {
2197    const METHOD: &'static str = "Network.emulateNetworkConditions";
2198    type Response = crate::EmptyReturns;
2199}
2200
2201/// Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated
2202/// Network.emulateNetworkConditions this method does not affect 'navigator' state. Use Network.overrideNetworkState to
2203/// explicitly modify 'navigator' behavior.
2204
2205#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2206#[serde(rename_all = "camelCase")]
2207pub struct EmulateNetworkConditionsByRuleParams {
2208    /// True to emulate internet disconnection. Deprecated, use the offline property in matchedNetworkConditions
2209    /// or emulateOfflineServiceWorker instead.
2210
2211    #[serde(skip_serializing_if = "Option::is_none")]
2212    pub offline: Option<bool>,
2213    /// True to emulate offline service worker.
2214
2215    #[serde(skip_serializing_if = "Option::is_none")]
2216    pub emulateOfflineServiceWorker: Option<bool>,
2217    /// Configure conditions for matching requests. If multiple entries match a request, the first entry wins.  Global
2218    /// conditions can be configured by leaving the urlPattern for the conditions empty. These global conditions are
2219    /// also applied for throttling of p2p connections.
2220
2221    pub matchedNetworkConditions: Vec<NetworkConditions>,
2222}
2223
2224/// Activates emulation of network conditions for individual requests using URL match patterns. Unlike the deprecated
2225/// Network.emulateNetworkConditions this method does not affect 'navigator' state. Use Network.overrideNetworkState to
2226/// explicitly modify 'navigator' behavior.
2227
2228#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2229#[serde(rename_all = "camelCase")]
2230pub struct EmulateNetworkConditionsByRuleReturns {
2231    /// An id for each entry in matchedNetworkConditions. The id will be included in the requestWillBeSentExtraInfo for
2232    /// requests affected by a rule.
2233
2234    pub ruleIds: Vec<String>,
2235}
2236
2237impl EmulateNetworkConditionsByRuleParams { pub const METHOD: &'static str = "Network.emulateNetworkConditionsByRule"; }
2238
2239impl crate::CdpCommand for EmulateNetworkConditionsByRuleParams {
2240    const METHOD: &'static str = "Network.emulateNetworkConditionsByRule";
2241    type Response = EmulateNetworkConditionsByRuleReturns;
2242}
2243
2244/// Override the state of navigator.onLine and navigator.connection.
2245
2246#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2247#[serde(rename_all = "camelCase")]
2248pub struct OverrideNetworkStateParams {
2249    /// True to emulate internet disconnection.
2250
2251    pub offline: bool,
2252    /// Minimum latency from request sent to response headers received (ms).
2253
2254    pub latency: f64,
2255    /// Maximal aggregated download throughput (bytes/sec). -1 disables download throttling.
2256
2257    pub downloadThroughput: f64,
2258    /// Maximal aggregated upload throughput (bytes/sec).  -1 disables upload throttling.
2259
2260    pub uploadThroughput: f64,
2261    /// Connection type if known.
2262
2263    #[serde(skip_serializing_if = "Option::is_none")]
2264    pub connectionType: Option<ConnectionType>,
2265}
2266
2267impl OverrideNetworkStateParams { pub const METHOD: &'static str = "Network.overrideNetworkState"; }
2268
2269impl crate::CdpCommand for OverrideNetworkStateParams {
2270    const METHOD: &'static str = "Network.overrideNetworkState";
2271    type Response = crate::EmptyReturns;
2272}
2273
2274/// Enables network tracking, network events will now be delivered to the client.
2275
2276#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2277#[serde(rename_all = "camelCase")]
2278pub struct EnableParams {
2279    /// Buffer size in bytes to use when preserving network payloads (XHRs, etc).
2280    /// This is the maximum number of bytes that will be collected by this
2281    /// DevTools session.
2282
2283    #[serde(skip_serializing_if = "Option::is_none")]
2284    pub maxTotalBufferSize: Option<u64>,
2285    /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
2286
2287    #[serde(skip_serializing_if = "Option::is_none")]
2288    pub maxResourceBufferSize: Option<u64>,
2289    /// Longest post body size (in bytes) that would be included in requestWillBeSent notification
2290
2291    #[serde(skip_serializing_if = "Option::is_none")]
2292    pub maxPostDataSize: Option<u64>,
2293    /// Whether DirectSocket chunk send/receive events should be reported.
2294
2295    #[serde(skip_serializing_if = "Option::is_none")]
2296    pub reportDirectSocketTraffic: Option<bool>,
2297    /// Enable storing response bodies outside of renderer, so that these survive
2298    /// a cross-process navigation. Requires maxTotalBufferSize to be set.
2299    /// Currently defaults to false. This field is being deprecated in favor of the dedicated
2300    /// configureDurableMessages command, due to the possibility of deadlocks when awaiting
2301    /// Network.enable before issuing Runtime.runIfWaitingForDebugger.
2302
2303    #[serde(skip_serializing_if = "Option::is_none")]
2304    pub enableDurableMessages: Option<bool>,
2305}
2306
2307impl EnableParams { pub const METHOD: &'static str = "Network.enable"; }
2308
2309impl crate::CdpCommand for EnableParams {
2310    const METHOD: &'static str = "Network.enable";
2311    type Response = crate::EmptyReturns;
2312}
2313
2314/// Configures storing response bodies outside of renderer, so that these survive
2315/// a cross-process navigation.
2316/// If maxTotalBufferSize is not set, durable messages are disabled.
2317
2318#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2319#[serde(rename_all = "camelCase")]
2320pub struct ConfigureDurableMessagesParams {
2321    /// Buffer size in bytes to use when preserving network payloads (XHRs, etc).
2322
2323    #[serde(skip_serializing_if = "Option::is_none")]
2324    pub maxTotalBufferSize: Option<u64>,
2325    /// Per-resource buffer size in bytes to use when preserving network payloads (XHRs, etc).
2326
2327    #[serde(skip_serializing_if = "Option::is_none")]
2328    pub maxResourceBufferSize: Option<u64>,
2329}
2330
2331impl ConfigureDurableMessagesParams { pub const METHOD: &'static str = "Network.configureDurableMessages"; }
2332
2333impl crate::CdpCommand for ConfigureDurableMessagesParams {
2334    const METHOD: &'static str = "Network.configureDurableMessages";
2335    type Response = crate::EmptyReturns;
2336}
2337
2338/// Returns all browser cookies. Depending on the backend support, will return detailed cookie
2339/// information in the 'cookies' field.
2340/// Deprecated. Use Storage.getCookies instead.
2341
2342#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2343#[serde(rename_all = "camelCase")]
2344pub struct GetAllCookiesReturns {
2345    /// Array of cookie objects.
2346
2347    pub cookies: Vec<Cookie>,
2348}
2349
2350#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2351pub struct GetAllCookiesParams {}
2352
2353impl GetAllCookiesParams { pub const METHOD: &'static str = "Network.getAllCookies"; }
2354
2355impl crate::CdpCommand for GetAllCookiesParams {
2356    const METHOD: &'static str = "Network.getAllCookies";
2357    type Response = GetAllCookiesReturns;
2358}
2359
2360/// Returns the DER-encoded certificate.
2361
2362#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2363#[serde(rename_all = "camelCase")]
2364pub struct GetCertificateParams {
2365    /// Origin to get certificate for.
2366
2367    pub origin: String,
2368}
2369
2370/// Returns the DER-encoded certificate.
2371
2372#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2373#[serde(rename_all = "camelCase")]
2374pub struct GetCertificateReturns {
2375
2376    pub tableNames: Vec<String>,
2377}
2378
2379impl GetCertificateParams { pub const METHOD: &'static str = "Network.getCertificate"; }
2380
2381impl crate::CdpCommand for GetCertificateParams {
2382    const METHOD: &'static str = "Network.getCertificate";
2383    type Response = GetCertificateReturns;
2384}
2385
2386/// Returns all browser cookies for the current URL. Depending on the backend support, will return
2387/// detailed cookie information in the 'cookies' field.
2388
2389#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2390#[serde(rename_all = "camelCase")]
2391pub struct GetCookiesParams {
2392    /// The list of URLs for which applicable cookies will be fetched.
2393    /// If not specified, it's assumed to be set to the list containing
2394    /// the URLs of the page and all of its subframes.
2395
2396    #[serde(skip_serializing_if = "Option::is_none")]
2397    pub urls: Option<Vec<String>>,
2398}
2399
2400/// Returns all browser cookies for the current URL. Depending on the backend support, will return
2401/// detailed cookie information in the 'cookies' field.
2402
2403#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2404#[serde(rename_all = "camelCase")]
2405pub struct GetCookiesReturns {
2406    /// Array of cookie objects.
2407
2408    pub cookies: Vec<Cookie>,
2409}
2410
2411impl GetCookiesParams { pub const METHOD: &'static str = "Network.getCookies"; }
2412
2413impl crate::CdpCommand for GetCookiesParams {
2414    const METHOD: &'static str = "Network.getCookies";
2415    type Response = GetCookiesReturns;
2416}
2417
2418/// Returns content served for the given request.
2419
2420#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2421#[serde(rename_all = "camelCase")]
2422pub struct GetResponseBodyParams {
2423    /// Identifier of the network request to get content for.
2424
2425    pub requestId: RequestId,
2426}
2427
2428/// Returns content served for the given request.
2429
2430#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2431#[serde(rename_all = "camelCase")]
2432pub struct GetResponseBodyReturns {
2433    /// Response body.
2434
2435    pub body: String,
2436    /// True, if content was sent as base64.
2437
2438    pub base64Encoded: bool,
2439}
2440
2441impl GetResponseBodyParams { pub const METHOD: &'static str = "Network.getResponseBody"; }
2442
2443impl crate::CdpCommand for GetResponseBodyParams {
2444    const METHOD: &'static str = "Network.getResponseBody";
2445    type Response = GetResponseBodyReturns;
2446}
2447
2448/// Returns post data sent with the request. Returns an error when no data was sent with the request.
2449
2450#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2451#[serde(rename_all = "camelCase")]
2452pub struct GetRequestPostDataParams {
2453    /// Identifier of the network request to get content for.
2454
2455    pub requestId: RequestId,
2456}
2457
2458/// Returns post data sent with the request. Returns an error when no data was sent with the request.
2459
2460#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2461#[serde(rename_all = "camelCase")]
2462pub struct GetRequestPostDataReturns {
2463    /// Request body string, omitting files from multipart requests
2464
2465    pub postData: String,
2466    /// True, if content was sent as base64.
2467
2468    pub base64Encoded: bool,
2469}
2470
2471impl GetRequestPostDataParams { pub const METHOD: &'static str = "Network.getRequestPostData"; }
2472
2473impl crate::CdpCommand for GetRequestPostDataParams {
2474    const METHOD: &'static str = "Network.getRequestPostData";
2475    type Response = GetRequestPostDataReturns;
2476}
2477
2478/// Returns content served for the given currently intercepted request.
2479
2480#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2481#[serde(rename_all = "camelCase")]
2482pub struct GetResponseBodyForInterceptionParams {
2483    /// Identifier for the intercepted request to get body for.
2484
2485    pub interceptionId: InterceptionId,
2486}
2487
2488/// Returns content served for the given currently intercepted request.
2489
2490#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2491#[serde(rename_all = "camelCase")]
2492pub struct GetResponseBodyForInterceptionReturns {
2493    /// Response body.
2494
2495    pub body: String,
2496    /// True, if content was sent as base64.
2497
2498    pub base64Encoded: bool,
2499}
2500
2501impl GetResponseBodyForInterceptionParams { pub const METHOD: &'static str = "Network.getResponseBodyForInterception"; }
2502
2503impl crate::CdpCommand for GetResponseBodyForInterceptionParams {
2504    const METHOD: &'static str = "Network.getResponseBodyForInterception";
2505    type Response = GetResponseBodyForInterceptionReturns;
2506}
2507
2508/// Returns a handle to the stream representing the response body. Note that after this command,
2509/// the intercepted request can't be continued as is -- you either need to cancel it or to provide
2510/// the response body. The stream only supports sequential read, IO.read will fail if the position
2511/// is specified.
2512
2513#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2514#[serde(rename_all = "camelCase")]
2515pub struct TakeResponseBodyForInterceptionAsStreamParams {
2516
2517    pub interceptionId: InterceptionId,
2518}
2519
2520/// Returns a handle to the stream representing the response body. Note that after this command,
2521/// the intercepted request can't be continued as is -- you either need to cancel it or to provide
2522/// the response body. The stream only supports sequential read, IO.read will fail if the position
2523/// is specified.
2524
2525#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2526#[serde(rename_all = "camelCase")]
2527pub struct TakeResponseBodyForInterceptionAsStreamReturns {
2528
2529    pub stream: crate::io::StreamHandle,
2530}
2531
2532impl TakeResponseBodyForInterceptionAsStreamParams { pub const METHOD: &'static str = "Network.takeResponseBodyForInterceptionAsStream"; }
2533
2534impl crate::CdpCommand for TakeResponseBodyForInterceptionAsStreamParams {
2535    const METHOD: &'static str = "Network.takeResponseBodyForInterceptionAsStream";
2536    type Response = TakeResponseBodyForInterceptionAsStreamReturns;
2537}
2538
2539/// This method sends a new XMLHttpRequest which is identical to the original one. The following
2540/// parameters should be identical: method, url, async, request body, extra headers, withCredentials
2541/// attribute, user, password.
2542
2543#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2544#[serde(rename_all = "camelCase")]
2545pub struct ReplayXHRParams {
2546    /// Identifier of XHR to replay.
2547
2548    pub requestId: RequestId,
2549}
2550
2551impl ReplayXHRParams { pub const METHOD: &'static str = "Network.replayXHR"; }
2552
2553impl crate::CdpCommand for ReplayXHRParams {
2554    const METHOD: &'static str = "Network.replayXHR";
2555    type Response = crate::EmptyReturns;
2556}
2557
2558/// Searches for given string in response content.
2559
2560#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2561#[serde(rename_all = "camelCase")]
2562pub struct SearchInResponseBodyParams {
2563    /// Identifier of the network response to search.
2564
2565    pub requestId: RequestId,
2566    /// String to search for.
2567
2568    pub query: String,
2569    /// If true, search is case sensitive.
2570
2571    #[serde(skip_serializing_if = "Option::is_none")]
2572    pub caseSensitive: Option<bool>,
2573    /// If true, treats string parameter as regex.
2574
2575    #[serde(skip_serializing_if = "Option::is_none")]
2576    pub isRegex: Option<bool>,
2577}
2578
2579/// Searches for given string in response content.
2580
2581#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2582#[serde(rename_all = "camelCase")]
2583pub struct SearchInResponseBodyReturns {
2584    /// List of search matches.
2585
2586    pub result: Vec<crate::debugger::SearchMatch>,
2587}
2588
2589impl SearchInResponseBodyParams { pub const METHOD: &'static str = "Network.searchInResponseBody"; }
2590
2591impl crate::CdpCommand for SearchInResponseBodyParams {
2592    const METHOD: &'static str = "Network.searchInResponseBody";
2593    type Response = SearchInResponseBodyReturns;
2594}
2595
2596/// Blocks URLs from loading.
2597
2598#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2599#[serde(rename_all = "camelCase")]
2600pub struct SetBlockedURLsParams {
2601    /// Patterns to match in the order in which they are given. These patterns
2602    /// also take precedence over any wildcard patterns defined in 'urls'.
2603
2604    #[serde(skip_serializing_if = "Option::is_none")]
2605    pub urlPatterns: Option<Vec<BlockPattern>>,
2606    /// URL patterns to block. Wildcards ('*') are allowed.
2607
2608    #[serde(skip_serializing_if = "Option::is_none")]
2609    pub urls: Option<Vec<String>>,
2610}
2611
2612impl SetBlockedURLsParams { pub const METHOD: &'static str = "Network.setBlockedURLs"; }
2613
2614impl crate::CdpCommand for SetBlockedURLsParams {
2615    const METHOD: &'static str = "Network.setBlockedURLs";
2616    type Response = crate::EmptyReturns;
2617}
2618
2619/// Toggles ignoring of service worker for each request.
2620
2621#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2622#[serde(rename_all = "camelCase")]
2623pub struct SetBypassServiceWorkerParams {
2624    /// Bypass service worker and load from network.
2625
2626    pub bypass: bool,
2627}
2628
2629impl SetBypassServiceWorkerParams { pub const METHOD: &'static str = "Network.setBypassServiceWorker"; }
2630
2631impl crate::CdpCommand for SetBypassServiceWorkerParams {
2632    const METHOD: &'static str = "Network.setBypassServiceWorker";
2633    type Response = crate::EmptyReturns;
2634}
2635
2636/// Toggles ignoring cache for each request. If 'true', cache will not be used.
2637
2638#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2639#[serde(rename_all = "camelCase")]
2640pub struct SetCacheDisabledParams {
2641    /// Cache disabled state.
2642
2643    pub cacheDisabled: bool,
2644}
2645
2646impl SetCacheDisabledParams { pub const METHOD: &'static str = "Network.setCacheDisabled"; }
2647
2648impl crate::CdpCommand for SetCacheDisabledParams {
2649    const METHOD: &'static str = "Network.setCacheDisabled";
2650    type Response = crate::EmptyReturns;
2651}
2652
2653/// Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
2654
2655#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2656#[serde(rename_all = "camelCase")]
2657pub struct SetCookieParams {
2658    /// Cookie name.
2659
2660    pub name: String,
2661    /// Cookie value.
2662
2663    pub value: String,
2664    /// The request-URI to associate with the setting of the cookie. This value can affect the
2665    /// default domain, path, source port, and source scheme values of the created cookie.
2666
2667    #[serde(skip_serializing_if = "Option::is_none")]
2668    pub url: Option<String>,
2669    /// Cookie domain.
2670
2671    #[serde(skip_serializing_if = "Option::is_none")]
2672    pub domain: Option<String>,
2673    /// Cookie path.
2674
2675    #[serde(skip_serializing_if = "Option::is_none")]
2676    pub path: Option<String>,
2677    /// True if cookie is secure.
2678
2679    #[serde(skip_serializing_if = "Option::is_none")]
2680    pub secure: Option<bool>,
2681    /// True if cookie is http-only.
2682
2683    #[serde(skip_serializing_if = "Option::is_none")]
2684    pub httpOnly: Option<bool>,
2685    /// Cookie SameSite type.
2686
2687    #[serde(skip_serializing_if = "Option::is_none")]
2688    pub sameSite: Option<CookieSameSite>,
2689    /// Cookie expiration date, session cookie if not set
2690
2691    #[serde(skip_serializing_if = "Option::is_none")]
2692    pub expires: Option<TimeSinceEpoch>,
2693    /// Cookie Priority type.
2694
2695    #[serde(skip_serializing_if = "Option::is_none")]
2696    pub priority: Option<CookiePriority>,
2697    /// Cookie source scheme type.
2698
2699    #[serde(skip_serializing_if = "Option::is_none")]
2700    pub sourceScheme: Option<CookieSourceScheme>,
2701    /// Cookie source port. Valid values are {-1, [1, 65535]}, -1 indicates an unspecified port.
2702    /// An unspecified port value allows protocol clients to emulate legacy cookie scope for the port.
2703    /// This is a temporary ability and it will be removed in the future.
2704
2705    #[serde(skip_serializing_if = "Option::is_none")]
2706    pub sourcePort: Option<i64>,
2707    /// Cookie partition key. If not set, the cookie will be set as not partitioned.
2708
2709    #[serde(skip_serializing_if = "Option::is_none")]
2710    pub partitionKey: Option<CookiePartitionKey>,
2711}
2712
2713/// Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
2714
2715#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2716#[serde(rename_all = "camelCase")]
2717pub struct SetCookieReturns {
2718    /// Always set to true. If an error occurs, the response indicates protocol error.
2719
2720    pub success: bool,
2721}
2722
2723impl SetCookieParams { pub const METHOD: &'static str = "Network.setCookie"; }
2724
2725impl crate::CdpCommand for SetCookieParams {
2726    const METHOD: &'static str = "Network.setCookie";
2727    type Response = SetCookieReturns;
2728}
2729
2730/// Sets given cookies.
2731
2732#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2733#[serde(rename_all = "camelCase")]
2734pub struct SetCookiesParams {
2735    /// Cookies to be set.
2736
2737    pub cookies: Vec<CookieParam>,
2738}
2739
2740impl SetCookiesParams { pub const METHOD: &'static str = "Network.setCookies"; }
2741
2742impl crate::CdpCommand for SetCookiesParams {
2743    const METHOD: &'static str = "Network.setCookies";
2744    type Response = crate::EmptyReturns;
2745}
2746
2747/// Specifies whether to always send extra HTTP headers with the requests from this page.
2748
2749#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2750#[serde(rename_all = "camelCase")]
2751pub struct SetExtraHTTPHeadersParams {
2752    /// Map with extra HTTP headers.
2753
2754    pub headers: Headers,
2755}
2756
2757impl SetExtraHTTPHeadersParams { pub const METHOD: &'static str = "Network.setExtraHTTPHeaders"; }
2758
2759impl crate::CdpCommand for SetExtraHTTPHeadersParams {
2760    const METHOD: &'static str = "Network.setExtraHTTPHeaders";
2761    type Response = crate::EmptyReturns;
2762}
2763
2764/// Specifies whether to attach a page script stack id in requests
2765
2766#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2767#[serde(rename_all = "camelCase")]
2768pub struct SetAttachDebugStackParams {
2769    /// Whether to attach a page script stack for debugging purpose.
2770
2771    pub enabled: bool,
2772}
2773
2774impl SetAttachDebugStackParams { pub const METHOD: &'static str = "Network.setAttachDebugStack"; }
2775
2776impl crate::CdpCommand for SetAttachDebugStackParams {
2777    const METHOD: &'static str = "Network.setAttachDebugStack";
2778    type Response = crate::EmptyReturns;
2779}
2780
2781/// Sets the requests to intercept that match the provided patterns and optionally resource types.
2782/// Deprecated, please use Fetch.enable instead.
2783
2784#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2785#[serde(rename_all = "camelCase")]
2786pub struct SetRequestInterceptionParams {
2787    /// Requests matching any of these patterns will be forwarded and wait for the corresponding
2788    /// continueInterceptedRequest call.
2789
2790    pub patterns: Vec<RequestPattern>,
2791}
2792
2793impl SetRequestInterceptionParams { pub const METHOD: &'static str = "Network.setRequestInterception"; }
2794
2795impl crate::CdpCommand for SetRequestInterceptionParams {
2796    const METHOD: &'static str = "Network.setRequestInterception";
2797    type Response = crate::EmptyReturns;
2798}
2799
2800/// Allows overriding user agent with the given string.
2801
2802#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2803#[serde(rename_all = "camelCase")]
2804pub struct SetUserAgentOverrideParams {
2805    /// User agent to use.
2806
2807    pub userAgent: String,
2808    /// Browser language to emulate.
2809
2810    #[serde(skip_serializing_if = "Option::is_none")]
2811    pub acceptLanguage: Option<String>,
2812    /// The platform navigator.platform should return.
2813
2814    #[serde(skip_serializing_if = "Option::is_none")]
2815    pub platform: Option<String>,
2816    /// To be sent in Sec-CH-UA-* headers and returned in navigator.userAgentData
2817
2818    #[serde(skip_serializing_if = "Option::is_none")]
2819    pub userAgentMetadata: Option<crate::emulation::UserAgentMetadata>,
2820}
2821
2822impl SetUserAgentOverrideParams { pub const METHOD: &'static str = "Network.setUserAgentOverride"; }
2823
2824impl crate::CdpCommand for SetUserAgentOverrideParams {
2825    const METHOD: &'static str = "Network.setUserAgentOverride";
2826    type Response = crate::EmptyReturns;
2827}
2828
2829/// Enables streaming of the response for the given requestId.
2830/// If enabled, the dataReceived event contains the data that was received during streaming.
2831
2832#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2833#[serde(rename_all = "camelCase")]
2834pub struct StreamResourceContentParams {
2835    /// Identifier of the request to stream.
2836
2837    pub requestId: RequestId,
2838}
2839
2840/// Enables streaming of the response for the given requestId.
2841/// If enabled, the dataReceived event contains the data that was received during streaming.
2842
2843#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2844#[serde(rename_all = "camelCase")]
2845pub struct StreamResourceContentReturns {
2846    /// Data that has been buffered until streaming is enabled. (Encoded as a base64 string when passed over JSON)
2847
2848    pub bufferedData: String,
2849}
2850
2851impl StreamResourceContentParams { pub const METHOD: &'static str = "Network.streamResourceContent"; }
2852
2853impl crate::CdpCommand for StreamResourceContentParams {
2854    const METHOD: &'static str = "Network.streamResourceContent";
2855    type Response = StreamResourceContentReturns;
2856}
2857
2858/// Returns information about the COEP/COOP isolation status.
2859
2860#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2861#[serde(rename_all = "camelCase")]
2862pub struct GetSecurityIsolationStatusParams {
2863    /// If no frameId is provided, the status of the target is provided.
2864
2865    #[serde(skip_serializing_if = "Option::is_none")]
2866    pub frameId: Option<crate::page::FrameId>,
2867}
2868
2869/// Returns information about the COEP/COOP isolation status.
2870
2871#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2872#[serde(rename_all = "camelCase")]
2873pub struct GetSecurityIsolationStatusReturns {
2874
2875    pub status: SecurityIsolationStatus,
2876}
2877
2878impl GetSecurityIsolationStatusParams { pub const METHOD: &'static str = "Network.getSecurityIsolationStatus"; }
2879
2880impl crate::CdpCommand for GetSecurityIsolationStatusParams {
2881    const METHOD: &'static str = "Network.getSecurityIsolationStatus";
2882    type Response = GetSecurityIsolationStatusReturns;
2883}
2884
2885/// Enables tracking for the Reporting API, events generated by the Reporting API will now be delivered to the client.
2886/// Enabling triggers 'reportingApiReportAdded' for all existing reports.
2887
2888#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2889#[serde(rename_all = "camelCase")]
2890pub struct EnableReportingApiParams {
2891    /// Whether to enable or disable events for the Reporting API
2892
2893    pub enable: bool,
2894}
2895
2896impl EnableReportingApiParams { pub const METHOD: &'static str = "Network.enableReportingApi"; }
2897
2898impl crate::CdpCommand for EnableReportingApiParams {
2899    const METHOD: &'static str = "Network.enableReportingApi";
2900    type Response = crate::EmptyReturns;
2901}
2902
2903/// Sets up tracking device bound sessions and fetching of initial set of sessions.
2904
2905#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2906#[serde(rename_all = "camelCase")]
2907pub struct EnableDeviceBoundSessionsParams {
2908    /// Whether to enable or disable events.
2909
2910    pub enable: bool,
2911}
2912
2913impl EnableDeviceBoundSessionsParams { pub const METHOD: &'static str = "Network.enableDeviceBoundSessions"; }
2914
2915impl crate::CdpCommand for EnableDeviceBoundSessionsParams {
2916    const METHOD: &'static str = "Network.enableDeviceBoundSessions";
2917    type Response = crate::EmptyReturns;
2918}
2919
2920/// Deletes a device bound session.
2921
2922#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2923#[serde(rename_all = "camelCase")]
2924pub struct DeleteDeviceBoundSessionParams {
2925
2926    pub key: DeviceBoundSessionKey,
2927}
2928
2929impl DeleteDeviceBoundSessionParams { pub const METHOD: &'static str = "Network.deleteDeviceBoundSession"; }
2930
2931impl crate::CdpCommand for DeleteDeviceBoundSessionParams {
2932    const METHOD: &'static str = "Network.deleteDeviceBoundSession";
2933    type Response = crate::EmptyReturns;
2934}
2935
2936/// Fetches the schemeful site for a specific origin.
2937
2938#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2939#[serde(rename_all = "camelCase")]
2940pub struct FetchSchemefulSiteParams {
2941    /// The URL origin.
2942
2943    pub origin: String,
2944}
2945
2946/// Fetches the schemeful site for a specific origin.
2947
2948#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2949#[serde(rename_all = "camelCase")]
2950pub struct FetchSchemefulSiteReturns {
2951    /// The corresponding schemeful site.
2952
2953    pub schemefulSite: String,
2954}
2955
2956impl FetchSchemefulSiteParams { pub const METHOD: &'static str = "Network.fetchSchemefulSite"; }
2957
2958impl crate::CdpCommand for FetchSchemefulSiteParams {
2959    const METHOD: &'static str = "Network.fetchSchemefulSite";
2960    type Response = FetchSchemefulSiteReturns;
2961}
2962
2963/// Fetches the resource and returns the content.
2964
2965#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2966#[serde(rename_all = "camelCase")]
2967pub struct LoadNetworkResourceParams {
2968    /// Frame id to get the resource for. Mandatory for frame targets, and
2969    /// should be omitted for worker targets.
2970
2971    #[serde(skip_serializing_if = "Option::is_none")]
2972    pub frameId: Option<crate::page::FrameId>,
2973    /// URL of the resource to get content for.
2974
2975    pub url: String,
2976    /// Options for the request.
2977
2978    pub options: LoadNetworkResourceOptions,
2979}
2980
2981/// Fetches the resource and returns the content.
2982
2983#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2984#[serde(rename_all = "camelCase")]
2985pub struct LoadNetworkResourceReturns {
2986
2987    pub resource: LoadNetworkResourcePageResult,
2988}
2989
2990impl LoadNetworkResourceParams { pub const METHOD: &'static str = "Network.loadNetworkResource"; }
2991
2992impl crate::CdpCommand for LoadNetworkResourceParams {
2993    const METHOD: &'static str = "Network.loadNetworkResource";
2994    type Response = LoadNetworkResourceReturns;
2995}
2996
2997/// Sets Controls for third-party cookie access
2998/// Page reload is required before the new cookie behavior will be observed
2999
3000#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3001#[serde(rename_all = "camelCase")]
3002pub struct SetCookieControlsParams {
3003    /// Whether 3pc restriction is enabled.
3004
3005    pub enableThirdPartyCookieRestriction: bool,
3006}
3007
3008impl SetCookieControlsParams { pub const METHOD: &'static str = "Network.setCookieControls"; }
3009
3010impl crate::CdpCommand for SetCookieControlsParams {
3011    const METHOD: &'static str = "Network.setCookieControls";
3012    type Response = crate::EmptyReturns;
3013}