package audits

// Code generated by cdproto-gen. DO NOT EDIT.

import (
	"fmt"
	"strings"

	"github.com/chromedp/cdproto/cdp"
	"github.com/chromedp/cdproto/network"
	"github.com/chromedp/cdproto/runtime"
)

// AffectedCookie information about a cookie that is affected by an inspector
// issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-AffectedCookie
type AffectedCookie struct {
	Name   string `json:"name"` // The following three properties uniquely identify a cookie
	Path   string `json:"path"`
	Domain string `json:"domain"`
}

// AffectedRequest information about a request that is affected by an
// inspector issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-AffectedRequest
type AffectedRequest struct {
	RequestID network.RequestID `json:"requestId,omitempty,omitzero"` // The unique request id.
	URL       string            `json:"url"`
}

// AffectedFrame information about the frame affected by an inspector issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-AffectedFrame
type AffectedFrame struct {
	FrameID cdp.FrameID `json:"frameId"`
}

// CookieExclusionReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieExclusionReason
type CookieExclusionReason string

// String returns the CookieExclusionReason as string value.
func (t CookieExclusionReason) String() string {
	return string(t)
}

// CookieExclusionReason values.
const (
	CookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax        CookieExclusionReason = "ExcludeSameSiteUnspecifiedTreatedAsLax"
	CookieExclusionReasonExcludeSameSiteNoneInsecure                   CookieExclusionReason = "ExcludeSameSiteNoneInsecure"
	CookieExclusionReasonExcludeSameSiteLax                            CookieExclusionReason = "ExcludeSameSiteLax"
	CookieExclusionReasonExcludeSameSiteStrict                         CookieExclusionReason = "ExcludeSameSiteStrict"
	CookieExclusionReasonExcludeDomainNonASCII                         CookieExclusionReason = "ExcludeDomainNonASCII"
	CookieExclusionReasonExcludeThirdPartyCookieBlockedInFirstPartySet CookieExclusionReason = "ExcludeThirdPartyCookieBlockedInFirstPartySet"
	CookieExclusionReasonExcludeThirdPartyPhaseout                     CookieExclusionReason = "ExcludeThirdPartyPhaseout"
	CookieExclusionReasonExcludePortMismatch                           CookieExclusionReason = "ExcludePortMismatch"
	CookieExclusionReasonExcludeSchemeMismatch                         CookieExclusionReason = "ExcludeSchemeMismatch"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *CookieExclusionReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch CookieExclusionReason(s) {
	case CookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax:
		*t = CookieExclusionReasonExcludeSameSiteUnspecifiedTreatedAsLax
	case CookieExclusionReasonExcludeSameSiteNoneInsecure:
		*t = CookieExclusionReasonExcludeSameSiteNoneInsecure
	case CookieExclusionReasonExcludeSameSiteLax:
		*t = CookieExclusionReasonExcludeSameSiteLax
	case CookieExclusionReasonExcludeSameSiteStrict:
		*t = CookieExclusionReasonExcludeSameSiteStrict
	case CookieExclusionReasonExcludeDomainNonASCII:
		*t = CookieExclusionReasonExcludeDomainNonASCII
	case CookieExclusionReasonExcludeThirdPartyCookieBlockedInFirstPartySet:
		*t = CookieExclusionReasonExcludeThirdPartyCookieBlockedInFirstPartySet
	case CookieExclusionReasonExcludeThirdPartyPhaseout:
		*t = CookieExclusionReasonExcludeThirdPartyPhaseout
	case CookieExclusionReasonExcludePortMismatch:
		*t = CookieExclusionReasonExcludePortMismatch
	case CookieExclusionReasonExcludeSchemeMismatch:
		*t = CookieExclusionReasonExcludeSchemeMismatch
	default:
		return fmt.Errorf("unknown CookieExclusionReason value: %v", s)
	}
	return nil
}

// CookieWarningReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieWarningReason
type CookieWarningReason string

// String returns the CookieWarningReason as string value.
func (t CookieWarningReason) String() string {
	return string(t)
}

// CookieWarningReason values.
const (
	CookieWarningReasonWarnSameSiteUnspecifiedCrossSiteContext        CookieWarningReason = "WarnSameSiteUnspecifiedCrossSiteContext"
	CookieWarningReasonWarnSameSiteNoneInsecure                       CookieWarningReason = "WarnSameSiteNoneInsecure"
	CookieWarningReasonWarnSameSiteUnspecifiedLaxAllowUnsafe          CookieWarningReason = "WarnSameSiteUnspecifiedLaxAllowUnsafe"
	CookieWarningReasonWarnSameSiteStrictLaxDowngradeStrict           CookieWarningReason = "WarnSameSiteStrictLaxDowngradeStrict"
	CookieWarningReasonWarnSameSiteStrictCrossDowngradeStrict         CookieWarningReason = "WarnSameSiteStrictCrossDowngradeStrict"
	CookieWarningReasonWarnSameSiteStrictCrossDowngradeLax            CookieWarningReason = "WarnSameSiteStrictCrossDowngradeLax"
	CookieWarningReasonWarnSameSiteLaxCrossDowngradeStrict            CookieWarningReason = "WarnSameSiteLaxCrossDowngradeStrict"
	CookieWarningReasonWarnSameSiteLaxCrossDowngradeLax               CookieWarningReason = "WarnSameSiteLaxCrossDowngradeLax"
	CookieWarningReasonWarnAttributeValueExceedsMaxSize               CookieWarningReason = "WarnAttributeValueExceedsMaxSize"
	CookieWarningReasonWarnDomainNonASCII                             CookieWarningReason = "WarnDomainNonASCII"
	CookieWarningReasonWarnThirdPartyPhaseout                         CookieWarningReason = "WarnThirdPartyPhaseout"
	CookieWarningReasonWarnCrossSiteRedirectDowngradeChangesInclusion CookieWarningReason = "WarnCrossSiteRedirectDowngradeChangesInclusion"
	CookieWarningReasonWarnDeprecationTrialMetadata                   CookieWarningReason = "WarnDeprecationTrialMetadata"
	CookieWarningReasonWarnThirdPartyCookieHeuristic                  CookieWarningReason = "WarnThirdPartyCookieHeuristic"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *CookieWarningReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch CookieWarningReason(s) {
	case CookieWarningReasonWarnSameSiteUnspecifiedCrossSiteContext:
		*t = CookieWarningReasonWarnSameSiteUnspecifiedCrossSiteContext
	case CookieWarningReasonWarnSameSiteNoneInsecure:
		*t = CookieWarningReasonWarnSameSiteNoneInsecure
	case CookieWarningReasonWarnSameSiteUnspecifiedLaxAllowUnsafe:
		*t = CookieWarningReasonWarnSameSiteUnspecifiedLaxAllowUnsafe
	case CookieWarningReasonWarnSameSiteStrictLaxDowngradeStrict:
		*t = CookieWarningReasonWarnSameSiteStrictLaxDowngradeStrict
	case CookieWarningReasonWarnSameSiteStrictCrossDowngradeStrict:
		*t = CookieWarningReasonWarnSameSiteStrictCrossDowngradeStrict
	case CookieWarningReasonWarnSameSiteStrictCrossDowngradeLax:
		*t = CookieWarningReasonWarnSameSiteStrictCrossDowngradeLax
	case CookieWarningReasonWarnSameSiteLaxCrossDowngradeStrict:
		*t = CookieWarningReasonWarnSameSiteLaxCrossDowngradeStrict
	case CookieWarningReasonWarnSameSiteLaxCrossDowngradeLax:
		*t = CookieWarningReasonWarnSameSiteLaxCrossDowngradeLax
	case CookieWarningReasonWarnAttributeValueExceedsMaxSize:
		*t = CookieWarningReasonWarnAttributeValueExceedsMaxSize
	case CookieWarningReasonWarnDomainNonASCII:
		*t = CookieWarningReasonWarnDomainNonASCII
	case CookieWarningReasonWarnThirdPartyPhaseout:
		*t = CookieWarningReasonWarnThirdPartyPhaseout
	case CookieWarningReasonWarnCrossSiteRedirectDowngradeChangesInclusion:
		*t = CookieWarningReasonWarnCrossSiteRedirectDowngradeChangesInclusion
	case CookieWarningReasonWarnDeprecationTrialMetadata:
		*t = CookieWarningReasonWarnDeprecationTrialMetadata
	case CookieWarningReasonWarnThirdPartyCookieHeuristic:
		*t = CookieWarningReasonWarnThirdPartyCookieHeuristic
	default:
		return fmt.Errorf("unknown CookieWarningReason value: %v", s)
	}
	return nil
}

// CookieOperation [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieOperation
type CookieOperation string

// String returns the CookieOperation as string value.
func (t CookieOperation) String() string {
	return string(t)
}

// CookieOperation values.
const (
	CookieOperationSetCookie  CookieOperation = "SetCookie"
	CookieOperationReadCookie CookieOperation = "ReadCookie"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *CookieOperation) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch CookieOperation(s) {
	case CookieOperationSetCookie:
		*t = CookieOperationSetCookie
	case CookieOperationReadCookie:
		*t = CookieOperationReadCookie
	default:
		return fmt.Errorf("unknown CookieOperation value: %v", s)
	}
	return nil
}

// InsightType represents the category of insight that a cookie issue falls
// under.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-InsightType
type InsightType string

// String returns the InsightType as string value.
func (t InsightType) String() string {
	return string(t)
}

// InsightType values.
const (
	InsightTypeGitHubResource InsightType = "GitHubResource"
	InsightTypeGracePeriod    InsightType = "GracePeriod"
	InsightTypeHeuristics     InsightType = "Heuristics"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *InsightType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch InsightType(s) {
	case InsightTypeGitHubResource:
		*t = InsightTypeGitHubResource
	case InsightTypeGracePeriod:
		*t = InsightTypeGracePeriod
	case InsightTypeHeuristics:
		*t = InsightTypeHeuristics
	default:
		return fmt.Errorf("unknown InsightType value: %v", s)
	}
	return nil
}

// CookieIssueInsight information about the suggested solution to a cookie
// issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieIssueInsight
type CookieIssueInsight struct {
	Type          InsightType `json:"type"`
	TableEntryURL string      `json:"tableEntryUrl,omitempty,omitzero"` // Link to table entry in third-party cookie migration readiness list.
}

// CookieIssueDetails this information is currently necessary, as the
// front-end has a difficult time finding a specific cookie. With this, we can
// convey specific error information without the cookie.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieIssueDetails
type CookieIssueDetails struct {
	Cookie                 *AffectedCookie         `json:"cookie,omitempty,omitzero"` // If AffectedCookie is not set then rawCookieLine contains the raw Set-Cookie header string. This hints at a problem where the cookie line is syntactically or semantically malformed in a way that no valid cookie could be created.
	RawCookieLine          string                  `json:"rawCookieLine,omitempty,omitzero"`
	CookieWarningReasons   []CookieWarningReason   `json:"cookieWarningReasons"`
	CookieExclusionReasons []CookieExclusionReason `json:"cookieExclusionReasons"`
	Operation              CookieOperation         `json:"operation"` // Optionally identifies the site-for-cookies and the cookie url, which may be used by the front-end as additional context.
	SiteForCookies         string                  `json:"siteForCookies,omitempty,omitzero"`
	CookieURL              string                  `json:"cookieUrl,omitempty,omitzero"`
	Request                *AffectedRequest        `json:"request,omitempty,omitzero"`
	Insight                *CookieIssueInsight     `json:"insight,omitempty,omitzero"` // The recommended solution to the issue.
}

// PerformanceIssueType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PerformanceIssueType
type PerformanceIssueType string

// String returns the PerformanceIssueType as string value.
func (t PerformanceIssueType) String() string {
	return string(t)
}

// PerformanceIssueType values.
const (
	PerformanceIssueTypeDocumentCookie PerformanceIssueType = "DocumentCookie"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *PerformanceIssueType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch PerformanceIssueType(s) {
	case PerformanceIssueTypeDocumentCookie:
		*t = PerformanceIssueTypeDocumentCookie
	default:
		return fmt.Errorf("unknown PerformanceIssueType value: %v", s)
	}
	return nil
}

// PerformanceIssueDetails details for a performance issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PerformanceIssueDetails
type PerformanceIssueDetails struct {
	PerformanceIssueType PerformanceIssueType `json:"performanceIssueType"`
	SourceCodeLocation   *SourceCodeLocation  `json:"sourceCodeLocation,omitempty,omitzero"`
}

// MixedContentResolutionStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-MixedContentResolutionStatus
type MixedContentResolutionStatus string

// String returns the MixedContentResolutionStatus as string value.
func (t MixedContentResolutionStatus) String() string {
	return string(t)
}

// MixedContentResolutionStatus values.
const (
	MixedContentResolutionStatusMixedContentBlocked               MixedContentResolutionStatus = "MixedContentBlocked"
	MixedContentResolutionStatusMixedContentAutomaticallyUpgraded MixedContentResolutionStatus = "MixedContentAutomaticallyUpgraded"
	MixedContentResolutionStatusMixedContentWarning               MixedContentResolutionStatus = "MixedContentWarning"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *MixedContentResolutionStatus) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch MixedContentResolutionStatus(s) {
	case MixedContentResolutionStatusMixedContentBlocked:
		*t = MixedContentResolutionStatusMixedContentBlocked
	case MixedContentResolutionStatusMixedContentAutomaticallyUpgraded:
		*t = MixedContentResolutionStatusMixedContentAutomaticallyUpgraded
	case MixedContentResolutionStatusMixedContentWarning:
		*t = MixedContentResolutionStatusMixedContentWarning
	default:
		return fmt.Errorf("unknown MixedContentResolutionStatus value: %v", s)
	}
	return nil
}

// MixedContentResourceType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-MixedContentResourceType
type MixedContentResourceType string

// String returns the MixedContentResourceType as string value.
func (t MixedContentResourceType) String() string {
	return string(t)
}

// MixedContentResourceType values.
const (
	MixedContentResourceTypeAudio            MixedContentResourceType = "Audio"
	MixedContentResourceTypeBeacon           MixedContentResourceType = "Beacon"
	MixedContentResourceTypeCSPReport        MixedContentResourceType = "CSPReport"
	MixedContentResourceTypeDownload         MixedContentResourceType = "Download"
	MixedContentResourceTypeEventSource      MixedContentResourceType = "EventSource"
	MixedContentResourceTypeFavicon          MixedContentResourceType = "Favicon"
	MixedContentResourceTypeFont             MixedContentResourceType = "Font"
	MixedContentResourceTypeForm             MixedContentResourceType = "Form"
	MixedContentResourceTypeFrame            MixedContentResourceType = "Frame"
	MixedContentResourceTypeImage            MixedContentResourceType = "Image"
	MixedContentResourceTypeImport           MixedContentResourceType = "Import"
	MixedContentResourceTypeJSON             MixedContentResourceType = "JSON"
	MixedContentResourceTypeManifest         MixedContentResourceType = "Manifest"
	MixedContentResourceTypePing             MixedContentResourceType = "Ping"
	MixedContentResourceTypePluginData       MixedContentResourceType = "PluginData"
	MixedContentResourceTypePluginResource   MixedContentResourceType = "PluginResource"
	MixedContentResourceTypePrefetch         MixedContentResourceType = "Prefetch"
	MixedContentResourceTypeResource         MixedContentResourceType = "Resource"
	MixedContentResourceTypeScript           MixedContentResourceType = "Script"
	MixedContentResourceTypeServiceWorker    MixedContentResourceType = "ServiceWorker"
	MixedContentResourceTypeSharedWorker     MixedContentResourceType = "SharedWorker"
	MixedContentResourceTypeSpeculationRules MixedContentResourceType = "SpeculationRules"
	MixedContentResourceTypeStylesheet       MixedContentResourceType = "Stylesheet"
	MixedContentResourceTypeTrack            MixedContentResourceType = "Track"
	MixedContentResourceTypeVideo            MixedContentResourceType = "Video"
	MixedContentResourceTypeWorker           MixedContentResourceType = "Worker"
	MixedContentResourceTypeXMLHTTPRequest   MixedContentResourceType = "XMLHttpRequest"
	MixedContentResourceTypeXSLT             MixedContentResourceType = "XSLT"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *MixedContentResourceType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch MixedContentResourceType(s) {
	case MixedContentResourceTypeAudio:
		*t = MixedContentResourceTypeAudio
	case MixedContentResourceTypeBeacon:
		*t = MixedContentResourceTypeBeacon
	case MixedContentResourceTypeCSPReport:
		*t = MixedContentResourceTypeCSPReport
	case MixedContentResourceTypeDownload:
		*t = MixedContentResourceTypeDownload
	case MixedContentResourceTypeEventSource:
		*t = MixedContentResourceTypeEventSource
	case MixedContentResourceTypeFavicon:
		*t = MixedContentResourceTypeFavicon
	case MixedContentResourceTypeFont:
		*t = MixedContentResourceTypeFont
	case MixedContentResourceTypeForm:
		*t = MixedContentResourceTypeForm
	case MixedContentResourceTypeFrame:
		*t = MixedContentResourceTypeFrame
	case MixedContentResourceTypeImage:
		*t = MixedContentResourceTypeImage
	case MixedContentResourceTypeImport:
		*t = MixedContentResourceTypeImport
	case MixedContentResourceTypeJSON:
		*t = MixedContentResourceTypeJSON
	case MixedContentResourceTypeManifest:
		*t = MixedContentResourceTypeManifest
	case MixedContentResourceTypePing:
		*t = MixedContentResourceTypePing
	case MixedContentResourceTypePluginData:
		*t = MixedContentResourceTypePluginData
	case MixedContentResourceTypePluginResource:
		*t = MixedContentResourceTypePluginResource
	case MixedContentResourceTypePrefetch:
		*t = MixedContentResourceTypePrefetch
	case MixedContentResourceTypeResource:
		*t = MixedContentResourceTypeResource
	case MixedContentResourceTypeScript:
		*t = MixedContentResourceTypeScript
	case MixedContentResourceTypeServiceWorker:
		*t = MixedContentResourceTypeServiceWorker
	case MixedContentResourceTypeSharedWorker:
		*t = MixedContentResourceTypeSharedWorker
	case MixedContentResourceTypeSpeculationRules:
		*t = MixedContentResourceTypeSpeculationRules
	case MixedContentResourceTypeStylesheet:
		*t = MixedContentResourceTypeStylesheet
	case MixedContentResourceTypeTrack:
		*t = MixedContentResourceTypeTrack
	case MixedContentResourceTypeVideo:
		*t = MixedContentResourceTypeVideo
	case MixedContentResourceTypeWorker:
		*t = MixedContentResourceTypeWorker
	case MixedContentResourceTypeXMLHTTPRequest:
		*t = MixedContentResourceTypeXMLHTTPRequest
	case MixedContentResourceTypeXSLT:
		*t = MixedContentResourceTypeXSLT
	default:
		return fmt.Errorf("unknown MixedContentResourceType value: %v", s)
	}
	return nil
}

// MixedContentIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-MixedContentIssueDetails
type MixedContentIssueDetails struct {
	ResourceType     MixedContentResourceType     `json:"resourceType,omitempty,omitzero"` // The type of resource causing the mixed content issue (css, js, iframe, form,...). Marked as optional because it is mapped to from blink::mojom::RequestContextType, which will be replaced by network::mojom::RequestDestination
	ResolutionStatus MixedContentResolutionStatus `json:"resolutionStatus"`                // The way the mixed content issue is being resolved.
	InsecureURL      string                       `json:"insecureURL"`                     // The unsafe http url causing the mixed content issue.
	MainResourceURL  string                       `json:"mainResourceURL"`                 // The url responsible for the call to an unsafe url.
	Request          *AffectedRequest             `json:"request,omitempty,omitzero"`      // The mixed content request. Does not always exist (e.g. for unsafe form submission urls).
	Frame            *AffectedFrame               `json:"frame,omitempty,omitzero"`        // Optional because not every mixed content issue is necessarily linked to a frame.
}

// BlockedByResponseReason enum indicating the reason a response has been
// blocked. These reasons are refinements of the net error BLOCKED_BY_RESPONSE.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-BlockedByResponseReason
type BlockedByResponseReason string

// String returns the BlockedByResponseReason as string value.
func (t BlockedByResponseReason) String() string {
	return string(t)
}

// BlockedByResponseReason values.
const (
	BlockedByResponseReasonCoepFrameResourceNeedsCoepHeader                        BlockedByResponseReason = "CoepFrameResourceNeedsCoepHeader"
	BlockedByResponseReasonCoopSandboxedIFrameCannotNavigateToCoopPage             BlockedByResponseReason = "CoopSandboxedIFrameCannotNavigateToCoopPage"
	BlockedByResponseReasonCorpNotSameOrigin                                       BlockedByResponseReason = "CorpNotSameOrigin"
	BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoep       BlockedByResponseReason = "CorpNotSameOriginAfterDefaultedToSameOriginByCoep"
	BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByDip        BlockedByResponseReason = "CorpNotSameOriginAfterDefaultedToSameOriginByDip"
	BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip BlockedByResponseReason = "CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip"
	BlockedByResponseReasonCorpNotSameSite                                         BlockedByResponseReason = "CorpNotSameSite"
	BlockedByResponseReasonSRIMessageSignatureMismatch                             BlockedByResponseReason = "SRIMessageSignatureMismatch"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *BlockedByResponseReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch BlockedByResponseReason(s) {
	case BlockedByResponseReasonCoepFrameResourceNeedsCoepHeader:
		*t = BlockedByResponseReasonCoepFrameResourceNeedsCoepHeader
	case BlockedByResponseReasonCoopSandboxedIFrameCannotNavigateToCoopPage:
		*t = BlockedByResponseReasonCoopSandboxedIFrameCannotNavigateToCoopPage
	case BlockedByResponseReasonCorpNotSameOrigin:
		*t = BlockedByResponseReasonCorpNotSameOrigin
	case BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoep:
		*t = BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoep
	case BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByDip:
		*t = BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByDip
	case BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip:
		*t = BlockedByResponseReasonCorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip
	case BlockedByResponseReasonCorpNotSameSite:
		*t = BlockedByResponseReasonCorpNotSameSite
	case BlockedByResponseReasonSRIMessageSignatureMismatch:
		*t = BlockedByResponseReasonSRIMessageSignatureMismatch
	default:
		return fmt.Errorf("unknown BlockedByResponseReason value: %v", s)
	}
	return nil
}

// BlockedByResponseIssueDetails details for a request that has been blocked
// with the BLOCKED_BY_RESPONSE code. Currently only used for COEP/COOP, but may
// be extended to include some CSP errors in the future.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-BlockedByResponseIssueDetails
type BlockedByResponseIssueDetails struct {
	Request      *AffectedRequest        `json:"request"`
	ParentFrame  *AffectedFrame          `json:"parentFrame,omitempty,omitzero"`
	BlockedFrame *AffectedFrame          `json:"blockedFrame,omitempty,omitzero"`
	Reason       BlockedByResponseReason `json:"reason"`
}

// HeavyAdResolutionStatus [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-HeavyAdResolutionStatus
type HeavyAdResolutionStatus string

// String returns the HeavyAdResolutionStatus as string value.
func (t HeavyAdResolutionStatus) String() string {
	return string(t)
}

// HeavyAdResolutionStatus values.
const (
	HeavyAdResolutionStatusHeavyAdBlocked HeavyAdResolutionStatus = "HeavyAdBlocked"
	HeavyAdResolutionStatusHeavyAdWarning HeavyAdResolutionStatus = "HeavyAdWarning"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *HeavyAdResolutionStatus) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch HeavyAdResolutionStatus(s) {
	case HeavyAdResolutionStatusHeavyAdBlocked:
		*t = HeavyAdResolutionStatusHeavyAdBlocked
	case HeavyAdResolutionStatusHeavyAdWarning:
		*t = HeavyAdResolutionStatusHeavyAdWarning
	default:
		return fmt.Errorf("unknown HeavyAdResolutionStatus value: %v", s)
	}
	return nil
}

// HeavyAdReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-HeavyAdReason
type HeavyAdReason string

// String returns the HeavyAdReason as string value.
func (t HeavyAdReason) String() string {
	return string(t)
}

// HeavyAdReason values.
const (
	HeavyAdReasonNetworkTotalLimit HeavyAdReason = "NetworkTotalLimit"
	HeavyAdReasonCPUTotalLimit     HeavyAdReason = "CpuTotalLimit"
	HeavyAdReasonCPUPeakLimit      HeavyAdReason = "CpuPeakLimit"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *HeavyAdReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch HeavyAdReason(s) {
	case HeavyAdReasonNetworkTotalLimit:
		*t = HeavyAdReasonNetworkTotalLimit
	case HeavyAdReasonCPUTotalLimit:
		*t = HeavyAdReasonCPUTotalLimit
	case HeavyAdReasonCPUPeakLimit:
		*t = HeavyAdReasonCPUPeakLimit
	default:
		return fmt.Errorf("unknown HeavyAdReason value: %v", s)
	}
	return nil
}

// HeavyAdIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-HeavyAdIssueDetails
type HeavyAdIssueDetails struct {
	Resolution HeavyAdResolutionStatus `json:"resolution"` // The resolution status, either blocking the content or warning.
	Reason     HeavyAdReason           `json:"reason"`     // The reason the ad was blocked, total network or cpu or peak cpu.
	Frame      *AffectedFrame          `json:"frame"`      // The frame that was blocked.
}

// ContentSecurityPolicyViolationType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ContentSecurityPolicyViolationType
type ContentSecurityPolicyViolationType string

// String returns the ContentSecurityPolicyViolationType as string value.
func (t ContentSecurityPolicyViolationType) String() string {
	return string(t)
}

// ContentSecurityPolicyViolationType values.
const (
	ContentSecurityPolicyViolationTypeKInlineViolation             ContentSecurityPolicyViolationType = "kInlineViolation"
	ContentSecurityPolicyViolationTypeKEvalViolation               ContentSecurityPolicyViolationType = "kEvalViolation"
	ContentSecurityPolicyViolationTypeKURLViolation                ContentSecurityPolicyViolationType = "kURLViolation"
	ContentSecurityPolicyViolationTypeKSRIViolation                ContentSecurityPolicyViolationType = "kSRIViolation"
	ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation   ContentSecurityPolicyViolationType = "kTrustedTypesSinkViolation"
	ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation ContentSecurityPolicyViolationType = "kTrustedTypesPolicyViolation"
	ContentSecurityPolicyViolationTypeKWasmEvalViolation           ContentSecurityPolicyViolationType = "kWasmEvalViolation"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *ContentSecurityPolicyViolationType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch ContentSecurityPolicyViolationType(s) {
	case ContentSecurityPolicyViolationTypeKInlineViolation:
		*t = ContentSecurityPolicyViolationTypeKInlineViolation
	case ContentSecurityPolicyViolationTypeKEvalViolation:
		*t = ContentSecurityPolicyViolationTypeKEvalViolation
	case ContentSecurityPolicyViolationTypeKURLViolation:
		*t = ContentSecurityPolicyViolationTypeKURLViolation
	case ContentSecurityPolicyViolationTypeKSRIViolation:
		*t = ContentSecurityPolicyViolationTypeKSRIViolation
	case ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation:
		*t = ContentSecurityPolicyViolationTypeKTrustedTypesSinkViolation
	case ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation:
		*t = ContentSecurityPolicyViolationTypeKTrustedTypesPolicyViolation
	case ContentSecurityPolicyViolationTypeKWasmEvalViolation:
		*t = ContentSecurityPolicyViolationTypeKWasmEvalViolation
	default:
		return fmt.Errorf("unknown ContentSecurityPolicyViolationType value: %v", s)
	}
	return nil
}

// SourceCodeLocation [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SourceCodeLocation
type SourceCodeLocation struct {
	ScriptID     cdp.ScriptID `json:"scriptId,omitempty,omitzero"`
	URL          string       `json:"url"`
	LineNumber   int64        `json:"lineNumber"`
	ColumnNumber int64        `json:"columnNumber"`
}

// ContentSecurityPolicyIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ContentSecurityPolicyIssueDetails
type ContentSecurityPolicyIssueDetails struct {
	BlockedURL                         string                             `json:"blockedURL,omitempty,omitzero"` // The url not included in allowed sources.
	ViolatedDirective                  string                             `json:"violatedDirective"`             // Specific directive that is violated, causing the CSP issue.
	IsReportOnly                       bool                               `json:"isReportOnly"`
	ContentSecurityPolicyViolationType ContentSecurityPolicyViolationType `json:"contentSecurityPolicyViolationType"`
	FrameAncestor                      *AffectedFrame                     `json:"frameAncestor,omitempty,omitzero"`
	SourceCodeLocation                 *SourceCodeLocation                `json:"sourceCodeLocation,omitempty,omitzero"`
	ViolatingNodeID                    cdp.BackendNodeID                  `json:"violatingNodeId,omitempty,omitzero"`
}

// SharedArrayBufferIssueType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SharedArrayBufferIssueType
type SharedArrayBufferIssueType string

// String returns the SharedArrayBufferIssueType as string value.
func (t SharedArrayBufferIssueType) String() string {
	return string(t)
}

// SharedArrayBufferIssueType values.
const (
	SharedArrayBufferIssueTypeTransferIssue SharedArrayBufferIssueType = "TransferIssue"
	SharedArrayBufferIssueTypeCreationIssue SharedArrayBufferIssueType = "CreationIssue"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *SharedArrayBufferIssueType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch SharedArrayBufferIssueType(s) {
	case SharedArrayBufferIssueTypeTransferIssue:
		*t = SharedArrayBufferIssueTypeTransferIssue
	case SharedArrayBufferIssueTypeCreationIssue:
		*t = SharedArrayBufferIssueTypeCreationIssue
	default:
		return fmt.Errorf("unknown SharedArrayBufferIssueType value: %v", s)
	}
	return nil
}

// SharedArrayBufferIssueDetails details for a issue arising from an SAB
// being instantiated in, or transferred to a context that is not cross-origin
// isolated.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SharedArrayBufferIssueDetails
type SharedArrayBufferIssueDetails struct {
	SourceCodeLocation *SourceCodeLocation        `json:"sourceCodeLocation"`
	IsWarning          bool                       `json:"isWarning"`
	Type               SharedArrayBufferIssueType `json:"type"`
}

// CorsIssueDetails details for a CORS related issue, e.g. a warning or error
// related to CORS RFC1918 enforcement.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CorsIssueDetails
type CorsIssueDetails struct {
	CorsErrorStatus        *network.CorsErrorStatus     `json:"corsErrorStatus"`
	IsWarning              bool                         `json:"isWarning"`
	Request                *AffectedRequest             `json:"request"`
	Location               *SourceCodeLocation          `json:"location,omitempty,omitzero"`
	InitiatorOrigin        string                       `json:"initiatorOrigin,omitempty,omitzero"`
	ResourceIPAddressSpace network.IPAddressSpace       `json:"resourceIPAddressSpace,omitempty,omitzero"`
	ClientSecurityState    *network.ClientSecurityState `json:"clientSecurityState,omitempty,omitzero"`
}

// SharedDictionaryError [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SharedDictionaryError
type SharedDictionaryError string

// String returns the SharedDictionaryError as string value.
func (t SharedDictionaryError) String() string {
	return string(t)
}

// SharedDictionaryError values.
const (
	SharedDictionaryErrorUseErrorCrossOriginNoCorsRequest          SharedDictionaryError = "UseErrorCrossOriginNoCorsRequest"
	SharedDictionaryErrorUseErrorDictionaryLoadFailure             SharedDictionaryError = "UseErrorDictionaryLoadFailure"
	SharedDictionaryErrorUseErrorMatchingDictionaryNotUsed         SharedDictionaryError = "UseErrorMatchingDictionaryNotUsed"
	SharedDictionaryErrorUseErrorUnexpectedContentDictionaryHeader SharedDictionaryError = "UseErrorUnexpectedContentDictionaryHeader"
	SharedDictionaryErrorWriteErrorCossOriginNoCorsRequest         SharedDictionaryError = "WriteErrorCossOriginNoCorsRequest"
	SharedDictionaryErrorWriteErrorDisallowedBySettings            SharedDictionaryError = "WriteErrorDisallowedBySettings"
	SharedDictionaryErrorWriteErrorExpiredResponse                 SharedDictionaryError = "WriteErrorExpiredResponse"
	SharedDictionaryErrorWriteErrorFeatureDisabled                 SharedDictionaryError = "WriteErrorFeatureDisabled"
	SharedDictionaryErrorWriteErrorInsufficientResources           SharedDictionaryError = "WriteErrorInsufficientResources"
	SharedDictionaryErrorWriteErrorInvalidMatchField               SharedDictionaryError = "WriteErrorInvalidMatchField"
	SharedDictionaryErrorWriteErrorInvalidStructuredHeader         SharedDictionaryError = "WriteErrorInvalidStructuredHeader"
	SharedDictionaryErrorWriteErrorInvalidTTLField                 SharedDictionaryError = "WriteErrorInvalidTTLField"
	SharedDictionaryErrorWriteErrorNavigationRequest               SharedDictionaryError = "WriteErrorNavigationRequest"
	SharedDictionaryErrorWriteErrorNoMatchField                    SharedDictionaryError = "WriteErrorNoMatchField"
	SharedDictionaryErrorWriteErrorNonIntegerTTLField              SharedDictionaryError = "WriteErrorNonIntegerTTLField"
	SharedDictionaryErrorWriteErrorNonListMatchDestField           SharedDictionaryError = "WriteErrorNonListMatchDestField"
	SharedDictionaryErrorWriteErrorNonSecureContext                SharedDictionaryError = "WriteErrorNonSecureContext"
	SharedDictionaryErrorWriteErrorNonStringIDField                SharedDictionaryError = "WriteErrorNonStringIdField"
	SharedDictionaryErrorWriteErrorNonStringInMatchDestList        SharedDictionaryError = "WriteErrorNonStringInMatchDestList"
	SharedDictionaryErrorWriteErrorInvalidMatchDestList            SharedDictionaryError = "WriteErrorInvalidMatchDestList"
	SharedDictionaryErrorWriteErrorNonStringMatchField             SharedDictionaryError = "WriteErrorNonStringMatchField"
	SharedDictionaryErrorWriteErrorNonTokenTypeField               SharedDictionaryError = "WriteErrorNonTokenTypeField"
	SharedDictionaryErrorWriteErrorRequestAborted                  SharedDictionaryError = "WriteErrorRequestAborted"
	SharedDictionaryErrorWriteErrorShuttingDown                    SharedDictionaryError = "WriteErrorShuttingDown"
	SharedDictionaryErrorWriteErrorTooLongIDField                  SharedDictionaryError = "WriteErrorTooLongIdField"
	SharedDictionaryErrorWriteErrorUnsupportedType                 SharedDictionaryError = "WriteErrorUnsupportedType"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *SharedDictionaryError) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch SharedDictionaryError(s) {
	case SharedDictionaryErrorUseErrorCrossOriginNoCorsRequest:
		*t = SharedDictionaryErrorUseErrorCrossOriginNoCorsRequest
	case SharedDictionaryErrorUseErrorDictionaryLoadFailure:
		*t = SharedDictionaryErrorUseErrorDictionaryLoadFailure
	case SharedDictionaryErrorUseErrorMatchingDictionaryNotUsed:
		*t = SharedDictionaryErrorUseErrorMatchingDictionaryNotUsed
	case SharedDictionaryErrorUseErrorUnexpectedContentDictionaryHeader:
		*t = SharedDictionaryErrorUseErrorUnexpectedContentDictionaryHeader
	case SharedDictionaryErrorWriteErrorCossOriginNoCorsRequest:
		*t = SharedDictionaryErrorWriteErrorCossOriginNoCorsRequest
	case SharedDictionaryErrorWriteErrorDisallowedBySettings:
		*t = SharedDictionaryErrorWriteErrorDisallowedBySettings
	case SharedDictionaryErrorWriteErrorExpiredResponse:
		*t = SharedDictionaryErrorWriteErrorExpiredResponse
	case SharedDictionaryErrorWriteErrorFeatureDisabled:
		*t = SharedDictionaryErrorWriteErrorFeatureDisabled
	case SharedDictionaryErrorWriteErrorInsufficientResources:
		*t = SharedDictionaryErrorWriteErrorInsufficientResources
	case SharedDictionaryErrorWriteErrorInvalidMatchField:
		*t = SharedDictionaryErrorWriteErrorInvalidMatchField
	case SharedDictionaryErrorWriteErrorInvalidStructuredHeader:
		*t = SharedDictionaryErrorWriteErrorInvalidStructuredHeader
	case SharedDictionaryErrorWriteErrorInvalidTTLField:
		*t = SharedDictionaryErrorWriteErrorInvalidTTLField
	case SharedDictionaryErrorWriteErrorNavigationRequest:
		*t = SharedDictionaryErrorWriteErrorNavigationRequest
	case SharedDictionaryErrorWriteErrorNoMatchField:
		*t = SharedDictionaryErrorWriteErrorNoMatchField
	case SharedDictionaryErrorWriteErrorNonIntegerTTLField:
		*t = SharedDictionaryErrorWriteErrorNonIntegerTTLField
	case SharedDictionaryErrorWriteErrorNonListMatchDestField:
		*t = SharedDictionaryErrorWriteErrorNonListMatchDestField
	case SharedDictionaryErrorWriteErrorNonSecureContext:
		*t = SharedDictionaryErrorWriteErrorNonSecureContext
	case SharedDictionaryErrorWriteErrorNonStringIDField:
		*t = SharedDictionaryErrorWriteErrorNonStringIDField
	case SharedDictionaryErrorWriteErrorNonStringInMatchDestList:
		*t = SharedDictionaryErrorWriteErrorNonStringInMatchDestList
	case SharedDictionaryErrorWriteErrorInvalidMatchDestList:
		*t = SharedDictionaryErrorWriteErrorInvalidMatchDestList
	case SharedDictionaryErrorWriteErrorNonStringMatchField:
		*t = SharedDictionaryErrorWriteErrorNonStringMatchField
	case SharedDictionaryErrorWriteErrorNonTokenTypeField:
		*t = SharedDictionaryErrorWriteErrorNonTokenTypeField
	case SharedDictionaryErrorWriteErrorRequestAborted:
		*t = SharedDictionaryErrorWriteErrorRequestAborted
	case SharedDictionaryErrorWriteErrorShuttingDown:
		*t = SharedDictionaryErrorWriteErrorShuttingDown
	case SharedDictionaryErrorWriteErrorTooLongIDField:
		*t = SharedDictionaryErrorWriteErrorTooLongIDField
	case SharedDictionaryErrorWriteErrorUnsupportedType:
		*t = SharedDictionaryErrorWriteErrorUnsupportedType
	default:
		return fmt.Errorf("unknown SharedDictionaryError value: %v", s)
	}
	return nil
}

// SRIMessageSignatureError [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SRIMessageSignatureError
type SRIMessageSignatureError string

// String returns the SRIMessageSignatureError as string value.
func (t SRIMessageSignatureError) String() string {
	return string(t)
}

// SRIMessageSignatureError values.
const (
	SRIMessageSignatureErrorMissingSignatureHeader                               SRIMessageSignatureError = "MissingSignatureHeader"
	SRIMessageSignatureErrorMissingSignatureInputHeader                          SRIMessageSignatureError = "MissingSignatureInputHeader"
	SRIMessageSignatureErrorInvalidSignatureHeader                               SRIMessageSignatureError = "InvalidSignatureHeader"
	SRIMessageSignatureErrorInvalidSignatureInputHeader                          SRIMessageSignatureError = "InvalidSignatureInputHeader"
	SRIMessageSignatureErrorSignatureHeaderValueIsNotByteSequence                SRIMessageSignatureError = "SignatureHeaderValueIsNotByteSequence"
	SRIMessageSignatureErrorSignatureHeaderValueIsParameterized                  SRIMessageSignatureError = "SignatureHeaderValueIsParameterized"
	SRIMessageSignatureErrorSignatureHeaderValueIsIncorrectLength                SRIMessageSignatureError = "SignatureHeaderValueIsIncorrectLength"
	SRIMessageSignatureErrorSignatureInputHeaderMissingLabel                     SRIMessageSignatureError = "SignatureInputHeaderMissingLabel"
	SRIMessageSignatureErrorSignatureInputHeaderValueNotInnerList                SRIMessageSignatureError = "SignatureInputHeaderValueNotInnerList"
	SRIMessageSignatureErrorSignatureInputHeaderValueMissingComponents           SRIMessageSignatureError = "SignatureInputHeaderValueMissingComponents"
	SRIMessageSignatureErrorSignatureInputHeaderInvalidComponentType             SRIMessageSignatureError = "SignatureInputHeaderInvalidComponentType"
	SRIMessageSignatureErrorSignatureInputHeaderInvalidComponentName             SRIMessageSignatureError = "SignatureInputHeaderInvalidComponentName"
	SRIMessageSignatureErrorSignatureInputHeaderInvalidHeaderComponentParameter  SRIMessageSignatureError = "SignatureInputHeaderInvalidHeaderComponentParameter"
	SRIMessageSignatureErrorSignatureInputHeaderInvalidDerivedComponentParameter SRIMessageSignatureError = "SignatureInputHeaderInvalidDerivedComponentParameter"
	SRIMessageSignatureErrorSignatureInputHeaderKeyIDLength                      SRIMessageSignatureError = "SignatureInputHeaderKeyIdLength"
	SRIMessageSignatureErrorSignatureInputHeaderInvalidParameter                 SRIMessageSignatureError = "SignatureInputHeaderInvalidParameter"
	SRIMessageSignatureErrorSignatureInputHeaderMissingRequiredParameters        SRIMessageSignatureError = "SignatureInputHeaderMissingRequiredParameters"
	SRIMessageSignatureErrorValidationFailedSignatureExpired                     SRIMessageSignatureError = "ValidationFailedSignatureExpired"
	SRIMessageSignatureErrorValidationFailedInvalidLength                        SRIMessageSignatureError = "ValidationFailedInvalidLength"
	SRIMessageSignatureErrorValidationFailedSignatureMismatch                    SRIMessageSignatureError = "ValidationFailedSignatureMismatch"
	SRIMessageSignatureErrorValidationFailedIntegrityMismatch                    SRIMessageSignatureError = "ValidationFailedIntegrityMismatch"
	SRIMessageSignatureErrorSignatureBaseUnknownDerivedComponent                 SRIMessageSignatureError = "SignatureBaseUnknownDerivedComponent"
	SRIMessageSignatureErrorSignatureBaseMissingHeader                           SRIMessageSignatureError = "SignatureBaseMissingHeader"
	SRIMessageSignatureErrorSignatureBaseInvalidUnencodedDigest                  SRIMessageSignatureError = "SignatureBaseInvalidUnencodedDigest"
	SRIMessageSignatureErrorSignatureBaseUnsupportedComponent                    SRIMessageSignatureError = "SignatureBaseUnsupportedComponent"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *SRIMessageSignatureError) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch SRIMessageSignatureError(s) {
	case SRIMessageSignatureErrorMissingSignatureHeader:
		*t = SRIMessageSignatureErrorMissingSignatureHeader
	case SRIMessageSignatureErrorMissingSignatureInputHeader:
		*t = SRIMessageSignatureErrorMissingSignatureInputHeader
	case SRIMessageSignatureErrorInvalidSignatureHeader:
		*t = SRIMessageSignatureErrorInvalidSignatureHeader
	case SRIMessageSignatureErrorInvalidSignatureInputHeader:
		*t = SRIMessageSignatureErrorInvalidSignatureInputHeader
	case SRIMessageSignatureErrorSignatureHeaderValueIsNotByteSequence:
		*t = SRIMessageSignatureErrorSignatureHeaderValueIsNotByteSequence
	case SRIMessageSignatureErrorSignatureHeaderValueIsParameterized:
		*t = SRIMessageSignatureErrorSignatureHeaderValueIsParameterized
	case SRIMessageSignatureErrorSignatureHeaderValueIsIncorrectLength:
		*t = SRIMessageSignatureErrorSignatureHeaderValueIsIncorrectLength
	case SRIMessageSignatureErrorSignatureInputHeaderMissingLabel:
		*t = SRIMessageSignatureErrorSignatureInputHeaderMissingLabel
	case SRIMessageSignatureErrorSignatureInputHeaderValueNotInnerList:
		*t = SRIMessageSignatureErrorSignatureInputHeaderValueNotInnerList
	case SRIMessageSignatureErrorSignatureInputHeaderValueMissingComponents:
		*t = SRIMessageSignatureErrorSignatureInputHeaderValueMissingComponents
	case SRIMessageSignatureErrorSignatureInputHeaderInvalidComponentType:
		*t = SRIMessageSignatureErrorSignatureInputHeaderInvalidComponentType
	case SRIMessageSignatureErrorSignatureInputHeaderInvalidComponentName:
		*t = SRIMessageSignatureErrorSignatureInputHeaderInvalidComponentName
	case SRIMessageSignatureErrorSignatureInputHeaderInvalidHeaderComponentParameter:
		*t = SRIMessageSignatureErrorSignatureInputHeaderInvalidHeaderComponentParameter
	case SRIMessageSignatureErrorSignatureInputHeaderInvalidDerivedComponentParameter:
		*t = SRIMessageSignatureErrorSignatureInputHeaderInvalidDerivedComponentParameter
	case SRIMessageSignatureErrorSignatureInputHeaderKeyIDLength:
		*t = SRIMessageSignatureErrorSignatureInputHeaderKeyIDLength
	case SRIMessageSignatureErrorSignatureInputHeaderInvalidParameter:
		*t = SRIMessageSignatureErrorSignatureInputHeaderInvalidParameter
	case SRIMessageSignatureErrorSignatureInputHeaderMissingRequiredParameters:
		*t = SRIMessageSignatureErrorSignatureInputHeaderMissingRequiredParameters
	case SRIMessageSignatureErrorValidationFailedSignatureExpired:
		*t = SRIMessageSignatureErrorValidationFailedSignatureExpired
	case SRIMessageSignatureErrorValidationFailedInvalidLength:
		*t = SRIMessageSignatureErrorValidationFailedInvalidLength
	case SRIMessageSignatureErrorValidationFailedSignatureMismatch:
		*t = SRIMessageSignatureErrorValidationFailedSignatureMismatch
	case SRIMessageSignatureErrorValidationFailedIntegrityMismatch:
		*t = SRIMessageSignatureErrorValidationFailedIntegrityMismatch
	case SRIMessageSignatureErrorSignatureBaseUnknownDerivedComponent:
		*t = SRIMessageSignatureErrorSignatureBaseUnknownDerivedComponent
	case SRIMessageSignatureErrorSignatureBaseMissingHeader:
		*t = SRIMessageSignatureErrorSignatureBaseMissingHeader
	case SRIMessageSignatureErrorSignatureBaseInvalidUnencodedDigest:
		*t = SRIMessageSignatureErrorSignatureBaseInvalidUnencodedDigest
	case SRIMessageSignatureErrorSignatureBaseUnsupportedComponent:
		*t = SRIMessageSignatureErrorSignatureBaseUnsupportedComponent
	default:
		return fmt.Errorf("unknown SRIMessageSignatureError value: %v", s)
	}
	return nil
}

// UnencodedDigestError [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-UnencodedDigestError
type UnencodedDigestError string

// String returns the UnencodedDigestError as string value.
func (t UnencodedDigestError) String() string {
	return string(t)
}

// UnencodedDigestError values.
const (
	UnencodedDigestErrorMalformedDictionary   UnencodedDigestError = "MalformedDictionary"
	UnencodedDigestErrorUnknownAlgorithm      UnencodedDigestError = "UnknownAlgorithm"
	UnencodedDigestErrorIncorrectDigestType   UnencodedDigestError = "IncorrectDigestType"
	UnencodedDigestErrorIncorrectDigestLength UnencodedDigestError = "IncorrectDigestLength"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *UnencodedDigestError) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch UnencodedDigestError(s) {
	case UnencodedDigestErrorMalformedDictionary:
		*t = UnencodedDigestErrorMalformedDictionary
	case UnencodedDigestErrorUnknownAlgorithm:
		*t = UnencodedDigestErrorUnknownAlgorithm
	case UnencodedDigestErrorIncorrectDigestType:
		*t = UnencodedDigestErrorIncorrectDigestType
	case UnencodedDigestErrorIncorrectDigestLength:
		*t = UnencodedDigestErrorIncorrectDigestLength
	default:
		return fmt.Errorf("unknown UnencodedDigestError value: %v", s)
	}
	return nil
}

// ConnectionAllowlistError [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ConnectionAllowlistError
type ConnectionAllowlistError string

// String returns the ConnectionAllowlistError as string value.
func (t ConnectionAllowlistError) String() string {
	return string(t)
}

// ConnectionAllowlistError values.
const (
	ConnectionAllowlistErrorInvalidHeader             ConnectionAllowlistError = "InvalidHeader"
	ConnectionAllowlistErrorMoreThanOneList           ConnectionAllowlistError = "MoreThanOneList"
	ConnectionAllowlistErrorItemNotInnerList          ConnectionAllowlistError = "ItemNotInnerList"
	ConnectionAllowlistErrorInvalidAllowlistItemType  ConnectionAllowlistError = "InvalidAllowlistItemType"
	ConnectionAllowlistErrorReportingEndpointNotToken ConnectionAllowlistError = "ReportingEndpointNotToken"
	ConnectionAllowlistErrorInvalidURLPattern         ConnectionAllowlistError = "InvalidUrlPattern"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *ConnectionAllowlistError) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch ConnectionAllowlistError(s) {
	case ConnectionAllowlistErrorInvalidHeader:
		*t = ConnectionAllowlistErrorInvalidHeader
	case ConnectionAllowlistErrorMoreThanOneList:
		*t = ConnectionAllowlistErrorMoreThanOneList
	case ConnectionAllowlistErrorItemNotInnerList:
		*t = ConnectionAllowlistErrorItemNotInnerList
	case ConnectionAllowlistErrorInvalidAllowlistItemType:
		*t = ConnectionAllowlistErrorInvalidAllowlistItemType
	case ConnectionAllowlistErrorReportingEndpointNotToken:
		*t = ConnectionAllowlistErrorReportingEndpointNotToken
	case ConnectionAllowlistErrorInvalidURLPattern:
		*t = ConnectionAllowlistErrorInvalidURLPattern
	default:
		return fmt.Errorf("unknown ConnectionAllowlistError value: %v", s)
	}
	return nil
}

// QuirksModeIssueDetails details for issues about documents in Quirks Mode
// or Limited Quirks Mode that affects page layouting.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-QuirksModeIssueDetails
type QuirksModeIssueDetails struct {
	IsLimitedQuirksMode bool              `json:"isLimitedQuirksMode"` // If false, it means the document's mode is "quirks" instead of "limited-quirks".
	DocumentNodeID      cdp.BackendNodeID `json:"documentNodeId"`
	URL                 string            `json:"url"`
	FrameID             cdp.FrameID       `json:"frameId"`
	LoaderID            cdp.LoaderID      `json:"loaderId"`
}

// SharedDictionaryIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SharedDictionaryIssueDetails
type SharedDictionaryIssueDetails struct {
	SharedDictionaryError SharedDictionaryError `json:"sharedDictionaryError"`
	Request               *AffectedRequest      `json:"request"`
}

// SRIMessageSignatureIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SRIMessageSignatureIssueDetails
type SRIMessageSignatureIssueDetails struct {
	Error               SRIMessageSignatureError `json:"error"`
	SignatureBase       string                   `json:"signatureBase"`
	IntegrityAssertions []string                 `json:"integrityAssertions"`
	Request             *AffectedRequest         `json:"request"`
}

// UnencodedDigestIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-UnencodedDigestIssueDetails
type UnencodedDigestIssueDetails struct {
	Error   UnencodedDigestError `json:"error"`
	Request *AffectedRequest     `json:"request"`
}

// ConnectionAllowlistIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ConnectionAllowlistIssueDetails
type ConnectionAllowlistIssueDetails struct {
	Error   ConnectionAllowlistError `json:"error"`
	Request *AffectedRequest         `json:"request"`
}

// GenericIssueErrorType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-GenericIssueErrorType
type GenericIssueErrorType string

// String returns the GenericIssueErrorType as string value.
func (t GenericIssueErrorType) String() string {
	return string(t)
}

// GenericIssueErrorType values.
const (
	GenericIssueErrorTypeFormLabelForNameError                                      GenericIssueErrorType = "FormLabelForNameError"
	GenericIssueErrorTypeFormDuplicateIDForInputError                               GenericIssueErrorType = "FormDuplicateIdForInputError"
	GenericIssueErrorTypeFormInputWithNoLabelError                                  GenericIssueErrorType = "FormInputWithNoLabelError"
	GenericIssueErrorTypeFormAutocompleteAttributeEmptyError                        GenericIssueErrorType = "FormAutocompleteAttributeEmptyError"
	GenericIssueErrorTypeFormEmptyIDAndNameAttributesForInputError                  GenericIssueErrorType = "FormEmptyIdAndNameAttributesForInputError"
	GenericIssueErrorTypeFormAriaLabelledByToNonExistingIDError                     GenericIssueErrorType = "FormAriaLabelledByToNonExistingIdError"
	GenericIssueErrorTypeFormInputAssignedAutocompleteValueToIDOrNameAttributeError GenericIssueErrorType = "FormInputAssignedAutocompleteValueToIdOrNameAttributeError"
	GenericIssueErrorTypeFormLabelHasNeitherForNorNestedInputError                  GenericIssueErrorType = "FormLabelHasNeitherForNorNestedInputError"
	GenericIssueErrorTypeFormLabelForMatchesNonExistingIDError                      GenericIssueErrorType = "FormLabelForMatchesNonExistingIdError"
	GenericIssueErrorTypeFormInputHasWrongButWellIntendedAutocompleteValueError     GenericIssueErrorType = "FormInputHasWrongButWellIntendedAutocompleteValueError"
	GenericIssueErrorTypeResponseWasBlockedByORB                                    GenericIssueErrorType = "ResponseWasBlockedByORB"
	GenericIssueErrorTypeNavigationEntryMarkedSkippable                             GenericIssueErrorType = "NavigationEntryMarkedSkippable"
	GenericIssueErrorTypeBackUINavigationWouldSkipAd                                GenericIssueErrorType = "BackUINavigationWouldSkipAd"
	GenericIssueErrorTypeAutofillAndManualTextPolicyControlledFeaturesInfo          GenericIssueErrorType = "AutofillAndManualTextPolicyControlledFeaturesInfo"
	GenericIssueErrorTypeAutofillPolicyControlledFeatureInfo                        GenericIssueErrorType = "AutofillPolicyControlledFeatureInfo"
	GenericIssueErrorTypeManualTextPolicyControlledFeatureInfo                      GenericIssueErrorType = "ManualTextPolicyControlledFeatureInfo"
	GenericIssueErrorTypeFormModelContextParameterMissingTitleAndDescription        GenericIssueErrorType = "FormModelContextParameterMissingTitleAndDescription"
	GenericIssueErrorTypeFormModelContextMissingToolName                            GenericIssueErrorType = "FormModelContextMissingToolName"
	GenericIssueErrorTypeFormModelContextMissingToolDescription                     GenericIssueErrorType = "FormModelContextMissingToolDescription"
	GenericIssueErrorTypeFormModelContextRequiredParameterMissingName               GenericIssueErrorType = "FormModelContextRequiredParameterMissingName"
	GenericIssueErrorTypeFormModelContextParameterMissingName                       GenericIssueErrorType = "FormModelContextParameterMissingName"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *GenericIssueErrorType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch GenericIssueErrorType(s) {
	case GenericIssueErrorTypeFormLabelForNameError:
		*t = GenericIssueErrorTypeFormLabelForNameError
	case GenericIssueErrorTypeFormDuplicateIDForInputError:
		*t = GenericIssueErrorTypeFormDuplicateIDForInputError
	case GenericIssueErrorTypeFormInputWithNoLabelError:
		*t = GenericIssueErrorTypeFormInputWithNoLabelError
	case GenericIssueErrorTypeFormAutocompleteAttributeEmptyError:
		*t = GenericIssueErrorTypeFormAutocompleteAttributeEmptyError
	case GenericIssueErrorTypeFormEmptyIDAndNameAttributesForInputError:
		*t = GenericIssueErrorTypeFormEmptyIDAndNameAttributesForInputError
	case GenericIssueErrorTypeFormAriaLabelledByToNonExistingIDError:
		*t = GenericIssueErrorTypeFormAriaLabelledByToNonExistingIDError
	case GenericIssueErrorTypeFormInputAssignedAutocompleteValueToIDOrNameAttributeError:
		*t = GenericIssueErrorTypeFormInputAssignedAutocompleteValueToIDOrNameAttributeError
	case GenericIssueErrorTypeFormLabelHasNeitherForNorNestedInputError:
		*t = GenericIssueErrorTypeFormLabelHasNeitherForNorNestedInputError
	case GenericIssueErrorTypeFormLabelForMatchesNonExistingIDError:
		*t = GenericIssueErrorTypeFormLabelForMatchesNonExistingIDError
	case GenericIssueErrorTypeFormInputHasWrongButWellIntendedAutocompleteValueError:
		*t = GenericIssueErrorTypeFormInputHasWrongButWellIntendedAutocompleteValueError
	case GenericIssueErrorTypeResponseWasBlockedByORB:
		*t = GenericIssueErrorTypeResponseWasBlockedByORB
	case GenericIssueErrorTypeNavigationEntryMarkedSkippable:
		*t = GenericIssueErrorTypeNavigationEntryMarkedSkippable
	case GenericIssueErrorTypeBackUINavigationWouldSkipAd:
		*t = GenericIssueErrorTypeBackUINavigationWouldSkipAd
	case GenericIssueErrorTypeAutofillAndManualTextPolicyControlledFeaturesInfo:
		*t = GenericIssueErrorTypeAutofillAndManualTextPolicyControlledFeaturesInfo
	case GenericIssueErrorTypeAutofillPolicyControlledFeatureInfo:
		*t = GenericIssueErrorTypeAutofillPolicyControlledFeatureInfo
	case GenericIssueErrorTypeManualTextPolicyControlledFeatureInfo:
		*t = GenericIssueErrorTypeManualTextPolicyControlledFeatureInfo
	case GenericIssueErrorTypeFormModelContextParameterMissingTitleAndDescription:
		*t = GenericIssueErrorTypeFormModelContextParameterMissingTitleAndDescription
	case GenericIssueErrorTypeFormModelContextMissingToolName:
		*t = GenericIssueErrorTypeFormModelContextMissingToolName
	case GenericIssueErrorTypeFormModelContextMissingToolDescription:
		*t = GenericIssueErrorTypeFormModelContextMissingToolDescription
	case GenericIssueErrorTypeFormModelContextRequiredParameterMissingName:
		*t = GenericIssueErrorTypeFormModelContextRequiredParameterMissingName
	case GenericIssueErrorTypeFormModelContextParameterMissingName:
		*t = GenericIssueErrorTypeFormModelContextParameterMissingName
	default:
		return fmt.Errorf("unknown GenericIssueErrorType value: %v", s)
	}
	return nil
}

// GenericIssueDetails depending on the concrete errorType, different
// properties are set.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-GenericIssueDetails
type GenericIssueDetails struct {
	ErrorType              GenericIssueErrorType `json:"errorType"` // Issues with the same errorType are aggregated in the frontend.
	FrameID                cdp.FrameID           `json:"frameId,omitempty,omitzero"`
	ViolatingNodeID        cdp.BackendNodeID     `json:"violatingNodeId,omitempty,omitzero"`
	ViolatingNodeAttribute string                `json:"violatingNodeAttribute,omitempty,omitzero"`
	Request                *AffectedRequest      `json:"request,omitempty,omitzero"`
}

// DeprecationIssueDetails this issue tracks information needed to print a
// deprecation message.
// https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-DeprecationIssueDetails
type DeprecationIssueDetails struct {
	AffectedFrame      *AffectedFrame      `json:"affectedFrame,omitempty,omitzero"`
	SourceCodeLocation *SourceCodeLocation `json:"sourceCodeLocation"`
	Type               string              `json:"type"` // One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5
}

// BounceTrackingIssueDetails this issue warns about sites in the redirect
// chain of a finished navigation that may be flagged as trackers and have their
// state cleared if they don't receive a user interaction. Note that in this
// context 'site' means eTLD+1. For example, if the URL
// https://example.test:80/bounce was in the redirect chain, the site reported
// would be example.test.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-BounceTrackingIssueDetails
type BounceTrackingIssueDetails struct {
	TrackingSites []string `json:"trackingSites"`
}

// CookieDeprecationMetadataIssueDetails this issue warns about third-party
// sites that are accessing cookies on the current page, and have been permitted
// due to having a global metadata grant. Note that in this context 'site' means
// eTLD+1. For example, if the URL https://example.test:80/web_page was
// accessing cookies, the site reported would be example.test.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-CookieDeprecationMetadataIssueDetails
type CookieDeprecationMetadataIssueDetails struct {
	AllowedSites     []string        `json:"allowedSites"`
	OptOutPercentage float64         `json:"optOutPercentage"`
	IsOptOutTopLevel bool            `json:"isOptOutTopLevel"`
	Operation        CookieOperation `json:"operation"`
}

// ClientHintIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ClientHintIssueReason
type ClientHintIssueReason string

// String returns the ClientHintIssueReason as string value.
func (t ClientHintIssueReason) String() string {
	return string(t)
}

// ClientHintIssueReason values.
const (
	ClientHintIssueReasonMetaTagAllowListInvalidOrigin ClientHintIssueReason = "MetaTagAllowListInvalidOrigin"
	ClientHintIssueReasonMetaTagModifiedHTML           ClientHintIssueReason = "MetaTagModifiedHTML"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *ClientHintIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch ClientHintIssueReason(s) {
	case ClientHintIssueReasonMetaTagAllowListInvalidOrigin:
		*t = ClientHintIssueReasonMetaTagAllowListInvalidOrigin
	case ClientHintIssueReasonMetaTagModifiedHTML:
		*t = ClientHintIssueReasonMetaTagModifiedHTML
	default:
		return fmt.Errorf("unknown ClientHintIssueReason value: %v", s)
	}
	return nil
}

// FederatedAuthRequestIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FederatedAuthRequestIssueDetails
type FederatedAuthRequestIssueDetails struct {
	FederatedAuthRequestIssueReason FederatedAuthRequestIssueReason `json:"federatedAuthRequestIssueReason"`
}

// FederatedAuthRequestIssueReason represents the failure reason when a
// federated authentication reason fails. Should be updated alongside
// RequestIdTokenStatus in
// third_party/blink/public/mojom/devtools/inspector_issue.mojom to include all
// cases except for success.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FederatedAuthRequestIssueReason
type FederatedAuthRequestIssueReason string

// String returns the FederatedAuthRequestIssueReason as string value.
func (t FederatedAuthRequestIssueReason) String() string {
	return string(t)
}

// FederatedAuthRequestIssueReason values.
const (
	FederatedAuthRequestIssueReasonShouldEmbargo                         FederatedAuthRequestIssueReason = "ShouldEmbargo"
	FederatedAuthRequestIssueReasonTooManyRequests                       FederatedAuthRequestIssueReason = "TooManyRequests"
	FederatedAuthRequestIssueReasonWellKnownHTTPNotFound                 FederatedAuthRequestIssueReason = "WellKnownHttpNotFound"
	FederatedAuthRequestIssueReasonWellKnownNoResponse                   FederatedAuthRequestIssueReason = "WellKnownNoResponse"
	FederatedAuthRequestIssueReasonWellKnownBlockedByConnectionAllowlist FederatedAuthRequestIssueReason = "WellKnownBlockedByConnectionAllowlist"
	FederatedAuthRequestIssueReasonWellKnownInvalidResponse              FederatedAuthRequestIssueReason = "WellKnownInvalidResponse"
	FederatedAuthRequestIssueReasonWellKnownListEmpty                    FederatedAuthRequestIssueReason = "WellKnownListEmpty"
	FederatedAuthRequestIssueReasonWellKnownInvalidContentType           FederatedAuthRequestIssueReason = "WellKnownInvalidContentType"
	FederatedAuthRequestIssueReasonConfigNotInWellKnown                  FederatedAuthRequestIssueReason = "ConfigNotInWellKnown"
	FederatedAuthRequestIssueReasonWellKnownTooBig                       FederatedAuthRequestIssueReason = "WellKnownTooBig"
	FederatedAuthRequestIssueReasonConfigHTTPNotFound                    FederatedAuthRequestIssueReason = "ConfigHttpNotFound"
	FederatedAuthRequestIssueReasonConfigNoResponse                      FederatedAuthRequestIssueReason = "ConfigNoResponse"
	FederatedAuthRequestIssueReasonConfigBlockedByConnectionAllowlist    FederatedAuthRequestIssueReason = "ConfigBlockedByConnectionAllowlist"
	FederatedAuthRequestIssueReasonConfigInvalidResponse                 FederatedAuthRequestIssueReason = "ConfigInvalidResponse"
	FederatedAuthRequestIssueReasonConfigInvalidContentType              FederatedAuthRequestIssueReason = "ConfigInvalidContentType"
	FederatedAuthRequestIssueReasonIdpNotPotentiallyTrustworthy          FederatedAuthRequestIssueReason = "IdpNotPotentiallyTrustworthy"
	FederatedAuthRequestIssueReasonDisabledInSettings                    FederatedAuthRequestIssueReason = "DisabledInSettings"
	FederatedAuthRequestIssueReasonDisabledInFlags                       FederatedAuthRequestIssueReason = "DisabledInFlags"
	FederatedAuthRequestIssueReasonErrorFetchingSignin                   FederatedAuthRequestIssueReason = "ErrorFetchingSignin"
	FederatedAuthRequestIssueReasonInvalidSigninResponse                 FederatedAuthRequestIssueReason = "InvalidSigninResponse"
	FederatedAuthRequestIssueReasonAccountsHTTPNotFound                  FederatedAuthRequestIssueReason = "AccountsHttpNotFound"
	FederatedAuthRequestIssueReasonAccountsNoResponse                    FederatedAuthRequestIssueReason = "AccountsNoResponse"
	FederatedAuthRequestIssueReasonAccountsBlockedByConnectionAllowlist  FederatedAuthRequestIssueReason = "AccountsBlockedByConnectionAllowlist"
	FederatedAuthRequestIssueReasonAccountsInvalidResponse               FederatedAuthRequestIssueReason = "AccountsInvalidResponse"
	FederatedAuthRequestIssueReasonAccountsListEmpty                     FederatedAuthRequestIssueReason = "AccountsListEmpty"
	FederatedAuthRequestIssueReasonAccountsInvalidContentType            FederatedAuthRequestIssueReason = "AccountsInvalidContentType"
	FederatedAuthRequestIssueReasonIDTokenHTTPNotFound                   FederatedAuthRequestIssueReason = "IdTokenHttpNotFound"
	FederatedAuthRequestIssueReasonIDTokenNoResponse                     FederatedAuthRequestIssueReason = "IdTokenNoResponse"
	FederatedAuthRequestIssueReasonIDTokenBlockedByConnectionAllowlist   FederatedAuthRequestIssueReason = "IdTokenBlockedByConnectionAllowlist"
	FederatedAuthRequestIssueReasonIDTokenInvalidResponse                FederatedAuthRequestIssueReason = "IdTokenInvalidResponse"
	FederatedAuthRequestIssueReasonIDTokenIdpErrorResponse               FederatedAuthRequestIssueReason = "IdTokenIdpErrorResponse"
	FederatedAuthRequestIssueReasonIDTokenCrossSiteIdpErrorResponse      FederatedAuthRequestIssueReason = "IdTokenCrossSiteIdpErrorResponse"
	FederatedAuthRequestIssueReasonIDTokenInvalidRequest                 FederatedAuthRequestIssueReason = "IdTokenInvalidRequest"
	FederatedAuthRequestIssueReasonIDTokenInvalidContentType             FederatedAuthRequestIssueReason = "IdTokenInvalidContentType"
	FederatedAuthRequestIssueReasonErrorIDToken                          FederatedAuthRequestIssueReason = "ErrorIdToken"
	FederatedAuthRequestIssueReasonCanceled                              FederatedAuthRequestIssueReason = "Canceled"
	FederatedAuthRequestIssueReasonRpPageNotVisible                      FederatedAuthRequestIssueReason = "RpPageNotVisible"
	FederatedAuthRequestIssueReasonSilentMediationFailure                FederatedAuthRequestIssueReason = "SilentMediationFailure"
	FederatedAuthRequestIssueReasonNotSignedInWithIdp                    FederatedAuthRequestIssueReason = "NotSignedInWithIdp"
	FederatedAuthRequestIssueReasonMissingTransientUserActivation        FederatedAuthRequestIssueReason = "MissingTransientUserActivation"
	FederatedAuthRequestIssueReasonReplacedByActiveMode                  FederatedAuthRequestIssueReason = "ReplacedByActiveMode"
	FederatedAuthRequestIssueReasonRelyingPartyOriginIsOpaque            FederatedAuthRequestIssueReason = "RelyingPartyOriginIsOpaque"
	FederatedAuthRequestIssueReasonTypeNotMatching                       FederatedAuthRequestIssueReason = "TypeNotMatching"
	FederatedAuthRequestIssueReasonUIDismissedNoEmbargo                  FederatedAuthRequestIssueReason = "UiDismissedNoEmbargo"
	FederatedAuthRequestIssueReasonCorsError                             FederatedAuthRequestIssueReason = "CorsError"
	FederatedAuthRequestIssueReasonSuppressedBySegmentationPlatform      FederatedAuthRequestIssueReason = "SuppressedBySegmentationPlatform"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *FederatedAuthRequestIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch FederatedAuthRequestIssueReason(s) {
	case FederatedAuthRequestIssueReasonShouldEmbargo:
		*t = FederatedAuthRequestIssueReasonShouldEmbargo
	case FederatedAuthRequestIssueReasonTooManyRequests:
		*t = FederatedAuthRequestIssueReasonTooManyRequests
	case FederatedAuthRequestIssueReasonWellKnownHTTPNotFound:
		*t = FederatedAuthRequestIssueReasonWellKnownHTTPNotFound
	case FederatedAuthRequestIssueReasonWellKnownNoResponse:
		*t = FederatedAuthRequestIssueReasonWellKnownNoResponse
	case FederatedAuthRequestIssueReasonWellKnownBlockedByConnectionAllowlist:
		*t = FederatedAuthRequestIssueReasonWellKnownBlockedByConnectionAllowlist
	case FederatedAuthRequestIssueReasonWellKnownInvalidResponse:
		*t = FederatedAuthRequestIssueReasonWellKnownInvalidResponse
	case FederatedAuthRequestIssueReasonWellKnownListEmpty:
		*t = FederatedAuthRequestIssueReasonWellKnownListEmpty
	case FederatedAuthRequestIssueReasonWellKnownInvalidContentType:
		*t = FederatedAuthRequestIssueReasonWellKnownInvalidContentType
	case FederatedAuthRequestIssueReasonConfigNotInWellKnown:
		*t = FederatedAuthRequestIssueReasonConfigNotInWellKnown
	case FederatedAuthRequestIssueReasonWellKnownTooBig:
		*t = FederatedAuthRequestIssueReasonWellKnownTooBig
	case FederatedAuthRequestIssueReasonConfigHTTPNotFound:
		*t = FederatedAuthRequestIssueReasonConfigHTTPNotFound
	case FederatedAuthRequestIssueReasonConfigNoResponse:
		*t = FederatedAuthRequestIssueReasonConfigNoResponse
	case FederatedAuthRequestIssueReasonConfigBlockedByConnectionAllowlist:
		*t = FederatedAuthRequestIssueReasonConfigBlockedByConnectionAllowlist
	case FederatedAuthRequestIssueReasonConfigInvalidResponse:
		*t = FederatedAuthRequestIssueReasonConfigInvalidResponse
	case FederatedAuthRequestIssueReasonConfigInvalidContentType:
		*t = FederatedAuthRequestIssueReasonConfigInvalidContentType
	case FederatedAuthRequestIssueReasonIdpNotPotentiallyTrustworthy:
		*t = FederatedAuthRequestIssueReasonIdpNotPotentiallyTrustworthy
	case FederatedAuthRequestIssueReasonDisabledInSettings:
		*t = FederatedAuthRequestIssueReasonDisabledInSettings
	case FederatedAuthRequestIssueReasonDisabledInFlags:
		*t = FederatedAuthRequestIssueReasonDisabledInFlags
	case FederatedAuthRequestIssueReasonErrorFetchingSignin:
		*t = FederatedAuthRequestIssueReasonErrorFetchingSignin
	case FederatedAuthRequestIssueReasonInvalidSigninResponse:
		*t = FederatedAuthRequestIssueReasonInvalidSigninResponse
	case FederatedAuthRequestIssueReasonAccountsHTTPNotFound:
		*t = FederatedAuthRequestIssueReasonAccountsHTTPNotFound
	case FederatedAuthRequestIssueReasonAccountsNoResponse:
		*t = FederatedAuthRequestIssueReasonAccountsNoResponse
	case FederatedAuthRequestIssueReasonAccountsBlockedByConnectionAllowlist:
		*t = FederatedAuthRequestIssueReasonAccountsBlockedByConnectionAllowlist
	case FederatedAuthRequestIssueReasonAccountsInvalidResponse:
		*t = FederatedAuthRequestIssueReasonAccountsInvalidResponse
	case FederatedAuthRequestIssueReasonAccountsListEmpty:
		*t = FederatedAuthRequestIssueReasonAccountsListEmpty
	case FederatedAuthRequestIssueReasonAccountsInvalidContentType:
		*t = FederatedAuthRequestIssueReasonAccountsInvalidContentType
	case FederatedAuthRequestIssueReasonIDTokenHTTPNotFound:
		*t = FederatedAuthRequestIssueReasonIDTokenHTTPNotFound
	case FederatedAuthRequestIssueReasonIDTokenNoResponse:
		*t = FederatedAuthRequestIssueReasonIDTokenNoResponse
	case FederatedAuthRequestIssueReasonIDTokenBlockedByConnectionAllowlist:
		*t = FederatedAuthRequestIssueReasonIDTokenBlockedByConnectionAllowlist
	case FederatedAuthRequestIssueReasonIDTokenInvalidResponse:
		*t = FederatedAuthRequestIssueReasonIDTokenInvalidResponse
	case FederatedAuthRequestIssueReasonIDTokenIdpErrorResponse:
		*t = FederatedAuthRequestIssueReasonIDTokenIdpErrorResponse
	case FederatedAuthRequestIssueReasonIDTokenCrossSiteIdpErrorResponse:
		*t = FederatedAuthRequestIssueReasonIDTokenCrossSiteIdpErrorResponse
	case FederatedAuthRequestIssueReasonIDTokenInvalidRequest:
		*t = FederatedAuthRequestIssueReasonIDTokenInvalidRequest
	case FederatedAuthRequestIssueReasonIDTokenInvalidContentType:
		*t = FederatedAuthRequestIssueReasonIDTokenInvalidContentType
	case FederatedAuthRequestIssueReasonErrorIDToken:
		*t = FederatedAuthRequestIssueReasonErrorIDToken
	case FederatedAuthRequestIssueReasonCanceled:
		*t = FederatedAuthRequestIssueReasonCanceled
	case FederatedAuthRequestIssueReasonRpPageNotVisible:
		*t = FederatedAuthRequestIssueReasonRpPageNotVisible
	case FederatedAuthRequestIssueReasonSilentMediationFailure:
		*t = FederatedAuthRequestIssueReasonSilentMediationFailure
	case FederatedAuthRequestIssueReasonNotSignedInWithIdp:
		*t = FederatedAuthRequestIssueReasonNotSignedInWithIdp
	case FederatedAuthRequestIssueReasonMissingTransientUserActivation:
		*t = FederatedAuthRequestIssueReasonMissingTransientUserActivation
	case FederatedAuthRequestIssueReasonReplacedByActiveMode:
		*t = FederatedAuthRequestIssueReasonReplacedByActiveMode
	case FederatedAuthRequestIssueReasonRelyingPartyOriginIsOpaque:
		*t = FederatedAuthRequestIssueReasonRelyingPartyOriginIsOpaque
	case FederatedAuthRequestIssueReasonTypeNotMatching:
		*t = FederatedAuthRequestIssueReasonTypeNotMatching
	case FederatedAuthRequestIssueReasonUIDismissedNoEmbargo:
		*t = FederatedAuthRequestIssueReasonUIDismissedNoEmbargo
	case FederatedAuthRequestIssueReasonCorsError:
		*t = FederatedAuthRequestIssueReasonCorsError
	case FederatedAuthRequestIssueReasonSuppressedBySegmentationPlatform:
		*t = FederatedAuthRequestIssueReasonSuppressedBySegmentationPlatform
	default:
		return fmt.Errorf("unknown FederatedAuthRequestIssueReason value: %v", s)
	}
	return nil
}

// FederatedAuthUserInfoRequestIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FederatedAuthUserInfoRequestIssueDetails
type FederatedAuthUserInfoRequestIssueDetails struct {
	FederatedAuthUserInfoRequestIssueReason FederatedAuthUserInfoRequestIssueReason `json:"federatedAuthUserInfoRequestIssueReason"`
}

// FederatedAuthUserInfoRequestIssueReason represents the failure reason when
// a getUserInfo() call fails. Should be updated alongside
// FederatedAuthUserInfoRequestResult in
// third_party/blink/public/mojom/devtools/inspector_issue.mojom.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FederatedAuthUserInfoRequestIssueReason
type FederatedAuthUserInfoRequestIssueReason string

// String returns the FederatedAuthUserInfoRequestIssueReason as string value.
func (t FederatedAuthUserInfoRequestIssueReason) String() string {
	return string(t)
}

// FederatedAuthUserInfoRequestIssueReason values.
const (
	FederatedAuthUserInfoRequestIssueReasonNotSameOrigin                      FederatedAuthUserInfoRequestIssueReason = "NotSameOrigin"
	FederatedAuthUserInfoRequestIssueReasonNotIframe                          FederatedAuthUserInfoRequestIssueReason = "NotIframe"
	FederatedAuthUserInfoRequestIssueReasonNotPotentiallyTrustworthy          FederatedAuthUserInfoRequestIssueReason = "NotPotentiallyTrustworthy"
	FederatedAuthUserInfoRequestIssueReasonNoAPIPermission                    FederatedAuthUserInfoRequestIssueReason = "NoApiPermission"
	FederatedAuthUserInfoRequestIssueReasonNotSignedInWithIdp                 FederatedAuthUserInfoRequestIssueReason = "NotSignedInWithIdp"
	FederatedAuthUserInfoRequestIssueReasonNoAccountSharingPermission         FederatedAuthUserInfoRequestIssueReason = "NoAccountSharingPermission"
	FederatedAuthUserInfoRequestIssueReasonInvalidConfigOrWellKnown           FederatedAuthUserInfoRequestIssueReason = "InvalidConfigOrWellKnown"
	FederatedAuthUserInfoRequestIssueReasonInvalidAccountsResponse            FederatedAuthUserInfoRequestIssueReason = "InvalidAccountsResponse"
	FederatedAuthUserInfoRequestIssueReasonNoReturningUserFromFetchedAccounts FederatedAuthUserInfoRequestIssueReason = "NoReturningUserFromFetchedAccounts"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *FederatedAuthUserInfoRequestIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch FederatedAuthUserInfoRequestIssueReason(s) {
	case FederatedAuthUserInfoRequestIssueReasonNotSameOrigin:
		*t = FederatedAuthUserInfoRequestIssueReasonNotSameOrigin
	case FederatedAuthUserInfoRequestIssueReasonNotIframe:
		*t = FederatedAuthUserInfoRequestIssueReasonNotIframe
	case FederatedAuthUserInfoRequestIssueReasonNotPotentiallyTrustworthy:
		*t = FederatedAuthUserInfoRequestIssueReasonNotPotentiallyTrustworthy
	case FederatedAuthUserInfoRequestIssueReasonNoAPIPermission:
		*t = FederatedAuthUserInfoRequestIssueReasonNoAPIPermission
	case FederatedAuthUserInfoRequestIssueReasonNotSignedInWithIdp:
		*t = FederatedAuthUserInfoRequestIssueReasonNotSignedInWithIdp
	case FederatedAuthUserInfoRequestIssueReasonNoAccountSharingPermission:
		*t = FederatedAuthUserInfoRequestIssueReasonNoAccountSharingPermission
	case FederatedAuthUserInfoRequestIssueReasonInvalidConfigOrWellKnown:
		*t = FederatedAuthUserInfoRequestIssueReasonInvalidConfigOrWellKnown
	case FederatedAuthUserInfoRequestIssueReasonInvalidAccountsResponse:
		*t = FederatedAuthUserInfoRequestIssueReasonInvalidAccountsResponse
	case FederatedAuthUserInfoRequestIssueReasonNoReturningUserFromFetchedAccounts:
		*t = FederatedAuthUserInfoRequestIssueReasonNoReturningUserFromFetchedAccounts
	default:
		return fmt.Errorf("unknown FederatedAuthUserInfoRequestIssueReason value: %v", s)
	}
	return nil
}

// EmailVerificationRequestIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-EmailVerificationRequestIssueDetails
type EmailVerificationRequestIssueDetails struct {
	EmailVerificationRequestIssueReason EmailVerificationRequestIssueReason `json:"emailVerificationRequestIssueReason"`
}

// EmailVerificationRequestIssueReason represents the failure reason when an
// email verification request fails. Should be updated alongside
// EmailVerificationRequestResult in
// third_party/blink/public/mojom/devtools/inspector_issue.mojom.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-EmailVerificationRequestIssueReason
type EmailVerificationRequestIssueReason string

// String returns the EmailVerificationRequestIssueReason as string value.
func (t EmailVerificationRequestIssueReason) String() string {
	return string(t)
}

// EmailVerificationRequestIssueReason values.
const (
	EmailVerificationRequestIssueReasonInvalidEmail                                 EmailVerificationRequestIssueReason = "InvalidEmail"
	EmailVerificationRequestIssueReasonDNSFetchFailed                               EmailVerificationRequestIssueReason = "DnsFetchFailed"
	EmailVerificationRequestIssueReasonDNSInvalidRecord                             EmailVerificationRequestIssueReason = "DnsInvalidRecord"
	EmailVerificationRequestIssueReasonWellKnownHTTPNotFound                        EmailVerificationRequestIssueReason = "WellKnownHttpNotFound"
	EmailVerificationRequestIssueReasonWellKnownNoResponse                          EmailVerificationRequestIssueReason = "WellKnownNoResponse"
	EmailVerificationRequestIssueReasonWellKnownInvalidResponse                     EmailVerificationRequestIssueReason = "WellKnownInvalidResponse"
	EmailVerificationRequestIssueReasonWellKnownListEmpty                           EmailVerificationRequestIssueReason = "WellKnownListEmpty"
	EmailVerificationRequestIssueReasonWellKnownInvalidContentType                  EmailVerificationRequestIssueReason = "WellKnownInvalidContentType"
	EmailVerificationRequestIssueReasonWellKnownMissingIssuanceEndpoint             EmailVerificationRequestIssueReason = "WellKnownMissingIssuanceEndpoint"
	EmailVerificationRequestIssueReasonWellKnownIssuanceEndpointCrossOrigin         EmailVerificationRequestIssueReason = "WellKnownIssuanceEndpointCrossOrigin"
	EmailVerificationRequestIssueReasonWellKnownUnsupportedSigningAlgorithm         EmailVerificationRequestIssueReason = "WellKnownUnsupportedSigningAlgorithm"
	EmailVerificationRequestIssueReasonTokenHTTPNotFound                            EmailVerificationRequestIssueReason = "TokenHttpNotFound"
	EmailVerificationRequestIssueReasonTokenNoResponse                              EmailVerificationRequestIssueReason = "TokenNoResponse"
	EmailVerificationRequestIssueReasonTokenInvalidResponse                         EmailVerificationRequestIssueReason = "TokenInvalidResponse"
	EmailVerificationRequestIssueReasonTokenInvalidContentType                      EmailVerificationRequestIssueReason = "TokenInvalidContentType"
	EmailVerificationRequestIssueReasonTokenMalformedSdJwt                          EmailVerificationRequestIssueReason = "TokenMalformedSdJwt"
	EmailVerificationRequestIssueReasonTokenInvalidSdJwt                            EmailVerificationRequestIssueReason = "TokenInvalidSdJwt"
	EmailVerificationRequestIssueReasonKeyBindingSigningFailed                      EmailVerificationRequestIssueReason = "KeyBindingSigningFailed"
	EmailVerificationRequestIssueReasonRpOriginIsOpaque                             EmailVerificationRequestIssueReason = "RpOriginIsOpaque"
	EmailVerificationRequestIssueReasonWellKnownMissingAccountsEndpoint             EmailVerificationRequestIssueReason = "WellKnownMissingAccountsEndpoint"
	EmailVerificationRequestIssueReasonUserLoggedOut                                EmailVerificationRequestIssueReason = "UserLoggedOut"
	EmailVerificationRequestIssueReasonWellKnownAccountsEndpointCrossOrigin         EmailVerificationRequestIssueReason = "WellKnownAccountsEndpointCrossOrigin"
	EmailVerificationRequestIssueReasonAccountsHTTPNotFound                         EmailVerificationRequestIssueReason = "AccountsHttpNotFound"
	EmailVerificationRequestIssueReasonAccountsNoResponse                           EmailVerificationRequestIssueReason = "AccountsNoResponse"
	EmailVerificationRequestIssueReasonAccountsInvalidResponse                      EmailVerificationRequestIssueReason = "AccountsInvalidResponse"
	EmailVerificationRequestIssueReasonAccountsInvalidContentType                   EmailVerificationRequestIssueReason = "AccountsInvalidContentType"
	EmailVerificationRequestIssueReasonAccountsEmptyList                            EmailVerificationRequestIssueReason = "AccountsEmptyList"
	EmailVerificationRequestIssueReasonEmailVerificationWellKnownHTTPNotFound       EmailVerificationRequestIssueReason = "EmailVerificationWellKnownHttpNotFound"
	EmailVerificationRequestIssueReasonEmailVerificationWellKnownNoResponse         EmailVerificationRequestIssueReason = "EmailVerificationWellKnownNoResponse"
	EmailVerificationRequestIssueReasonEmailVerificationWellKnownInvalidResponse    EmailVerificationRequestIssueReason = "EmailVerificationWellKnownInvalidResponse"
	EmailVerificationRequestIssueReasonEmailVerificationWellKnownInvalidContentType EmailVerificationRequestIssueReason = "EmailVerificationWellKnownInvalidContentType"
	EmailVerificationRequestIssueReasonJwksHTTPNotFound                             EmailVerificationRequestIssueReason = "JwksHttpNotFound"
	EmailVerificationRequestIssueReasonJwksInvalidResponse                          EmailVerificationRequestIssueReason = "JwksInvalidResponse"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtUnsupportedHeaderAlg   EmailVerificationRequestIssueReason = "TokenVerificationSdJwtUnsupportedHeaderAlg"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidTyp             EmailVerificationRequestIssueReason = "TokenVerificationSdJwtInvalidTyp"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingIss             EmailVerificationRequestIssueReason = "TokenVerificationSdJwtMissingIss"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingIat             EmailVerificationRequestIssueReason = "TokenVerificationSdJwtMissingIat"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingCnf             EmailVerificationRequestIssueReason = "TokenVerificationSdJwtMissingCnf"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingEmail           EmailVerificationRequestIssueReason = "TokenVerificationSdJwtMissingEmail"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidIssuedAt        EmailVerificationRequestIssueReason = "TokenVerificationSdJwtInvalidIssuedAt"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidIssuer          EmailVerificationRequestIssueReason = "TokenVerificationSdJwtInvalidIssuer"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtJwksMissingKeys        EmailVerificationRequestIssueReason = "TokenVerificationSdJwtJwksMissingKeys"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtSignatureFailed        EmailVerificationRequestIssueReason = "TokenVerificationSdJwtSignatureFailed"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidEmailVerified   EmailVerificationRequestIssueReason = "TokenVerificationSdJwtInvalidEmailVerified"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidEmail           EmailVerificationRequestIssueReason = "TokenVerificationSdJwtInvalidEmail"
	EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidHolderKey       EmailVerificationRequestIssueReason = "TokenVerificationSdJwtInvalidHolderKey"
	EmailVerificationRequestIssueReasonTokenVerificationKbInvalidTyp                EmailVerificationRequestIssueReason = "TokenVerificationKbInvalidTyp"
	EmailVerificationRequestIssueReasonTokenVerificationKbMissingAud                EmailVerificationRequestIssueReason = "TokenVerificationKbMissingAud"
	EmailVerificationRequestIssueReasonTokenVerificationKbMissingNonce              EmailVerificationRequestIssueReason = "TokenVerificationKbMissingNonce"
	EmailVerificationRequestIssueReasonTokenVerificationKbMissingIat                EmailVerificationRequestIssueReason = "TokenVerificationKbMissingIat"
	EmailVerificationRequestIssueReasonTokenVerificationKbMissingSdHash             EmailVerificationRequestIssueReason = "TokenVerificationKbMissingSdHash"
	EmailVerificationRequestIssueReasonTokenVerificationKbInvalidIssuedAt           EmailVerificationRequestIssueReason = "TokenVerificationKbInvalidIssuedAt"
	EmailVerificationRequestIssueReasonTokenVerificationKbInvalidAudience           EmailVerificationRequestIssueReason = "TokenVerificationKbInvalidAudience"
	EmailVerificationRequestIssueReasonTokenVerificationKbInvalidNonce              EmailVerificationRequestIssueReason = "TokenVerificationKbInvalidNonce"
	EmailVerificationRequestIssueReasonTokenVerificationKbInvalidSdHash             EmailVerificationRequestIssueReason = "TokenVerificationKbInvalidSdHash"
	EmailVerificationRequestIssueReasonTokenVerificationKbMissingCnf                EmailVerificationRequestIssueReason = "TokenVerificationKbMissingCnf"
	EmailVerificationRequestIssueReasonTokenVerificationKbSignatureFailed           EmailVerificationRequestIssueReason = "TokenVerificationKbSignatureFailed"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *EmailVerificationRequestIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch EmailVerificationRequestIssueReason(s) {
	case EmailVerificationRequestIssueReasonInvalidEmail:
		*t = EmailVerificationRequestIssueReasonInvalidEmail
	case EmailVerificationRequestIssueReasonDNSFetchFailed:
		*t = EmailVerificationRequestIssueReasonDNSFetchFailed
	case EmailVerificationRequestIssueReasonDNSInvalidRecord:
		*t = EmailVerificationRequestIssueReasonDNSInvalidRecord
	case EmailVerificationRequestIssueReasonWellKnownHTTPNotFound:
		*t = EmailVerificationRequestIssueReasonWellKnownHTTPNotFound
	case EmailVerificationRequestIssueReasonWellKnownNoResponse:
		*t = EmailVerificationRequestIssueReasonWellKnownNoResponse
	case EmailVerificationRequestIssueReasonWellKnownInvalidResponse:
		*t = EmailVerificationRequestIssueReasonWellKnownInvalidResponse
	case EmailVerificationRequestIssueReasonWellKnownListEmpty:
		*t = EmailVerificationRequestIssueReasonWellKnownListEmpty
	case EmailVerificationRequestIssueReasonWellKnownInvalidContentType:
		*t = EmailVerificationRequestIssueReasonWellKnownInvalidContentType
	case EmailVerificationRequestIssueReasonWellKnownMissingIssuanceEndpoint:
		*t = EmailVerificationRequestIssueReasonWellKnownMissingIssuanceEndpoint
	case EmailVerificationRequestIssueReasonWellKnownIssuanceEndpointCrossOrigin:
		*t = EmailVerificationRequestIssueReasonWellKnownIssuanceEndpointCrossOrigin
	case EmailVerificationRequestIssueReasonWellKnownUnsupportedSigningAlgorithm:
		*t = EmailVerificationRequestIssueReasonWellKnownUnsupportedSigningAlgorithm
	case EmailVerificationRequestIssueReasonTokenHTTPNotFound:
		*t = EmailVerificationRequestIssueReasonTokenHTTPNotFound
	case EmailVerificationRequestIssueReasonTokenNoResponse:
		*t = EmailVerificationRequestIssueReasonTokenNoResponse
	case EmailVerificationRequestIssueReasonTokenInvalidResponse:
		*t = EmailVerificationRequestIssueReasonTokenInvalidResponse
	case EmailVerificationRequestIssueReasonTokenInvalidContentType:
		*t = EmailVerificationRequestIssueReasonTokenInvalidContentType
	case EmailVerificationRequestIssueReasonTokenMalformedSdJwt:
		*t = EmailVerificationRequestIssueReasonTokenMalformedSdJwt
	case EmailVerificationRequestIssueReasonTokenInvalidSdJwt:
		*t = EmailVerificationRequestIssueReasonTokenInvalidSdJwt
	case EmailVerificationRequestIssueReasonKeyBindingSigningFailed:
		*t = EmailVerificationRequestIssueReasonKeyBindingSigningFailed
	case EmailVerificationRequestIssueReasonRpOriginIsOpaque:
		*t = EmailVerificationRequestIssueReasonRpOriginIsOpaque
	case EmailVerificationRequestIssueReasonWellKnownMissingAccountsEndpoint:
		*t = EmailVerificationRequestIssueReasonWellKnownMissingAccountsEndpoint
	case EmailVerificationRequestIssueReasonUserLoggedOut:
		*t = EmailVerificationRequestIssueReasonUserLoggedOut
	case EmailVerificationRequestIssueReasonWellKnownAccountsEndpointCrossOrigin:
		*t = EmailVerificationRequestIssueReasonWellKnownAccountsEndpointCrossOrigin
	case EmailVerificationRequestIssueReasonAccountsHTTPNotFound:
		*t = EmailVerificationRequestIssueReasonAccountsHTTPNotFound
	case EmailVerificationRequestIssueReasonAccountsNoResponse:
		*t = EmailVerificationRequestIssueReasonAccountsNoResponse
	case EmailVerificationRequestIssueReasonAccountsInvalidResponse:
		*t = EmailVerificationRequestIssueReasonAccountsInvalidResponse
	case EmailVerificationRequestIssueReasonAccountsInvalidContentType:
		*t = EmailVerificationRequestIssueReasonAccountsInvalidContentType
	case EmailVerificationRequestIssueReasonAccountsEmptyList:
		*t = EmailVerificationRequestIssueReasonAccountsEmptyList
	case EmailVerificationRequestIssueReasonEmailVerificationWellKnownHTTPNotFound:
		*t = EmailVerificationRequestIssueReasonEmailVerificationWellKnownHTTPNotFound
	case EmailVerificationRequestIssueReasonEmailVerificationWellKnownNoResponse:
		*t = EmailVerificationRequestIssueReasonEmailVerificationWellKnownNoResponse
	case EmailVerificationRequestIssueReasonEmailVerificationWellKnownInvalidResponse:
		*t = EmailVerificationRequestIssueReasonEmailVerificationWellKnownInvalidResponse
	case EmailVerificationRequestIssueReasonEmailVerificationWellKnownInvalidContentType:
		*t = EmailVerificationRequestIssueReasonEmailVerificationWellKnownInvalidContentType
	case EmailVerificationRequestIssueReasonJwksHTTPNotFound:
		*t = EmailVerificationRequestIssueReasonJwksHTTPNotFound
	case EmailVerificationRequestIssueReasonJwksInvalidResponse:
		*t = EmailVerificationRequestIssueReasonJwksInvalidResponse
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtUnsupportedHeaderAlg:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtUnsupportedHeaderAlg
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidTyp:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidTyp
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingIss:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingIss
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingIat:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingIat
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingCnf:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingCnf
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingEmail:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtMissingEmail
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidIssuedAt:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidIssuedAt
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidIssuer:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidIssuer
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtJwksMissingKeys:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtJwksMissingKeys
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtSignatureFailed:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtSignatureFailed
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidEmailVerified:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidEmailVerified
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidEmail:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidEmail
	case EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidHolderKey:
		*t = EmailVerificationRequestIssueReasonTokenVerificationSdJwtInvalidHolderKey
	case EmailVerificationRequestIssueReasonTokenVerificationKbInvalidTyp:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbInvalidTyp
	case EmailVerificationRequestIssueReasonTokenVerificationKbMissingAud:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbMissingAud
	case EmailVerificationRequestIssueReasonTokenVerificationKbMissingNonce:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbMissingNonce
	case EmailVerificationRequestIssueReasonTokenVerificationKbMissingIat:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbMissingIat
	case EmailVerificationRequestIssueReasonTokenVerificationKbMissingSdHash:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbMissingSdHash
	case EmailVerificationRequestIssueReasonTokenVerificationKbInvalidIssuedAt:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbInvalidIssuedAt
	case EmailVerificationRequestIssueReasonTokenVerificationKbInvalidAudience:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbInvalidAudience
	case EmailVerificationRequestIssueReasonTokenVerificationKbInvalidNonce:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbInvalidNonce
	case EmailVerificationRequestIssueReasonTokenVerificationKbInvalidSdHash:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbInvalidSdHash
	case EmailVerificationRequestIssueReasonTokenVerificationKbMissingCnf:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbMissingCnf
	case EmailVerificationRequestIssueReasonTokenVerificationKbSignatureFailed:
		*t = EmailVerificationRequestIssueReasonTokenVerificationKbSignatureFailed
	default:
		return fmt.Errorf("unknown EmailVerificationRequestIssueReason value: %v", s)
	}
	return nil
}

// ClientHintIssueDetails this issue tracks client hints related issues. It's
// used to deprecate old features, encourage the use of new ones, and provide
// general guidance.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ClientHintIssueDetails
type ClientHintIssueDetails struct {
	SourceCodeLocation    *SourceCodeLocation   `json:"sourceCodeLocation"`
	ClientHintIssueReason ClientHintIssueReason `json:"clientHintIssueReason"`
}

// FailedRequestInfo [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-FailedRequestInfo
type FailedRequestInfo struct {
	URL            string            `json:"url"`            // The URL that failed to load.
	FailureMessage string            `json:"failureMessage"` // The failure message for the failed request.
	RequestID      network.RequestID `json:"requestId,omitempty,omitzero"`
}

// PartitioningBlobURLInfo [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PartitioningBlobURLInfo
type PartitioningBlobURLInfo string

// String returns the PartitioningBlobURLInfo as string value.
func (t PartitioningBlobURLInfo) String() string {
	return string(t)
}

// PartitioningBlobURLInfo values.
const (
	PartitioningBlobURLInfoBlockedCrossPartitionFetching PartitioningBlobURLInfo = "BlockedCrossPartitionFetching"
	PartitioningBlobURLInfoEnforceNoopenerForNavigation  PartitioningBlobURLInfo = "EnforceNoopenerForNavigation"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *PartitioningBlobURLInfo) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch PartitioningBlobURLInfo(s) {
	case PartitioningBlobURLInfoBlockedCrossPartitionFetching:
		*t = PartitioningBlobURLInfoBlockedCrossPartitionFetching
	case PartitioningBlobURLInfoEnforceNoopenerForNavigation:
		*t = PartitioningBlobURLInfoEnforceNoopenerForNavigation
	default:
		return fmt.Errorf("unknown PartitioningBlobURLInfo value: %v", s)
	}
	return nil
}

// PartitioningBlobURLIssueDetails [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PartitioningBlobURLIssueDetails
type PartitioningBlobURLIssueDetails struct {
	URL                     string                  `json:"url"`                     // The BlobURL that failed to load.
	PartitioningBlobURLInfo PartitioningBlobURLInfo `json:"partitioningBlobURLInfo"` // Additional information about the Partitioning Blob URL issue.
}

// ElementAccessibilityIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ElementAccessibilityIssueReason
type ElementAccessibilityIssueReason string

// String returns the ElementAccessibilityIssueReason as string value.
func (t ElementAccessibilityIssueReason) String() string {
	return string(t)
}

// ElementAccessibilityIssueReason values.
const (
	ElementAccessibilityIssueReasonDisallowedSelectChild               ElementAccessibilityIssueReason = "DisallowedSelectChild"
	ElementAccessibilityIssueReasonDisallowedOptGroupChild             ElementAccessibilityIssueReason = "DisallowedOptGroupChild"
	ElementAccessibilityIssueReasonNonPhrasingContentOptionChild       ElementAccessibilityIssueReason = "NonPhrasingContentOptionChild"
	ElementAccessibilityIssueReasonInteractiveContentOptionChild       ElementAccessibilityIssueReason = "InteractiveContentOptionChild"
	ElementAccessibilityIssueReasonInteractiveContentLegendChild       ElementAccessibilityIssueReason = "InteractiveContentLegendChild"
	ElementAccessibilityIssueReasonInteractiveContentSummaryDescendant ElementAccessibilityIssueReason = "InteractiveContentSummaryDescendant"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *ElementAccessibilityIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch ElementAccessibilityIssueReason(s) {
	case ElementAccessibilityIssueReasonDisallowedSelectChild:
		*t = ElementAccessibilityIssueReasonDisallowedSelectChild
	case ElementAccessibilityIssueReasonDisallowedOptGroupChild:
		*t = ElementAccessibilityIssueReasonDisallowedOptGroupChild
	case ElementAccessibilityIssueReasonNonPhrasingContentOptionChild:
		*t = ElementAccessibilityIssueReasonNonPhrasingContentOptionChild
	case ElementAccessibilityIssueReasonInteractiveContentOptionChild:
		*t = ElementAccessibilityIssueReasonInteractiveContentOptionChild
	case ElementAccessibilityIssueReasonInteractiveContentLegendChild:
		*t = ElementAccessibilityIssueReasonInteractiveContentLegendChild
	case ElementAccessibilityIssueReasonInteractiveContentSummaryDescendant:
		*t = ElementAccessibilityIssueReasonInteractiveContentSummaryDescendant
	default:
		return fmt.Errorf("unknown ElementAccessibilityIssueReason value: %v", s)
	}
	return nil
}

// ElementAccessibilityIssueDetails this issue warns about errors in the
// select or summary element content model.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-ElementAccessibilityIssueDetails
type ElementAccessibilityIssueDetails struct {
	NodeID                          cdp.BackendNodeID               `json:"nodeId"`
	ElementAccessibilityIssueReason ElementAccessibilityIssueReason `json:"elementAccessibilityIssueReason"`
	HasDisallowedAttributes         bool                            `json:"hasDisallowedAttributes"`
}

// StyleSheetLoadingIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-StyleSheetLoadingIssueReason
type StyleSheetLoadingIssueReason string

// String returns the StyleSheetLoadingIssueReason as string value.
func (t StyleSheetLoadingIssueReason) String() string {
	return string(t)
}

// StyleSheetLoadingIssueReason values.
const (
	StyleSheetLoadingIssueReasonLateImportRule StyleSheetLoadingIssueReason = "LateImportRule"
	StyleSheetLoadingIssueReasonRequestFailed  StyleSheetLoadingIssueReason = "RequestFailed"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *StyleSheetLoadingIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch StyleSheetLoadingIssueReason(s) {
	case StyleSheetLoadingIssueReasonLateImportRule:
		*t = StyleSheetLoadingIssueReasonLateImportRule
	case StyleSheetLoadingIssueReasonRequestFailed:
		*t = StyleSheetLoadingIssueReasonRequestFailed
	default:
		return fmt.Errorf("unknown StyleSheetLoadingIssueReason value: %v", s)
	}
	return nil
}

// StylesheetLoadingIssueDetails this issue warns when a referenced
// stylesheet couldn't be loaded.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-StylesheetLoadingIssueDetails
type StylesheetLoadingIssueDetails struct {
	SourceCodeLocation           *SourceCodeLocation          `json:"sourceCodeLocation"`                   // Source code position that referenced the failing stylesheet.
	StyleSheetLoadingIssueReason StyleSheetLoadingIssueReason `json:"styleSheetLoadingIssueReason"`         // Reason why the stylesheet couldn't be loaded.
	FailedRequestInfo            *FailedRequestInfo           `json:"failedRequestInfo,omitempty,omitzero"` // Contains additional info when the failure was due to a request.
}

// PropertyRuleIssueReason [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PropertyRuleIssueReason
type PropertyRuleIssueReason string

// String returns the PropertyRuleIssueReason as string value.
func (t PropertyRuleIssueReason) String() string {
	return string(t)
}

// PropertyRuleIssueReason values.
const (
	PropertyRuleIssueReasonInvalidSyntax       PropertyRuleIssueReason = "InvalidSyntax"
	PropertyRuleIssueReasonInvalidInitialValue PropertyRuleIssueReason = "InvalidInitialValue"
	PropertyRuleIssueReasonInvalidInherits     PropertyRuleIssueReason = "InvalidInherits"
	PropertyRuleIssueReasonInvalidName         PropertyRuleIssueReason = "InvalidName"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *PropertyRuleIssueReason) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch PropertyRuleIssueReason(s) {
	case PropertyRuleIssueReasonInvalidSyntax:
		*t = PropertyRuleIssueReasonInvalidSyntax
	case PropertyRuleIssueReasonInvalidInitialValue:
		*t = PropertyRuleIssueReasonInvalidInitialValue
	case PropertyRuleIssueReasonInvalidInherits:
		*t = PropertyRuleIssueReasonInvalidInherits
	case PropertyRuleIssueReasonInvalidName:
		*t = PropertyRuleIssueReasonInvalidName
	default:
		return fmt.Errorf("unknown PropertyRuleIssueReason value: %v", s)
	}
	return nil
}

// PropertyRuleIssueDetails this issue warns about errors in property rules
// that lead to property registrations being ignored.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PropertyRuleIssueDetails
type PropertyRuleIssueDetails struct {
	SourceCodeLocation      *SourceCodeLocation     `json:"sourceCodeLocation"`               // Source code position of the property rule.
	PropertyRuleIssueReason PropertyRuleIssueReason `json:"propertyRuleIssueReason"`          // Reason why the property rule was discarded.
	PropertyValue           string                  `json:"propertyValue,omitempty,omitzero"` // The value of the property rule property that failed to parse
}

// UserReidentificationIssueType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-UserReidentificationIssueType
type UserReidentificationIssueType string

// String returns the UserReidentificationIssueType as string value.
func (t UserReidentificationIssueType) String() string {
	return string(t)
}

// UserReidentificationIssueType values.
const (
	UserReidentificationIssueTypeBlockedFrameNavigation UserReidentificationIssueType = "BlockedFrameNavigation"
	UserReidentificationIssueTypeBlockedSubresource     UserReidentificationIssueType = "BlockedSubresource"
	UserReidentificationIssueTypeNoisedCanvasReadback   UserReidentificationIssueType = "NoisedCanvasReadback"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *UserReidentificationIssueType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch UserReidentificationIssueType(s) {
	case UserReidentificationIssueTypeBlockedFrameNavigation:
		*t = UserReidentificationIssueTypeBlockedFrameNavigation
	case UserReidentificationIssueTypeBlockedSubresource:
		*t = UserReidentificationIssueTypeBlockedSubresource
	case UserReidentificationIssueTypeNoisedCanvasReadback:
		*t = UserReidentificationIssueTypeNoisedCanvasReadback
	default:
		return fmt.Errorf("unknown UserReidentificationIssueType value: %v", s)
	}
	return nil
}

// UserReidentificationIssueDetails this issue warns about uses of APIs that
// may be considered misuse to re-identify users.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-UserReidentificationIssueDetails
type UserReidentificationIssueDetails struct {
	Type               UserReidentificationIssueType `json:"type"`
	Request            *AffectedRequest              `json:"request,omitempty,omitzero"`            // Applies to BlockedFrameNavigation and BlockedSubresource issue types.
	SourceCodeLocation *SourceCodeLocation           `json:"sourceCodeLocation,omitempty,omitzero"` // Applies to NoisedCanvasReadback issue type.
}

// PermissionElementIssueType [no description].
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PermissionElementIssueType
type PermissionElementIssueType string

// String returns the PermissionElementIssueType as string value.
func (t PermissionElementIssueType) String() string {
	return string(t)
}

// PermissionElementIssueType values.
const (
	PermissionElementIssueTypeInvalidType                    PermissionElementIssueType = "InvalidType"
	PermissionElementIssueTypeFencedFrameDisallowed          PermissionElementIssueType = "FencedFrameDisallowed"
	PermissionElementIssueTypeCspFrameAncestorsMissing       PermissionElementIssueType = "CspFrameAncestorsMissing"
	PermissionElementIssueTypePermissionsPolicyBlocked       PermissionElementIssueType = "PermissionsPolicyBlocked"
	PermissionElementIssueTypePaddingRightUnsupported        PermissionElementIssueType = "PaddingRightUnsupported"
	PermissionElementIssueTypePaddingBottomUnsupported       PermissionElementIssueType = "PaddingBottomUnsupported"
	PermissionElementIssueTypeInsetBoxShadowUnsupported      PermissionElementIssueType = "InsetBoxShadowUnsupported"
	PermissionElementIssueTypeRequestInProgress              PermissionElementIssueType = "RequestInProgress"
	PermissionElementIssueTypeUntrustedEvent                 PermissionElementIssueType = "UntrustedEvent"
	PermissionElementIssueTypeRegistrationFailed             PermissionElementIssueType = "RegistrationFailed"
	PermissionElementIssueTypeTypeNotSupported               PermissionElementIssueType = "TypeNotSupported"
	PermissionElementIssueTypeInvalidTypeActivation          PermissionElementIssueType = "InvalidTypeActivation"
	PermissionElementIssueTypeSecurityChecksFailed           PermissionElementIssueType = "SecurityChecksFailed"
	PermissionElementIssueTypeActivationDisabled             PermissionElementIssueType = "ActivationDisabled"
	PermissionElementIssueTypeGeolocationDeprecated          PermissionElementIssueType = "GeolocationDeprecated"
	PermissionElementIssueTypeInvalidDisplayStyle            PermissionElementIssueType = "InvalidDisplayStyle"
	PermissionElementIssueTypeNonOpaqueColor                 PermissionElementIssueType = "NonOpaqueColor"
	PermissionElementIssueTypeLowContrast                    PermissionElementIssueType = "LowContrast"
	PermissionElementIssueTypeFontSizeTooSmall               PermissionElementIssueType = "FontSizeTooSmall"
	PermissionElementIssueTypeFontSizeTooLarge               PermissionElementIssueType = "FontSizeTooLarge"
	PermissionElementIssueTypeInvalidSizeValue               PermissionElementIssueType = "InvalidSizeValue"
	PermissionElementIssueTypeNonSecureContext               PermissionElementIssueType = "NonSecureContext"
	PermissionElementIssueTypeMissingTransientUserActivation PermissionElementIssueType = "MissingTransientUserActivation"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *PermissionElementIssueType) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch PermissionElementIssueType(s) {
	case PermissionElementIssueTypeInvalidType:
		*t = PermissionElementIssueTypeInvalidType
	case PermissionElementIssueTypeFencedFrameDisallowed:
		*t = PermissionElementIssueTypeFencedFrameDisallowed
	case PermissionElementIssueTypeCspFrameAncestorsMissing:
		*t = PermissionElementIssueTypeCspFrameAncestorsMissing
	case PermissionElementIssueTypePermissionsPolicyBlocked:
		*t = PermissionElementIssueTypePermissionsPolicyBlocked
	case PermissionElementIssueTypePaddingRightUnsupported:
		*t = PermissionElementIssueTypePaddingRightUnsupported
	case PermissionElementIssueTypePaddingBottomUnsupported:
		*t = PermissionElementIssueTypePaddingBottomUnsupported
	case PermissionElementIssueTypeInsetBoxShadowUnsupported:
		*t = PermissionElementIssueTypeInsetBoxShadowUnsupported
	case PermissionElementIssueTypeRequestInProgress:
		*t = PermissionElementIssueTypeRequestInProgress
	case PermissionElementIssueTypeUntrustedEvent:
		*t = PermissionElementIssueTypeUntrustedEvent
	case PermissionElementIssueTypeRegistrationFailed:
		*t = PermissionElementIssueTypeRegistrationFailed
	case PermissionElementIssueTypeTypeNotSupported:
		*t = PermissionElementIssueTypeTypeNotSupported
	case PermissionElementIssueTypeInvalidTypeActivation:
		*t = PermissionElementIssueTypeInvalidTypeActivation
	case PermissionElementIssueTypeSecurityChecksFailed:
		*t = PermissionElementIssueTypeSecurityChecksFailed
	case PermissionElementIssueTypeActivationDisabled:
		*t = PermissionElementIssueTypeActivationDisabled
	case PermissionElementIssueTypeGeolocationDeprecated:
		*t = PermissionElementIssueTypeGeolocationDeprecated
	case PermissionElementIssueTypeInvalidDisplayStyle:
		*t = PermissionElementIssueTypeInvalidDisplayStyle
	case PermissionElementIssueTypeNonOpaqueColor:
		*t = PermissionElementIssueTypeNonOpaqueColor
	case PermissionElementIssueTypeLowContrast:
		*t = PermissionElementIssueTypeLowContrast
	case PermissionElementIssueTypeFontSizeTooSmall:
		*t = PermissionElementIssueTypeFontSizeTooSmall
	case PermissionElementIssueTypeFontSizeTooLarge:
		*t = PermissionElementIssueTypeFontSizeTooLarge
	case PermissionElementIssueTypeInvalidSizeValue:
		*t = PermissionElementIssueTypeInvalidSizeValue
	case PermissionElementIssueTypeNonSecureContext:
		*t = PermissionElementIssueTypeNonSecureContext
	case PermissionElementIssueTypeMissingTransientUserActivation:
		*t = PermissionElementIssueTypeMissingTransientUserActivation
	default:
		return fmt.Errorf("unknown PermissionElementIssueType value: %v", s)
	}
	return nil
}

// PermissionElementIssueDetails this issue warns about improper usage of the
// <permission> element.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-PermissionElementIssueDetails
type PermissionElementIssueDetails struct {
	IssueType              PermissionElementIssueType `json:"issueType"`
	Type                   string                     `json:"type,omitempty,omitzero"`                   // The value of the type attribute.
	NodeID                 cdp.BackendNodeID          `json:"nodeId,omitempty,omitzero"`                 // The node ID of the <permission> element.
	IsWarning              bool                       `json:"isWarning"`                                 // True if the issue is a warning, false if it is an error.
	PermissionName         string                     `json:"permissionName,omitempty,omitzero"`         // Fields for message construction: Used for messages that reference a specific permission name
	OccluderNodeInfo       string                     `json:"occluderNodeInfo,omitempty,omitzero"`       // Used for messages about occlusion
	OccluderParentNodeInfo string                     `json:"occluderParentNodeInfo,omitempty,omitzero"` // Used for messages about occluder's parent
	DisableReason          string                     `json:"disableReason,omitempty,omitzero"`          // Used for messages about activation disabled reason
}

// SelectivePermissionsInterventionIssueDetails the issue warns about blocked
// calls to privacy sensitive APIs via the Selective Permissions Intervention.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-SelectivePermissionsInterventionIssueDetails
type SelectivePermissionsInterventionIssueDetails struct {
	APIName    string              `json:"apiName"`                       // Which API was intervened on.
	AdAncestry *cdp.AdAncestry     `json:"adAncestry"`                    // Why the ad script using the API is considered an ad.
	StackTrace *runtime.StackTrace `json:"stackTrace,omitempty,omitzero"` // The stack trace at the time of the intervention.
}

// LazyLoadImageIssueDetails details for issues about lazy-loaded images
// without explicit dimensions.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-LazyLoadImageIssueDetails
type LazyLoadImageIssueDetails struct {
	NodeID  cdp.BackendNodeID `json:"nodeId"`  // DOM node of the problematic HTMLImageElement.
	URL     string            `json:"url"`     // URL or src attribute of the image.
	FrameID cdp.FrameID       `json:"frameId"` // Frame containing the image.
}

// InspectorIssueCode a unique identifier for the type of issue. Each type
// may use one of the optional fields in InspectorIssueDetails to convey more
// specific information about the kind of issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-InspectorIssueCode
type InspectorIssueCode string

// String returns the InspectorIssueCode as string value.
func (t InspectorIssueCode) String() string {
	return string(t)
}

// InspectorIssueCode values.
const (
	InspectorIssueCodeCookieIssue                           InspectorIssueCode = "CookieIssue"
	InspectorIssueCodeMixedContentIssue                     InspectorIssueCode = "MixedContentIssue"
	InspectorIssueCodeBlockedByResponseIssue                InspectorIssueCode = "BlockedByResponseIssue"
	InspectorIssueCodeHeavyAdIssue                          InspectorIssueCode = "HeavyAdIssue"
	InspectorIssueCodeContentSecurityPolicyIssue            InspectorIssueCode = "ContentSecurityPolicyIssue"
	InspectorIssueCodeSharedArrayBufferIssue                InspectorIssueCode = "SharedArrayBufferIssue"
	InspectorIssueCodeCorsIssue                             InspectorIssueCode = "CorsIssue"
	InspectorIssueCodeQuirksModeIssue                       InspectorIssueCode = "QuirksModeIssue"
	InspectorIssueCodePartitioningBlobURLIssue              InspectorIssueCode = "PartitioningBlobURLIssue"
	InspectorIssueCodeNavigatorUserAgentIssue               InspectorIssueCode = "NavigatorUserAgentIssue"
	InspectorIssueCodeGenericIssue                          InspectorIssueCode = "GenericIssue"
	InspectorIssueCodeDeprecationIssue                      InspectorIssueCode = "DeprecationIssue"
	InspectorIssueCodeClientHintIssue                       InspectorIssueCode = "ClientHintIssue"
	InspectorIssueCodeFederatedAuthRequestIssue             InspectorIssueCode = "FederatedAuthRequestIssue"
	InspectorIssueCodeBounceTrackingIssue                   InspectorIssueCode = "BounceTrackingIssue"
	InspectorIssueCodeCookieDeprecationMetadataIssue        InspectorIssueCode = "CookieDeprecationMetadataIssue"
	InspectorIssueCodeStylesheetLoadingIssue                InspectorIssueCode = "StylesheetLoadingIssue"
	InspectorIssueCodeFederatedAuthUserInfoRequestIssue     InspectorIssueCode = "FederatedAuthUserInfoRequestIssue"
	InspectorIssueCodePropertyRuleIssue                     InspectorIssueCode = "PropertyRuleIssue"
	InspectorIssueCodeSharedDictionaryIssue                 InspectorIssueCode = "SharedDictionaryIssue"
	InspectorIssueCodeElementAccessibilityIssue             InspectorIssueCode = "ElementAccessibilityIssue"
	InspectorIssueCodeSRIMessageSignatureIssue              InspectorIssueCode = "SRIMessageSignatureIssue"
	InspectorIssueCodeUnencodedDigestIssue                  InspectorIssueCode = "UnencodedDigestIssue"
	InspectorIssueCodeConnectionAllowlistIssue              InspectorIssueCode = "ConnectionAllowlistIssue"
	InspectorIssueCodeUserReidentificationIssue             InspectorIssueCode = "UserReidentificationIssue"
	InspectorIssueCodePermissionElementIssue                InspectorIssueCode = "PermissionElementIssue"
	InspectorIssueCodePerformanceIssue                      InspectorIssueCode = "PerformanceIssue"
	InspectorIssueCodeSelectivePermissionsInterventionIssue InspectorIssueCode = "SelectivePermissionsInterventionIssue"
	InspectorIssueCodeEmailVerificationRequestIssue         InspectorIssueCode = "EmailVerificationRequestIssue"
	InspectorIssueCodeLazyLoadImageIssue                    InspectorIssueCode = "LazyLoadImageIssue"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *InspectorIssueCode) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch InspectorIssueCode(s) {
	case InspectorIssueCodeCookieIssue:
		*t = InspectorIssueCodeCookieIssue
	case InspectorIssueCodeMixedContentIssue:
		*t = InspectorIssueCodeMixedContentIssue
	case InspectorIssueCodeBlockedByResponseIssue:
		*t = InspectorIssueCodeBlockedByResponseIssue
	case InspectorIssueCodeHeavyAdIssue:
		*t = InspectorIssueCodeHeavyAdIssue
	case InspectorIssueCodeContentSecurityPolicyIssue:
		*t = InspectorIssueCodeContentSecurityPolicyIssue
	case InspectorIssueCodeSharedArrayBufferIssue:
		*t = InspectorIssueCodeSharedArrayBufferIssue
	case InspectorIssueCodeCorsIssue:
		*t = InspectorIssueCodeCorsIssue
	case InspectorIssueCodeQuirksModeIssue:
		*t = InspectorIssueCodeQuirksModeIssue
	case InspectorIssueCodePartitioningBlobURLIssue:
		*t = InspectorIssueCodePartitioningBlobURLIssue
	case InspectorIssueCodeNavigatorUserAgentIssue:
		*t = InspectorIssueCodeNavigatorUserAgentIssue
	case InspectorIssueCodeGenericIssue:
		*t = InspectorIssueCodeGenericIssue
	case InspectorIssueCodeDeprecationIssue:
		*t = InspectorIssueCodeDeprecationIssue
	case InspectorIssueCodeClientHintIssue:
		*t = InspectorIssueCodeClientHintIssue
	case InspectorIssueCodeFederatedAuthRequestIssue:
		*t = InspectorIssueCodeFederatedAuthRequestIssue
	case InspectorIssueCodeBounceTrackingIssue:
		*t = InspectorIssueCodeBounceTrackingIssue
	case InspectorIssueCodeCookieDeprecationMetadataIssue:
		*t = InspectorIssueCodeCookieDeprecationMetadataIssue
	case InspectorIssueCodeStylesheetLoadingIssue:
		*t = InspectorIssueCodeStylesheetLoadingIssue
	case InspectorIssueCodeFederatedAuthUserInfoRequestIssue:
		*t = InspectorIssueCodeFederatedAuthUserInfoRequestIssue
	case InspectorIssueCodePropertyRuleIssue:
		*t = InspectorIssueCodePropertyRuleIssue
	case InspectorIssueCodeSharedDictionaryIssue:
		*t = InspectorIssueCodeSharedDictionaryIssue
	case InspectorIssueCodeElementAccessibilityIssue:
		*t = InspectorIssueCodeElementAccessibilityIssue
	case InspectorIssueCodeSRIMessageSignatureIssue:
		*t = InspectorIssueCodeSRIMessageSignatureIssue
	case InspectorIssueCodeUnencodedDigestIssue:
		*t = InspectorIssueCodeUnencodedDigestIssue
	case InspectorIssueCodeConnectionAllowlistIssue:
		*t = InspectorIssueCodeConnectionAllowlistIssue
	case InspectorIssueCodeUserReidentificationIssue:
		*t = InspectorIssueCodeUserReidentificationIssue
	case InspectorIssueCodePermissionElementIssue:
		*t = InspectorIssueCodePermissionElementIssue
	case InspectorIssueCodePerformanceIssue:
		*t = InspectorIssueCodePerformanceIssue
	case InspectorIssueCodeSelectivePermissionsInterventionIssue:
		*t = InspectorIssueCodeSelectivePermissionsInterventionIssue
	case InspectorIssueCodeEmailVerificationRequestIssue:
		*t = InspectorIssueCodeEmailVerificationRequestIssue
	case InspectorIssueCodeLazyLoadImageIssue:
		*t = InspectorIssueCodeLazyLoadImageIssue
	default:
		return fmt.Errorf("unknown InspectorIssueCode value: %v", s)
	}
	return nil
}

// InspectorIssueDetails this struct holds a list of optional fields with
// additional information specific to the kind of issue. When adding a new issue
// code, please also add a new optional field to this type.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-InspectorIssueDetails
type InspectorIssueDetails struct {
	CookieIssueDetails                           *CookieIssueDetails                           `json:"cookieIssueDetails,omitempty,omitzero"`
	MixedContentIssueDetails                     *MixedContentIssueDetails                     `json:"mixedContentIssueDetails,omitempty,omitzero"`
	BlockedByResponseIssueDetails                *BlockedByResponseIssueDetails                `json:"blockedByResponseIssueDetails,omitempty,omitzero"`
	HeavyAdIssueDetails                          *HeavyAdIssueDetails                          `json:"heavyAdIssueDetails,omitempty,omitzero"`
	ContentSecurityPolicyIssueDetails            *ContentSecurityPolicyIssueDetails            `json:"contentSecurityPolicyIssueDetails,omitempty,omitzero"`
	SharedArrayBufferIssueDetails                *SharedArrayBufferIssueDetails                `json:"sharedArrayBufferIssueDetails,omitempty,omitzero"`
	CorsIssueDetails                             *CorsIssueDetails                             `json:"corsIssueDetails,omitempty,omitzero"`
	QuirksModeIssueDetails                       *QuirksModeIssueDetails                       `json:"quirksModeIssueDetails,omitempty,omitzero"`
	PartitioningBlobURLIssueDetails              *PartitioningBlobURLIssueDetails              `json:"partitioningBlobURLIssueDetails,omitempty,omitzero"`
	GenericIssueDetails                          *GenericIssueDetails                          `json:"genericIssueDetails,omitempty,omitzero"`
	DeprecationIssueDetails                      *DeprecationIssueDetails                      `json:"deprecationIssueDetails,omitempty,omitzero"`
	ClientHintIssueDetails                       *ClientHintIssueDetails                       `json:"clientHintIssueDetails,omitempty,omitzero"`
	FederatedAuthRequestIssueDetails             *FederatedAuthRequestIssueDetails             `json:"federatedAuthRequestIssueDetails,omitempty,omitzero"`
	BounceTrackingIssueDetails                   *BounceTrackingIssueDetails                   `json:"bounceTrackingIssueDetails,omitempty,omitzero"`
	CookieDeprecationMetadataIssueDetails        *CookieDeprecationMetadataIssueDetails        `json:"cookieDeprecationMetadataIssueDetails,omitempty,omitzero"`
	StylesheetLoadingIssueDetails                *StylesheetLoadingIssueDetails                `json:"stylesheetLoadingIssueDetails,omitempty,omitzero"`
	PropertyRuleIssueDetails                     *PropertyRuleIssueDetails                     `json:"propertyRuleIssueDetails,omitempty,omitzero"`
	FederatedAuthUserInfoRequestIssueDetails     *FederatedAuthUserInfoRequestIssueDetails     `json:"federatedAuthUserInfoRequestIssueDetails,omitempty,omitzero"`
	SharedDictionaryIssueDetails                 *SharedDictionaryIssueDetails                 `json:"sharedDictionaryIssueDetails,omitempty,omitzero"`
	ElementAccessibilityIssueDetails             *ElementAccessibilityIssueDetails             `json:"elementAccessibilityIssueDetails,omitempty,omitzero"`
	SriMessageSignatureIssueDetails              *SRIMessageSignatureIssueDetails              `json:"sriMessageSignatureIssueDetails,omitempty,omitzero"`
	UnencodedDigestIssueDetails                  *UnencodedDigestIssueDetails                  `json:"unencodedDigestIssueDetails,omitempty,omitzero"`
	ConnectionAllowlistIssueDetails              *ConnectionAllowlistIssueDetails              `json:"connectionAllowlistIssueDetails,omitempty,omitzero"`
	UserReidentificationIssueDetails             *UserReidentificationIssueDetails             `json:"userReidentificationIssueDetails,omitempty,omitzero"`
	PermissionElementIssueDetails                *PermissionElementIssueDetails                `json:"permissionElementIssueDetails,omitempty,omitzero"`
	PerformanceIssueDetails                      *PerformanceIssueDetails                      `json:"performanceIssueDetails,omitempty,omitzero"`
	SelectivePermissionsInterventionIssueDetails *SelectivePermissionsInterventionIssueDetails `json:"selectivePermissionsInterventionIssueDetails,omitempty,omitzero"`
	EmailVerificationRequestIssueDetails         *EmailVerificationRequestIssueDetails         `json:"emailVerificationRequestIssueDetails,omitempty,omitzero"`
	LazyLoadImageIssueDetails                    *LazyLoadImageIssueDetails                    `json:"lazyLoadImageIssueDetails,omitempty,omitzero"`
}

// IssueID a unique id for a DevTools inspector issue. Allows other entities
// (e.g. exceptions, CDP message, console messages, etc.) to reference an issue.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-IssueId
type IssueID string

// String returns the IssueID as string value.
func (t IssueID) String() string {
	return string(t)
}

// InspectorIssue an inspector issue reported from the back-end.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#type-InspectorIssue
type InspectorIssue struct {
	Code    InspectorIssueCode     `json:"code"`
	Details *InspectorIssueDetails `json:"details"`
	IssueID IssueID                `json:"issueId,omitempty,omitzero"` // A unique id for this issue. May be omitted if no other entity (e.g. exception, CDP message, etc.) is referencing this issue.
}

// GetEncodedResponseEncoding the encoding to use.
//
// See: https://chromedevtools.github.io/devtools-protocol/tot/Audits#method-getEncodedResponse
type GetEncodedResponseEncoding string

// String returns the GetEncodedResponseEncoding as string value.
func (t GetEncodedResponseEncoding) String() string {
	return string(t)
}

// GetEncodedResponseEncoding values.
const (
	GetEncodedResponseEncodingWebp GetEncodedResponseEncoding = "webp"
	GetEncodedResponseEncodingJpeg GetEncodedResponseEncoding = "jpeg"
	GetEncodedResponseEncodingPng  GetEncodedResponseEncoding = "png"
)

// UnmarshalJSON satisfies [json.Unmarshaler].
func (t *GetEncodedResponseEncoding) UnmarshalJSON(buf []byte) error {
	s := string(buf)
	s = strings.TrimSuffix(strings.TrimPrefix(s, `"`), `"`)

	switch GetEncodedResponseEncoding(s) {
	case GetEncodedResponseEncodingWebp:
		*t = GetEncodedResponseEncodingWebp
	case GetEncodedResponseEncodingJpeg:
		*t = GetEncodedResponseEncodingJpeg
	case GetEncodedResponseEncodingPng:
		*t = GetEncodedResponseEncodingPng
	default:
		return fmt.Errorf("unknown GetEncodedResponseEncoding value: %v", s)
	}
	return nil
}
