Skip to main content

browser_protocol/audits/
mod.rs

1//! Audits domain allows investigation of page violations and possible improvements.
2
3
4use serde::{Serialize, Deserialize};
5use serde_json::Value as JsonValue;
6use std::borrow::Cow;
7
8/// Information about a cookie that is affected by an inspector issue.
9
10#[derive(Debug, Clone, Serialize, Deserialize, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct AffectedCookie<'a> {
13    /// The following three properties uniquely identify a cookie
14    name: Cow<'a, str>,
15    path: Cow<'a, str>,
16    domain: Cow<'a, str>,
17}
18
19impl<'a> AffectedCookie<'a> {
20    /// Creates a builder for this type with the required parameters:
21    /// * `name`: The following three properties uniquely identify a cookie
22    /// * `path`: 
23    /// * `domain`: 
24    pub fn builder(name: impl Into<Cow<'a, str>>, path: impl Into<Cow<'a, str>>, domain: impl Into<Cow<'a, str>>) -> AffectedCookieBuilder<'a> {
25        AffectedCookieBuilder {
26            name: name.into(),
27            path: path.into(),
28            domain: domain.into(),
29        }
30    }
31    /// The following three properties uniquely identify a cookie
32    pub fn name(&self) -> &str { self.name.as_ref() }
33    pub fn path(&self) -> &str { self.path.as_ref() }
34    pub fn domain(&self) -> &str { self.domain.as_ref() }
35}
36
37
38pub struct AffectedCookieBuilder<'a> {
39    name: Cow<'a, str>,
40    path: Cow<'a, str>,
41    domain: Cow<'a, str>,
42}
43
44impl<'a> AffectedCookieBuilder<'a> {
45    pub fn build(self) -> AffectedCookie<'a> {
46        AffectedCookie {
47            name: self.name,
48            path: self.path,
49            domain: self.domain,
50        }
51    }
52}
53
54/// Information about a request that is affected by an inspector issue.
55
56#[derive(Debug, Clone, Serialize, Deserialize, Default)]
57#[serde(rename_all = "camelCase")]
58pub struct AffectedRequest<'a> {
59    /// The unique request id.
60    #[serde(skip_serializing_if = "Option::is_none", rename = "requestId")]
61    request_id: Option<crate::network::RequestId<'a>>,
62    url: Cow<'a, str>,
63}
64
65impl<'a> AffectedRequest<'a> {
66    /// Creates a builder for this type with the required parameters:
67    /// * `url`: 
68    pub fn builder(url: impl Into<Cow<'a, str>>) -> AffectedRequestBuilder<'a> {
69        AffectedRequestBuilder {
70            request_id: None,
71            url: url.into(),
72        }
73    }
74    /// The unique request id.
75    pub fn request_id(&self) -> Option<&crate::network::RequestId<'a>> { self.request_id.as_ref() }
76    pub fn url(&self) -> &str { self.url.as_ref() }
77}
78
79
80pub struct AffectedRequestBuilder<'a> {
81    request_id: Option<crate::network::RequestId<'a>>,
82    url: Cow<'a, str>,
83}
84
85impl<'a> AffectedRequestBuilder<'a> {
86    /// The unique request id.
87    pub fn request_id(mut self, request_id: crate::network::RequestId<'a>) -> Self { self.request_id = Some(request_id); self }
88    pub fn build(self) -> AffectedRequest<'a> {
89        AffectedRequest {
90            request_id: self.request_id,
91            url: self.url,
92        }
93    }
94}
95
96/// Information about the frame affected by an inspector issue.
97
98#[derive(Debug, Clone, Serialize, Deserialize, Default)]
99#[serde(rename_all = "camelCase")]
100pub struct AffectedFrame<'a> {
101    #[serde(rename = "frameId")]
102    frame_id: crate::page::FrameId<'a>,
103}
104
105impl<'a> AffectedFrame<'a> {
106    /// Creates a builder for this type with the required parameters:
107    /// * `frame_id`: 
108    pub fn builder(frame_id: crate::page::FrameId<'a>) -> AffectedFrameBuilder<'a> {
109        AffectedFrameBuilder {
110            frame_id: frame_id,
111        }
112    }
113    pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
114}
115
116
117pub struct AffectedFrameBuilder<'a> {
118    frame_id: crate::page::FrameId<'a>,
119}
120
121impl<'a> AffectedFrameBuilder<'a> {
122    pub fn build(self) -> AffectedFrame<'a> {
123        AffectedFrame {
124            frame_id: self.frame_id,
125        }
126    }
127}
128
129
130#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
131pub enum CookieExclusionReason {
132    #[default]
133    #[serde(rename = "ExcludeSameSiteUnspecifiedTreatedAsLax")]
134    ExcludeSameSiteUnspecifiedTreatedAsLax,
135    #[serde(rename = "ExcludeSameSiteNoneInsecure")]
136    ExcludeSameSiteNoneInsecure,
137    #[serde(rename = "ExcludeSameSiteLax")]
138    ExcludeSameSiteLax,
139    #[serde(rename = "ExcludeSameSiteStrict")]
140    ExcludeSameSiteStrict,
141    #[serde(rename = "ExcludeDomainNonASCII")]
142    ExcludeDomainNonASCII,
143    #[serde(rename = "ExcludeThirdPartyCookieBlockedInFirstPartySet")]
144    ExcludeThirdPartyCookieBlockedInFirstPartySet,
145    #[serde(rename = "ExcludeThirdPartyPhaseout")]
146    ExcludeThirdPartyPhaseout,
147    #[serde(rename = "ExcludePortMismatch")]
148    ExcludePortMismatch,
149    #[serde(rename = "ExcludeSchemeMismatch")]
150    ExcludeSchemeMismatch,
151}
152
153
154#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
155pub enum CookieWarningReason {
156    #[default]
157    #[serde(rename = "WarnSameSiteUnspecifiedCrossSiteContext")]
158    WarnSameSiteUnspecifiedCrossSiteContext,
159    #[serde(rename = "WarnSameSiteNoneInsecure")]
160    WarnSameSiteNoneInsecure,
161    #[serde(rename = "WarnSameSiteUnspecifiedLaxAllowUnsafe")]
162    WarnSameSiteUnspecifiedLaxAllowUnsafe,
163    #[serde(rename = "WarnSameSiteStrictLaxDowngradeStrict")]
164    WarnSameSiteStrictLaxDowngradeStrict,
165    #[serde(rename = "WarnSameSiteStrictCrossDowngradeStrict")]
166    WarnSameSiteStrictCrossDowngradeStrict,
167    #[serde(rename = "WarnSameSiteStrictCrossDowngradeLax")]
168    WarnSameSiteStrictCrossDowngradeLax,
169    #[serde(rename = "WarnSameSiteLaxCrossDowngradeStrict")]
170    WarnSameSiteLaxCrossDowngradeStrict,
171    #[serde(rename = "WarnSameSiteLaxCrossDowngradeLax")]
172    WarnSameSiteLaxCrossDowngradeLax,
173    #[serde(rename = "WarnAttributeValueExceedsMaxSize")]
174    WarnAttributeValueExceedsMaxSize,
175    #[serde(rename = "WarnDomainNonASCII")]
176    WarnDomainNonASCII,
177    #[serde(rename = "WarnThirdPartyPhaseout")]
178    WarnThirdPartyPhaseout,
179    #[serde(rename = "WarnCrossSiteRedirectDowngradeChangesInclusion")]
180    WarnCrossSiteRedirectDowngradeChangesInclusion,
181    #[serde(rename = "WarnDeprecationTrialMetadata")]
182    WarnDeprecationTrialMetadata,
183    #[serde(rename = "WarnThirdPartyCookieHeuristic")]
184    WarnThirdPartyCookieHeuristic,
185}
186
187
188#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
189pub enum CookieOperation {
190    #[default]
191    #[serde(rename = "SetCookie")]
192    SetCookie,
193    #[serde(rename = "ReadCookie")]
194    ReadCookie,
195}
196
197/// Represents the category of insight that a cookie issue falls under.
198
199#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
200pub enum InsightType {
201    #[default]
202    #[serde(rename = "GitHubResource")]
203    GitHubResource,
204    #[serde(rename = "GracePeriod")]
205    GracePeriod,
206    #[serde(rename = "Heuristics")]
207    Heuristics,
208}
209
210/// Information about the suggested solution to a cookie issue.
211
212#[derive(Debug, Clone, Serialize, Deserialize, Default)]
213#[serde(rename_all = "camelCase")]
214pub struct CookieIssueInsight<'a> {
215    #[serde(rename = "type")]
216    type_: InsightType,
217    /// Link to table entry in third-party cookie migration readiness list.
218    #[serde(skip_serializing_if = "Option::is_none", rename = "tableEntryUrl")]
219    table_entry_url: Option<Cow<'a, str>>,
220}
221
222impl<'a> CookieIssueInsight<'a> {
223    /// Creates a builder for this type with the required parameters:
224    /// * `type_`: 
225    pub fn builder(type_: impl Into<InsightType>) -> CookieIssueInsightBuilder<'a> {
226        CookieIssueInsightBuilder {
227            type_: type_.into(),
228            table_entry_url: None,
229        }
230    }
231    pub fn type_(&self) -> &InsightType { &self.type_ }
232    /// Link to table entry in third-party cookie migration readiness list.
233    pub fn table_entry_url(&self) -> Option<&str> { self.table_entry_url.as_deref() }
234}
235
236
237pub struct CookieIssueInsightBuilder<'a> {
238    type_: InsightType,
239    table_entry_url: Option<Cow<'a, str>>,
240}
241
242impl<'a> CookieIssueInsightBuilder<'a> {
243    /// Link to table entry in third-party cookie migration readiness list.
244    pub fn table_entry_url(mut self, table_entry_url: impl Into<Cow<'a, str>>) -> Self { self.table_entry_url = Some(table_entry_url.into()); self }
245    pub fn build(self) -> CookieIssueInsight<'a> {
246        CookieIssueInsight {
247            type_: self.type_,
248            table_entry_url: self.table_entry_url,
249        }
250    }
251}
252
253/// This information is currently necessary, as the front-end has a difficult
254/// time finding a specific cookie. With this, we can convey specific error
255/// information without the cookie.
256
257#[derive(Debug, Clone, Serialize, Deserialize, Default)]
258#[serde(rename_all = "camelCase")]
259pub struct CookieIssueDetails<'a> {
260    /// If AffectedCookie is not set then rawCookieLine contains the raw
261    /// Set-Cookie header string. This hints at a problem where the
262    /// cookie line is syntactically or semantically malformed in a way
263    /// that no valid cookie could be created.
264    #[serde(skip_serializing_if = "Option::is_none")]
265    cookie: Option<AffectedCookie<'a>>,
266    #[serde(skip_serializing_if = "Option::is_none", rename = "rawCookieLine")]
267    raw_cookie_line: Option<Cow<'a, str>>,
268    #[serde(rename = "cookieWarningReasons")]
269    cookie_warning_reasons: Vec<CookieWarningReason>,
270    #[serde(rename = "cookieExclusionReasons")]
271    cookie_exclusion_reasons: Vec<CookieExclusionReason>,
272    /// Optionally identifies the site-for-cookies and the cookie url, which
273    /// may be used by the front-end as additional context.
274    operation: CookieOperation,
275    #[serde(skip_serializing_if = "Option::is_none", rename = "siteForCookies")]
276    site_for_cookies: Option<Cow<'a, str>>,
277    #[serde(skip_serializing_if = "Option::is_none", rename = "cookieUrl")]
278    cookie_url: Option<Cow<'a, str>>,
279    #[serde(skip_serializing_if = "Option::is_none")]
280    request: Option<AffectedRequest<'a>>,
281    /// The recommended solution to the issue.
282    #[serde(skip_serializing_if = "Option::is_none")]
283    insight: Option<CookieIssueInsight<'a>>,
284}
285
286impl<'a> CookieIssueDetails<'a> {
287    /// Creates a builder for this type with the required parameters:
288    /// * `cookie_warning_reasons`: 
289    /// * `cookie_exclusion_reasons`: 
290    /// * `operation`: Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context.
291    pub fn builder(cookie_warning_reasons: Vec<CookieWarningReason>, cookie_exclusion_reasons: Vec<CookieExclusionReason>, operation: impl Into<CookieOperation>) -> CookieIssueDetailsBuilder<'a> {
292        CookieIssueDetailsBuilder {
293            cookie: None,
294            raw_cookie_line: None,
295            cookie_warning_reasons: cookie_warning_reasons,
296            cookie_exclusion_reasons: cookie_exclusion_reasons,
297            operation: operation.into(),
298            site_for_cookies: None,
299            cookie_url: None,
300            request: None,
301            insight: None,
302        }
303    }
304    /// If AffectedCookie is not set then rawCookieLine contains the raw
305    /// Set-Cookie header string. This hints at a problem where the
306    /// cookie line is syntactically or semantically malformed in a way
307    /// that no valid cookie could be created.
308    pub fn cookie(&self) -> Option<&AffectedCookie<'a>> { self.cookie.as_ref() }
309    pub fn raw_cookie_line(&self) -> Option<&str> { self.raw_cookie_line.as_deref() }
310    pub fn cookie_warning_reasons(&self) -> &[CookieWarningReason] { &self.cookie_warning_reasons }
311    pub fn cookie_exclusion_reasons(&self) -> &[CookieExclusionReason] { &self.cookie_exclusion_reasons }
312    /// Optionally identifies the site-for-cookies and the cookie url, which
313    /// may be used by the front-end as additional context.
314    pub fn operation(&self) -> &CookieOperation { &self.operation }
315    pub fn site_for_cookies(&self) -> Option<&str> { self.site_for_cookies.as_deref() }
316    pub fn cookie_url(&self) -> Option<&str> { self.cookie_url.as_deref() }
317    pub fn request(&self) -> Option<&AffectedRequest<'a>> { self.request.as_ref() }
318    /// The recommended solution to the issue.
319    pub fn insight(&self) -> Option<&CookieIssueInsight<'a>> { self.insight.as_ref() }
320}
321
322
323pub struct CookieIssueDetailsBuilder<'a> {
324    cookie: Option<AffectedCookie<'a>>,
325    raw_cookie_line: Option<Cow<'a, str>>,
326    cookie_warning_reasons: Vec<CookieWarningReason>,
327    cookie_exclusion_reasons: Vec<CookieExclusionReason>,
328    operation: CookieOperation,
329    site_for_cookies: Option<Cow<'a, str>>,
330    cookie_url: Option<Cow<'a, str>>,
331    request: Option<AffectedRequest<'a>>,
332    insight: Option<CookieIssueInsight<'a>>,
333}
334
335impl<'a> CookieIssueDetailsBuilder<'a> {
336    /// If AffectedCookie is not set then rawCookieLine contains the raw
337    /// Set-Cookie header string. This hints at a problem where the
338    /// cookie line is syntactically or semantically malformed in a way
339    /// that no valid cookie could be created.
340    pub fn cookie(mut self, cookie: AffectedCookie<'a>) -> Self { self.cookie = Some(cookie); self }
341    pub fn raw_cookie_line(mut self, raw_cookie_line: impl Into<Cow<'a, str>>) -> Self { self.raw_cookie_line = Some(raw_cookie_line.into()); self }
342    pub fn site_for_cookies(mut self, site_for_cookies: impl Into<Cow<'a, str>>) -> Self { self.site_for_cookies = Some(site_for_cookies.into()); self }
343    pub fn cookie_url(mut self, cookie_url: impl Into<Cow<'a, str>>) -> Self { self.cookie_url = Some(cookie_url.into()); self }
344    pub fn request(mut self, request: AffectedRequest<'a>) -> Self { self.request = Some(request); self }
345    /// The recommended solution to the issue.
346    pub fn insight(mut self, insight: CookieIssueInsight<'a>) -> Self { self.insight = Some(insight); self }
347    pub fn build(self) -> CookieIssueDetails<'a> {
348        CookieIssueDetails {
349            cookie: self.cookie,
350            raw_cookie_line: self.raw_cookie_line,
351            cookie_warning_reasons: self.cookie_warning_reasons,
352            cookie_exclusion_reasons: self.cookie_exclusion_reasons,
353            operation: self.operation,
354            site_for_cookies: self.site_for_cookies,
355            cookie_url: self.cookie_url,
356            request: self.request,
357            insight: self.insight,
358        }
359    }
360}
361
362
363#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
364pub enum PerformanceIssueType {
365    #[default]
366    #[serde(rename = "DocumentCookie")]
367    DocumentCookie,
368}
369
370/// Details for a performance issue.
371
372#[derive(Debug, Clone, Serialize, Deserialize, Default)]
373#[serde(rename_all = "camelCase")]
374pub struct PerformanceIssueDetails<'a> {
375    #[serde(rename = "performanceIssueType")]
376    performance_issue_type: PerformanceIssueType,
377    #[serde(skip_serializing_if = "Option::is_none", rename = "sourceCodeLocation")]
378    source_code_location: Option<SourceCodeLocation<'a>>,
379}
380
381impl<'a> PerformanceIssueDetails<'a> {
382    /// Creates a builder for this type with the required parameters:
383    /// * `performance_issue_type`: 
384    pub fn builder(performance_issue_type: impl Into<PerformanceIssueType>) -> PerformanceIssueDetailsBuilder<'a> {
385        PerformanceIssueDetailsBuilder {
386            performance_issue_type: performance_issue_type.into(),
387            source_code_location: None,
388        }
389    }
390    pub fn performance_issue_type(&self) -> &PerformanceIssueType { &self.performance_issue_type }
391    pub fn source_code_location(&self) -> Option<&SourceCodeLocation<'a>> { self.source_code_location.as_ref() }
392}
393
394
395pub struct PerformanceIssueDetailsBuilder<'a> {
396    performance_issue_type: PerformanceIssueType,
397    source_code_location: Option<SourceCodeLocation<'a>>,
398}
399
400impl<'a> PerformanceIssueDetailsBuilder<'a> {
401    pub fn source_code_location(mut self, source_code_location: SourceCodeLocation<'a>) -> Self { self.source_code_location = Some(source_code_location); self }
402    pub fn build(self) -> PerformanceIssueDetails<'a> {
403        PerformanceIssueDetails {
404            performance_issue_type: self.performance_issue_type,
405            source_code_location: self.source_code_location,
406        }
407    }
408}
409
410
411#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
412pub enum MixedContentResolutionStatus {
413    #[default]
414    #[serde(rename = "MixedContentBlocked")]
415    MixedContentBlocked,
416    #[serde(rename = "MixedContentAutomaticallyUpgraded")]
417    MixedContentAutomaticallyUpgraded,
418    #[serde(rename = "MixedContentWarning")]
419    MixedContentWarning,
420}
421
422
423#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
424pub enum MixedContentResourceType {
425    #[default]
426    #[serde(rename = "AttributionSrc")]
427    AttributionSrc,
428    #[serde(rename = "Audio")]
429    Audio,
430    #[serde(rename = "Beacon")]
431    Beacon,
432    #[serde(rename = "CSPReport")]
433    CSPReport,
434    #[serde(rename = "Download")]
435    Download,
436    #[serde(rename = "EventSource")]
437    EventSource,
438    #[serde(rename = "Favicon")]
439    Favicon,
440    #[serde(rename = "Font")]
441    Font,
442    #[serde(rename = "Form")]
443    Form,
444    #[serde(rename = "Frame")]
445    Frame,
446    #[serde(rename = "Image")]
447    Image,
448    #[serde(rename = "Import")]
449    Import,
450    #[serde(rename = "JSON")]
451    JSON,
452    #[serde(rename = "Manifest")]
453    Manifest,
454    #[serde(rename = "Ping")]
455    Ping,
456    #[serde(rename = "PluginData")]
457    PluginData,
458    #[serde(rename = "PluginResource")]
459    PluginResource,
460    #[serde(rename = "Prefetch")]
461    Prefetch,
462    #[serde(rename = "Resource")]
463    Resource,
464    #[serde(rename = "Script")]
465    Script,
466    #[serde(rename = "ServiceWorker")]
467    ServiceWorker,
468    #[serde(rename = "SharedWorker")]
469    SharedWorker,
470    #[serde(rename = "SpeculationRules")]
471    SpeculationRules,
472    #[serde(rename = "Stylesheet")]
473    Stylesheet,
474    #[serde(rename = "Track")]
475    Track,
476    #[serde(rename = "Video")]
477    Video,
478    #[serde(rename = "Worker")]
479    Worker,
480    #[serde(rename = "XMLHttpRequest")]
481    XMLHttpRequest,
482    #[serde(rename = "XSLT")]
483    XSLT,
484}
485
486
487#[derive(Debug, Clone, Serialize, Deserialize, Default)]
488#[serde(rename_all = "camelCase")]
489pub struct MixedContentIssueDetails<'a> {
490    /// The type of resource causing the mixed content issue (css, js, iframe,
491    /// form,...). Marked as optional because it is mapped to from
492    /// blink::mojom::RequestContextType, which will be replaced
493    /// by network::mojom::RequestDestination
494    #[serde(skip_serializing_if = "Option::is_none", rename = "resourceType")]
495    resource_type: Option<MixedContentResourceType>,
496    /// The way the mixed content issue is being resolved.
497    #[serde(rename = "resolutionStatus")]
498    resolution_status: MixedContentResolutionStatus,
499    /// The unsafe http url causing the mixed content issue.
500    #[serde(rename = "insecureURL")]
501    insecure_url: Cow<'a, str>,
502    /// The url responsible for the call to an unsafe url.
503    #[serde(rename = "mainResourceURL")]
504    main_resource_url: Cow<'a, str>,
505    /// The mixed content request.
506    /// Does not always exist (e.g. for unsafe form submission urls).
507    #[serde(skip_serializing_if = "Option::is_none")]
508    request: Option<AffectedRequest<'a>>,
509    /// Optional because not every mixed content issue is necessarily linked to a frame.
510    #[serde(skip_serializing_if = "Option::is_none")]
511    frame: Option<AffectedFrame<'a>>,
512}
513
514impl<'a> MixedContentIssueDetails<'a> {
515    /// Creates a builder for this type with the required parameters:
516    /// * `resolution_status`: The way the mixed content issue is being resolved.
517    /// * `insecure_url`: The unsafe http url causing the mixed content issue.
518    /// * `main_resource_url`: The url responsible for the call to an unsafe url.
519    pub fn builder(resolution_status: impl Into<MixedContentResolutionStatus>, insecure_url: impl Into<Cow<'a, str>>, main_resource_url: impl Into<Cow<'a, str>>) -> MixedContentIssueDetailsBuilder<'a> {
520        MixedContentIssueDetailsBuilder {
521            resource_type: None,
522            resolution_status: resolution_status.into(),
523            insecure_url: insecure_url.into(),
524            main_resource_url: main_resource_url.into(),
525            request: None,
526            frame: None,
527        }
528    }
529    /// The type of resource causing the mixed content issue (css, js, iframe,
530    /// form,...). Marked as optional because it is mapped to from
531    /// blink::mojom::RequestContextType, which will be replaced
532    /// by network::mojom::RequestDestination
533    pub fn resource_type(&self) -> Option<&MixedContentResourceType> { self.resource_type.as_ref() }
534    /// The way the mixed content issue is being resolved.
535    pub fn resolution_status(&self) -> &MixedContentResolutionStatus { &self.resolution_status }
536    /// The unsafe http url causing the mixed content issue.
537    pub fn insecure_url(&self) -> &str { self.insecure_url.as_ref() }
538    /// The url responsible for the call to an unsafe url.
539    pub fn main_resource_url(&self) -> &str { self.main_resource_url.as_ref() }
540    /// The mixed content request.
541    /// Does not always exist (e.g. for unsafe form submission urls).
542    pub fn request(&self) -> Option<&AffectedRequest<'a>> { self.request.as_ref() }
543    /// Optional because not every mixed content issue is necessarily linked to a frame.
544    pub fn frame(&self) -> Option<&AffectedFrame<'a>> { self.frame.as_ref() }
545}
546
547
548pub struct MixedContentIssueDetailsBuilder<'a> {
549    resource_type: Option<MixedContentResourceType>,
550    resolution_status: MixedContentResolutionStatus,
551    insecure_url: Cow<'a, str>,
552    main_resource_url: Cow<'a, str>,
553    request: Option<AffectedRequest<'a>>,
554    frame: Option<AffectedFrame<'a>>,
555}
556
557impl<'a> MixedContentIssueDetailsBuilder<'a> {
558    /// The type of resource causing the mixed content issue (css, js, iframe,
559    /// form,...). Marked as optional because it is mapped to from
560    /// blink::mojom::RequestContextType, which will be replaced
561    /// by network::mojom::RequestDestination
562    pub fn resource_type(mut self, resource_type: impl Into<MixedContentResourceType>) -> Self { self.resource_type = Some(resource_type.into()); self }
563    /// The mixed content request.
564    /// Does not always exist (e.g. for unsafe form submission urls).
565    pub fn request(mut self, request: AffectedRequest<'a>) -> Self { self.request = Some(request); self }
566    /// Optional because not every mixed content issue is necessarily linked to a frame.
567    pub fn frame(mut self, frame: AffectedFrame<'a>) -> Self { self.frame = Some(frame); self }
568    pub fn build(self) -> MixedContentIssueDetails<'a> {
569        MixedContentIssueDetails {
570            resource_type: self.resource_type,
571            resolution_status: self.resolution_status,
572            insecure_url: self.insecure_url,
573            main_resource_url: self.main_resource_url,
574            request: self.request,
575            frame: self.frame,
576        }
577    }
578}
579
580/// Enum indicating the reason a response has been blocked. These reasons are
581/// refinements of the net error BLOCKED_BY_RESPONSE.
582
583#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
584pub enum BlockedByResponseReason {
585    #[default]
586    #[serde(rename = "CoepFrameResourceNeedsCoepHeader")]
587    CoepFrameResourceNeedsCoepHeader,
588    #[serde(rename = "CoopSandboxedIFrameCannotNavigateToCoopPage")]
589    CoopSandboxedIFrameCannotNavigateToCoopPage,
590    #[serde(rename = "CorpNotSameOrigin")]
591    CorpNotSameOrigin,
592    #[serde(rename = "CorpNotSameOriginAfterDefaultedToSameOriginByCoep")]
593    CorpNotSameOriginAfterDefaultedToSameOriginByCoep,
594    #[serde(rename = "CorpNotSameOriginAfterDefaultedToSameOriginByDip")]
595    CorpNotSameOriginAfterDefaultedToSameOriginByDip,
596    #[serde(rename = "CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip")]
597    CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip,
598    #[serde(rename = "CorpNotSameSite")]
599    CorpNotSameSite,
600    #[serde(rename = "SRIMessageSignatureMismatch")]
601    SRIMessageSignatureMismatch,
602}
603
604/// Details for a request that has been blocked with the BLOCKED_BY_RESPONSE
605/// code. Currently only used for COEP/COOP, but may be extended to include
606/// some CSP errors in the future.
607
608#[derive(Debug, Clone, Serialize, Deserialize, Default)]
609#[serde(rename_all = "camelCase")]
610pub struct BlockedByResponseIssueDetails<'a> {
611    request: AffectedRequest<'a>,
612    #[serde(skip_serializing_if = "Option::is_none", rename = "parentFrame")]
613    parent_frame: Option<AffectedFrame<'a>>,
614    #[serde(skip_serializing_if = "Option::is_none", rename = "blockedFrame")]
615    blocked_frame: Option<AffectedFrame<'a>>,
616    reason: BlockedByResponseReason,
617}
618
619impl<'a> BlockedByResponseIssueDetails<'a> {
620    /// Creates a builder for this type with the required parameters:
621    /// * `request`: 
622    /// * `reason`: 
623    pub fn builder(request: AffectedRequest<'a>, reason: impl Into<BlockedByResponseReason>) -> BlockedByResponseIssueDetailsBuilder<'a> {
624        BlockedByResponseIssueDetailsBuilder {
625            request: request,
626            parent_frame: None,
627            blocked_frame: None,
628            reason: reason.into(),
629        }
630    }
631    pub fn request(&self) -> &AffectedRequest<'a> { &self.request }
632    pub fn parent_frame(&self) -> Option<&AffectedFrame<'a>> { self.parent_frame.as_ref() }
633    pub fn blocked_frame(&self) -> Option<&AffectedFrame<'a>> { self.blocked_frame.as_ref() }
634    pub fn reason(&self) -> &BlockedByResponseReason { &self.reason }
635}
636
637
638pub struct BlockedByResponseIssueDetailsBuilder<'a> {
639    request: AffectedRequest<'a>,
640    parent_frame: Option<AffectedFrame<'a>>,
641    blocked_frame: Option<AffectedFrame<'a>>,
642    reason: BlockedByResponseReason,
643}
644
645impl<'a> BlockedByResponseIssueDetailsBuilder<'a> {
646    pub fn parent_frame(mut self, parent_frame: AffectedFrame<'a>) -> Self { self.parent_frame = Some(parent_frame); self }
647    pub fn blocked_frame(mut self, blocked_frame: AffectedFrame<'a>) -> Self { self.blocked_frame = Some(blocked_frame); self }
648    pub fn build(self) -> BlockedByResponseIssueDetails<'a> {
649        BlockedByResponseIssueDetails {
650            request: self.request,
651            parent_frame: self.parent_frame,
652            blocked_frame: self.blocked_frame,
653            reason: self.reason,
654        }
655    }
656}
657
658
659#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
660pub enum HeavyAdResolutionStatus {
661    #[default]
662    #[serde(rename = "HeavyAdBlocked")]
663    HeavyAdBlocked,
664    #[serde(rename = "HeavyAdWarning")]
665    HeavyAdWarning,
666}
667
668
669#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
670pub enum HeavyAdReason {
671    #[default]
672    #[serde(rename = "NetworkTotalLimit")]
673    NetworkTotalLimit,
674    #[serde(rename = "CpuTotalLimit")]
675    CpuTotalLimit,
676    #[serde(rename = "CpuPeakLimit")]
677    CpuPeakLimit,
678}
679
680
681#[derive(Debug, Clone, Serialize, Deserialize, Default)]
682#[serde(rename_all = "camelCase")]
683pub struct HeavyAdIssueDetails<'a> {
684    /// The resolution status, either blocking the content or warning.
685    resolution: HeavyAdResolutionStatus,
686    /// The reason the ad was blocked, total network or cpu or peak cpu.
687    reason: HeavyAdReason,
688    /// The frame that was blocked.
689    frame: AffectedFrame<'a>,
690}
691
692impl<'a> HeavyAdIssueDetails<'a> {
693    /// Creates a builder for this type with the required parameters:
694    /// * `resolution`: The resolution status, either blocking the content or warning.
695    /// * `reason`: The reason the ad was blocked, total network or cpu or peak cpu.
696    /// * `frame`: The frame that was blocked.
697    pub fn builder(resolution: impl Into<HeavyAdResolutionStatus>, reason: impl Into<HeavyAdReason>, frame: AffectedFrame<'a>) -> HeavyAdIssueDetailsBuilder<'a> {
698        HeavyAdIssueDetailsBuilder {
699            resolution: resolution.into(),
700            reason: reason.into(),
701            frame: frame,
702        }
703    }
704    /// The resolution status, either blocking the content or warning.
705    pub fn resolution(&self) -> &HeavyAdResolutionStatus { &self.resolution }
706    /// The reason the ad was blocked, total network or cpu or peak cpu.
707    pub fn reason(&self) -> &HeavyAdReason { &self.reason }
708    /// The frame that was blocked.
709    pub fn frame(&self) -> &AffectedFrame<'a> { &self.frame }
710}
711
712
713pub struct HeavyAdIssueDetailsBuilder<'a> {
714    resolution: HeavyAdResolutionStatus,
715    reason: HeavyAdReason,
716    frame: AffectedFrame<'a>,
717}
718
719impl<'a> HeavyAdIssueDetailsBuilder<'a> {
720    pub fn build(self) -> HeavyAdIssueDetails<'a> {
721        HeavyAdIssueDetails {
722            resolution: self.resolution,
723            reason: self.reason,
724            frame: self.frame,
725        }
726    }
727}
728
729
730#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
731pub enum ContentSecurityPolicyViolationType {
732    #[default]
733    #[serde(rename = "kInlineViolation")]
734    KInlineViolation,
735    #[serde(rename = "kEvalViolation")]
736    KEvalViolation,
737    #[serde(rename = "kURLViolation")]
738    KURLViolation,
739    #[serde(rename = "kSRIViolation")]
740    KSRIViolation,
741    #[serde(rename = "kTrustedTypesSinkViolation")]
742    KTrustedTypesSinkViolation,
743    #[serde(rename = "kTrustedTypesPolicyViolation")]
744    KTrustedTypesPolicyViolation,
745    #[serde(rename = "kWasmEvalViolation")]
746    KWasmEvalViolation,
747}
748
749
750#[derive(Debug, Clone, Serialize, Deserialize, Default)]
751#[serde(rename_all = "camelCase")]
752pub struct SourceCodeLocation<'a> {
753    #[serde(skip_serializing_if = "Option::is_none", rename = "scriptId")]
754    script_id: Option<crate::runtime::ScriptId<'a>>,
755    url: Cow<'a, str>,
756    #[serde(rename = "lineNumber")]
757    line_number: i64,
758    #[serde(rename = "columnNumber")]
759    column_number: i64,
760}
761
762impl<'a> SourceCodeLocation<'a> {
763    /// Creates a builder for this type with the required parameters:
764    /// * `url`: 
765    /// * `line_number`: 
766    /// * `column_number`: 
767    pub fn builder(url: impl Into<Cow<'a, str>>, line_number: i64, column_number: i64) -> SourceCodeLocationBuilder<'a> {
768        SourceCodeLocationBuilder {
769            script_id: None,
770            url: url.into(),
771            line_number: line_number,
772            column_number: column_number,
773        }
774    }
775    pub fn script_id(&self) -> Option<&crate::runtime::ScriptId<'a>> { self.script_id.as_ref() }
776    pub fn url(&self) -> &str { self.url.as_ref() }
777    pub fn line_number(&self) -> i64 { self.line_number }
778    pub fn column_number(&self) -> i64 { self.column_number }
779}
780
781
782pub struct SourceCodeLocationBuilder<'a> {
783    script_id: Option<crate::runtime::ScriptId<'a>>,
784    url: Cow<'a, str>,
785    line_number: i64,
786    column_number: i64,
787}
788
789impl<'a> SourceCodeLocationBuilder<'a> {
790    pub fn script_id(mut self, script_id: crate::runtime::ScriptId<'a>) -> Self { self.script_id = Some(script_id); self }
791    pub fn build(self) -> SourceCodeLocation<'a> {
792        SourceCodeLocation {
793            script_id: self.script_id,
794            url: self.url,
795            line_number: self.line_number,
796            column_number: self.column_number,
797        }
798    }
799}
800
801
802#[derive(Debug, Clone, Serialize, Deserialize, Default)]
803#[serde(rename_all = "camelCase")]
804pub struct ContentSecurityPolicyIssueDetails<'a> {
805    /// The url not included in allowed sources.
806    #[serde(skip_serializing_if = "Option::is_none", rename = "blockedURL")]
807    blocked_url: Option<Cow<'a, str>>,
808    /// Specific directive that is violated, causing the CSP issue.
809    #[serde(rename = "violatedDirective")]
810    violated_directive: Cow<'a, str>,
811    #[serde(rename = "isReportOnly")]
812    is_report_only: bool,
813    #[serde(rename = "contentSecurityPolicyViolationType")]
814    content_security_policy_violation_type: ContentSecurityPolicyViolationType,
815    #[serde(skip_serializing_if = "Option::is_none", rename = "frameAncestor")]
816    frame_ancestor: Option<AffectedFrame<'a>>,
817    #[serde(skip_serializing_if = "Option::is_none", rename = "sourceCodeLocation")]
818    source_code_location: Option<SourceCodeLocation<'a>>,
819    #[serde(skip_serializing_if = "Option::is_none", rename = "violatingNodeId")]
820    violating_node_id: Option<crate::dom::BackendNodeId>,
821}
822
823impl<'a> ContentSecurityPolicyIssueDetails<'a> {
824    /// Creates a builder for this type with the required parameters:
825    /// * `violated_directive`: Specific directive that is violated, causing the CSP issue.
826    /// * `is_report_only`: 
827    /// * `content_security_policy_violation_type`: 
828    pub fn builder(violated_directive: impl Into<Cow<'a, str>>, is_report_only: bool, content_security_policy_violation_type: impl Into<ContentSecurityPolicyViolationType>) -> ContentSecurityPolicyIssueDetailsBuilder<'a> {
829        ContentSecurityPolicyIssueDetailsBuilder {
830            blocked_url: None,
831            violated_directive: violated_directive.into(),
832            is_report_only: is_report_only,
833            content_security_policy_violation_type: content_security_policy_violation_type.into(),
834            frame_ancestor: None,
835            source_code_location: None,
836            violating_node_id: None,
837        }
838    }
839    /// The url not included in allowed sources.
840    pub fn blocked_url(&self) -> Option<&str> { self.blocked_url.as_deref() }
841    /// Specific directive that is violated, causing the CSP issue.
842    pub fn violated_directive(&self) -> &str { self.violated_directive.as_ref() }
843    pub fn is_report_only(&self) -> bool { self.is_report_only }
844    pub fn content_security_policy_violation_type(&self) -> &ContentSecurityPolicyViolationType { &self.content_security_policy_violation_type }
845    pub fn frame_ancestor(&self) -> Option<&AffectedFrame<'a>> { self.frame_ancestor.as_ref() }
846    pub fn source_code_location(&self) -> Option<&SourceCodeLocation<'a>> { self.source_code_location.as_ref() }
847    pub fn violating_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.violating_node_id.as_ref() }
848}
849
850
851pub struct ContentSecurityPolicyIssueDetailsBuilder<'a> {
852    blocked_url: Option<Cow<'a, str>>,
853    violated_directive: Cow<'a, str>,
854    is_report_only: bool,
855    content_security_policy_violation_type: ContentSecurityPolicyViolationType,
856    frame_ancestor: Option<AffectedFrame<'a>>,
857    source_code_location: Option<SourceCodeLocation<'a>>,
858    violating_node_id: Option<crate::dom::BackendNodeId>,
859}
860
861impl<'a> ContentSecurityPolicyIssueDetailsBuilder<'a> {
862    /// The url not included in allowed sources.
863    pub fn blocked_url(mut self, blocked_url: impl Into<Cow<'a, str>>) -> Self { self.blocked_url = Some(blocked_url.into()); self }
864    pub fn frame_ancestor(mut self, frame_ancestor: AffectedFrame<'a>) -> Self { self.frame_ancestor = Some(frame_ancestor); self }
865    pub fn source_code_location(mut self, source_code_location: SourceCodeLocation<'a>) -> Self { self.source_code_location = Some(source_code_location); self }
866    pub fn violating_node_id(mut self, violating_node_id: crate::dom::BackendNodeId) -> Self { self.violating_node_id = Some(violating_node_id); self }
867    pub fn build(self) -> ContentSecurityPolicyIssueDetails<'a> {
868        ContentSecurityPolicyIssueDetails {
869            blocked_url: self.blocked_url,
870            violated_directive: self.violated_directive,
871            is_report_only: self.is_report_only,
872            content_security_policy_violation_type: self.content_security_policy_violation_type,
873            frame_ancestor: self.frame_ancestor,
874            source_code_location: self.source_code_location,
875            violating_node_id: self.violating_node_id,
876        }
877    }
878}
879
880
881#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
882pub enum SharedArrayBufferIssueType {
883    #[default]
884    #[serde(rename = "TransferIssue")]
885    TransferIssue,
886    #[serde(rename = "CreationIssue")]
887    CreationIssue,
888}
889
890/// Details for a issue arising from an SAB being instantiated in, or
891/// transferred to a context that is not cross-origin isolated.
892
893#[derive(Debug, Clone, Serialize, Deserialize, Default)]
894#[serde(rename_all = "camelCase")]
895pub struct SharedArrayBufferIssueDetails<'a> {
896    #[serde(rename = "sourceCodeLocation")]
897    source_code_location: SourceCodeLocation<'a>,
898    #[serde(rename = "isWarning")]
899    is_warning: bool,
900    #[serde(rename = "type")]
901    type_: SharedArrayBufferIssueType,
902}
903
904impl<'a> SharedArrayBufferIssueDetails<'a> {
905    /// Creates a builder for this type with the required parameters:
906    /// * `source_code_location`: 
907    /// * `is_warning`: 
908    /// * `type_`: 
909    pub fn builder(source_code_location: SourceCodeLocation<'a>, is_warning: bool, type_: impl Into<SharedArrayBufferIssueType>) -> SharedArrayBufferIssueDetailsBuilder<'a> {
910        SharedArrayBufferIssueDetailsBuilder {
911            source_code_location: source_code_location,
912            is_warning: is_warning,
913            type_: type_.into(),
914        }
915    }
916    pub fn source_code_location(&self) -> &SourceCodeLocation<'a> { &self.source_code_location }
917    pub fn is_warning(&self) -> bool { self.is_warning }
918    pub fn type_(&self) -> &SharedArrayBufferIssueType { &self.type_ }
919}
920
921
922pub struct SharedArrayBufferIssueDetailsBuilder<'a> {
923    source_code_location: SourceCodeLocation<'a>,
924    is_warning: bool,
925    type_: SharedArrayBufferIssueType,
926}
927
928impl<'a> SharedArrayBufferIssueDetailsBuilder<'a> {
929    pub fn build(self) -> SharedArrayBufferIssueDetails<'a> {
930        SharedArrayBufferIssueDetails {
931            source_code_location: self.source_code_location,
932            is_warning: self.is_warning,
933            type_: self.type_,
934        }
935    }
936}
937
938/// Details for a CORS related issue, e.g. a warning or error related to
939/// CORS RFC1918 enforcement.
940
941#[derive(Debug, Clone, Serialize, Deserialize, Default)]
942#[serde(rename_all = "camelCase")]
943pub struct CorsIssueDetails<'a> {
944    #[serde(rename = "corsErrorStatus")]
945    cors_error_status: crate::network::CorsErrorStatus<'a>,
946    #[serde(rename = "isWarning")]
947    is_warning: bool,
948    request: AffectedRequest<'a>,
949    #[serde(skip_serializing_if = "Option::is_none")]
950    location: Option<SourceCodeLocation<'a>>,
951    #[serde(skip_serializing_if = "Option::is_none", rename = "initiatorOrigin")]
952    initiator_origin: Option<Cow<'a, str>>,
953    #[serde(skip_serializing_if = "Option::is_none", rename = "resourceIPAddressSpace")]
954    resource_ip_address_space: Option<crate::network::IPAddressSpace>,
955    #[serde(skip_serializing_if = "Option::is_none", rename = "clientSecurityState")]
956    client_security_state: Option<crate::network::ClientSecurityState>,
957}
958
959impl<'a> CorsIssueDetails<'a> {
960    /// Creates a builder for this type with the required parameters:
961    /// * `cors_error_status`: 
962    /// * `is_warning`: 
963    /// * `request`: 
964    pub fn builder(cors_error_status: crate::network::CorsErrorStatus<'a>, is_warning: bool, request: AffectedRequest<'a>) -> CorsIssueDetailsBuilder<'a> {
965        CorsIssueDetailsBuilder {
966            cors_error_status: cors_error_status,
967            is_warning: is_warning,
968            request: request,
969            location: None,
970            initiator_origin: None,
971            resource_ip_address_space: None,
972            client_security_state: None,
973        }
974    }
975    pub fn cors_error_status(&self) -> &crate::network::CorsErrorStatus<'a> { &self.cors_error_status }
976    pub fn is_warning(&self) -> bool { self.is_warning }
977    pub fn request(&self) -> &AffectedRequest<'a> { &self.request }
978    pub fn location(&self) -> Option<&SourceCodeLocation<'a>> { self.location.as_ref() }
979    pub fn initiator_origin(&self) -> Option<&str> { self.initiator_origin.as_deref() }
980    pub fn resource_ip_address_space(&self) -> Option<&crate::network::IPAddressSpace> { self.resource_ip_address_space.as_ref() }
981    pub fn client_security_state(&self) -> Option<&crate::network::ClientSecurityState> { self.client_security_state.as_ref() }
982}
983
984
985pub struct CorsIssueDetailsBuilder<'a> {
986    cors_error_status: crate::network::CorsErrorStatus<'a>,
987    is_warning: bool,
988    request: AffectedRequest<'a>,
989    location: Option<SourceCodeLocation<'a>>,
990    initiator_origin: Option<Cow<'a, str>>,
991    resource_ip_address_space: Option<crate::network::IPAddressSpace>,
992    client_security_state: Option<crate::network::ClientSecurityState>,
993}
994
995impl<'a> CorsIssueDetailsBuilder<'a> {
996    pub fn location(mut self, location: SourceCodeLocation<'a>) -> Self { self.location = Some(location); self }
997    pub fn initiator_origin(mut self, initiator_origin: impl Into<Cow<'a, str>>) -> Self { self.initiator_origin = Some(initiator_origin.into()); self }
998    pub fn resource_ip_address_space(mut self, resource_ip_address_space: crate::network::IPAddressSpace) -> Self { self.resource_ip_address_space = Some(resource_ip_address_space); self }
999    pub fn client_security_state(mut self, client_security_state: crate::network::ClientSecurityState) -> Self { self.client_security_state = Some(client_security_state); self }
1000    pub fn build(self) -> CorsIssueDetails<'a> {
1001        CorsIssueDetails {
1002            cors_error_status: self.cors_error_status,
1003            is_warning: self.is_warning,
1004            request: self.request,
1005            location: self.location,
1006            initiator_origin: self.initiator_origin,
1007            resource_ip_address_space: self.resource_ip_address_space,
1008            client_security_state: self.client_security_state,
1009        }
1010    }
1011}
1012
1013
1014#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1015pub enum AttributionReportingIssueType {
1016    #[default]
1017    #[serde(rename = "PermissionPolicyDisabled")]
1018    PermissionPolicyDisabled,
1019    #[serde(rename = "UntrustworthyReportingOrigin")]
1020    UntrustworthyReportingOrigin,
1021    #[serde(rename = "InsecureContext")]
1022    InsecureContext,
1023    #[serde(rename = "InvalidHeader")]
1024    InvalidHeader,
1025    #[serde(rename = "InvalidRegisterTriggerHeader")]
1026    InvalidRegisterTriggerHeader,
1027    #[serde(rename = "SourceAndTriggerHeaders")]
1028    SourceAndTriggerHeaders,
1029    #[serde(rename = "SourceIgnored")]
1030    SourceIgnored,
1031    #[serde(rename = "TriggerIgnored")]
1032    TriggerIgnored,
1033    #[serde(rename = "OsSourceIgnored")]
1034    OsSourceIgnored,
1035    #[serde(rename = "OsTriggerIgnored")]
1036    OsTriggerIgnored,
1037    #[serde(rename = "InvalidRegisterOsSourceHeader")]
1038    InvalidRegisterOsSourceHeader,
1039    #[serde(rename = "InvalidRegisterOsTriggerHeader")]
1040    InvalidRegisterOsTriggerHeader,
1041    #[serde(rename = "WebAndOsHeaders")]
1042    WebAndOsHeaders,
1043    #[serde(rename = "NoWebOrOsSupport")]
1044    NoWebOrOsSupport,
1045    #[serde(rename = "NavigationRegistrationWithoutTransientUserActivation")]
1046    NavigationRegistrationWithoutTransientUserActivation,
1047    #[serde(rename = "InvalidInfoHeader")]
1048    InvalidInfoHeader,
1049    #[serde(rename = "NoRegisterSourceHeader")]
1050    NoRegisterSourceHeader,
1051    #[serde(rename = "NoRegisterTriggerHeader")]
1052    NoRegisterTriggerHeader,
1053    #[serde(rename = "NoRegisterOsSourceHeader")]
1054    NoRegisterOsSourceHeader,
1055    #[serde(rename = "NoRegisterOsTriggerHeader")]
1056    NoRegisterOsTriggerHeader,
1057    #[serde(rename = "NavigationRegistrationUniqueScopeAlreadySet")]
1058    NavigationRegistrationUniqueScopeAlreadySet,
1059}
1060
1061
1062#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1063pub enum SharedDictionaryError {
1064    #[default]
1065    #[serde(rename = "UseErrorCrossOriginNoCorsRequest")]
1066    UseErrorCrossOriginNoCorsRequest,
1067    #[serde(rename = "UseErrorDictionaryLoadFailure")]
1068    UseErrorDictionaryLoadFailure,
1069    #[serde(rename = "UseErrorMatchingDictionaryNotUsed")]
1070    UseErrorMatchingDictionaryNotUsed,
1071    #[serde(rename = "UseErrorUnexpectedContentDictionaryHeader")]
1072    UseErrorUnexpectedContentDictionaryHeader,
1073    #[serde(rename = "WriteErrorCossOriginNoCorsRequest")]
1074    WriteErrorCossOriginNoCorsRequest,
1075    #[serde(rename = "WriteErrorDisallowedBySettings")]
1076    WriteErrorDisallowedBySettings,
1077    #[serde(rename = "WriteErrorExpiredResponse")]
1078    WriteErrorExpiredResponse,
1079    #[serde(rename = "WriteErrorFeatureDisabled")]
1080    WriteErrorFeatureDisabled,
1081    #[serde(rename = "WriteErrorInsufficientResources")]
1082    WriteErrorInsufficientResources,
1083    #[serde(rename = "WriteErrorInvalidMatchField")]
1084    WriteErrorInvalidMatchField,
1085    #[serde(rename = "WriteErrorInvalidStructuredHeader")]
1086    WriteErrorInvalidStructuredHeader,
1087    #[serde(rename = "WriteErrorInvalidTTLField")]
1088    WriteErrorInvalidTTLField,
1089    #[serde(rename = "WriteErrorNavigationRequest")]
1090    WriteErrorNavigationRequest,
1091    #[serde(rename = "WriteErrorNoMatchField")]
1092    WriteErrorNoMatchField,
1093    #[serde(rename = "WriteErrorNonIntegerTTLField")]
1094    WriteErrorNonIntegerTTLField,
1095    #[serde(rename = "WriteErrorNonListMatchDestField")]
1096    WriteErrorNonListMatchDestField,
1097    #[serde(rename = "WriteErrorNonSecureContext")]
1098    WriteErrorNonSecureContext,
1099    #[serde(rename = "WriteErrorNonStringIdField")]
1100    WriteErrorNonStringIdField,
1101    #[serde(rename = "WriteErrorNonStringInMatchDestList")]
1102    WriteErrorNonStringInMatchDestList,
1103    #[serde(rename = "WriteErrorNonStringMatchField")]
1104    WriteErrorNonStringMatchField,
1105    #[serde(rename = "WriteErrorNonTokenTypeField")]
1106    WriteErrorNonTokenTypeField,
1107    #[serde(rename = "WriteErrorRequestAborted")]
1108    WriteErrorRequestAborted,
1109    #[serde(rename = "WriteErrorShuttingDown")]
1110    WriteErrorShuttingDown,
1111    #[serde(rename = "WriteErrorTooLongIdField")]
1112    WriteErrorTooLongIdField,
1113    #[serde(rename = "WriteErrorUnsupportedType")]
1114    WriteErrorUnsupportedType,
1115}
1116
1117
1118#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1119pub enum SRIMessageSignatureError {
1120    #[default]
1121    #[serde(rename = "MissingSignatureHeader")]
1122    MissingSignatureHeader,
1123    #[serde(rename = "MissingSignatureInputHeader")]
1124    MissingSignatureInputHeader,
1125    #[serde(rename = "InvalidSignatureHeader")]
1126    InvalidSignatureHeader,
1127    #[serde(rename = "InvalidSignatureInputHeader")]
1128    InvalidSignatureInputHeader,
1129    #[serde(rename = "SignatureHeaderValueIsNotByteSequence")]
1130    SignatureHeaderValueIsNotByteSequence,
1131    #[serde(rename = "SignatureHeaderValueIsParameterized")]
1132    SignatureHeaderValueIsParameterized,
1133    #[serde(rename = "SignatureHeaderValueIsIncorrectLength")]
1134    SignatureHeaderValueIsIncorrectLength,
1135    #[serde(rename = "SignatureInputHeaderMissingLabel")]
1136    SignatureInputHeaderMissingLabel,
1137    #[serde(rename = "SignatureInputHeaderValueNotInnerList")]
1138    SignatureInputHeaderValueNotInnerList,
1139    #[serde(rename = "SignatureInputHeaderValueMissingComponents")]
1140    SignatureInputHeaderValueMissingComponents,
1141    #[serde(rename = "SignatureInputHeaderInvalidComponentType")]
1142    SignatureInputHeaderInvalidComponentType,
1143    #[serde(rename = "SignatureInputHeaderInvalidComponentName")]
1144    SignatureInputHeaderInvalidComponentName,
1145    #[serde(rename = "SignatureInputHeaderInvalidHeaderComponentParameter")]
1146    SignatureInputHeaderInvalidHeaderComponentParameter,
1147    #[serde(rename = "SignatureInputHeaderInvalidDerivedComponentParameter")]
1148    SignatureInputHeaderInvalidDerivedComponentParameter,
1149    #[serde(rename = "SignatureInputHeaderKeyIdLength")]
1150    SignatureInputHeaderKeyIdLength,
1151    #[serde(rename = "SignatureInputHeaderInvalidParameter")]
1152    SignatureInputHeaderInvalidParameter,
1153    #[serde(rename = "SignatureInputHeaderMissingRequiredParameters")]
1154    SignatureInputHeaderMissingRequiredParameters,
1155    #[serde(rename = "ValidationFailedSignatureExpired")]
1156    ValidationFailedSignatureExpired,
1157    #[serde(rename = "ValidationFailedInvalidLength")]
1158    ValidationFailedInvalidLength,
1159    #[serde(rename = "ValidationFailedSignatureMismatch")]
1160    ValidationFailedSignatureMismatch,
1161    #[serde(rename = "ValidationFailedIntegrityMismatch")]
1162    ValidationFailedIntegrityMismatch,
1163    #[serde(rename = "SignatureBaseUnknownDerivedComponent")]
1164    SignatureBaseUnknownDerivedComponent,
1165    #[serde(rename = "SignatureBaseMissingHeader")]
1166    SignatureBaseMissingHeader,
1167    #[serde(rename = "SignatureBaseInvalidUnencodedDigest")]
1168    SignatureBaseInvalidUnencodedDigest,
1169    #[serde(rename = "SignatureBaseUnsupportedComponent")]
1170    SignatureBaseUnsupportedComponent,
1171}
1172
1173
1174#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1175pub enum UnencodedDigestError {
1176    #[default]
1177    #[serde(rename = "MalformedDictionary")]
1178    MalformedDictionary,
1179    #[serde(rename = "UnknownAlgorithm")]
1180    UnknownAlgorithm,
1181    #[serde(rename = "IncorrectDigestType")]
1182    IncorrectDigestType,
1183    #[serde(rename = "IncorrectDigestLength")]
1184    IncorrectDigestLength,
1185}
1186
1187
1188#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1189pub enum ConnectionAllowlistError {
1190    #[default]
1191    #[serde(rename = "InvalidHeader")]
1192    InvalidHeader,
1193    #[serde(rename = "MoreThanOneList")]
1194    MoreThanOneList,
1195    #[serde(rename = "ItemNotInnerList")]
1196    ItemNotInnerList,
1197    #[serde(rename = "InvalidAllowlistItemType")]
1198    InvalidAllowlistItemType,
1199    #[serde(rename = "ReportingEndpointNotToken")]
1200    ReportingEndpointNotToken,
1201    #[serde(rename = "InvalidUrlPattern")]
1202    InvalidUrlPattern,
1203}
1204
1205/// Details for issues around "Attribution Reporting API" usage.
1206/// Explainer: <https://github.com/WICG/attribution-reporting-api>
1207
1208#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1209#[serde(rename_all = "camelCase")]
1210pub struct AttributionReportingIssueDetails<'a> {
1211    #[serde(rename = "violationType")]
1212    violation_type: AttributionReportingIssueType,
1213    #[serde(skip_serializing_if = "Option::is_none")]
1214    request: Option<AffectedRequest<'a>>,
1215    #[serde(skip_serializing_if = "Option::is_none", rename = "violatingNodeId")]
1216    violating_node_id: Option<crate::dom::BackendNodeId>,
1217    #[serde(skip_serializing_if = "Option::is_none", rename = "invalidParameter")]
1218    invalid_parameter: Option<Cow<'a, str>>,
1219}
1220
1221impl<'a> AttributionReportingIssueDetails<'a> {
1222    /// Creates a builder for this type with the required parameters:
1223    /// * `violation_type`: 
1224    pub fn builder(violation_type: impl Into<AttributionReportingIssueType>) -> AttributionReportingIssueDetailsBuilder<'a> {
1225        AttributionReportingIssueDetailsBuilder {
1226            violation_type: violation_type.into(),
1227            request: None,
1228            violating_node_id: None,
1229            invalid_parameter: None,
1230        }
1231    }
1232    pub fn violation_type(&self) -> &AttributionReportingIssueType { &self.violation_type }
1233    pub fn request(&self) -> Option<&AffectedRequest<'a>> { self.request.as_ref() }
1234    pub fn violating_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.violating_node_id.as_ref() }
1235    pub fn invalid_parameter(&self) -> Option<&str> { self.invalid_parameter.as_deref() }
1236}
1237
1238
1239pub struct AttributionReportingIssueDetailsBuilder<'a> {
1240    violation_type: AttributionReportingIssueType,
1241    request: Option<AffectedRequest<'a>>,
1242    violating_node_id: Option<crate::dom::BackendNodeId>,
1243    invalid_parameter: Option<Cow<'a, str>>,
1244}
1245
1246impl<'a> AttributionReportingIssueDetailsBuilder<'a> {
1247    pub fn request(mut self, request: AffectedRequest<'a>) -> Self { self.request = Some(request); self }
1248    pub fn violating_node_id(mut self, violating_node_id: crate::dom::BackendNodeId) -> Self { self.violating_node_id = Some(violating_node_id); self }
1249    pub fn invalid_parameter(mut self, invalid_parameter: impl Into<Cow<'a, str>>) -> Self { self.invalid_parameter = Some(invalid_parameter.into()); self }
1250    pub fn build(self) -> AttributionReportingIssueDetails<'a> {
1251        AttributionReportingIssueDetails {
1252            violation_type: self.violation_type,
1253            request: self.request,
1254            violating_node_id: self.violating_node_id,
1255            invalid_parameter: self.invalid_parameter,
1256        }
1257    }
1258}
1259
1260/// Details for issues about documents in Quirks Mode
1261/// or Limited Quirks Mode that affects page layouting.
1262
1263#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1264#[serde(rename_all = "camelCase")]
1265pub struct QuirksModeIssueDetails<'a> {
1266    /// If false, it means the document's mode is "quirks"
1267    /// instead of "limited-quirks".
1268    #[serde(rename = "isLimitedQuirksMode")]
1269    is_limited_quirks_mode: bool,
1270    #[serde(rename = "documentNodeId")]
1271    document_node_id: crate::dom::BackendNodeId,
1272    url: Cow<'a, str>,
1273    #[serde(rename = "frameId")]
1274    frame_id: crate::page::FrameId<'a>,
1275    #[serde(rename = "loaderId")]
1276    loader_id: crate::network::LoaderId<'a>,
1277}
1278
1279impl<'a> QuirksModeIssueDetails<'a> {
1280    /// Creates a builder for this type with the required parameters:
1281    /// * `is_limited_quirks_mode`: If false, it means the document's mode is "quirks" instead of "limited-quirks".
1282    /// * `document_node_id`: 
1283    /// * `url`: 
1284    /// * `frame_id`: 
1285    /// * `loader_id`: 
1286    pub fn builder(is_limited_quirks_mode: bool, document_node_id: crate::dom::BackendNodeId, url: impl Into<Cow<'a, str>>, frame_id: crate::page::FrameId<'a>, loader_id: crate::network::LoaderId<'a>) -> QuirksModeIssueDetailsBuilder<'a> {
1287        QuirksModeIssueDetailsBuilder {
1288            is_limited_quirks_mode: is_limited_quirks_mode,
1289            document_node_id: document_node_id,
1290            url: url.into(),
1291            frame_id: frame_id,
1292            loader_id: loader_id,
1293        }
1294    }
1295    /// If false, it means the document's mode is "quirks"
1296    /// instead of "limited-quirks".
1297    pub fn is_limited_quirks_mode(&self) -> bool { self.is_limited_quirks_mode }
1298    pub fn document_node_id(&self) -> &crate::dom::BackendNodeId { &self.document_node_id }
1299    pub fn url(&self) -> &str { self.url.as_ref() }
1300    pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
1301    pub fn loader_id(&self) -> &crate::network::LoaderId<'a> { &self.loader_id }
1302}
1303
1304
1305pub struct QuirksModeIssueDetailsBuilder<'a> {
1306    is_limited_quirks_mode: bool,
1307    document_node_id: crate::dom::BackendNodeId,
1308    url: Cow<'a, str>,
1309    frame_id: crate::page::FrameId<'a>,
1310    loader_id: crate::network::LoaderId<'a>,
1311}
1312
1313impl<'a> QuirksModeIssueDetailsBuilder<'a> {
1314    pub fn build(self) -> QuirksModeIssueDetails<'a> {
1315        QuirksModeIssueDetails {
1316            is_limited_quirks_mode: self.is_limited_quirks_mode,
1317            document_node_id: self.document_node_id,
1318            url: self.url,
1319            frame_id: self.frame_id,
1320            loader_id: self.loader_id,
1321        }
1322    }
1323}
1324
1325
1326#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1327#[serde(rename_all = "camelCase")]
1328pub struct NavigatorUserAgentIssueDetails<'a> {
1329    url: Cow<'a, str>,
1330    #[serde(skip_serializing_if = "Option::is_none")]
1331    location: Option<SourceCodeLocation<'a>>,
1332}
1333
1334impl<'a> NavigatorUserAgentIssueDetails<'a> {
1335    /// Creates a builder for this type with the required parameters:
1336    /// * `url`: 
1337    pub fn builder(url: impl Into<Cow<'a, str>>) -> NavigatorUserAgentIssueDetailsBuilder<'a> {
1338        NavigatorUserAgentIssueDetailsBuilder {
1339            url: url.into(),
1340            location: None,
1341        }
1342    }
1343    pub fn url(&self) -> &str { self.url.as_ref() }
1344    pub fn location(&self) -> Option<&SourceCodeLocation<'a>> { self.location.as_ref() }
1345}
1346
1347
1348pub struct NavigatorUserAgentIssueDetailsBuilder<'a> {
1349    url: Cow<'a, str>,
1350    location: Option<SourceCodeLocation<'a>>,
1351}
1352
1353impl<'a> NavigatorUserAgentIssueDetailsBuilder<'a> {
1354    pub fn location(mut self, location: SourceCodeLocation<'a>) -> Self { self.location = Some(location); self }
1355    pub fn build(self) -> NavigatorUserAgentIssueDetails<'a> {
1356        NavigatorUserAgentIssueDetails {
1357            url: self.url,
1358            location: self.location,
1359        }
1360    }
1361}
1362
1363
1364#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1365#[serde(rename_all = "camelCase")]
1366pub struct SharedDictionaryIssueDetails<'a> {
1367    #[serde(rename = "sharedDictionaryError")]
1368    shared_dictionary_error: SharedDictionaryError,
1369    request: AffectedRequest<'a>,
1370}
1371
1372impl<'a> SharedDictionaryIssueDetails<'a> {
1373    /// Creates a builder for this type with the required parameters:
1374    /// * `shared_dictionary_error`: 
1375    /// * `request`: 
1376    pub fn builder(shared_dictionary_error: impl Into<SharedDictionaryError>, request: AffectedRequest<'a>) -> SharedDictionaryIssueDetailsBuilder<'a> {
1377        SharedDictionaryIssueDetailsBuilder {
1378            shared_dictionary_error: shared_dictionary_error.into(),
1379            request: request,
1380        }
1381    }
1382    pub fn shared_dictionary_error(&self) -> &SharedDictionaryError { &self.shared_dictionary_error }
1383    pub fn request(&self) -> &AffectedRequest<'a> { &self.request }
1384}
1385
1386
1387pub struct SharedDictionaryIssueDetailsBuilder<'a> {
1388    shared_dictionary_error: SharedDictionaryError,
1389    request: AffectedRequest<'a>,
1390}
1391
1392impl<'a> SharedDictionaryIssueDetailsBuilder<'a> {
1393    pub fn build(self) -> SharedDictionaryIssueDetails<'a> {
1394        SharedDictionaryIssueDetails {
1395            shared_dictionary_error: self.shared_dictionary_error,
1396            request: self.request,
1397        }
1398    }
1399}
1400
1401
1402#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1403#[serde(rename_all = "camelCase")]
1404pub struct SRIMessageSignatureIssueDetails<'a> {
1405    error: SRIMessageSignatureError,
1406    #[serde(rename = "signatureBase")]
1407    signature_base: Cow<'a, str>,
1408    #[serde(rename = "integrityAssertions")]
1409    integrity_assertions: Vec<Cow<'a, str>>,
1410    request: AffectedRequest<'a>,
1411}
1412
1413impl<'a> SRIMessageSignatureIssueDetails<'a> {
1414    /// Creates a builder for this type with the required parameters:
1415    /// * `error`: 
1416    /// * `signature_base`: 
1417    /// * `integrity_assertions`: 
1418    /// * `request`: 
1419    pub fn builder(error: impl Into<SRIMessageSignatureError>, signature_base: impl Into<Cow<'a, str>>, integrity_assertions: Vec<Cow<'a, str>>, request: AffectedRequest<'a>) -> SRIMessageSignatureIssueDetailsBuilder<'a> {
1420        SRIMessageSignatureIssueDetailsBuilder {
1421            error: error.into(),
1422            signature_base: signature_base.into(),
1423            integrity_assertions: integrity_assertions,
1424            request: request,
1425        }
1426    }
1427    pub fn error(&self) -> &SRIMessageSignatureError { &self.error }
1428    pub fn signature_base(&self) -> &str { self.signature_base.as_ref() }
1429    pub fn integrity_assertions(&self) -> &[Cow<'a, str>] { &self.integrity_assertions }
1430    pub fn request(&self) -> &AffectedRequest<'a> { &self.request }
1431}
1432
1433
1434pub struct SRIMessageSignatureIssueDetailsBuilder<'a> {
1435    error: SRIMessageSignatureError,
1436    signature_base: Cow<'a, str>,
1437    integrity_assertions: Vec<Cow<'a, str>>,
1438    request: AffectedRequest<'a>,
1439}
1440
1441impl<'a> SRIMessageSignatureIssueDetailsBuilder<'a> {
1442    pub fn build(self) -> SRIMessageSignatureIssueDetails<'a> {
1443        SRIMessageSignatureIssueDetails {
1444            error: self.error,
1445            signature_base: self.signature_base,
1446            integrity_assertions: self.integrity_assertions,
1447            request: self.request,
1448        }
1449    }
1450}
1451
1452
1453#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1454#[serde(rename_all = "camelCase")]
1455pub struct UnencodedDigestIssueDetails<'a> {
1456    error: UnencodedDigestError,
1457    request: AffectedRequest<'a>,
1458}
1459
1460impl<'a> UnencodedDigestIssueDetails<'a> {
1461    /// Creates a builder for this type with the required parameters:
1462    /// * `error`: 
1463    /// * `request`: 
1464    pub fn builder(error: impl Into<UnencodedDigestError>, request: AffectedRequest<'a>) -> UnencodedDigestIssueDetailsBuilder<'a> {
1465        UnencodedDigestIssueDetailsBuilder {
1466            error: error.into(),
1467            request: request,
1468        }
1469    }
1470    pub fn error(&self) -> &UnencodedDigestError { &self.error }
1471    pub fn request(&self) -> &AffectedRequest<'a> { &self.request }
1472}
1473
1474
1475pub struct UnencodedDigestIssueDetailsBuilder<'a> {
1476    error: UnencodedDigestError,
1477    request: AffectedRequest<'a>,
1478}
1479
1480impl<'a> UnencodedDigestIssueDetailsBuilder<'a> {
1481    pub fn build(self) -> UnencodedDigestIssueDetails<'a> {
1482        UnencodedDigestIssueDetails {
1483            error: self.error,
1484            request: self.request,
1485        }
1486    }
1487}
1488
1489
1490#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1491#[serde(rename_all = "camelCase")]
1492pub struct ConnectionAllowlistIssueDetails<'a> {
1493    error: ConnectionAllowlistError,
1494    request: AffectedRequest<'a>,
1495}
1496
1497impl<'a> ConnectionAllowlistIssueDetails<'a> {
1498    /// Creates a builder for this type with the required parameters:
1499    /// * `error`: 
1500    /// * `request`: 
1501    pub fn builder(error: impl Into<ConnectionAllowlistError>, request: AffectedRequest<'a>) -> ConnectionAllowlistIssueDetailsBuilder<'a> {
1502        ConnectionAllowlistIssueDetailsBuilder {
1503            error: error.into(),
1504            request: request,
1505        }
1506    }
1507    pub fn error(&self) -> &ConnectionAllowlistError { &self.error }
1508    pub fn request(&self) -> &AffectedRequest<'a> { &self.request }
1509}
1510
1511
1512pub struct ConnectionAllowlistIssueDetailsBuilder<'a> {
1513    error: ConnectionAllowlistError,
1514    request: AffectedRequest<'a>,
1515}
1516
1517impl<'a> ConnectionAllowlistIssueDetailsBuilder<'a> {
1518    pub fn build(self) -> ConnectionAllowlistIssueDetails<'a> {
1519        ConnectionAllowlistIssueDetails {
1520            error: self.error,
1521            request: self.request,
1522        }
1523    }
1524}
1525
1526
1527#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1528pub enum GenericIssueErrorType {
1529    #[default]
1530    #[serde(rename = "FormLabelForNameError")]
1531    FormLabelForNameError,
1532    #[serde(rename = "FormDuplicateIdForInputError")]
1533    FormDuplicateIdForInputError,
1534    #[serde(rename = "FormInputWithNoLabelError")]
1535    FormInputWithNoLabelError,
1536    #[serde(rename = "FormAutocompleteAttributeEmptyError")]
1537    FormAutocompleteAttributeEmptyError,
1538    #[serde(rename = "FormEmptyIdAndNameAttributesForInputError")]
1539    FormEmptyIdAndNameAttributesForInputError,
1540    #[serde(rename = "FormAriaLabelledByToNonExistingIdError")]
1541    FormAriaLabelledByToNonExistingIdError,
1542    #[serde(rename = "FormInputAssignedAutocompleteValueToIdOrNameAttributeError")]
1543    FormInputAssignedAutocompleteValueToIdOrNameAttributeError,
1544    #[serde(rename = "FormLabelHasNeitherForNorNestedInputError")]
1545    FormLabelHasNeitherForNorNestedInputError,
1546    #[serde(rename = "FormLabelForMatchesNonExistingIdError")]
1547    FormLabelForMatchesNonExistingIdError,
1548    #[serde(rename = "FormInputHasWrongButWellIntendedAutocompleteValueError")]
1549    FormInputHasWrongButWellIntendedAutocompleteValueError,
1550    #[serde(rename = "ResponseWasBlockedByORB")]
1551    ResponseWasBlockedByORB,
1552    #[serde(rename = "NavigationEntryMarkedSkippable")]
1553    NavigationEntryMarkedSkippable,
1554    #[serde(rename = "BackUINavigationWouldSkipAd")]
1555    BackUINavigationWouldSkipAd,
1556    #[serde(rename = "AutofillAndManualTextPolicyControlledFeaturesInfo")]
1557    AutofillAndManualTextPolicyControlledFeaturesInfo,
1558    #[serde(rename = "AutofillPolicyControlledFeatureInfo")]
1559    AutofillPolicyControlledFeatureInfo,
1560    #[serde(rename = "ManualTextPolicyControlledFeatureInfo")]
1561    ManualTextPolicyControlledFeatureInfo,
1562    #[serde(rename = "FormModelContextParameterMissingTitleAndDescription")]
1563    FormModelContextParameterMissingTitleAndDescription,
1564    #[serde(rename = "FormModelContextMissingToolName")]
1565    FormModelContextMissingToolName,
1566    #[serde(rename = "FormModelContextMissingToolDescription")]
1567    FormModelContextMissingToolDescription,
1568    #[serde(rename = "FormModelContextRequiredParameterMissingName")]
1569    FormModelContextRequiredParameterMissingName,
1570    #[serde(rename = "FormModelContextParameterMissingName")]
1571    FormModelContextParameterMissingName,
1572}
1573
1574/// Depending on the concrete errorType, different properties are set.
1575
1576#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1577#[serde(rename_all = "camelCase")]
1578pub struct GenericIssueDetails<'a> {
1579    /// Issues with the same errorType are aggregated in the frontend.
1580    #[serde(rename = "errorType")]
1581    error_type: GenericIssueErrorType,
1582    #[serde(skip_serializing_if = "Option::is_none", rename = "frameId")]
1583    frame_id: Option<crate::page::FrameId<'a>>,
1584    #[serde(skip_serializing_if = "Option::is_none", rename = "violatingNodeId")]
1585    violating_node_id: Option<crate::dom::BackendNodeId>,
1586    #[serde(skip_serializing_if = "Option::is_none", rename = "violatingNodeAttribute")]
1587    violating_node_attribute: Option<Cow<'a, str>>,
1588    #[serde(skip_serializing_if = "Option::is_none")]
1589    request: Option<AffectedRequest<'a>>,
1590}
1591
1592impl<'a> GenericIssueDetails<'a> {
1593    /// Creates a builder for this type with the required parameters:
1594    /// * `error_type`: Issues with the same errorType are aggregated in the frontend.
1595    pub fn builder(error_type: impl Into<GenericIssueErrorType>) -> GenericIssueDetailsBuilder<'a> {
1596        GenericIssueDetailsBuilder {
1597            error_type: error_type.into(),
1598            frame_id: None,
1599            violating_node_id: None,
1600            violating_node_attribute: None,
1601            request: None,
1602        }
1603    }
1604    /// Issues with the same errorType are aggregated in the frontend.
1605    pub fn error_type(&self) -> &GenericIssueErrorType { &self.error_type }
1606    pub fn frame_id(&self) -> Option<&crate::page::FrameId<'a>> { self.frame_id.as_ref() }
1607    pub fn violating_node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.violating_node_id.as_ref() }
1608    pub fn violating_node_attribute(&self) -> Option<&str> { self.violating_node_attribute.as_deref() }
1609    pub fn request(&self) -> Option<&AffectedRequest<'a>> { self.request.as_ref() }
1610}
1611
1612
1613pub struct GenericIssueDetailsBuilder<'a> {
1614    error_type: GenericIssueErrorType,
1615    frame_id: Option<crate::page::FrameId<'a>>,
1616    violating_node_id: Option<crate::dom::BackendNodeId>,
1617    violating_node_attribute: Option<Cow<'a, str>>,
1618    request: Option<AffectedRequest<'a>>,
1619}
1620
1621impl<'a> GenericIssueDetailsBuilder<'a> {
1622    pub fn frame_id(mut self, frame_id: crate::page::FrameId<'a>) -> Self { self.frame_id = Some(frame_id); self }
1623    pub fn violating_node_id(mut self, violating_node_id: crate::dom::BackendNodeId) -> Self { self.violating_node_id = Some(violating_node_id); self }
1624    pub fn violating_node_attribute(mut self, violating_node_attribute: impl Into<Cow<'a, str>>) -> Self { self.violating_node_attribute = Some(violating_node_attribute.into()); self }
1625    pub fn request(mut self, request: AffectedRequest<'a>) -> Self { self.request = Some(request); self }
1626    pub fn build(self) -> GenericIssueDetails<'a> {
1627        GenericIssueDetails {
1628            error_type: self.error_type,
1629            frame_id: self.frame_id,
1630            violating_node_id: self.violating_node_id,
1631            violating_node_attribute: self.violating_node_attribute,
1632            request: self.request,
1633        }
1634    }
1635}
1636
1637/// This issue tracks information needed to print a deprecation message.
1638/// <https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md>
1639
1640#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1641#[serde(rename_all = "camelCase")]
1642pub struct DeprecationIssueDetails<'a> {
1643    #[serde(skip_serializing_if = "Option::is_none", rename = "affectedFrame")]
1644    affected_frame: Option<AffectedFrame<'a>>,
1645    #[serde(rename = "sourceCodeLocation")]
1646    source_code_location: SourceCodeLocation<'a>,
1647    /// One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5
1648    #[serde(rename = "type")]
1649    type_: Cow<'a, str>,
1650}
1651
1652impl<'a> DeprecationIssueDetails<'a> {
1653    /// Creates a builder for this type with the required parameters:
1654    /// * `source_code_location`: 
1655    /// * `type_`: One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5
1656    pub fn builder(source_code_location: SourceCodeLocation<'a>, type_: impl Into<Cow<'a, str>>) -> DeprecationIssueDetailsBuilder<'a> {
1657        DeprecationIssueDetailsBuilder {
1658            affected_frame: None,
1659            source_code_location: source_code_location,
1660            type_: type_.into(),
1661        }
1662    }
1663    pub fn affected_frame(&self) -> Option<&AffectedFrame<'a>> { self.affected_frame.as_ref() }
1664    pub fn source_code_location(&self) -> &SourceCodeLocation<'a> { &self.source_code_location }
1665    /// One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5
1666    pub fn type_(&self) -> &str { self.type_.as_ref() }
1667}
1668
1669
1670pub struct DeprecationIssueDetailsBuilder<'a> {
1671    affected_frame: Option<AffectedFrame<'a>>,
1672    source_code_location: SourceCodeLocation<'a>,
1673    type_: Cow<'a, str>,
1674}
1675
1676impl<'a> DeprecationIssueDetailsBuilder<'a> {
1677    pub fn affected_frame(mut self, affected_frame: AffectedFrame<'a>) -> Self { self.affected_frame = Some(affected_frame); self }
1678    pub fn build(self) -> DeprecationIssueDetails<'a> {
1679        DeprecationIssueDetails {
1680            affected_frame: self.affected_frame,
1681            source_code_location: self.source_code_location,
1682            type_: self.type_,
1683        }
1684    }
1685}
1686
1687/// This issue warns about sites in the redirect chain of a finished navigation
1688/// that may be flagged as trackers and have their state cleared if they don't
1689/// receive a user interaction. Note that in this context 'site' means eTLD+1.
1690/// For example, if the URL 'https://example.test:80/bounce' was in the
1691/// redirect chain, the site reported would be 'example.test'.
1692
1693#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1694#[serde(rename_all = "camelCase")]
1695pub struct BounceTrackingIssueDetails<'a> {
1696    #[serde(rename = "trackingSites")]
1697    tracking_sites: Vec<Cow<'a, str>>,
1698}
1699
1700impl<'a> BounceTrackingIssueDetails<'a> {
1701    /// Creates a builder for this type with the required parameters:
1702    /// * `tracking_sites`: 
1703    pub fn builder(tracking_sites: Vec<Cow<'a, str>>) -> BounceTrackingIssueDetailsBuilder<'a> {
1704        BounceTrackingIssueDetailsBuilder {
1705            tracking_sites: tracking_sites,
1706        }
1707    }
1708    pub fn tracking_sites(&self) -> &[Cow<'a, str>] { &self.tracking_sites }
1709}
1710
1711
1712pub struct BounceTrackingIssueDetailsBuilder<'a> {
1713    tracking_sites: Vec<Cow<'a, str>>,
1714}
1715
1716impl<'a> BounceTrackingIssueDetailsBuilder<'a> {
1717    pub fn build(self) -> BounceTrackingIssueDetails<'a> {
1718        BounceTrackingIssueDetails {
1719            tracking_sites: self.tracking_sites,
1720        }
1721    }
1722}
1723
1724/// This issue warns about third-party sites that are accessing cookies on the
1725/// current page, and have been permitted due to having a global metadata grant.
1726/// Note that in this context 'site' means eTLD+1. For example, if the URL
1727/// 'https://example.test:80/web_page' was accessing cookies, the site reported
1728/// would be 'example.test'.
1729
1730#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1731#[serde(rename_all = "camelCase")]
1732pub struct CookieDeprecationMetadataIssueDetails<'a> {
1733    #[serde(rename = "allowedSites")]
1734    allowed_sites: Vec<Cow<'a, str>>,
1735    #[serde(rename = "optOutPercentage")]
1736    opt_out_percentage: f64,
1737    #[serde(rename = "isOptOutTopLevel")]
1738    is_opt_out_top_level: bool,
1739    operation: CookieOperation,
1740}
1741
1742impl<'a> CookieDeprecationMetadataIssueDetails<'a> {
1743    /// Creates a builder for this type with the required parameters:
1744    /// * `allowed_sites`: 
1745    /// * `opt_out_percentage`: 
1746    /// * `is_opt_out_top_level`: 
1747    /// * `operation`: 
1748    pub fn builder(allowed_sites: Vec<Cow<'a, str>>, opt_out_percentage: f64, is_opt_out_top_level: bool, operation: impl Into<CookieOperation>) -> CookieDeprecationMetadataIssueDetailsBuilder<'a> {
1749        CookieDeprecationMetadataIssueDetailsBuilder {
1750            allowed_sites: allowed_sites,
1751            opt_out_percentage: opt_out_percentage,
1752            is_opt_out_top_level: is_opt_out_top_level,
1753            operation: operation.into(),
1754        }
1755    }
1756    pub fn allowed_sites(&self) -> &[Cow<'a, str>] { &self.allowed_sites }
1757    pub fn opt_out_percentage(&self) -> f64 { self.opt_out_percentage }
1758    pub fn is_opt_out_top_level(&self) -> bool { self.is_opt_out_top_level }
1759    pub fn operation(&self) -> &CookieOperation { &self.operation }
1760}
1761
1762
1763pub struct CookieDeprecationMetadataIssueDetailsBuilder<'a> {
1764    allowed_sites: Vec<Cow<'a, str>>,
1765    opt_out_percentage: f64,
1766    is_opt_out_top_level: bool,
1767    operation: CookieOperation,
1768}
1769
1770impl<'a> CookieDeprecationMetadataIssueDetailsBuilder<'a> {
1771    pub fn build(self) -> CookieDeprecationMetadataIssueDetails<'a> {
1772        CookieDeprecationMetadataIssueDetails {
1773            allowed_sites: self.allowed_sites,
1774            opt_out_percentage: self.opt_out_percentage,
1775            is_opt_out_top_level: self.is_opt_out_top_level,
1776            operation: self.operation,
1777        }
1778    }
1779}
1780
1781
1782#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1783pub enum ClientHintIssueReason {
1784    #[default]
1785    #[serde(rename = "MetaTagAllowListInvalidOrigin")]
1786    MetaTagAllowListInvalidOrigin,
1787    #[serde(rename = "MetaTagModifiedHTML")]
1788    MetaTagModifiedHTML,
1789}
1790
1791
1792#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1793#[serde(rename_all = "camelCase")]
1794pub struct FederatedAuthRequestIssueDetails {
1795    #[serde(rename = "federatedAuthRequestIssueReason")]
1796    federated_auth_request_issue_reason: FederatedAuthRequestIssueReason,
1797}
1798
1799impl FederatedAuthRequestIssueDetails {
1800    /// Creates a builder for this type with the required parameters:
1801    /// * `federated_auth_request_issue_reason`: 
1802    pub fn builder(federated_auth_request_issue_reason: impl Into<FederatedAuthRequestIssueReason>) -> FederatedAuthRequestIssueDetailsBuilder {
1803        FederatedAuthRequestIssueDetailsBuilder {
1804            federated_auth_request_issue_reason: federated_auth_request_issue_reason.into(),
1805        }
1806    }
1807    pub fn federated_auth_request_issue_reason(&self) -> &FederatedAuthRequestIssueReason { &self.federated_auth_request_issue_reason }
1808}
1809
1810
1811pub struct FederatedAuthRequestIssueDetailsBuilder {
1812    federated_auth_request_issue_reason: FederatedAuthRequestIssueReason,
1813}
1814
1815impl FederatedAuthRequestIssueDetailsBuilder {
1816    pub fn build(self) -> FederatedAuthRequestIssueDetails {
1817        FederatedAuthRequestIssueDetails {
1818            federated_auth_request_issue_reason: self.federated_auth_request_issue_reason,
1819        }
1820    }
1821}
1822
1823/// Represents the failure reason when a federated authentication reason fails.
1824/// Should be updated alongside RequestIdTokenStatus in
1825/// third_party/blink/public/mojom/devtools/inspector_issue.mojom to include
1826/// all cases except for success.
1827
1828#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1829pub enum FederatedAuthRequestIssueReason {
1830    #[default]
1831    #[serde(rename = "ShouldEmbargo")]
1832    ShouldEmbargo,
1833    #[serde(rename = "TooManyRequests")]
1834    TooManyRequests,
1835    #[serde(rename = "WellKnownHttpNotFound")]
1836    WellKnownHttpNotFound,
1837    #[serde(rename = "WellKnownNoResponse")]
1838    WellKnownNoResponse,
1839    #[serde(rename = "WellKnownInvalidResponse")]
1840    WellKnownInvalidResponse,
1841    #[serde(rename = "WellKnownListEmpty")]
1842    WellKnownListEmpty,
1843    #[serde(rename = "WellKnownInvalidContentType")]
1844    WellKnownInvalidContentType,
1845    #[serde(rename = "ConfigNotInWellKnown")]
1846    ConfigNotInWellKnown,
1847    #[serde(rename = "WellKnownTooBig")]
1848    WellKnownTooBig,
1849    #[serde(rename = "ConfigHttpNotFound")]
1850    ConfigHttpNotFound,
1851    #[serde(rename = "ConfigNoResponse")]
1852    ConfigNoResponse,
1853    #[serde(rename = "ConfigInvalidResponse")]
1854    ConfigInvalidResponse,
1855    #[serde(rename = "ConfigInvalidContentType")]
1856    ConfigInvalidContentType,
1857    #[serde(rename = "IdpNotPotentiallyTrustworthy")]
1858    IdpNotPotentiallyTrustworthy,
1859    #[serde(rename = "DisabledInSettings")]
1860    DisabledInSettings,
1861    #[serde(rename = "DisabledInFlags")]
1862    DisabledInFlags,
1863    #[serde(rename = "ErrorFetchingSignin")]
1864    ErrorFetchingSignin,
1865    #[serde(rename = "InvalidSigninResponse")]
1866    InvalidSigninResponse,
1867    #[serde(rename = "AccountsHttpNotFound")]
1868    AccountsHttpNotFound,
1869    #[serde(rename = "AccountsNoResponse")]
1870    AccountsNoResponse,
1871    #[serde(rename = "AccountsInvalidResponse")]
1872    AccountsInvalidResponse,
1873    #[serde(rename = "AccountsListEmpty")]
1874    AccountsListEmpty,
1875    #[serde(rename = "AccountsInvalidContentType")]
1876    AccountsInvalidContentType,
1877    #[serde(rename = "IdTokenHttpNotFound")]
1878    IdTokenHttpNotFound,
1879    #[serde(rename = "IdTokenNoResponse")]
1880    IdTokenNoResponse,
1881    #[serde(rename = "IdTokenInvalidResponse")]
1882    IdTokenInvalidResponse,
1883    #[serde(rename = "IdTokenIdpErrorResponse")]
1884    IdTokenIdpErrorResponse,
1885    #[serde(rename = "IdTokenCrossSiteIdpErrorResponse")]
1886    IdTokenCrossSiteIdpErrorResponse,
1887    #[serde(rename = "IdTokenInvalidRequest")]
1888    IdTokenInvalidRequest,
1889    #[serde(rename = "IdTokenInvalidContentType")]
1890    IdTokenInvalidContentType,
1891    #[serde(rename = "ErrorIdToken")]
1892    ErrorIdToken,
1893    #[serde(rename = "Canceled")]
1894    Canceled,
1895    #[serde(rename = "RpPageNotVisible")]
1896    RpPageNotVisible,
1897    #[serde(rename = "SilentMediationFailure")]
1898    SilentMediationFailure,
1899    #[serde(rename = "NotSignedInWithIdp")]
1900    NotSignedInWithIdp,
1901    #[serde(rename = "MissingTransientUserActivation")]
1902    MissingTransientUserActivation,
1903    #[serde(rename = "ReplacedByActiveMode")]
1904    ReplacedByActiveMode,
1905    #[serde(rename = "RelyingPartyOriginIsOpaque")]
1906    RelyingPartyOriginIsOpaque,
1907    #[serde(rename = "TypeNotMatching")]
1908    TypeNotMatching,
1909    #[serde(rename = "UiDismissedNoEmbargo")]
1910    UiDismissedNoEmbargo,
1911    #[serde(rename = "CorsError")]
1912    CorsError,
1913    #[serde(rename = "SuppressedBySegmentationPlatform")]
1914    SuppressedBySegmentationPlatform,
1915}
1916
1917
1918#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1919#[serde(rename_all = "camelCase")]
1920pub struct FederatedAuthUserInfoRequestIssueDetails {
1921    #[serde(rename = "federatedAuthUserInfoRequestIssueReason")]
1922    federated_auth_user_info_request_issue_reason: FederatedAuthUserInfoRequestIssueReason,
1923}
1924
1925impl FederatedAuthUserInfoRequestIssueDetails {
1926    /// Creates a builder for this type with the required parameters:
1927    /// * `federated_auth_user_info_request_issue_reason`: 
1928    pub fn builder(federated_auth_user_info_request_issue_reason: impl Into<FederatedAuthUserInfoRequestIssueReason>) -> FederatedAuthUserInfoRequestIssueDetailsBuilder {
1929        FederatedAuthUserInfoRequestIssueDetailsBuilder {
1930            federated_auth_user_info_request_issue_reason: federated_auth_user_info_request_issue_reason.into(),
1931        }
1932    }
1933    pub fn federated_auth_user_info_request_issue_reason(&self) -> &FederatedAuthUserInfoRequestIssueReason { &self.federated_auth_user_info_request_issue_reason }
1934}
1935
1936
1937pub struct FederatedAuthUserInfoRequestIssueDetailsBuilder {
1938    federated_auth_user_info_request_issue_reason: FederatedAuthUserInfoRequestIssueReason,
1939}
1940
1941impl FederatedAuthUserInfoRequestIssueDetailsBuilder {
1942    pub fn build(self) -> FederatedAuthUserInfoRequestIssueDetails {
1943        FederatedAuthUserInfoRequestIssueDetails {
1944            federated_auth_user_info_request_issue_reason: self.federated_auth_user_info_request_issue_reason,
1945        }
1946    }
1947}
1948
1949/// Represents the failure reason when a getUserInfo() call fails.
1950/// Should be updated alongside FederatedAuthUserInfoRequestResult in
1951/// third_party/blink/public/mojom/devtools/inspector_issue.mojom.
1952
1953#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
1954pub enum FederatedAuthUserInfoRequestIssueReason {
1955    #[default]
1956    #[serde(rename = "NotSameOrigin")]
1957    NotSameOrigin,
1958    #[serde(rename = "NotIframe")]
1959    NotIframe,
1960    #[serde(rename = "NotPotentiallyTrustworthy")]
1961    NotPotentiallyTrustworthy,
1962    #[serde(rename = "NoApiPermission")]
1963    NoApiPermission,
1964    #[serde(rename = "NotSignedInWithIdp")]
1965    NotSignedInWithIdp,
1966    #[serde(rename = "NoAccountSharingPermission")]
1967    NoAccountSharingPermission,
1968    #[serde(rename = "InvalidConfigOrWellKnown")]
1969    InvalidConfigOrWellKnown,
1970    #[serde(rename = "InvalidAccountsResponse")]
1971    InvalidAccountsResponse,
1972    #[serde(rename = "NoReturningUserFromFetchedAccounts")]
1973    NoReturningUserFromFetchedAccounts,
1974}
1975
1976/// This issue tracks client hints related issues. It's used to deprecate old
1977/// features, encourage the use of new ones, and provide general guidance.
1978
1979#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1980#[serde(rename_all = "camelCase")]
1981pub struct ClientHintIssueDetails<'a> {
1982    #[serde(rename = "sourceCodeLocation")]
1983    source_code_location: SourceCodeLocation<'a>,
1984    #[serde(rename = "clientHintIssueReason")]
1985    client_hint_issue_reason: ClientHintIssueReason,
1986}
1987
1988impl<'a> ClientHintIssueDetails<'a> {
1989    /// Creates a builder for this type with the required parameters:
1990    /// * `source_code_location`: 
1991    /// * `client_hint_issue_reason`: 
1992    pub fn builder(source_code_location: SourceCodeLocation<'a>, client_hint_issue_reason: impl Into<ClientHintIssueReason>) -> ClientHintIssueDetailsBuilder<'a> {
1993        ClientHintIssueDetailsBuilder {
1994            source_code_location: source_code_location,
1995            client_hint_issue_reason: client_hint_issue_reason.into(),
1996        }
1997    }
1998    pub fn source_code_location(&self) -> &SourceCodeLocation<'a> { &self.source_code_location }
1999    pub fn client_hint_issue_reason(&self) -> &ClientHintIssueReason { &self.client_hint_issue_reason }
2000}
2001
2002
2003pub struct ClientHintIssueDetailsBuilder<'a> {
2004    source_code_location: SourceCodeLocation<'a>,
2005    client_hint_issue_reason: ClientHintIssueReason,
2006}
2007
2008impl<'a> ClientHintIssueDetailsBuilder<'a> {
2009    pub fn build(self) -> ClientHintIssueDetails<'a> {
2010        ClientHintIssueDetails {
2011            source_code_location: self.source_code_location,
2012            client_hint_issue_reason: self.client_hint_issue_reason,
2013        }
2014    }
2015}
2016
2017
2018#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2019#[serde(rename_all = "camelCase")]
2020pub struct FailedRequestInfo<'a> {
2021    /// The URL that failed to load.
2022    url: Cow<'a, str>,
2023    /// The failure message for the failed request.
2024    #[serde(rename = "failureMessage")]
2025    failure_message: Cow<'a, str>,
2026    #[serde(skip_serializing_if = "Option::is_none", rename = "requestId")]
2027    request_id: Option<crate::network::RequestId<'a>>,
2028}
2029
2030impl<'a> FailedRequestInfo<'a> {
2031    /// Creates a builder for this type with the required parameters:
2032    /// * `url`: The URL that failed to load.
2033    /// * `failure_message`: The failure message for the failed request.
2034    pub fn builder(url: impl Into<Cow<'a, str>>, failure_message: impl Into<Cow<'a, str>>) -> FailedRequestInfoBuilder<'a> {
2035        FailedRequestInfoBuilder {
2036            url: url.into(),
2037            failure_message: failure_message.into(),
2038            request_id: None,
2039        }
2040    }
2041    /// The URL that failed to load.
2042    pub fn url(&self) -> &str { self.url.as_ref() }
2043    /// The failure message for the failed request.
2044    pub fn failure_message(&self) -> &str { self.failure_message.as_ref() }
2045    pub fn request_id(&self) -> Option<&crate::network::RequestId<'a>> { self.request_id.as_ref() }
2046}
2047
2048
2049pub struct FailedRequestInfoBuilder<'a> {
2050    url: Cow<'a, str>,
2051    failure_message: Cow<'a, str>,
2052    request_id: Option<crate::network::RequestId<'a>>,
2053}
2054
2055impl<'a> FailedRequestInfoBuilder<'a> {
2056    pub fn request_id(mut self, request_id: crate::network::RequestId<'a>) -> Self { self.request_id = Some(request_id); self }
2057    pub fn build(self) -> FailedRequestInfo<'a> {
2058        FailedRequestInfo {
2059            url: self.url,
2060            failure_message: self.failure_message,
2061            request_id: self.request_id,
2062        }
2063    }
2064}
2065
2066
2067#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2068pub enum PartitioningBlobURLInfo {
2069    #[default]
2070    #[serde(rename = "BlockedCrossPartitionFetching")]
2071    BlockedCrossPartitionFetching,
2072    #[serde(rename = "EnforceNoopenerForNavigation")]
2073    EnforceNoopenerForNavigation,
2074}
2075
2076
2077#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2078#[serde(rename_all = "camelCase")]
2079pub struct PartitioningBlobURLIssueDetails<'a> {
2080    /// The BlobURL that failed to load.
2081    url: Cow<'a, str>,
2082    /// Additional information about the Partitioning Blob URL issue.
2083    #[serde(rename = "partitioningBlobURLInfo")]
2084    partitioning_blob_url_info: PartitioningBlobURLInfo,
2085}
2086
2087impl<'a> PartitioningBlobURLIssueDetails<'a> {
2088    /// Creates a builder for this type with the required parameters:
2089    /// * `url`: The BlobURL that failed to load.
2090    /// * `partitioning_blob_url_info`: Additional information about the Partitioning Blob URL issue.
2091    pub fn builder(url: impl Into<Cow<'a, str>>, partitioning_blob_url_info: impl Into<PartitioningBlobURLInfo>) -> PartitioningBlobURLIssueDetailsBuilder<'a> {
2092        PartitioningBlobURLIssueDetailsBuilder {
2093            url: url.into(),
2094            partitioning_blob_url_info: partitioning_blob_url_info.into(),
2095        }
2096    }
2097    /// The BlobURL that failed to load.
2098    pub fn url(&self) -> &str { self.url.as_ref() }
2099    /// Additional information about the Partitioning Blob URL issue.
2100    pub fn partitioning_blob_url_info(&self) -> &PartitioningBlobURLInfo { &self.partitioning_blob_url_info }
2101}
2102
2103
2104pub struct PartitioningBlobURLIssueDetailsBuilder<'a> {
2105    url: Cow<'a, str>,
2106    partitioning_blob_url_info: PartitioningBlobURLInfo,
2107}
2108
2109impl<'a> PartitioningBlobURLIssueDetailsBuilder<'a> {
2110    pub fn build(self) -> PartitioningBlobURLIssueDetails<'a> {
2111        PartitioningBlobURLIssueDetails {
2112            url: self.url,
2113            partitioning_blob_url_info: self.partitioning_blob_url_info,
2114        }
2115    }
2116}
2117
2118
2119#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2120pub enum ElementAccessibilityIssueReason {
2121    #[default]
2122    #[serde(rename = "DisallowedSelectChild")]
2123    DisallowedSelectChild,
2124    #[serde(rename = "DisallowedOptGroupChild")]
2125    DisallowedOptGroupChild,
2126    #[serde(rename = "NonPhrasingContentOptionChild")]
2127    NonPhrasingContentOptionChild,
2128    #[serde(rename = "InteractiveContentOptionChild")]
2129    InteractiveContentOptionChild,
2130    #[serde(rename = "InteractiveContentLegendChild")]
2131    InteractiveContentLegendChild,
2132    #[serde(rename = "InteractiveContentSummaryDescendant")]
2133    InteractiveContentSummaryDescendant,
2134}
2135
2136/// This issue warns about errors in the select or summary element content model.
2137
2138#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2139#[serde(rename_all = "camelCase")]
2140pub struct ElementAccessibilityIssueDetails {
2141    #[serde(rename = "nodeId")]
2142    node_id: crate::dom::BackendNodeId,
2143    #[serde(rename = "elementAccessibilityIssueReason")]
2144    element_accessibility_issue_reason: ElementAccessibilityIssueReason,
2145    #[serde(rename = "hasDisallowedAttributes")]
2146    has_disallowed_attributes: bool,
2147}
2148
2149impl ElementAccessibilityIssueDetails {
2150    /// Creates a builder for this type with the required parameters:
2151    /// * `node_id`: 
2152    /// * `element_accessibility_issue_reason`: 
2153    /// * `has_disallowed_attributes`: 
2154    pub fn builder(node_id: crate::dom::BackendNodeId, element_accessibility_issue_reason: impl Into<ElementAccessibilityIssueReason>, has_disallowed_attributes: bool) -> ElementAccessibilityIssueDetailsBuilder {
2155        ElementAccessibilityIssueDetailsBuilder {
2156            node_id: node_id,
2157            element_accessibility_issue_reason: element_accessibility_issue_reason.into(),
2158            has_disallowed_attributes: has_disallowed_attributes,
2159        }
2160    }
2161    pub fn node_id(&self) -> &crate::dom::BackendNodeId { &self.node_id }
2162    pub fn element_accessibility_issue_reason(&self) -> &ElementAccessibilityIssueReason { &self.element_accessibility_issue_reason }
2163    pub fn has_disallowed_attributes(&self) -> bool { self.has_disallowed_attributes }
2164}
2165
2166
2167pub struct ElementAccessibilityIssueDetailsBuilder {
2168    node_id: crate::dom::BackendNodeId,
2169    element_accessibility_issue_reason: ElementAccessibilityIssueReason,
2170    has_disallowed_attributes: bool,
2171}
2172
2173impl ElementAccessibilityIssueDetailsBuilder {
2174    pub fn build(self) -> ElementAccessibilityIssueDetails {
2175        ElementAccessibilityIssueDetails {
2176            node_id: self.node_id,
2177            element_accessibility_issue_reason: self.element_accessibility_issue_reason,
2178            has_disallowed_attributes: self.has_disallowed_attributes,
2179        }
2180    }
2181}
2182
2183
2184#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2185pub enum StyleSheetLoadingIssueReason {
2186    #[default]
2187    #[serde(rename = "LateImportRule")]
2188    LateImportRule,
2189    #[serde(rename = "RequestFailed")]
2190    RequestFailed,
2191}
2192
2193/// This issue warns when a referenced stylesheet couldn't be loaded.
2194
2195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2196#[serde(rename_all = "camelCase")]
2197pub struct StylesheetLoadingIssueDetails<'a> {
2198    /// Source code position that referenced the failing stylesheet.
2199    #[serde(rename = "sourceCodeLocation")]
2200    source_code_location: SourceCodeLocation<'a>,
2201    /// Reason why the stylesheet couldn't be loaded.
2202    #[serde(rename = "styleSheetLoadingIssueReason")]
2203    style_sheet_loading_issue_reason: StyleSheetLoadingIssueReason,
2204    /// Contains additional info when the failure was due to a request.
2205    #[serde(skip_serializing_if = "Option::is_none", rename = "failedRequestInfo")]
2206    failed_request_info: Option<FailedRequestInfo<'a>>,
2207}
2208
2209impl<'a> StylesheetLoadingIssueDetails<'a> {
2210    /// Creates a builder for this type with the required parameters:
2211    /// * `source_code_location`: Source code position that referenced the failing stylesheet.
2212    /// * `style_sheet_loading_issue_reason`: Reason why the stylesheet couldn't be loaded.
2213    pub fn builder(source_code_location: SourceCodeLocation<'a>, style_sheet_loading_issue_reason: impl Into<StyleSheetLoadingIssueReason>) -> StylesheetLoadingIssueDetailsBuilder<'a> {
2214        StylesheetLoadingIssueDetailsBuilder {
2215            source_code_location: source_code_location,
2216            style_sheet_loading_issue_reason: style_sheet_loading_issue_reason.into(),
2217            failed_request_info: None,
2218        }
2219    }
2220    /// Source code position that referenced the failing stylesheet.
2221    pub fn source_code_location(&self) -> &SourceCodeLocation<'a> { &self.source_code_location }
2222    /// Reason why the stylesheet couldn't be loaded.
2223    pub fn style_sheet_loading_issue_reason(&self) -> &StyleSheetLoadingIssueReason { &self.style_sheet_loading_issue_reason }
2224    /// Contains additional info when the failure was due to a request.
2225    pub fn failed_request_info(&self) -> Option<&FailedRequestInfo<'a>> { self.failed_request_info.as_ref() }
2226}
2227
2228
2229pub struct StylesheetLoadingIssueDetailsBuilder<'a> {
2230    source_code_location: SourceCodeLocation<'a>,
2231    style_sheet_loading_issue_reason: StyleSheetLoadingIssueReason,
2232    failed_request_info: Option<FailedRequestInfo<'a>>,
2233}
2234
2235impl<'a> StylesheetLoadingIssueDetailsBuilder<'a> {
2236    /// Contains additional info when the failure was due to a request.
2237    pub fn failed_request_info(mut self, failed_request_info: FailedRequestInfo<'a>) -> Self { self.failed_request_info = Some(failed_request_info); self }
2238    pub fn build(self) -> StylesheetLoadingIssueDetails<'a> {
2239        StylesheetLoadingIssueDetails {
2240            source_code_location: self.source_code_location,
2241            style_sheet_loading_issue_reason: self.style_sheet_loading_issue_reason,
2242            failed_request_info: self.failed_request_info,
2243        }
2244    }
2245}
2246
2247
2248#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2249pub enum PropertyRuleIssueReason {
2250    #[default]
2251    #[serde(rename = "InvalidSyntax")]
2252    InvalidSyntax,
2253    #[serde(rename = "InvalidInitialValue")]
2254    InvalidInitialValue,
2255    #[serde(rename = "InvalidInherits")]
2256    InvalidInherits,
2257    #[serde(rename = "InvalidName")]
2258    InvalidName,
2259}
2260
2261/// This issue warns about errors in property rules that lead to property
2262/// registrations being ignored.
2263
2264#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2265#[serde(rename_all = "camelCase")]
2266pub struct PropertyRuleIssueDetails<'a> {
2267    /// Source code position of the property rule.
2268    #[serde(rename = "sourceCodeLocation")]
2269    source_code_location: SourceCodeLocation<'a>,
2270    /// Reason why the property rule was discarded.
2271    #[serde(rename = "propertyRuleIssueReason")]
2272    property_rule_issue_reason: PropertyRuleIssueReason,
2273    /// The value of the property rule property that failed to parse
2274    #[serde(skip_serializing_if = "Option::is_none", rename = "propertyValue")]
2275    property_value: Option<Cow<'a, str>>,
2276}
2277
2278impl<'a> PropertyRuleIssueDetails<'a> {
2279    /// Creates a builder for this type with the required parameters:
2280    /// * `source_code_location`: Source code position of the property rule.
2281    /// * `property_rule_issue_reason`: Reason why the property rule was discarded.
2282    pub fn builder(source_code_location: SourceCodeLocation<'a>, property_rule_issue_reason: impl Into<PropertyRuleIssueReason>) -> PropertyRuleIssueDetailsBuilder<'a> {
2283        PropertyRuleIssueDetailsBuilder {
2284            source_code_location: source_code_location,
2285            property_rule_issue_reason: property_rule_issue_reason.into(),
2286            property_value: None,
2287        }
2288    }
2289    /// Source code position of the property rule.
2290    pub fn source_code_location(&self) -> &SourceCodeLocation<'a> { &self.source_code_location }
2291    /// Reason why the property rule was discarded.
2292    pub fn property_rule_issue_reason(&self) -> &PropertyRuleIssueReason { &self.property_rule_issue_reason }
2293    /// The value of the property rule property that failed to parse
2294    pub fn property_value(&self) -> Option<&str> { self.property_value.as_deref() }
2295}
2296
2297
2298pub struct PropertyRuleIssueDetailsBuilder<'a> {
2299    source_code_location: SourceCodeLocation<'a>,
2300    property_rule_issue_reason: PropertyRuleIssueReason,
2301    property_value: Option<Cow<'a, str>>,
2302}
2303
2304impl<'a> PropertyRuleIssueDetailsBuilder<'a> {
2305    /// The value of the property rule property that failed to parse
2306    pub fn property_value(mut self, property_value: impl Into<Cow<'a, str>>) -> Self { self.property_value = Some(property_value.into()); self }
2307    pub fn build(self) -> PropertyRuleIssueDetails<'a> {
2308        PropertyRuleIssueDetails {
2309            source_code_location: self.source_code_location,
2310            property_rule_issue_reason: self.property_rule_issue_reason,
2311            property_value: self.property_value,
2312        }
2313    }
2314}
2315
2316
2317#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2318pub enum UserReidentificationIssueType {
2319    #[default]
2320    #[serde(rename = "BlockedFrameNavigation")]
2321    BlockedFrameNavigation,
2322    #[serde(rename = "BlockedSubresource")]
2323    BlockedSubresource,
2324    #[serde(rename = "NoisedCanvasReadback")]
2325    NoisedCanvasReadback,
2326}
2327
2328/// This issue warns about uses of APIs that may be considered misuse to
2329/// re-identify users.
2330
2331#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2332#[serde(rename_all = "camelCase")]
2333pub struct UserReidentificationIssueDetails<'a> {
2334    #[serde(rename = "type")]
2335    type_: UserReidentificationIssueType,
2336    /// Applies to BlockedFrameNavigation and BlockedSubresource issue types.
2337    #[serde(skip_serializing_if = "Option::is_none")]
2338    request: Option<AffectedRequest<'a>>,
2339    /// Applies to NoisedCanvasReadback issue type.
2340    #[serde(skip_serializing_if = "Option::is_none", rename = "sourceCodeLocation")]
2341    source_code_location: Option<SourceCodeLocation<'a>>,
2342}
2343
2344impl<'a> UserReidentificationIssueDetails<'a> {
2345    /// Creates a builder for this type with the required parameters:
2346    /// * `type_`: 
2347    pub fn builder(type_: impl Into<UserReidentificationIssueType>) -> UserReidentificationIssueDetailsBuilder<'a> {
2348        UserReidentificationIssueDetailsBuilder {
2349            type_: type_.into(),
2350            request: None,
2351            source_code_location: None,
2352        }
2353    }
2354    pub fn type_(&self) -> &UserReidentificationIssueType { &self.type_ }
2355    /// Applies to BlockedFrameNavigation and BlockedSubresource issue types.
2356    pub fn request(&self) -> Option<&AffectedRequest<'a>> { self.request.as_ref() }
2357    /// Applies to NoisedCanvasReadback issue type.
2358    pub fn source_code_location(&self) -> Option<&SourceCodeLocation<'a>> { self.source_code_location.as_ref() }
2359}
2360
2361
2362pub struct UserReidentificationIssueDetailsBuilder<'a> {
2363    type_: UserReidentificationIssueType,
2364    request: Option<AffectedRequest<'a>>,
2365    source_code_location: Option<SourceCodeLocation<'a>>,
2366}
2367
2368impl<'a> UserReidentificationIssueDetailsBuilder<'a> {
2369    /// Applies to BlockedFrameNavigation and BlockedSubresource issue types.
2370    pub fn request(mut self, request: AffectedRequest<'a>) -> Self { self.request = Some(request); self }
2371    /// Applies to NoisedCanvasReadback issue type.
2372    pub fn source_code_location(mut self, source_code_location: SourceCodeLocation<'a>) -> Self { self.source_code_location = Some(source_code_location); self }
2373    pub fn build(self) -> UserReidentificationIssueDetails<'a> {
2374        UserReidentificationIssueDetails {
2375            type_: self.type_,
2376            request: self.request,
2377            source_code_location: self.source_code_location,
2378        }
2379    }
2380}
2381
2382
2383#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2384pub enum PermissionElementIssueType {
2385    #[default]
2386    #[serde(rename = "InvalidType")]
2387    InvalidType,
2388    #[serde(rename = "FencedFrameDisallowed")]
2389    FencedFrameDisallowed,
2390    #[serde(rename = "CspFrameAncestorsMissing")]
2391    CspFrameAncestorsMissing,
2392    #[serde(rename = "PermissionsPolicyBlocked")]
2393    PermissionsPolicyBlocked,
2394    #[serde(rename = "PaddingRightUnsupported")]
2395    PaddingRightUnsupported,
2396    #[serde(rename = "PaddingBottomUnsupported")]
2397    PaddingBottomUnsupported,
2398    #[serde(rename = "InsetBoxShadowUnsupported")]
2399    InsetBoxShadowUnsupported,
2400    #[serde(rename = "RequestInProgress")]
2401    RequestInProgress,
2402    #[serde(rename = "UntrustedEvent")]
2403    UntrustedEvent,
2404    #[serde(rename = "RegistrationFailed")]
2405    RegistrationFailed,
2406    #[serde(rename = "TypeNotSupported")]
2407    TypeNotSupported,
2408    #[serde(rename = "InvalidTypeActivation")]
2409    InvalidTypeActivation,
2410    #[serde(rename = "SecurityChecksFailed")]
2411    SecurityChecksFailed,
2412    #[serde(rename = "ActivationDisabled")]
2413    ActivationDisabled,
2414    #[serde(rename = "GeolocationDeprecated")]
2415    GeolocationDeprecated,
2416    #[serde(rename = "InvalidDisplayStyle")]
2417    InvalidDisplayStyle,
2418    #[serde(rename = "NonOpaqueColor")]
2419    NonOpaqueColor,
2420    #[serde(rename = "LowContrast")]
2421    LowContrast,
2422    #[serde(rename = "FontSizeTooSmall")]
2423    FontSizeTooSmall,
2424    #[serde(rename = "FontSizeTooLarge")]
2425    FontSizeTooLarge,
2426    #[serde(rename = "InvalidSizeValue")]
2427    InvalidSizeValue,
2428}
2429
2430/// This issue warns about improper usage of the \<permission\> element.
2431
2432#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2433#[serde(rename_all = "camelCase")]
2434pub struct PermissionElementIssueDetails<'a> {
2435    #[serde(rename = "issueType")]
2436    issue_type: PermissionElementIssueType,
2437    /// The value of the type attribute.
2438    #[serde(skip_serializing_if = "Option::is_none", rename = "type")]
2439    type_: Option<Cow<'a, str>>,
2440    /// The node ID of the \<permission\> element.
2441    #[serde(skip_serializing_if = "Option::is_none", rename = "nodeId")]
2442    node_id: Option<crate::dom::BackendNodeId>,
2443    /// True if the issue is a warning, false if it is an error.
2444    #[serde(skip_serializing_if = "Option::is_none", rename = "isWarning")]
2445    is_warning: Option<bool>,
2446    /// Fields for message construction:
2447    /// Used for messages that reference a specific permission name
2448    #[serde(skip_serializing_if = "Option::is_none", rename = "permissionName")]
2449    permission_name: Option<Cow<'a, str>>,
2450    /// Used for messages about occlusion
2451    #[serde(skip_serializing_if = "Option::is_none", rename = "occluderNodeInfo")]
2452    occluder_node_info: Option<Cow<'a, str>>,
2453    /// Used for messages about occluder's parent
2454    #[serde(skip_serializing_if = "Option::is_none", rename = "occluderParentNodeInfo")]
2455    occluder_parent_node_info: Option<Cow<'a, str>>,
2456    /// Used for messages about activation disabled reason
2457    #[serde(skip_serializing_if = "Option::is_none", rename = "disableReason")]
2458    disable_reason: Option<Cow<'a, str>>,
2459}
2460
2461impl<'a> PermissionElementIssueDetails<'a> {
2462    /// Creates a builder for this type with the required parameters:
2463    /// * `issue_type`: 
2464    pub fn builder(issue_type: impl Into<PermissionElementIssueType>) -> PermissionElementIssueDetailsBuilder<'a> {
2465        PermissionElementIssueDetailsBuilder {
2466            issue_type: issue_type.into(),
2467            type_: None,
2468            node_id: None,
2469            is_warning: None,
2470            permission_name: None,
2471            occluder_node_info: None,
2472            occluder_parent_node_info: None,
2473            disable_reason: None,
2474        }
2475    }
2476    pub fn issue_type(&self) -> &PermissionElementIssueType { &self.issue_type }
2477    /// The value of the type attribute.
2478    pub fn type_(&self) -> Option<&str> { self.type_.as_deref() }
2479    /// The node ID of the \<permission\> element.
2480    pub fn node_id(&self) -> Option<&crate::dom::BackendNodeId> { self.node_id.as_ref() }
2481    /// True if the issue is a warning, false if it is an error.
2482    pub fn is_warning(&self) -> Option<bool> { self.is_warning }
2483    /// Fields for message construction:
2484    /// Used for messages that reference a specific permission name
2485    pub fn permission_name(&self) -> Option<&str> { self.permission_name.as_deref() }
2486    /// Used for messages about occlusion
2487    pub fn occluder_node_info(&self) -> Option<&str> { self.occluder_node_info.as_deref() }
2488    /// Used for messages about occluder's parent
2489    pub fn occluder_parent_node_info(&self) -> Option<&str> { self.occluder_parent_node_info.as_deref() }
2490    /// Used for messages about activation disabled reason
2491    pub fn disable_reason(&self) -> Option<&str> { self.disable_reason.as_deref() }
2492}
2493
2494
2495pub struct PermissionElementIssueDetailsBuilder<'a> {
2496    issue_type: PermissionElementIssueType,
2497    type_: Option<Cow<'a, str>>,
2498    node_id: Option<crate::dom::BackendNodeId>,
2499    is_warning: Option<bool>,
2500    permission_name: Option<Cow<'a, str>>,
2501    occluder_node_info: Option<Cow<'a, str>>,
2502    occluder_parent_node_info: Option<Cow<'a, str>>,
2503    disable_reason: Option<Cow<'a, str>>,
2504}
2505
2506impl<'a> PermissionElementIssueDetailsBuilder<'a> {
2507    /// The value of the type attribute.
2508    pub fn type_(mut self, type_: impl Into<Cow<'a, str>>) -> Self { self.type_ = Some(type_.into()); self }
2509    /// The node ID of the \<permission\> element.
2510    pub fn node_id(mut self, node_id: crate::dom::BackendNodeId) -> Self { self.node_id = Some(node_id); self }
2511    /// True if the issue is a warning, false if it is an error.
2512    pub fn is_warning(mut self, is_warning: bool) -> Self { self.is_warning = Some(is_warning); self }
2513    /// Fields for message construction:
2514    /// Used for messages that reference a specific permission name
2515    pub fn permission_name(mut self, permission_name: impl Into<Cow<'a, str>>) -> Self { self.permission_name = Some(permission_name.into()); self }
2516    /// Used for messages about occlusion
2517    pub fn occluder_node_info(mut self, occluder_node_info: impl Into<Cow<'a, str>>) -> Self { self.occluder_node_info = Some(occluder_node_info.into()); self }
2518    /// Used for messages about occluder's parent
2519    pub fn occluder_parent_node_info(mut self, occluder_parent_node_info: impl Into<Cow<'a, str>>) -> Self { self.occluder_parent_node_info = Some(occluder_parent_node_info.into()); self }
2520    /// Used for messages about activation disabled reason
2521    pub fn disable_reason(mut self, disable_reason: impl Into<Cow<'a, str>>) -> Self { self.disable_reason = Some(disable_reason.into()); self }
2522    pub fn build(self) -> PermissionElementIssueDetails<'a> {
2523        PermissionElementIssueDetails {
2524            issue_type: self.issue_type,
2525            type_: self.type_,
2526            node_id: self.node_id,
2527            is_warning: self.is_warning,
2528            permission_name: self.permission_name,
2529            occluder_node_info: self.occluder_node_info,
2530            occluder_parent_node_info: self.occluder_parent_node_info,
2531            disable_reason: self.disable_reason,
2532        }
2533    }
2534}
2535
2536/// The issue warns about blocked calls to privacy sensitive APIs via the
2537/// Selective Permissions Intervention.
2538
2539#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2540#[serde(rename_all = "camelCase")]
2541pub struct SelectivePermissionsInterventionIssueDetails<'a> {
2542    /// Which API was intervened on.
2543    #[serde(rename = "apiName")]
2544    api_name: Cow<'a, str>,
2545    /// Why the ad script using the API is considered an ad.
2546    #[serde(rename = "adAncestry")]
2547    ad_ancestry: crate::network::AdAncestry<'a>,
2548    /// The stack trace at the time of the intervention.
2549    #[serde(skip_serializing_if = "Option::is_none", rename = "stackTrace")]
2550    stack_trace: Option<crate::runtime::StackTrace>,
2551}
2552
2553impl<'a> SelectivePermissionsInterventionIssueDetails<'a> {
2554    /// Creates a builder for this type with the required parameters:
2555    /// * `api_name`: Which API was intervened on.
2556    /// * `ad_ancestry`: Why the ad script using the API is considered an ad.
2557    pub fn builder(api_name: impl Into<Cow<'a, str>>, ad_ancestry: crate::network::AdAncestry<'a>) -> SelectivePermissionsInterventionIssueDetailsBuilder<'a> {
2558        SelectivePermissionsInterventionIssueDetailsBuilder {
2559            api_name: api_name.into(),
2560            ad_ancestry: ad_ancestry,
2561            stack_trace: None,
2562        }
2563    }
2564    /// Which API was intervened on.
2565    pub fn api_name(&self) -> &str { self.api_name.as_ref() }
2566    /// Why the ad script using the API is considered an ad.
2567    pub fn ad_ancestry(&self) -> &crate::network::AdAncestry<'a> { &self.ad_ancestry }
2568    /// The stack trace at the time of the intervention.
2569    pub fn stack_trace(&self) -> Option<&crate::runtime::StackTrace> { self.stack_trace.as_ref() }
2570}
2571
2572
2573pub struct SelectivePermissionsInterventionIssueDetailsBuilder<'a> {
2574    api_name: Cow<'a, str>,
2575    ad_ancestry: crate::network::AdAncestry<'a>,
2576    stack_trace: Option<crate::runtime::StackTrace>,
2577}
2578
2579impl<'a> SelectivePermissionsInterventionIssueDetailsBuilder<'a> {
2580    /// The stack trace at the time of the intervention.
2581    pub fn stack_trace(mut self, stack_trace: crate::runtime::StackTrace) -> Self { self.stack_trace = Some(stack_trace); self }
2582    pub fn build(self) -> SelectivePermissionsInterventionIssueDetails<'a> {
2583        SelectivePermissionsInterventionIssueDetails {
2584            api_name: self.api_name,
2585            ad_ancestry: self.ad_ancestry,
2586            stack_trace: self.stack_trace,
2587        }
2588    }
2589}
2590
2591/// A unique identifier for the type of issue. Each type may use one of the
2592/// optional fields in InspectorIssueDetails to convey more specific
2593/// information about the kind of issue.
2594
2595#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
2596pub enum InspectorIssueCode {
2597    #[default]
2598    #[serde(rename = "CookieIssue")]
2599    CookieIssue,
2600    #[serde(rename = "MixedContentIssue")]
2601    MixedContentIssue,
2602    #[serde(rename = "BlockedByResponseIssue")]
2603    BlockedByResponseIssue,
2604    #[serde(rename = "HeavyAdIssue")]
2605    HeavyAdIssue,
2606    #[serde(rename = "ContentSecurityPolicyIssue")]
2607    ContentSecurityPolicyIssue,
2608    #[serde(rename = "SharedArrayBufferIssue")]
2609    SharedArrayBufferIssue,
2610    #[serde(rename = "CorsIssue")]
2611    CorsIssue,
2612    #[serde(rename = "AttributionReportingIssue")]
2613    AttributionReportingIssue,
2614    #[serde(rename = "QuirksModeIssue")]
2615    QuirksModeIssue,
2616    #[serde(rename = "PartitioningBlobURLIssue")]
2617    PartitioningBlobURLIssue,
2618    #[serde(rename = "NavigatorUserAgentIssue")]
2619    NavigatorUserAgentIssue,
2620    #[serde(rename = "GenericIssue")]
2621    GenericIssue,
2622    #[serde(rename = "DeprecationIssue")]
2623    DeprecationIssue,
2624    #[serde(rename = "ClientHintIssue")]
2625    ClientHintIssue,
2626    #[serde(rename = "FederatedAuthRequestIssue")]
2627    FederatedAuthRequestIssue,
2628    #[serde(rename = "BounceTrackingIssue")]
2629    BounceTrackingIssue,
2630    #[serde(rename = "CookieDeprecationMetadataIssue")]
2631    CookieDeprecationMetadataIssue,
2632    #[serde(rename = "StylesheetLoadingIssue")]
2633    StylesheetLoadingIssue,
2634    #[serde(rename = "FederatedAuthUserInfoRequestIssue")]
2635    FederatedAuthUserInfoRequestIssue,
2636    #[serde(rename = "PropertyRuleIssue")]
2637    PropertyRuleIssue,
2638    #[serde(rename = "SharedDictionaryIssue")]
2639    SharedDictionaryIssue,
2640    #[serde(rename = "ElementAccessibilityIssue")]
2641    ElementAccessibilityIssue,
2642    #[serde(rename = "SRIMessageSignatureIssue")]
2643    SRIMessageSignatureIssue,
2644    #[serde(rename = "UnencodedDigestIssue")]
2645    UnencodedDigestIssue,
2646    #[serde(rename = "ConnectionAllowlistIssue")]
2647    ConnectionAllowlistIssue,
2648    #[serde(rename = "UserReidentificationIssue")]
2649    UserReidentificationIssue,
2650    #[serde(rename = "PermissionElementIssue")]
2651    PermissionElementIssue,
2652    #[serde(rename = "PerformanceIssue")]
2653    PerformanceIssue,
2654    #[serde(rename = "SelectivePermissionsInterventionIssue")]
2655    SelectivePermissionsInterventionIssue,
2656}
2657
2658/// This struct holds a list of optional fields with additional information
2659/// specific to the kind of issue. When adding a new issue code, please also
2660/// add a new optional field to this type.
2661
2662#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2663#[serde(rename_all = "camelCase")]
2664pub struct InspectorIssueDetails<'a> {
2665    #[serde(skip_serializing_if = "Option::is_none", rename = "cookieIssueDetails")]
2666    cookie_issue_details: Option<CookieIssueDetails<'a>>,
2667    #[serde(skip_serializing_if = "Option::is_none", rename = "mixedContentIssueDetails")]
2668    mixed_content_issue_details: Option<MixedContentIssueDetails<'a>>,
2669    #[serde(skip_serializing_if = "Option::is_none", rename = "blockedByResponseIssueDetails")]
2670    blocked_by_response_issue_details: Option<BlockedByResponseIssueDetails<'a>>,
2671    #[serde(skip_serializing_if = "Option::is_none", rename = "heavyAdIssueDetails")]
2672    heavy_ad_issue_details: Option<HeavyAdIssueDetails<'a>>,
2673    #[serde(skip_serializing_if = "Option::is_none", rename = "contentSecurityPolicyIssueDetails")]
2674    content_security_policy_issue_details: Option<ContentSecurityPolicyIssueDetails<'a>>,
2675    #[serde(skip_serializing_if = "Option::is_none", rename = "sharedArrayBufferIssueDetails")]
2676    shared_array_buffer_issue_details: Option<SharedArrayBufferIssueDetails<'a>>,
2677    #[serde(skip_serializing_if = "Option::is_none", rename = "corsIssueDetails")]
2678    cors_issue_details: Option<CorsIssueDetails<'a>>,
2679    #[serde(skip_serializing_if = "Option::is_none", rename = "attributionReportingIssueDetails")]
2680    attribution_reporting_issue_details: Option<AttributionReportingIssueDetails<'a>>,
2681    #[serde(skip_serializing_if = "Option::is_none", rename = "quirksModeIssueDetails")]
2682    quirks_mode_issue_details: Option<QuirksModeIssueDetails<'a>>,
2683    #[serde(skip_serializing_if = "Option::is_none", rename = "partitioningBlobURLIssueDetails")]
2684    partitioning_blob_url_issue_details: Option<PartitioningBlobURLIssueDetails<'a>>,
2685    #[serde(skip_serializing_if = "Option::is_none", rename = "navigatorUserAgentIssueDetails")]
2686    navigator_user_agent_issue_details: Option<NavigatorUserAgentIssueDetails<'a>>,
2687    #[serde(skip_serializing_if = "Option::is_none", rename = "genericIssueDetails")]
2688    generic_issue_details: Option<GenericIssueDetails<'a>>,
2689    #[serde(skip_serializing_if = "Option::is_none", rename = "deprecationIssueDetails")]
2690    deprecation_issue_details: Option<DeprecationIssueDetails<'a>>,
2691    #[serde(skip_serializing_if = "Option::is_none", rename = "clientHintIssueDetails")]
2692    client_hint_issue_details: Option<ClientHintIssueDetails<'a>>,
2693    #[serde(skip_serializing_if = "Option::is_none", rename = "federatedAuthRequestIssueDetails")]
2694    federated_auth_request_issue_details: Option<FederatedAuthRequestIssueDetails>,
2695    #[serde(skip_serializing_if = "Option::is_none", rename = "bounceTrackingIssueDetails")]
2696    bounce_tracking_issue_details: Option<BounceTrackingIssueDetails<'a>>,
2697    #[serde(skip_serializing_if = "Option::is_none", rename = "cookieDeprecationMetadataIssueDetails")]
2698    cookie_deprecation_metadata_issue_details: Option<CookieDeprecationMetadataIssueDetails<'a>>,
2699    #[serde(skip_serializing_if = "Option::is_none", rename = "stylesheetLoadingIssueDetails")]
2700    stylesheet_loading_issue_details: Option<StylesheetLoadingIssueDetails<'a>>,
2701    #[serde(skip_serializing_if = "Option::is_none", rename = "propertyRuleIssueDetails")]
2702    property_rule_issue_details: Option<PropertyRuleIssueDetails<'a>>,
2703    #[serde(skip_serializing_if = "Option::is_none", rename = "federatedAuthUserInfoRequestIssueDetails")]
2704    federated_auth_user_info_request_issue_details: Option<FederatedAuthUserInfoRequestIssueDetails>,
2705    #[serde(skip_serializing_if = "Option::is_none", rename = "sharedDictionaryIssueDetails")]
2706    shared_dictionary_issue_details: Option<SharedDictionaryIssueDetails<'a>>,
2707    #[serde(skip_serializing_if = "Option::is_none", rename = "elementAccessibilityIssueDetails")]
2708    element_accessibility_issue_details: Option<ElementAccessibilityIssueDetails>,
2709    #[serde(skip_serializing_if = "Option::is_none", rename = "sriMessageSignatureIssueDetails")]
2710    sri_message_signature_issue_details: Option<SRIMessageSignatureIssueDetails<'a>>,
2711    #[serde(skip_serializing_if = "Option::is_none", rename = "unencodedDigestIssueDetails")]
2712    unencoded_digest_issue_details: Option<UnencodedDigestIssueDetails<'a>>,
2713    #[serde(skip_serializing_if = "Option::is_none", rename = "connectionAllowlistIssueDetails")]
2714    connection_allowlist_issue_details: Option<ConnectionAllowlistIssueDetails<'a>>,
2715    #[serde(skip_serializing_if = "Option::is_none", rename = "userReidentificationIssueDetails")]
2716    user_reidentification_issue_details: Option<UserReidentificationIssueDetails<'a>>,
2717    #[serde(skip_serializing_if = "Option::is_none", rename = "permissionElementIssueDetails")]
2718    permission_element_issue_details: Option<PermissionElementIssueDetails<'a>>,
2719    #[serde(skip_serializing_if = "Option::is_none", rename = "performanceIssueDetails")]
2720    performance_issue_details: Option<PerformanceIssueDetails<'a>>,
2721    #[serde(skip_serializing_if = "Option::is_none", rename = "selectivePermissionsInterventionIssueDetails")]
2722    selective_permissions_intervention_issue_details: Option<SelectivePermissionsInterventionIssueDetails<'a>>,
2723}
2724
2725impl<'a> InspectorIssueDetails<'a> {
2726    /// Creates a builder for this type.
2727    pub fn builder() -> InspectorIssueDetailsBuilder<'a> {
2728        InspectorIssueDetailsBuilder {
2729            cookie_issue_details: None,
2730            mixed_content_issue_details: None,
2731            blocked_by_response_issue_details: None,
2732            heavy_ad_issue_details: None,
2733            content_security_policy_issue_details: None,
2734            shared_array_buffer_issue_details: None,
2735            cors_issue_details: None,
2736            attribution_reporting_issue_details: None,
2737            quirks_mode_issue_details: None,
2738            partitioning_blob_url_issue_details: None,
2739            navigator_user_agent_issue_details: None,
2740            generic_issue_details: None,
2741            deprecation_issue_details: None,
2742            client_hint_issue_details: None,
2743            federated_auth_request_issue_details: None,
2744            bounce_tracking_issue_details: None,
2745            cookie_deprecation_metadata_issue_details: None,
2746            stylesheet_loading_issue_details: None,
2747            property_rule_issue_details: None,
2748            federated_auth_user_info_request_issue_details: None,
2749            shared_dictionary_issue_details: None,
2750            element_accessibility_issue_details: None,
2751            sri_message_signature_issue_details: None,
2752            unencoded_digest_issue_details: None,
2753            connection_allowlist_issue_details: None,
2754            user_reidentification_issue_details: None,
2755            permission_element_issue_details: None,
2756            performance_issue_details: None,
2757            selective_permissions_intervention_issue_details: None,
2758        }
2759    }
2760    pub fn cookie_issue_details(&self) -> Option<&CookieIssueDetails<'a>> { self.cookie_issue_details.as_ref() }
2761    pub fn mixed_content_issue_details(&self) -> Option<&MixedContentIssueDetails<'a>> { self.mixed_content_issue_details.as_ref() }
2762    pub fn blocked_by_response_issue_details(&self) -> Option<&BlockedByResponseIssueDetails<'a>> { self.blocked_by_response_issue_details.as_ref() }
2763    pub fn heavy_ad_issue_details(&self) -> Option<&HeavyAdIssueDetails<'a>> { self.heavy_ad_issue_details.as_ref() }
2764    pub fn content_security_policy_issue_details(&self) -> Option<&ContentSecurityPolicyIssueDetails<'a>> { self.content_security_policy_issue_details.as_ref() }
2765    pub fn shared_array_buffer_issue_details(&self) -> Option<&SharedArrayBufferIssueDetails<'a>> { self.shared_array_buffer_issue_details.as_ref() }
2766    pub fn cors_issue_details(&self) -> Option<&CorsIssueDetails<'a>> { self.cors_issue_details.as_ref() }
2767    pub fn attribution_reporting_issue_details(&self) -> Option<&AttributionReportingIssueDetails<'a>> { self.attribution_reporting_issue_details.as_ref() }
2768    pub fn quirks_mode_issue_details(&self) -> Option<&QuirksModeIssueDetails<'a>> { self.quirks_mode_issue_details.as_ref() }
2769    pub fn partitioning_blob_url_issue_details(&self) -> Option<&PartitioningBlobURLIssueDetails<'a>> { self.partitioning_blob_url_issue_details.as_ref() }
2770    pub fn navigator_user_agent_issue_details(&self) -> Option<&NavigatorUserAgentIssueDetails<'a>> { self.navigator_user_agent_issue_details.as_ref() }
2771    pub fn generic_issue_details(&self) -> Option<&GenericIssueDetails<'a>> { self.generic_issue_details.as_ref() }
2772    pub fn deprecation_issue_details(&self) -> Option<&DeprecationIssueDetails<'a>> { self.deprecation_issue_details.as_ref() }
2773    pub fn client_hint_issue_details(&self) -> Option<&ClientHintIssueDetails<'a>> { self.client_hint_issue_details.as_ref() }
2774    pub fn federated_auth_request_issue_details(&self) -> Option<&FederatedAuthRequestIssueDetails> { self.federated_auth_request_issue_details.as_ref() }
2775    pub fn bounce_tracking_issue_details(&self) -> Option<&BounceTrackingIssueDetails<'a>> { self.bounce_tracking_issue_details.as_ref() }
2776    pub fn cookie_deprecation_metadata_issue_details(&self) -> Option<&CookieDeprecationMetadataIssueDetails<'a>> { self.cookie_deprecation_metadata_issue_details.as_ref() }
2777    pub fn stylesheet_loading_issue_details(&self) -> Option<&StylesheetLoadingIssueDetails<'a>> { self.stylesheet_loading_issue_details.as_ref() }
2778    pub fn property_rule_issue_details(&self) -> Option<&PropertyRuleIssueDetails<'a>> { self.property_rule_issue_details.as_ref() }
2779    pub fn federated_auth_user_info_request_issue_details(&self) -> Option<&FederatedAuthUserInfoRequestIssueDetails> { self.federated_auth_user_info_request_issue_details.as_ref() }
2780    pub fn shared_dictionary_issue_details(&self) -> Option<&SharedDictionaryIssueDetails<'a>> { self.shared_dictionary_issue_details.as_ref() }
2781    pub fn element_accessibility_issue_details(&self) -> Option<&ElementAccessibilityIssueDetails> { self.element_accessibility_issue_details.as_ref() }
2782    pub fn sri_message_signature_issue_details(&self) -> Option<&SRIMessageSignatureIssueDetails<'a>> { self.sri_message_signature_issue_details.as_ref() }
2783    pub fn unencoded_digest_issue_details(&self) -> Option<&UnencodedDigestIssueDetails<'a>> { self.unencoded_digest_issue_details.as_ref() }
2784    pub fn connection_allowlist_issue_details(&self) -> Option<&ConnectionAllowlistIssueDetails<'a>> { self.connection_allowlist_issue_details.as_ref() }
2785    pub fn user_reidentification_issue_details(&self) -> Option<&UserReidentificationIssueDetails<'a>> { self.user_reidentification_issue_details.as_ref() }
2786    pub fn permission_element_issue_details(&self) -> Option<&PermissionElementIssueDetails<'a>> { self.permission_element_issue_details.as_ref() }
2787    pub fn performance_issue_details(&self) -> Option<&PerformanceIssueDetails<'a>> { self.performance_issue_details.as_ref() }
2788    pub fn selective_permissions_intervention_issue_details(&self) -> Option<&SelectivePermissionsInterventionIssueDetails<'a>> { self.selective_permissions_intervention_issue_details.as_ref() }
2789}
2790
2791#[derive(Default)]
2792pub struct InspectorIssueDetailsBuilder<'a> {
2793    cookie_issue_details: Option<CookieIssueDetails<'a>>,
2794    mixed_content_issue_details: Option<MixedContentIssueDetails<'a>>,
2795    blocked_by_response_issue_details: Option<BlockedByResponseIssueDetails<'a>>,
2796    heavy_ad_issue_details: Option<HeavyAdIssueDetails<'a>>,
2797    content_security_policy_issue_details: Option<ContentSecurityPolicyIssueDetails<'a>>,
2798    shared_array_buffer_issue_details: Option<SharedArrayBufferIssueDetails<'a>>,
2799    cors_issue_details: Option<CorsIssueDetails<'a>>,
2800    attribution_reporting_issue_details: Option<AttributionReportingIssueDetails<'a>>,
2801    quirks_mode_issue_details: Option<QuirksModeIssueDetails<'a>>,
2802    partitioning_blob_url_issue_details: Option<PartitioningBlobURLIssueDetails<'a>>,
2803    navigator_user_agent_issue_details: Option<NavigatorUserAgentIssueDetails<'a>>,
2804    generic_issue_details: Option<GenericIssueDetails<'a>>,
2805    deprecation_issue_details: Option<DeprecationIssueDetails<'a>>,
2806    client_hint_issue_details: Option<ClientHintIssueDetails<'a>>,
2807    federated_auth_request_issue_details: Option<FederatedAuthRequestIssueDetails>,
2808    bounce_tracking_issue_details: Option<BounceTrackingIssueDetails<'a>>,
2809    cookie_deprecation_metadata_issue_details: Option<CookieDeprecationMetadataIssueDetails<'a>>,
2810    stylesheet_loading_issue_details: Option<StylesheetLoadingIssueDetails<'a>>,
2811    property_rule_issue_details: Option<PropertyRuleIssueDetails<'a>>,
2812    federated_auth_user_info_request_issue_details: Option<FederatedAuthUserInfoRequestIssueDetails>,
2813    shared_dictionary_issue_details: Option<SharedDictionaryIssueDetails<'a>>,
2814    element_accessibility_issue_details: Option<ElementAccessibilityIssueDetails>,
2815    sri_message_signature_issue_details: Option<SRIMessageSignatureIssueDetails<'a>>,
2816    unencoded_digest_issue_details: Option<UnencodedDigestIssueDetails<'a>>,
2817    connection_allowlist_issue_details: Option<ConnectionAllowlistIssueDetails<'a>>,
2818    user_reidentification_issue_details: Option<UserReidentificationIssueDetails<'a>>,
2819    permission_element_issue_details: Option<PermissionElementIssueDetails<'a>>,
2820    performance_issue_details: Option<PerformanceIssueDetails<'a>>,
2821    selective_permissions_intervention_issue_details: Option<SelectivePermissionsInterventionIssueDetails<'a>>,
2822}
2823
2824impl<'a> InspectorIssueDetailsBuilder<'a> {
2825    pub fn cookie_issue_details(mut self, cookie_issue_details: CookieIssueDetails<'a>) -> Self { self.cookie_issue_details = Some(cookie_issue_details); self }
2826    pub fn mixed_content_issue_details(mut self, mixed_content_issue_details: MixedContentIssueDetails<'a>) -> Self { self.mixed_content_issue_details = Some(mixed_content_issue_details); self }
2827    pub fn blocked_by_response_issue_details(mut self, blocked_by_response_issue_details: BlockedByResponseIssueDetails<'a>) -> Self { self.blocked_by_response_issue_details = Some(blocked_by_response_issue_details); self }
2828    pub fn heavy_ad_issue_details(mut self, heavy_ad_issue_details: HeavyAdIssueDetails<'a>) -> Self { self.heavy_ad_issue_details = Some(heavy_ad_issue_details); self }
2829    pub fn content_security_policy_issue_details(mut self, content_security_policy_issue_details: ContentSecurityPolicyIssueDetails<'a>) -> Self { self.content_security_policy_issue_details = Some(content_security_policy_issue_details); self }
2830    pub fn shared_array_buffer_issue_details(mut self, shared_array_buffer_issue_details: SharedArrayBufferIssueDetails<'a>) -> Self { self.shared_array_buffer_issue_details = Some(shared_array_buffer_issue_details); self }
2831    pub fn cors_issue_details(mut self, cors_issue_details: CorsIssueDetails<'a>) -> Self { self.cors_issue_details = Some(cors_issue_details); self }
2832    pub fn attribution_reporting_issue_details(mut self, attribution_reporting_issue_details: AttributionReportingIssueDetails<'a>) -> Self { self.attribution_reporting_issue_details = Some(attribution_reporting_issue_details); self }
2833    pub fn quirks_mode_issue_details(mut self, quirks_mode_issue_details: QuirksModeIssueDetails<'a>) -> Self { self.quirks_mode_issue_details = Some(quirks_mode_issue_details); self }
2834    pub fn partitioning_blob_url_issue_details(mut self, partitioning_blob_url_issue_details: PartitioningBlobURLIssueDetails<'a>) -> Self { self.partitioning_blob_url_issue_details = Some(partitioning_blob_url_issue_details); self }
2835    pub fn navigator_user_agent_issue_details(mut self, navigator_user_agent_issue_details: NavigatorUserAgentIssueDetails<'a>) -> Self { self.navigator_user_agent_issue_details = Some(navigator_user_agent_issue_details); self }
2836    pub fn generic_issue_details(mut self, generic_issue_details: GenericIssueDetails<'a>) -> Self { self.generic_issue_details = Some(generic_issue_details); self }
2837    pub fn deprecation_issue_details(mut self, deprecation_issue_details: DeprecationIssueDetails<'a>) -> Self { self.deprecation_issue_details = Some(deprecation_issue_details); self }
2838    pub fn client_hint_issue_details(mut self, client_hint_issue_details: ClientHintIssueDetails<'a>) -> Self { self.client_hint_issue_details = Some(client_hint_issue_details); self }
2839    pub fn federated_auth_request_issue_details(mut self, federated_auth_request_issue_details: FederatedAuthRequestIssueDetails) -> Self { self.federated_auth_request_issue_details = Some(federated_auth_request_issue_details); self }
2840    pub fn bounce_tracking_issue_details(mut self, bounce_tracking_issue_details: BounceTrackingIssueDetails<'a>) -> Self { self.bounce_tracking_issue_details = Some(bounce_tracking_issue_details); self }
2841    pub fn cookie_deprecation_metadata_issue_details(mut self, cookie_deprecation_metadata_issue_details: CookieDeprecationMetadataIssueDetails<'a>) -> Self { self.cookie_deprecation_metadata_issue_details = Some(cookie_deprecation_metadata_issue_details); self }
2842    pub fn stylesheet_loading_issue_details(mut self, stylesheet_loading_issue_details: StylesheetLoadingIssueDetails<'a>) -> Self { self.stylesheet_loading_issue_details = Some(stylesheet_loading_issue_details); self }
2843    pub fn property_rule_issue_details(mut self, property_rule_issue_details: PropertyRuleIssueDetails<'a>) -> Self { self.property_rule_issue_details = Some(property_rule_issue_details); self }
2844    pub fn federated_auth_user_info_request_issue_details(mut self, federated_auth_user_info_request_issue_details: FederatedAuthUserInfoRequestIssueDetails) -> Self { self.federated_auth_user_info_request_issue_details = Some(federated_auth_user_info_request_issue_details); self }
2845    pub fn shared_dictionary_issue_details(mut self, shared_dictionary_issue_details: SharedDictionaryIssueDetails<'a>) -> Self { self.shared_dictionary_issue_details = Some(shared_dictionary_issue_details); self }
2846    pub fn element_accessibility_issue_details(mut self, element_accessibility_issue_details: ElementAccessibilityIssueDetails) -> Self { self.element_accessibility_issue_details = Some(element_accessibility_issue_details); self }
2847    pub fn sri_message_signature_issue_details(mut self, sri_message_signature_issue_details: SRIMessageSignatureIssueDetails<'a>) -> Self { self.sri_message_signature_issue_details = Some(sri_message_signature_issue_details); self }
2848    pub fn unencoded_digest_issue_details(mut self, unencoded_digest_issue_details: UnencodedDigestIssueDetails<'a>) -> Self { self.unencoded_digest_issue_details = Some(unencoded_digest_issue_details); self }
2849    pub fn connection_allowlist_issue_details(mut self, connection_allowlist_issue_details: ConnectionAllowlistIssueDetails<'a>) -> Self { self.connection_allowlist_issue_details = Some(connection_allowlist_issue_details); self }
2850    pub fn user_reidentification_issue_details(mut self, user_reidentification_issue_details: UserReidentificationIssueDetails<'a>) -> Self { self.user_reidentification_issue_details = Some(user_reidentification_issue_details); self }
2851    pub fn permission_element_issue_details(mut self, permission_element_issue_details: PermissionElementIssueDetails<'a>) -> Self { self.permission_element_issue_details = Some(permission_element_issue_details); self }
2852    pub fn performance_issue_details(mut self, performance_issue_details: PerformanceIssueDetails<'a>) -> Self { self.performance_issue_details = Some(performance_issue_details); self }
2853    pub fn selective_permissions_intervention_issue_details(mut self, selective_permissions_intervention_issue_details: SelectivePermissionsInterventionIssueDetails<'a>) -> Self { self.selective_permissions_intervention_issue_details = Some(selective_permissions_intervention_issue_details); self }
2854    pub fn build(self) -> InspectorIssueDetails<'a> {
2855        InspectorIssueDetails {
2856            cookie_issue_details: self.cookie_issue_details,
2857            mixed_content_issue_details: self.mixed_content_issue_details,
2858            blocked_by_response_issue_details: self.blocked_by_response_issue_details,
2859            heavy_ad_issue_details: self.heavy_ad_issue_details,
2860            content_security_policy_issue_details: self.content_security_policy_issue_details,
2861            shared_array_buffer_issue_details: self.shared_array_buffer_issue_details,
2862            cors_issue_details: self.cors_issue_details,
2863            attribution_reporting_issue_details: self.attribution_reporting_issue_details,
2864            quirks_mode_issue_details: self.quirks_mode_issue_details,
2865            partitioning_blob_url_issue_details: self.partitioning_blob_url_issue_details,
2866            navigator_user_agent_issue_details: self.navigator_user_agent_issue_details,
2867            generic_issue_details: self.generic_issue_details,
2868            deprecation_issue_details: self.deprecation_issue_details,
2869            client_hint_issue_details: self.client_hint_issue_details,
2870            federated_auth_request_issue_details: self.federated_auth_request_issue_details,
2871            bounce_tracking_issue_details: self.bounce_tracking_issue_details,
2872            cookie_deprecation_metadata_issue_details: self.cookie_deprecation_metadata_issue_details,
2873            stylesheet_loading_issue_details: self.stylesheet_loading_issue_details,
2874            property_rule_issue_details: self.property_rule_issue_details,
2875            federated_auth_user_info_request_issue_details: self.federated_auth_user_info_request_issue_details,
2876            shared_dictionary_issue_details: self.shared_dictionary_issue_details,
2877            element_accessibility_issue_details: self.element_accessibility_issue_details,
2878            sri_message_signature_issue_details: self.sri_message_signature_issue_details,
2879            unencoded_digest_issue_details: self.unencoded_digest_issue_details,
2880            connection_allowlist_issue_details: self.connection_allowlist_issue_details,
2881            user_reidentification_issue_details: self.user_reidentification_issue_details,
2882            permission_element_issue_details: self.permission_element_issue_details,
2883            performance_issue_details: self.performance_issue_details,
2884            selective_permissions_intervention_issue_details: self.selective_permissions_intervention_issue_details,
2885        }
2886    }
2887}
2888
2889/// A unique id for a DevTools inspector issue. Allows other entities (e.g.
2890/// exceptions, CDP message, console messages, etc.) to reference an issue.
2891
2892pub type IssueId<'a> = Cow<'a, str>;
2893
2894/// An inspector issue reported from the back-end.
2895
2896#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2897#[serde(rename_all = "camelCase")]
2898pub struct InspectorIssue<'a> {
2899    code: InspectorIssueCode,
2900    details: InspectorIssueDetails<'a>,
2901    /// A unique id for this issue. May be omitted if no other entity (e.g.
2902    /// exception, CDP message, etc.) is referencing this issue.
2903    #[serde(skip_serializing_if = "Option::is_none", rename = "issueId")]
2904    issue_id: Option<IssueId<'a>>,
2905}
2906
2907impl<'a> InspectorIssue<'a> {
2908    /// Creates a builder for this type with the required parameters:
2909    /// * `code`: 
2910    /// * `details`: 
2911    pub fn builder(code: impl Into<InspectorIssueCode>, details: InspectorIssueDetails<'a>) -> InspectorIssueBuilder<'a> {
2912        InspectorIssueBuilder {
2913            code: code.into(),
2914            details: details,
2915            issue_id: None,
2916        }
2917    }
2918    pub fn code(&self) -> &InspectorIssueCode { &self.code }
2919    pub fn details(&self) -> &InspectorIssueDetails<'a> { &self.details }
2920    /// A unique id for this issue. May be omitted if no other entity (e.g.
2921    /// exception, CDP message, etc.) is referencing this issue.
2922    pub fn issue_id(&self) -> Option<&IssueId<'a>> { self.issue_id.as_ref() }
2923}
2924
2925
2926pub struct InspectorIssueBuilder<'a> {
2927    code: InspectorIssueCode,
2928    details: InspectorIssueDetails<'a>,
2929    issue_id: Option<IssueId<'a>>,
2930}
2931
2932impl<'a> InspectorIssueBuilder<'a> {
2933    /// A unique id for this issue. May be omitted if no other entity (e.g.
2934    /// exception, CDP message, etc.) is referencing this issue.
2935    pub fn issue_id(mut self, issue_id: impl Into<IssueId<'a>>) -> Self { self.issue_id = Some(issue_id.into()); self }
2936    pub fn build(self) -> InspectorIssue<'a> {
2937        InspectorIssue {
2938            code: self.code,
2939            details: self.details,
2940            issue_id: self.issue_id,
2941        }
2942    }
2943}
2944
2945/// Returns the response body and size if it were re-encoded with the specified settings. Only
2946/// applies to images.
2947
2948#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2949#[serde(rename_all = "camelCase")]
2950pub struct GetEncodedResponseParams<'a> {
2951    /// Identifier of the network request to get content for.
2952    #[serde(rename = "requestId")]
2953    request_id: crate::network::RequestId<'a>,
2954    /// The encoding to use.
2955    encoding: Cow<'a, str>,
2956    /// The quality of the encoding (0-1). (defaults to 1)
2957    #[serde(skip_serializing_if = "Option::is_none")]
2958    quality: Option<f64>,
2959    /// Whether to only return the size information (defaults to false).
2960    #[serde(skip_serializing_if = "Option::is_none", rename = "sizeOnly")]
2961    size_only: Option<bool>,
2962}
2963
2964impl<'a> GetEncodedResponseParams<'a> {
2965    /// Creates a builder for this type with the required parameters:
2966    /// * `request_id`: Identifier of the network request to get content for.
2967    /// * `encoding`: The encoding to use.
2968    pub fn builder(request_id: crate::network::RequestId<'a>, encoding: impl Into<Cow<'a, str>>) -> GetEncodedResponseParamsBuilder<'a> {
2969        GetEncodedResponseParamsBuilder {
2970            request_id: request_id,
2971            encoding: encoding.into(),
2972            quality: None,
2973            size_only: None,
2974        }
2975    }
2976    /// Identifier of the network request to get content for.
2977    pub fn request_id(&self) -> &crate::network::RequestId<'a> { &self.request_id }
2978    /// The encoding to use.
2979    pub fn encoding(&self) -> &str { self.encoding.as_ref() }
2980    /// The quality of the encoding (0-1). (defaults to 1)
2981    pub fn quality(&self) -> Option<f64> { self.quality }
2982    /// Whether to only return the size information (defaults to false).
2983    pub fn size_only(&self) -> Option<bool> { self.size_only }
2984}
2985
2986
2987pub struct GetEncodedResponseParamsBuilder<'a> {
2988    request_id: crate::network::RequestId<'a>,
2989    encoding: Cow<'a, str>,
2990    quality: Option<f64>,
2991    size_only: Option<bool>,
2992}
2993
2994impl<'a> GetEncodedResponseParamsBuilder<'a> {
2995    /// The quality of the encoding (0-1). (defaults to 1)
2996    pub fn quality(mut self, quality: f64) -> Self { self.quality = Some(quality); self }
2997    /// Whether to only return the size information (defaults to false).
2998    pub fn size_only(mut self, size_only: bool) -> Self { self.size_only = Some(size_only); self }
2999    pub fn build(self) -> GetEncodedResponseParams<'a> {
3000        GetEncodedResponseParams {
3001            request_id: self.request_id,
3002            encoding: self.encoding,
3003            quality: self.quality,
3004            size_only: self.size_only,
3005        }
3006    }
3007}
3008
3009/// Returns the response body and size if it were re-encoded with the specified settings. Only
3010/// applies to images.
3011
3012#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3013#[serde(rename_all = "camelCase")]
3014pub struct GetEncodedResponseReturns<'a> {
3015    /// The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON)
3016    #[serde(skip_serializing_if = "Option::is_none")]
3017    body: Option<Cow<'a, str>>,
3018    /// Size before re-encoding.
3019    #[serde(rename = "originalSize")]
3020    original_size: u64,
3021    /// Size after re-encoding.
3022    #[serde(rename = "encodedSize")]
3023    encoded_size: u64,
3024}
3025
3026impl<'a> GetEncodedResponseReturns<'a> {
3027    /// Creates a builder for this type with the required parameters:
3028    /// * `original_size`: Size before re-encoding.
3029    /// * `encoded_size`: Size after re-encoding.
3030    pub fn builder(original_size: u64, encoded_size: u64) -> GetEncodedResponseReturnsBuilder<'a> {
3031        GetEncodedResponseReturnsBuilder {
3032            body: None,
3033            original_size: original_size,
3034            encoded_size: encoded_size,
3035        }
3036    }
3037    /// The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON)
3038    pub fn body(&self) -> Option<&str> { self.body.as_deref() }
3039    /// Size before re-encoding.
3040    pub fn original_size(&self) -> u64 { self.original_size }
3041    /// Size after re-encoding.
3042    pub fn encoded_size(&self) -> u64 { self.encoded_size }
3043}
3044
3045
3046pub struct GetEncodedResponseReturnsBuilder<'a> {
3047    body: Option<Cow<'a, str>>,
3048    original_size: u64,
3049    encoded_size: u64,
3050}
3051
3052impl<'a> GetEncodedResponseReturnsBuilder<'a> {
3053    /// The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON)
3054    pub fn body(mut self, body: impl Into<Cow<'a, str>>) -> Self { self.body = Some(body.into()); self }
3055    pub fn build(self) -> GetEncodedResponseReturns<'a> {
3056        GetEncodedResponseReturns {
3057            body: self.body,
3058            original_size: self.original_size,
3059            encoded_size: self.encoded_size,
3060        }
3061    }
3062}
3063
3064impl<'a> GetEncodedResponseParams<'a> { pub const METHOD: &'static str = "Audits.getEncodedResponse"; }
3065
3066impl<'a> crate::CdpCommand<'a> for GetEncodedResponseParams<'a> {
3067    const METHOD: &'static str = "Audits.getEncodedResponse";
3068    type Response = GetEncodedResponseReturns<'a>;
3069}
3070
3071#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3072pub struct DisableParams {}
3073
3074impl DisableParams { pub const METHOD: &'static str = "Audits.disable"; }
3075
3076impl<'a> crate::CdpCommand<'a> for DisableParams {
3077    const METHOD: &'static str = "Audits.disable";
3078    type Response = crate::EmptyReturns;
3079}
3080
3081#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3082pub struct EnableParams {}
3083
3084impl EnableParams { pub const METHOD: &'static str = "Audits.enable"; }
3085
3086impl<'a> crate::CdpCommand<'a> for EnableParams {
3087    const METHOD: &'static str = "Audits.enable";
3088    type Response = crate::EmptyReturns;
3089}
3090
3091/// Runs the form issues check for the target page. Found issues are reported
3092/// using Audits.issueAdded event.
3093
3094#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3095#[serde(rename_all = "camelCase")]
3096pub struct CheckFormsIssuesReturns<'a> {
3097    #[serde(rename = "formIssues")]
3098    form_issues: Vec<GenericIssueDetails<'a>>,
3099}
3100
3101impl<'a> CheckFormsIssuesReturns<'a> {
3102    /// Creates a builder for this type with the required parameters:
3103    /// * `form_issues`: 
3104    pub fn builder(form_issues: Vec<GenericIssueDetails<'a>>) -> CheckFormsIssuesReturnsBuilder<'a> {
3105        CheckFormsIssuesReturnsBuilder {
3106            form_issues: form_issues,
3107        }
3108    }
3109    pub fn form_issues(&self) -> &[GenericIssueDetails<'a>] { &self.form_issues }
3110}
3111
3112
3113pub struct CheckFormsIssuesReturnsBuilder<'a> {
3114    form_issues: Vec<GenericIssueDetails<'a>>,
3115}
3116
3117impl<'a> CheckFormsIssuesReturnsBuilder<'a> {
3118    pub fn build(self) -> CheckFormsIssuesReturns<'a> {
3119        CheckFormsIssuesReturns {
3120            form_issues: self.form_issues,
3121        }
3122    }
3123}
3124
3125#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3126pub struct CheckFormsIssuesParams {}
3127
3128impl CheckFormsIssuesParams { pub const METHOD: &'static str = "Audits.checkFormsIssues"; }
3129
3130impl<'a> crate::CdpCommand<'a> for CheckFormsIssuesParams {
3131    const METHOD: &'static str = "Audits.checkFormsIssues";
3132    type Response = CheckFormsIssuesReturns<'a>;
3133}