#[derive(Debug, Clone, serde::Serialize)]
pub struct AffectedCookie {
#[serde(rename = "name")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub name: String,
#[serde(rename = "path")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub path: String,
#[serde(rename = "domain")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub domain: String,
}
impl<'de> serde::Deserialize<'de> for AffectedCookie {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = AffectedCookie;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "name")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub name: String,
#[serde(rename = "path")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub path: String,
#[serde(rename = "domain")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub domain: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(AffectedCookie {
name: fields.name,
path: fields.path,
domain: fields.domain,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct AffectedFrame {
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
}
impl<'de> serde::Deserialize<'de> for AffectedFrame {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = AffectedFrame;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(AffectedFrame {
frame_id: fields.frame_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct AffectedRequest {
#[serde(rename = "requestId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request_id: Option<crate::network::types::RequestId>,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
}
impl<'de> serde::Deserialize<'de> for AffectedRequest {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = AffectedRequest;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request_id: Option<crate::network::types::RequestId>,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(AffectedRequest {
request_id: fields.request_id,
url: fields.url,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct BlockedByResponseIssueDetails {
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
#[serde(rename = "parentFrame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub parent_frame: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "blockedFrame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub blocked_frame: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "reason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reason: crate::audits::types::BlockedByResponseReason,
}
impl<'de> serde::Deserialize<'de> for BlockedByResponseIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = BlockedByResponseIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
#[serde(rename = "parentFrame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub parent_frame: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "blockedFrame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub blocked_frame: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "reason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reason: crate::audits::types::BlockedByResponseReason,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(BlockedByResponseIssueDetails {
request: fields.request,
parent_frame: fields.parent_frame,
blocked_frame: fields.blocked_frame,
reason: fields.reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum BlockedByResponseReason {
CoepFrameResourceNeedsCoepHeader,
CoopSandboxedIFrameCannotNavigateToCoopPage,
CorpNotSameOrigin,
CorpNotSameOriginAfterDefaultedToSameOriginByCoep,
CorpNotSameOriginAfterDefaultedToSameOriginByDip,
CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip,
CorpNotSameSite,
SriMessageSignatureMismatch,
Unknown(String),
}
impl BlockedByResponseReason {
pub fn as_str(&self) -> &str {
match self {
Self::CoepFrameResourceNeedsCoepHeader => "CoepFrameResourceNeedsCoepHeader",
Self::CoopSandboxedIFrameCannotNavigateToCoopPage => {
"CoopSandboxedIFrameCannotNavigateToCoopPage"
}
Self::CorpNotSameOrigin => "CorpNotSameOrigin",
Self::CorpNotSameOriginAfterDefaultedToSameOriginByCoep => {
"CorpNotSameOriginAfterDefaultedToSameOriginByCoep"
}
Self::CorpNotSameOriginAfterDefaultedToSameOriginByDip => {
"CorpNotSameOriginAfterDefaultedToSameOriginByDip"
}
Self::CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip => {
"CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip"
}
Self::CorpNotSameSite => "CorpNotSameSite",
Self::SriMessageSignatureMismatch => "SRIMessageSignatureMismatch",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for BlockedByResponseReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for BlockedByResponseReason {
fn from(value: String) -> Self {
match value.as_str() {
"CoepFrameResourceNeedsCoepHeader" => {
BlockedByResponseReason::CoepFrameResourceNeedsCoepHeader
}
"CoopSandboxedIFrameCannotNavigateToCoopPage" => {
BlockedByResponseReason::CoopSandboxedIFrameCannotNavigateToCoopPage
}
"CorpNotSameOrigin" => BlockedByResponseReason::CorpNotSameOrigin,
"CorpNotSameOriginAfterDefaultedToSameOriginByCoep" => {
BlockedByResponseReason::CorpNotSameOriginAfterDefaultedToSameOriginByCoep
}
"CorpNotSameOriginAfterDefaultedToSameOriginByDip" => {
BlockedByResponseReason::CorpNotSameOriginAfterDefaultedToSameOriginByDip
}
"CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip" => {
BlockedByResponseReason::CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip
}
"CorpNotSameSite" => BlockedByResponseReason::CorpNotSameSite,
"SRIMessageSignatureMismatch" => BlockedByResponseReason::SriMessageSignatureMismatch,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for BlockedByResponseReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for BlockedByResponseReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = BlockedByResponseReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(
match v {
"CoepFrameResourceNeedsCoepHeader" => {
BlockedByResponseReason::CoepFrameResourceNeedsCoepHeader
}
"CoopSandboxedIFrameCannotNavigateToCoopPage" => {
BlockedByResponseReason::CoopSandboxedIFrameCannotNavigateToCoopPage
}
"CorpNotSameOrigin" => BlockedByResponseReason::CorpNotSameOrigin,
"CorpNotSameOriginAfterDefaultedToSameOriginByCoep" => {
BlockedByResponseReason::CorpNotSameOriginAfterDefaultedToSameOriginByCoep
}
"CorpNotSameOriginAfterDefaultedToSameOriginByDip" => {
BlockedByResponseReason::CorpNotSameOriginAfterDefaultedToSameOriginByDip
}
"CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip" => {
BlockedByResponseReason::CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip
}
"CorpNotSameSite" => BlockedByResponseReason::CorpNotSameSite,
"SRIMessageSignatureMismatch" => {
BlockedByResponseReason::SriMessageSignatureMismatch
}
_ => BlockedByResponseReason::Unknown(v.to_owned()),
},
)
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(BlockedByResponseReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct BounceTrackingIssueDetails {
#[serde(rename = "trackingSites")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub tracking_sites: Vec<String>,
}
impl<'de> serde::Deserialize<'de> for BounceTrackingIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = BounceTrackingIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "trackingSites")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub tracking_sites: Vec<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(BounceTrackingIssueDetails {
tracking_sites: fields.tracking_sites,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ClientHintIssueDetails {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "clientHintIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub client_hint_issue_reason: crate::audits::types::ClientHintIssueReason,
}
impl<'de> serde::Deserialize<'de> for ClientHintIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ClientHintIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "clientHintIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub client_hint_issue_reason: crate::audits::types::ClientHintIssueReason,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ClientHintIssueDetails {
source_code_location: fields.source_code_location,
client_hint_issue_reason: fields.client_hint_issue_reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ClientHintIssueReason {
MetaTagAllowListInvalidOrigin,
MetaTagModifiedHtml,
Unknown(String),
}
impl ClientHintIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::MetaTagAllowListInvalidOrigin => "MetaTagAllowListInvalidOrigin",
Self::MetaTagModifiedHtml => "MetaTagModifiedHTML",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for ClientHintIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for ClientHintIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"MetaTagAllowListInvalidOrigin" => ClientHintIssueReason::MetaTagAllowListInvalidOrigin,
"MetaTagModifiedHTML" => ClientHintIssueReason::MetaTagModifiedHtml,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for ClientHintIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for ClientHintIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ClientHintIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"MetaTagAllowListInvalidOrigin" => {
ClientHintIssueReason::MetaTagAllowListInvalidOrigin
}
"MetaTagModifiedHTML" => ClientHintIssueReason::MetaTagModifiedHtml,
_ => ClientHintIssueReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(ClientHintIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ConnectionAllowlistError {
InvalidHeader,
MoreThanOneList,
ItemNotInnerList,
InvalidAllowlistItemType,
ReportingEndpointNotToken,
InvalidUrlPattern,
IFrameAttributeLoosensEmbeddingRequirement,
InvalidAllowConnectionAllowlistFrom,
EmbeddingRequirementNotSatisfied,
Unknown(String),
}
impl ConnectionAllowlistError {
pub fn as_str(&self) -> &str {
match self {
Self::InvalidHeader => "InvalidHeader",
Self::MoreThanOneList => "MoreThanOneList",
Self::ItemNotInnerList => "ItemNotInnerList",
Self::InvalidAllowlistItemType => "InvalidAllowlistItemType",
Self::ReportingEndpointNotToken => "ReportingEndpointNotToken",
Self::InvalidUrlPattern => "InvalidUrlPattern",
Self::IFrameAttributeLoosensEmbeddingRequirement => {
"IFrameAttributeLoosensEmbeddingRequirement"
}
Self::InvalidAllowConnectionAllowlistFrom => "InvalidAllowConnectionAllowlistFrom",
Self::EmbeddingRequirementNotSatisfied => "EmbeddingRequirementNotSatisfied",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for ConnectionAllowlistError {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for ConnectionAllowlistError {
fn from(value: String) -> Self {
match value.as_str() {
"InvalidHeader" => ConnectionAllowlistError::InvalidHeader,
"MoreThanOneList" => ConnectionAllowlistError::MoreThanOneList,
"ItemNotInnerList" => ConnectionAllowlistError::ItemNotInnerList,
"InvalidAllowlistItemType" => ConnectionAllowlistError::InvalidAllowlistItemType,
"ReportingEndpointNotToken" => ConnectionAllowlistError::ReportingEndpointNotToken,
"InvalidUrlPattern" => ConnectionAllowlistError::InvalidUrlPattern,
"IFrameAttributeLoosensEmbeddingRequirement" => {
ConnectionAllowlistError::IFrameAttributeLoosensEmbeddingRequirement
}
"InvalidAllowConnectionAllowlistFrom" => {
ConnectionAllowlistError::InvalidAllowConnectionAllowlistFrom
}
"EmbeddingRequirementNotSatisfied" => {
ConnectionAllowlistError::EmbeddingRequirementNotSatisfied
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for ConnectionAllowlistError {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for ConnectionAllowlistError {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConnectionAllowlistError;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"InvalidHeader" => ConnectionAllowlistError::InvalidHeader,
"MoreThanOneList" => ConnectionAllowlistError::MoreThanOneList,
"ItemNotInnerList" => ConnectionAllowlistError::ItemNotInnerList,
"InvalidAllowlistItemType" => {
ConnectionAllowlistError::InvalidAllowlistItemType
}
"ReportingEndpointNotToken" => {
ConnectionAllowlistError::ReportingEndpointNotToken
}
"InvalidUrlPattern" => ConnectionAllowlistError::InvalidUrlPattern,
"IFrameAttributeLoosensEmbeddingRequirement" => {
ConnectionAllowlistError::IFrameAttributeLoosensEmbeddingRequirement
}
"InvalidAllowConnectionAllowlistFrom" => {
ConnectionAllowlistError::InvalidAllowConnectionAllowlistFrom
}
"EmbeddingRequirementNotSatisfied" => {
ConnectionAllowlistError::EmbeddingRequirementNotSatisfied
}
_ => ConnectionAllowlistError::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(ConnectionAllowlistError::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ConnectionAllowlistIssueDetails {
#[serde(rename = "error")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error: crate::audits::types::ConnectionAllowlistError,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
impl<'de> serde::Deserialize<'de> for ConnectionAllowlistIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConnectionAllowlistIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "error")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error: crate::audits::types::ConnectionAllowlistError,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ConnectionAllowlistIssueDetails {
error: fields.error,
request: fields.request,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ContentSecurityPolicyIssueDetails {
#[serde(rename = "blockedURL")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub blocked_url: Option<String>,
#[serde(rename = "violatedDirective")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub violated_directive: String,
#[serde(rename = "isReportOnly")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_report_only: bool,
#[serde(rename = "contentSecurityPolicyViolationType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub content_security_policy_violation_type:
crate::audits::types::ContentSecurityPolicyViolationType,
#[serde(rename = "frameAncestor")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_ancestor: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "sourceCodeLocation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_code_location: Option<crate::audits::types::SourceCodeLocation>,
#[serde(rename = "violatingNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub violating_node_id: Option<crate::dom::types::BackendNodeId>,
}
impl<'de> serde::Deserialize<'de> for ContentSecurityPolicyIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContentSecurityPolicyIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "blockedURL")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub blocked_url: Option<String>,
#[serde(rename = "violatedDirective")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub violated_directive: String,
#[serde(rename = "isReportOnly")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_report_only: bool,
#[serde(rename = "contentSecurityPolicyViolationType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub content_security_policy_violation_type:
crate::audits::types::ContentSecurityPolicyViolationType,
#[serde(rename = "frameAncestor")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_ancestor: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "sourceCodeLocation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_code_location: Option<crate::audits::types::SourceCodeLocation>,
#[serde(rename = "violatingNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub violating_node_id: Option<crate::dom::types::BackendNodeId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContentSecurityPolicyIssueDetails {
blocked_url: fields.blocked_url,
violated_directive: fields.violated_directive,
is_report_only: fields.is_report_only,
content_security_policy_violation_type: fields
.content_security_policy_violation_type,
frame_ancestor: fields.frame_ancestor,
source_code_location: fields.source_code_location,
violating_node_id: fields.violating_node_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ContentSecurityPolicyViolationType {
KInlineViolation,
KEvalViolation,
KUrlViolation,
KSriViolation,
KTrustedTypesSinkViolation,
KTrustedTypesPolicyViolation,
KWasmEvalViolation,
Unknown(String),
}
impl ContentSecurityPolicyViolationType {
pub fn as_str(&self) -> &str {
match self {
Self::KInlineViolation => "kInlineViolation",
Self::KEvalViolation => "kEvalViolation",
Self::KUrlViolation => "kURLViolation",
Self::KSriViolation => "kSRIViolation",
Self::KTrustedTypesSinkViolation => "kTrustedTypesSinkViolation",
Self::KTrustedTypesPolicyViolation => "kTrustedTypesPolicyViolation",
Self::KWasmEvalViolation => "kWasmEvalViolation",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for ContentSecurityPolicyViolationType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for ContentSecurityPolicyViolationType {
fn from(value: String) -> Self {
match value.as_str() {
"kInlineViolation" => ContentSecurityPolicyViolationType::KInlineViolation,
"kEvalViolation" => ContentSecurityPolicyViolationType::KEvalViolation,
"kURLViolation" => ContentSecurityPolicyViolationType::KUrlViolation,
"kSRIViolation" => ContentSecurityPolicyViolationType::KSriViolation,
"kTrustedTypesSinkViolation" => {
ContentSecurityPolicyViolationType::KTrustedTypesSinkViolation
}
"kTrustedTypesPolicyViolation" => {
ContentSecurityPolicyViolationType::KTrustedTypesPolicyViolation
}
"kWasmEvalViolation" => ContentSecurityPolicyViolationType::KWasmEvalViolation,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for ContentSecurityPolicyViolationType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for ContentSecurityPolicyViolationType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContentSecurityPolicyViolationType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"kInlineViolation" => ContentSecurityPolicyViolationType::KInlineViolation,
"kEvalViolation" => ContentSecurityPolicyViolationType::KEvalViolation,
"kURLViolation" => ContentSecurityPolicyViolationType::KUrlViolation,
"kSRIViolation" => ContentSecurityPolicyViolationType::KSriViolation,
"kTrustedTypesSinkViolation" => {
ContentSecurityPolicyViolationType::KTrustedTypesSinkViolation
}
"kTrustedTypesPolicyViolation" => {
ContentSecurityPolicyViolationType::KTrustedTypesPolicyViolation
}
"kWasmEvalViolation" => ContentSecurityPolicyViolationType::KWasmEvalViolation,
_ => ContentSecurityPolicyViolationType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(ContentSecurityPolicyViolationType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CookieDeprecationMetadataIssueDetails {
#[serde(rename = "allowedSites")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub allowed_sites: Vec<String>,
#[serde(rename = "optOutPercentage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub opt_out_percentage: ydp_core::FiniteF64,
#[serde(rename = "isOptOutTopLevel")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_opt_out_top_level: bool,
#[serde(rename = "operation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub operation: crate::audits::types::CookieOperation,
}
impl<'de> serde::Deserialize<'de> for CookieDeprecationMetadataIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CookieDeprecationMetadataIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "allowedSites")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub allowed_sites: Vec<String>,
#[serde(rename = "optOutPercentage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub opt_out_percentage: ydp_core::FiniteF64,
#[serde(rename = "isOptOutTopLevel")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_opt_out_top_level: bool,
#[serde(rename = "operation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub operation: crate::audits::types::CookieOperation,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CookieDeprecationMetadataIssueDetails {
allowed_sites: fields.allowed_sites,
opt_out_percentage: fields.opt_out_percentage,
is_opt_out_top_level: fields.is_opt_out_top_level,
operation: fields.operation,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum CookieExclusionReason {
ExcludeSameSiteUnspecifiedTreatedAsLax,
ExcludeSameSiteNoneInsecure,
ExcludeSameSiteLax,
ExcludeSameSiteStrict,
ExcludeDomainNonAscii,
ExcludeThirdPartyCookieBlockedInFirstPartySet,
ExcludeThirdPartyPhaseout,
ExcludePortMismatch,
ExcludeSchemeMismatch,
Unknown(String),
}
impl CookieExclusionReason {
pub fn as_str(&self) -> &str {
match self {
Self::ExcludeSameSiteUnspecifiedTreatedAsLax => {
"ExcludeSameSiteUnspecifiedTreatedAsLax"
}
Self::ExcludeSameSiteNoneInsecure => "ExcludeSameSiteNoneInsecure",
Self::ExcludeSameSiteLax => "ExcludeSameSiteLax",
Self::ExcludeSameSiteStrict => "ExcludeSameSiteStrict",
Self::ExcludeDomainNonAscii => "ExcludeDomainNonASCII",
Self::ExcludeThirdPartyCookieBlockedInFirstPartySet => {
"ExcludeThirdPartyCookieBlockedInFirstPartySet"
}
Self::ExcludeThirdPartyPhaseout => "ExcludeThirdPartyPhaseout",
Self::ExcludePortMismatch => "ExcludePortMismatch",
Self::ExcludeSchemeMismatch => "ExcludeSchemeMismatch",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for CookieExclusionReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for CookieExclusionReason {
fn from(value: String) -> Self {
match value.as_str() {
"ExcludeSameSiteUnspecifiedTreatedAsLax" => {
CookieExclusionReason::ExcludeSameSiteUnspecifiedTreatedAsLax
}
"ExcludeSameSiteNoneInsecure" => CookieExclusionReason::ExcludeSameSiteNoneInsecure,
"ExcludeSameSiteLax" => CookieExclusionReason::ExcludeSameSiteLax,
"ExcludeSameSiteStrict" => CookieExclusionReason::ExcludeSameSiteStrict,
"ExcludeDomainNonASCII" => CookieExclusionReason::ExcludeDomainNonAscii,
"ExcludeThirdPartyCookieBlockedInFirstPartySet" => {
CookieExclusionReason::ExcludeThirdPartyCookieBlockedInFirstPartySet
}
"ExcludeThirdPartyPhaseout" => CookieExclusionReason::ExcludeThirdPartyPhaseout,
"ExcludePortMismatch" => CookieExclusionReason::ExcludePortMismatch,
"ExcludeSchemeMismatch" => CookieExclusionReason::ExcludeSchemeMismatch,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for CookieExclusionReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for CookieExclusionReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CookieExclusionReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"ExcludeSameSiteUnspecifiedTreatedAsLax" => {
CookieExclusionReason::ExcludeSameSiteUnspecifiedTreatedAsLax
}
"ExcludeSameSiteNoneInsecure" => {
CookieExclusionReason::ExcludeSameSiteNoneInsecure
}
"ExcludeSameSiteLax" => CookieExclusionReason::ExcludeSameSiteLax,
"ExcludeSameSiteStrict" => CookieExclusionReason::ExcludeSameSiteStrict,
"ExcludeDomainNonASCII" => CookieExclusionReason::ExcludeDomainNonAscii,
"ExcludeThirdPartyCookieBlockedInFirstPartySet" => {
CookieExclusionReason::ExcludeThirdPartyCookieBlockedInFirstPartySet
}
"ExcludeThirdPartyPhaseout" => CookieExclusionReason::ExcludeThirdPartyPhaseout,
"ExcludePortMismatch" => CookieExclusionReason::ExcludePortMismatch,
"ExcludeSchemeMismatch" => CookieExclusionReason::ExcludeSchemeMismatch,
_ => CookieExclusionReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(CookieExclusionReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CookieIssueDetails {
#[serde(rename = "cookie")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie: Option<crate::audits::types::AffectedCookie>,
#[serde(rename = "rawCookieLine")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub raw_cookie_line: Option<String>,
#[serde(rename = "cookieWarningReasons")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub cookie_warning_reasons: Vec<crate::audits::types::CookieWarningReason>,
#[serde(rename = "cookieExclusionReasons")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub cookie_exclusion_reasons: Vec<crate::audits::types::CookieExclusionReason>,
#[serde(rename = "operation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub operation: crate::audits::types::CookieOperation,
#[serde(rename = "siteForCookies")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub site_for_cookies: Option<String>,
#[serde(rename = "cookieUrl")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie_url: Option<String>,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
#[serde(rename = "insight")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub insight: Option<crate::audits::types::CookieIssueInsight>,
}
impl<'de> serde::Deserialize<'de> for CookieIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CookieIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "cookie")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie: Option<crate::audits::types::AffectedCookie>,
#[serde(rename = "rawCookieLine")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub raw_cookie_line: Option<String>,
#[serde(rename = "cookieWarningReasons")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub cookie_warning_reasons: Vec<crate::audits::types::CookieWarningReason>,
#[serde(rename = "cookieExclusionReasons")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub cookie_exclusion_reasons: Vec<crate::audits::types::CookieExclusionReason>,
#[serde(rename = "operation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub operation: crate::audits::types::CookieOperation,
#[serde(rename = "siteForCookies")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub site_for_cookies: Option<String>,
#[serde(rename = "cookieUrl")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie_url: Option<String>,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
#[serde(rename = "insight")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub insight: Option<crate::audits::types::CookieIssueInsight>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CookieIssueDetails {
cookie: fields.cookie,
raw_cookie_line: fields.raw_cookie_line,
cookie_warning_reasons: fields.cookie_warning_reasons,
cookie_exclusion_reasons: fields.cookie_exclusion_reasons,
operation: fields.operation,
site_for_cookies: fields.site_for_cookies,
cookie_url: fields.cookie_url,
request: fields.request,
insight: fields.insight,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CookieIssueInsight {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: crate::audits::types::InsightType,
#[serde(rename = "tableEntryUrl")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub table_entry_url: Option<String>,
}
impl<'de> serde::Deserialize<'de> for CookieIssueInsight {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CookieIssueInsight;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: crate::audits::types::InsightType,
#[serde(rename = "tableEntryUrl")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub table_entry_url: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CookieIssueInsight {
r#type: fields.r#type,
table_entry_url: fields.table_entry_url,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum CookieOperation {
SetCookie,
ReadCookie,
Unknown(String),
}
impl CookieOperation {
pub fn as_str(&self) -> &str {
match self {
Self::SetCookie => "SetCookie",
Self::ReadCookie => "ReadCookie",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for CookieOperation {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for CookieOperation {
fn from(value: String) -> Self {
match value.as_str() {
"SetCookie" => CookieOperation::SetCookie,
"ReadCookie" => CookieOperation::ReadCookie,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for CookieOperation {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for CookieOperation {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CookieOperation;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"SetCookie" => CookieOperation::SetCookie,
"ReadCookie" => CookieOperation::ReadCookie,
_ => CookieOperation::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(CookieOperation::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum CookieWarningReason {
WarnSameSiteUnspecifiedCrossSiteContext,
WarnSameSiteNoneInsecure,
WarnSameSiteUnspecifiedLaxAllowUnsafe,
WarnSameSiteStrictLaxDowngradeStrict,
WarnSameSiteStrictCrossDowngradeStrict,
WarnSameSiteStrictCrossDowngradeLax,
WarnSameSiteLaxCrossDowngradeStrict,
WarnSameSiteLaxCrossDowngradeLax,
WarnAttributeValueExceedsMaxSize,
WarnDomainNonAscii,
WarnThirdPartyPhaseout,
WarnCrossSiteRedirectDowngradeChangesInclusion,
WarnDeprecationTrialMetadata,
WarnThirdPartyCookieHeuristic,
Unknown(String),
}
impl CookieWarningReason {
pub fn as_str(&self) -> &str {
match self {
Self::WarnSameSiteUnspecifiedCrossSiteContext => {
"WarnSameSiteUnspecifiedCrossSiteContext"
}
Self::WarnSameSiteNoneInsecure => "WarnSameSiteNoneInsecure",
Self::WarnSameSiteUnspecifiedLaxAllowUnsafe => "WarnSameSiteUnspecifiedLaxAllowUnsafe",
Self::WarnSameSiteStrictLaxDowngradeStrict => "WarnSameSiteStrictLaxDowngradeStrict",
Self::WarnSameSiteStrictCrossDowngradeStrict => {
"WarnSameSiteStrictCrossDowngradeStrict"
}
Self::WarnSameSiteStrictCrossDowngradeLax => "WarnSameSiteStrictCrossDowngradeLax",
Self::WarnSameSiteLaxCrossDowngradeStrict => "WarnSameSiteLaxCrossDowngradeStrict",
Self::WarnSameSiteLaxCrossDowngradeLax => "WarnSameSiteLaxCrossDowngradeLax",
Self::WarnAttributeValueExceedsMaxSize => "WarnAttributeValueExceedsMaxSize",
Self::WarnDomainNonAscii => "WarnDomainNonASCII",
Self::WarnThirdPartyPhaseout => "WarnThirdPartyPhaseout",
Self::WarnCrossSiteRedirectDowngradeChangesInclusion => {
"WarnCrossSiteRedirectDowngradeChangesInclusion"
}
Self::WarnDeprecationTrialMetadata => "WarnDeprecationTrialMetadata",
Self::WarnThirdPartyCookieHeuristic => "WarnThirdPartyCookieHeuristic",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for CookieWarningReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for CookieWarningReason {
fn from(value: String) -> Self {
match value.as_str() {
"WarnSameSiteUnspecifiedCrossSiteContext" => {
CookieWarningReason::WarnSameSiteUnspecifiedCrossSiteContext
}
"WarnSameSiteNoneInsecure" => CookieWarningReason::WarnSameSiteNoneInsecure,
"WarnSameSiteUnspecifiedLaxAllowUnsafe" => {
CookieWarningReason::WarnSameSiteUnspecifiedLaxAllowUnsafe
}
"WarnSameSiteStrictLaxDowngradeStrict" => {
CookieWarningReason::WarnSameSiteStrictLaxDowngradeStrict
}
"WarnSameSiteStrictCrossDowngradeStrict" => {
CookieWarningReason::WarnSameSiteStrictCrossDowngradeStrict
}
"WarnSameSiteStrictCrossDowngradeLax" => {
CookieWarningReason::WarnSameSiteStrictCrossDowngradeLax
}
"WarnSameSiteLaxCrossDowngradeStrict" => {
CookieWarningReason::WarnSameSiteLaxCrossDowngradeStrict
}
"WarnSameSiteLaxCrossDowngradeLax" => {
CookieWarningReason::WarnSameSiteLaxCrossDowngradeLax
}
"WarnAttributeValueExceedsMaxSize" => {
CookieWarningReason::WarnAttributeValueExceedsMaxSize
}
"WarnDomainNonASCII" => CookieWarningReason::WarnDomainNonAscii,
"WarnThirdPartyPhaseout" => CookieWarningReason::WarnThirdPartyPhaseout,
"WarnCrossSiteRedirectDowngradeChangesInclusion" => {
CookieWarningReason::WarnCrossSiteRedirectDowngradeChangesInclusion
}
"WarnDeprecationTrialMetadata" => CookieWarningReason::WarnDeprecationTrialMetadata,
"WarnThirdPartyCookieHeuristic" => CookieWarningReason::WarnThirdPartyCookieHeuristic,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for CookieWarningReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for CookieWarningReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CookieWarningReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"WarnSameSiteUnspecifiedCrossSiteContext" => {
CookieWarningReason::WarnSameSiteUnspecifiedCrossSiteContext
}
"WarnSameSiteNoneInsecure" => CookieWarningReason::WarnSameSiteNoneInsecure,
"WarnSameSiteUnspecifiedLaxAllowUnsafe" => {
CookieWarningReason::WarnSameSiteUnspecifiedLaxAllowUnsafe
}
"WarnSameSiteStrictLaxDowngradeStrict" => {
CookieWarningReason::WarnSameSiteStrictLaxDowngradeStrict
}
"WarnSameSiteStrictCrossDowngradeStrict" => {
CookieWarningReason::WarnSameSiteStrictCrossDowngradeStrict
}
"WarnSameSiteStrictCrossDowngradeLax" => {
CookieWarningReason::WarnSameSiteStrictCrossDowngradeLax
}
"WarnSameSiteLaxCrossDowngradeStrict" => {
CookieWarningReason::WarnSameSiteLaxCrossDowngradeStrict
}
"WarnSameSiteLaxCrossDowngradeLax" => {
CookieWarningReason::WarnSameSiteLaxCrossDowngradeLax
}
"WarnAttributeValueExceedsMaxSize" => {
CookieWarningReason::WarnAttributeValueExceedsMaxSize
}
"WarnDomainNonASCII" => CookieWarningReason::WarnDomainNonAscii,
"WarnThirdPartyPhaseout" => CookieWarningReason::WarnThirdPartyPhaseout,
"WarnCrossSiteRedirectDowngradeChangesInclusion" => {
CookieWarningReason::WarnCrossSiteRedirectDowngradeChangesInclusion
}
"WarnDeprecationTrialMetadata" => {
CookieWarningReason::WarnDeprecationTrialMetadata
}
"WarnThirdPartyCookieHeuristic" => {
CookieWarningReason::WarnThirdPartyCookieHeuristic
}
_ => CookieWarningReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(CookieWarningReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CorsIssueDetails {
#[serde(rename = "corsErrorStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub cors_error_status: crate::network::types::CorsErrorStatus,
#[serde(rename = "isWarning")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_warning: bool,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
#[serde(rename = "location")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<crate::audits::types::SourceCodeLocation>,
#[serde(rename = "initiatorOrigin")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub initiator_origin: Option<String>,
#[serde(rename = "resourceIPAddressSpace")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub resource_ip_address_space: Option<crate::network::types::IpAddressSpace>,
#[serde(rename = "clientSecurityState")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub client_security_state: Option<crate::network::types::ClientSecurityState>,
}
impl<'de> serde::Deserialize<'de> for CorsIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CorsIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "corsErrorStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub cors_error_status: crate::network::types::CorsErrorStatus,
#[serde(rename = "isWarning")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_warning: bool,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
#[serde(rename = "location")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<crate::audits::types::SourceCodeLocation>,
#[serde(rename = "initiatorOrigin")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub initiator_origin: Option<String>,
#[serde(rename = "resourceIPAddressSpace")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub resource_ip_address_space: Option<crate::network::types::IpAddressSpace>,
#[serde(rename = "clientSecurityState")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub client_security_state: Option<crate::network::types::ClientSecurityState>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CorsIssueDetails {
cors_error_status: fields.cors_error_status,
is_warning: fields.is_warning,
request: fields.request,
location: fields.location,
initiator_origin: fields.initiator_origin,
resource_ip_address_space: fields.resource_ip_address_space,
client_security_state: fields.client_security_state,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct DeprecationIssueDetails {
#[serde(rename = "affectedFrame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub affected_frame: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: String,
}
impl<'de> serde::Deserialize<'de> for DeprecationIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DeprecationIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "affectedFrame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub affected_frame: Option<crate::audits::types::AffectedFrame>,
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DeprecationIssueDetails {
affected_frame: fields.affected_frame,
source_code_location: fields.source_code_location,
r#type: fields.r#type,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ElementAccessibilityIssueDetails {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::BackendNodeId,
#[serde(rename = "elementAccessibilityIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub element_accessibility_issue_reason: crate::audits::types::ElementAccessibilityIssueReason,
#[serde(rename = "hasDisallowedAttributes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub has_disallowed_attributes: bool,
}
impl<'de> serde::Deserialize<'de> for ElementAccessibilityIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ElementAccessibilityIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::BackendNodeId,
#[serde(rename = "elementAccessibilityIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub element_accessibility_issue_reason:
crate::audits::types::ElementAccessibilityIssueReason,
#[serde(rename = "hasDisallowedAttributes")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub has_disallowed_attributes: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ElementAccessibilityIssueDetails {
node_id: fields.node_id,
element_accessibility_issue_reason: fields.element_accessibility_issue_reason,
has_disallowed_attributes: fields.has_disallowed_attributes,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum ElementAccessibilityIssueReason {
DisallowedSelectChild,
DisallowedOptGroupChild,
NonPhrasingContentOptionChild,
InteractiveContentOptionChild,
InteractiveContentLegendChild,
InteractiveContentSummaryDescendant,
Unknown(String),
}
impl ElementAccessibilityIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::DisallowedSelectChild => "DisallowedSelectChild",
Self::DisallowedOptGroupChild => "DisallowedOptGroupChild",
Self::NonPhrasingContentOptionChild => "NonPhrasingContentOptionChild",
Self::InteractiveContentOptionChild => "InteractiveContentOptionChild",
Self::InteractiveContentLegendChild => "InteractiveContentLegendChild",
Self::InteractiveContentSummaryDescendant => "InteractiveContentSummaryDescendant",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for ElementAccessibilityIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for ElementAccessibilityIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"DisallowedSelectChild" => ElementAccessibilityIssueReason::DisallowedSelectChild,
"DisallowedOptGroupChild" => ElementAccessibilityIssueReason::DisallowedOptGroupChild,
"NonPhrasingContentOptionChild" => {
ElementAccessibilityIssueReason::NonPhrasingContentOptionChild
}
"InteractiveContentOptionChild" => {
ElementAccessibilityIssueReason::InteractiveContentOptionChild
}
"InteractiveContentLegendChild" => {
ElementAccessibilityIssueReason::InteractiveContentLegendChild
}
"InteractiveContentSummaryDescendant" => {
ElementAccessibilityIssueReason::InteractiveContentSummaryDescendant
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for ElementAccessibilityIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for ElementAccessibilityIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ElementAccessibilityIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"DisallowedSelectChild" => {
ElementAccessibilityIssueReason::DisallowedSelectChild
}
"DisallowedOptGroupChild" => {
ElementAccessibilityIssueReason::DisallowedOptGroupChild
}
"NonPhrasingContentOptionChild" => {
ElementAccessibilityIssueReason::NonPhrasingContentOptionChild
}
"InteractiveContentOptionChild" => {
ElementAccessibilityIssueReason::InteractiveContentOptionChild
}
"InteractiveContentLegendChild" => {
ElementAccessibilityIssueReason::InteractiveContentLegendChild
}
"InteractiveContentSummaryDescendant" => {
ElementAccessibilityIssueReason::InteractiveContentSummaryDescendant
}
_ => ElementAccessibilityIssueReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(ElementAccessibilityIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct EmailVerificationRequestIssueDetails {
#[serde(rename = "emailVerificationRequestIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub email_verification_request_issue_reason:
crate::audits::types::EmailVerificationRequestIssueReason,
}
impl<'de> serde::Deserialize<'de> for EmailVerificationRequestIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EmailVerificationRequestIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "emailVerificationRequestIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub email_verification_request_issue_reason:
crate::audits::types::EmailVerificationRequestIssueReason,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EmailVerificationRequestIssueDetails {
email_verification_request_issue_reason: fields
.email_verification_request_issue_reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum EmailVerificationRequestIssueReason {
InvalidEmail,
DnsFetchFailed,
DnsInvalidRecord,
WellKnownHttpNotFound,
WellKnownNoResponse,
WellKnownInvalidResponse,
WellKnownListEmpty,
WellKnownInvalidContentType,
WellKnownMissingIssuanceEndpoint,
WellKnownIssuanceEndpointCrossOrigin,
WellKnownUnsupportedSigningAlgorithm,
TokenHttpNotFound,
TokenNoResponse,
TokenInvalidResponse,
TokenInvalidContentType,
TokenMalformedSdJwt,
TokenInvalidSdJwt,
KeyBindingSigningFailed,
RpOriginIsOpaque,
WellKnownMissingAccountsEndpoint,
UserLoggedOut,
WellKnownAccountsEndpointCrossOrigin,
AccountsHttpNotFound,
AccountsNoResponse,
AccountsInvalidResponse,
AccountsInvalidContentType,
AccountsEmptyList,
EmailVerificationWellKnownHttpNotFound,
EmailVerificationWellKnownNoResponse,
EmailVerificationWellKnownInvalidResponse,
EmailVerificationWellKnownInvalidContentType,
JwksHttpNotFound,
JwksInvalidResponse,
TokenVerificationSdJwtUnsupportedHeaderAlg,
TokenVerificationSdJwtInvalidTyp,
TokenVerificationSdJwtMissingIss,
TokenVerificationSdJwtMissingIat,
TokenVerificationSdJwtMissingCnf,
TokenVerificationSdJwtMissingEmail,
TokenVerificationSdJwtInvalidIssuedAt,
TokenVerificationSdJwtInvalidIssuer,
TokenVerificationSdJwtJwksMissingKeys,
TokenVerificationSdJwtSignatureFailed,
TokenVerificationSdJwtInvalidEmailVerified,
TokenVerificationSdJwtInvalidEmail,
TokenVerificationSdJwtInvalidHolderKey,
TokenVerificationKbInvalidTyp,
TokenVerificationKbMissingAud,
TokenVerificationKbMissingNonce,
TokenVerificationKbMissingIat,
TokenVerificationKbMissingSdHash,
TokenVerificationKbInvalidIssuedAt,
TokenVerificationKbInvalidAudience,
TokenVerificationKbInvalidNonce,
TokenVerificationKbInvalidSdHash,
TokenVerificationKbMissingCnf,
TokenVerificationKbSignatureFailed,
CrossOriginIframeNotSupported,
Unknown(String),
}
impl EmailVerificationRequestIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::InvalidEmail => "InvalidEmail",
Self::DnsFetchFailed => "DnsFetchFailed",
Self::DnsInvalidRecord => "DnsInvalidRecord",
Self::WellKnownHttpNotFound => "WellKnownHttpNotFound",
Self::WellKnownNoResponse => "WellKnownNoResponse",
Self::WellKnownInvalidResponse => "WellKnownInvalidResponse",
Self::WellKnownListEmpty => "WellKnownListEmpty",
Self::WellKnownInvalidContentType => "WellKnownInvalidContentType",
Self::WellKnownMissingIssuanceEndpoint => "WellKnownMissingIssuanceEndpoint",
Self::WellKnownIssuanceEndpointCrossOrigin => "WellKnownIssuanceEndpointCrossOrigin",
Self::WellKnownUnsupportedSigningAlgorithm => "WellKnownUnsupportedSigningAlgorithm",
Self::TokenHttpNotFound => "TokenHttpNotFound",
Self::TokenNoResponse => "TokenNoResponse",
Self::TokenInvalidResponse => "TokenInvalidResponse",
Self::TokenInvalidContentType => "TokenInvalidContentType",
Self::TokenMalformedSdJwt => "TokenMalformedSdJwt",
Self::TokenInvalidSdJwt => "TokenInvalidSdJwt",
Self::KeyBindingSigningFailed => "KeyBindingSigningFailed",
Self::RpOriginIsOpaque => "RpOriginIsOpaque",
Self::WellKnownMissingAccountsEndpoint => "WellKnownMissingAccountsEndpoint",
Self::UserLoggedOut => "UserLoggedOut",
Self::WellKnownAccountsEndpointCrossOrigin => "WellKnownAccountsEndpointCrossOrigin",
Self::AccountsHttpNotFound => "AccountsHttpNotFound",
Self::AccountsNoResponse => "AccountsNoResponse",
Self::AccountsInvalidResponse => "AccountsInvalidResponse",
Self::AccountsInvalidContentType => "AccountsInvalidContentType",
Self::AccountsEmptyList => "AccountsEmptyList",
Self::EmailVerificationWellKnownHttpNotFound => {
"EmailVerificationWellKnownHttpNotFound"
}
Self::EmailVerificationWellKnownNoResponse => "EmailVerificationWellKnownNoResponse",
Self::EmailVerificationWellKnownInvalidResponse => {
"EmailVerificationWellKnownInvalidResponse"
}
Self::EmailVerificationWellKnownInvalidContentType => {
"EmailVerificationWellKnownInvalidContentType"
}
Self::JwksHttpNotFound => "JwksHttpNotFound",
Self::JwksInvalidResponse => "JwksInvalidResponse",
Self::TokenVerificationSdJwtUnsupportedHeaderAlg => {
"TokenVerificationSdJwtUnsupportedHeaderAlg"
}
Self::TokenVerificationSdJwtInvalidTyp => "TokenVerificationSdJwtInvalidTyp",
Self::TokenVerificationSdJwtMissingIss => "TokenVerificationSdJwtMissingIss",
Self::TokenVerificationSdJwtMissingIat => "TokenVerificationSdJwtMissingIat",
Self::TokenVerificationSdJwtMissingCnf => "TokenVerificationSdJwtMissingCnf",
Self::TokenVerificationSdJwtMissingEmail => "TokenVerificationSdJwtMissingEmail",
Self::TokenVerificationSdJwtInvalidIssuedAt => "TokenVerificationSdJwtInvalidIssuedAt",
Self::TokenVerificationSdJwtInvalidIssuer => "TokenVerificationSdJwtInvalidIssuer",
Self::TokenVerificationSdJwtJwksMissingKeys => "TokenVerificationSdJwtJwksMissingKeys",
Self::TokenVerificationSdJwtSignatureFailed => "TokenVerificationSdJwtSignatureFailed",
Self::TokenVerificationSdJwtInvalidEmailVerified => {
"TokenVerificationSdJwtInvalidEmailVerified"
}
Self::TokenVerificationSdJwtInvalidEmail => "TokenVerificationSdJwtInvalidEmail",
Self::TokenVerificationSdJwtInvalidHolderKey => {
"TokenVerificationSdJwtInvalidHolderKey"
}
Self::TokenVerificationKbInvalidTyp => "TokenVerificationKbInvalidTyp",
Self::TokenVerificationKbMissingAud => "TokenVerificationKbMissingAud",
Self::TokenVerificationKbMissingNonce => "TokenVerificationKbMissingNonce",
Self::TokenVerificationKbMissingIat => "TokenVerificationKbMissingIat",
Self::TokenVerificationKbMissingSdHash => "TokenVerificationKbMissingSdHash",
Self::TokenVerificationKbInvalidIssuedAt => "TokenVerificationKbInvalidIssuedAt",
Self::TokenVerificationKbInvalidAudience => "TokenVerificationKbInvalidAudience",
Self::TokenVerificationKbInvalidNonce => "TokenVerificationKbInvalidNonce",
Self::TokenVerificationKbInvalidSdHash => "TokenVerificationKbInvalidSdHash",
Self::TokenVerificationKbMissingCnf => "TokenVerificationKbMissingCnf",
Self::TokenVerificationKbSignatureFailed => "TokenVerificationKbSignatureFailed",
Self::CrossOriginIframeNotSupported => "CrossOriginIframeNotSupported",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for EmailVerificationRequestIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for EmailVerificationRequestIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"InvalidEmail" => EmailVerificationRequestIssueReason::InvalidEmail,
"DnsFetchFailed" => EmailVerificationRequestIssueReason::DnsFetchFailed,
"DnsInvalidRecord" => EmailVerificationRequestIssueReason::DnsInvalidRecord,
"WellKnownHttpNotFound" => EmailVerificationRequestIssueReason::WellKnownHttpNotFound,
"WellKnownNoResponse" => EmailVerificationRequestIssueReason::WellKnownNoResponse,
"WellKnownInvalidResponse" => {
EmailVerificationRequestIssueReason::WellKnownInvalidResponse
}
"WellKnownListEmpty" => EmailVerificationRequestIssueReason::WellKnownListEmpty,
"WellKnownInvalidContentType" => {
EmailVerificationRequestIssueReason::WellKnownInvalidContentType
}
"WellKnownMissingIssuanceEndpoint" => {
EmailVerificationRequestIssueReason::WellKnownMissingIssuanceEndpoint
}
"WellKnownIssuanceEndpointCrossOrigin" => {
EmailVerificationRequestIssueReason::WellKnownIssuanceEndpointCrossOrigin
}
"WellKnownUnsupportedSigningAlgorithm" => {
EmailVerificationRequestIssueReason::WellKnownUnsupportedSigningAlgorithm
}
"TokenHttpNotFound" => EmailVerificationRequestIssueReason::TokenHttpNotFound,
"TokenNoResponse" => EmailVerificationRequestIssueReason::TokenNoResponse,
"TokenInvalidResponse" => EmailVerificationRequestIssueReason::TokenInvalidResponse,
"TokenInvalidContentType" => {
EmailVerificationRequestIssueReason::TokenInvalidContentType
}
"TokenMalformedSdJwt" => EmailVerificationRequestIssueReason::TokenMalformedSdJwt,
"TokenInvalidSdJwt" => EmailVerificationRequestIssueReason::TokenInvalidSdJwt,
"KeyBindingSigningFailed" => {
EmailVerificationRequestIssueReason::KeyBindingSigningFailed
}
"RpOriginIsOpaque" => EmailVerificationRequestIssueReason::RpOriginIsOpaque,
"WellKnownMissingAccountsEndpoint" => {
EmailVerificationRequestIssueReason::WellKnownMissingAccountsEndpoint
}
"UserLoggedOut" => EmailVerificationRequestIssueReason::UserLoggedOut,
"WellKnownAccountsEndpointCrossOrigin" => {
EmailVerificationRequestIssueReason::WellKnownAccountsEndpointCrossOrigin
}
"AccountsHttpNotFound" => EmailVerificationRequestIssueReason::AccountsHttpNotFound,
"AccountsNoResponse" => EmailVerificationRequestIssueReason::AccountsNoResponse,
"AccountsInvalidResponse" => {
EmailVerificationRequestIssueReason::AccountsInvalidResponse
}
"AccountsInvalidContentType" => {
EmailVerificationRequestIssueReason::AccountsInvalidContentType
}
"AccountsEmptyList" => EmailVerificationRequestIssueReason::AccountsEmptyList,
"EmailVerificationWellKnownHttpNotFound" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownHttpNotFound
}
"EmailVerificationWellKnownNoResponse" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownNoResponse
}
"EmailVerificationWellKnownInvalidResponse" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownInvalidResponse
}
"EmailVerificationWellKnownInvalidContentType" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownInvalidContentType
}
"JwksHttpNotFound" => EmailVerificationRequestIssueReason::JwksHttpNotFound,
"JwksInvalidResponse" => EmailVerificationRequestIssueReason::JwksInvalidResponse,
"TokenVerificationSdJwtUnsupportedHeaderAlg" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtUnsupportedHeaderAlg
}
"TokenVerificationSdJwtInvalidTyp" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidTyp
}
"TokenVerificationSdJwtMissingIss" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingIss
}
"TokenVerificationSdJwtMissingIat" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingIat
}
"TokenVerificationSdJwtMissingCnf" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingCnf
}
"TokenVerificationSdJwtMissingEmail" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingEmail
}
"TokenVerificationSdJwtInvalidIssuedAt" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidIssuedAt
}
"TokenVerificationSdJwtInvalidIssuer" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidIssuer
}
"TokenVerificationSdJwtJwksMissingKeys" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtJwksMissingKeys
}
"TokenVerificationSdJwtSignatureFailed" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtSignatureFailed
}
"TokenVerificationSdJwtInvalidEmailVerified" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidEmailVerified
}
"TokenVerificationSdJwtInvalidEmail" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidEmail
}
"TokenVerificationSdJwtInvalidHolderKey" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidHolderKey
}
"TokenVerificationKbInvalidTyp" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidTyp
}
"TokenVerificationKbMissingAud" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingAud
}
"TokenVerificationKbMissingNonce" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingNonce
}
"TokenVerificationKbMissingIat" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingIat
}
"TokenVerificationKbMissingSdHash" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingSdHash
}
"TokenVerificationKbInvalidIssuedAt" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidIssuedAt
}
"TokenVerificationKbInvalidAudience" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidAudience
}
"TokenVerificationKbInvalidNonce" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidNonce
}
"TokenVerificationKbInvalidSdHash" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidSdHash
}
"TokenVerificationKbMissingCnf" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingCnf
}
"TokenVerificationKbSignatureFailed" => {
EmailVerificationRequestIssueReason::TokenVerificationKbSignatureFailed
}
"CrossOriginIframeNotSupported" => {
EmailVerificationRequestIssueReason::CrossOriginIframeNotSupported
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for EmailVerificationRequestIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for EmailVerificationRequestIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EmailVerificationRequestIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(
match v {
"InvalidEmail" => {
EmailVerificationRequestIssueReason::InvalidEmail
}
"DnsFetchFailed" => {
EmailVerificationRequestIssueReason::DnsFetchFailed
}
"DnsInvalidRecord" => {
EmailVerificationRequestIssueReason::DnsInvalidRecord
}
"WellKnownHttpNotFound" => {
EmailVerificationRequestIssueReason::WellKnownHttpNotFound
}
"WellKnownNoResponse" => {
EmailVerificationRequestIssueReason::WellKnownNoResponse
}
"WellKnownInvalidResponse" => {
EmailVerificationRequestIssueReason::WellKnownInvalidResponse
}
"WellKnownListEmpty" => {
EmailVerificationRequestIssueReason::WellKnownListEmpty
}
"WellKnownInvalidContentType" => {
EmailVerificationRequestIssueReason::WellKnownInvalidContentType
}
"WellKnownMissingIssuanceEndpoint" => {
EmailVerificationRequestIssueReason::WellKnownMissingIssuanceEndpoint
}
"WellKnownIssuanceEndpointCrossOrigin" => {
EmailVerificationRequestIssueReason::WellKnownIssuanceEndpointCrossOrigin
}
"WellKnownUnsupportedSigningAlgorithm" => {
EmailVerificationRequestIssueReason::WellKnownUnsupportedSigningAlgorithm
}
"TokenHttpNotFound" => {
EmailVerificationRequestIssueReason::TokenHttpNotFound
}
"TokenNoResponse" => {
EmailVerificationRequestIssueReason::TokenNoResponse
}
"TokenInvalidResponse" => {
EmailVerificationRequestIssueReason::TokenInvalidResponse
}
"TokenInvalidContentType" => {
EmailVerificationRequestIssueReason::TokenInvalidContentType
}
"TokenMalformedSdJwt" => {
EmailVerificationRequestIssueReason::TokenMalformedSdJwt
}
"TokenInvalidSdJwt" => {
EmailVerificationRequestIssueReason::TokenInvalidSdJwt
}
"KeyBindingSigningFailed" => {
EmailVerificationRequestIssueReason::KeyBindingSigningFailed
}
"RpOriginIsOpaque" => {
EmailVerificationRequestIssueReason::RpOriginIsOpaque
}
"WellKnownMissingAccountsEndpoint" => {
EmailVerificationRequestIssueReason::WellKnownMissingAccountsEndpoint
}
"UserLoggedOut" => {
EmailVerificationRequestIssueReason::UserLoggedOut
}
"WellKnownAccountsEndpointCrossOrigin" => {
EmailVerificationRequestIssueReason::WellKnownAccountsEndpointCrossOrigin
}
"AccountsHttpNotFound" => {
EmailVerificationRequestIssueReason::AccountsHttpNotFound
}
"AccountsNoResponse" => {
EmailVerificationRequestIssueReason::AccountsNoResponse
}
"AccountsInvalidResponse" => {
EmailVerificationRequestIssueReason::AccountsInvalidResponse
}
"AccountsInvalidContentType" => {
EmailVerificationRequestIssueReason::AccountsInvalidContentType
}
"AccountsEmptyList" => {
EmailVerificationRequestIssueReason::AccountsEmptyList
}
"EmailVerificationWellKnownHttpNotFound" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownHttpNotFound
}
"EmailVerificationWellKnownNoResponse" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownNoResponse
}
"EmailVerificationWellKnownInvalidResponse" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownInvalidResponse
}
"EmailVerificationWellKnownInvalidContentType" => {
EmailVerificationRequestIssueReason::EmailVerificationWellKnownInvalidContentType
}
"JwksHttpNotFound" => {
EmailVerificationRequestIssueReason::JwksHttpNotFound
}
"JwksInvalidResponse" => {
EmailVerificationRequestIssueReason::JwksInvalidResponse
}
"TokenVerificationSdJwtUnsupportedHeaderAlg" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtUnsupportedHeaderAlg
}
"TokenVerificationSdJwtInvalidTyp" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidTyp
}
"TokenVerificationSdJwtMissingIss" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingIss
}
"TokenVerificationSdJwtMissingIat" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingIat
}
"TokenVerificationSdJwtMissingCnf" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingCnf
}
"TokenVerificationSdJwtMissingEmail" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtMissingEmail
}
"TokenVerificationSdJwtInvalidIssuedAt" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidIssuedAt
}
"TokenVerificationSdJwtInvalidIssuer" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidIssuer
}
"TokenVerificationSdJwtJwksMissingKeys" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtJwksMissingKeys
}
"TokenVerificationSdJwtSignatureFailed" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtSignatureFailed
}
"TokenVerificationSdJwtInvalidEmailVerified" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidEmailVerified
}
"TokenVerificationSdJwtInvalidEmail" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidEmail
}
"TokenVerificationSdJwtInvalidHolderKey" => {
EmailVerificationRequestIssueReason::TokenVerificationSdJwtInvalidHolderKey
}
"TokenVerificationKbInvalidTyp" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidTyp
}
"TokenVerificationKbMissingAud" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingAud
}
"TokenVerificationKbMissingNonce" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingNonce
}
"TokenVerificationKbMissingIat" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingIat
}
"TokenVerificationKbMissingSdHash" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingSdHash
}
"TokenVerificationKbInvalidIssuedAt" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidIssuedAt
}
"TokenVerificationKbInvalidAudience" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidAudience
}
"TokenVerificationKbInvalidNonce" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidNonce
}
"TokenVerificationKbInvalidSdHash" => {
EmailVerificationRequestIssueReason::TokenVerificationKbInvalidSdHash
}
"TokenVerificationKbMissingCnf" => {
EmailVerificationRequestIssueReason::TokenVerificationKbMissingCnf
}
"TokenVerificationKbSignatureFailed" => {
EmailVerificationRequestIssueReason::TokenVerificationKbSignatureFailed
}
"CrossOriginIframeNotSupported" => {
EmailVerificationRequestIssueReason::CrossOriginIframeNotSupported
}
_ => EmailVerificationRequestIssueReason::Unknown(v.to_owned()),
},
)
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(EmailVerificationRequestIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct FailedRequestInfo {
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "failureMessage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub failure_message: String,
#[serde(rename = "requestId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request_id: Option<crate::network::types::RequestId>,
}
impl<'de> serde::Deserialize<'de> for FailedRequestInfo {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FailedRequestInfo;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "failureMessage")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub failure_message: String,
#[serde(rename = "requestId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request_id: Option<crate::network::types::RequestId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FailedRequestInfo {
url: fields.url,
failure_message: fields.failure_message,
request_id: fields.request_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct FederatedAuthRequestIssueDetails {
#[serde(rename = "federatedAuthRequestIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub federated_auth_request_issue_reason: crate::audits::types::FederatedAuthRequestIssueReason,
}
impl<'de> serde::Deserialize<'de> for FederatedAuthRequestIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FederatedAuthRequestIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "federatedAuthRequestIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub federated_auth_request_issue_reason:
crate::audits::types::FederatedAuthRequestIssueReason,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FederatedAuthRequestIssueDetails {
federated_auth_request_issue_reason: fields.federated_auth_request_issue_reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum FederatedAuthRequestIssueReason {
ShouldEmbargo,
TooManyRequests,
WellKnownHttpNotFound,
WellKnownNoResponse,
WellKnownBlockedByConnectionAllowlist,
WellKnownInvalidResponse,
WellKnownListEmpty,
WellKnownInvalidContentType,
ConfigNotInWellKnown,
WellKnownTooBig,
ConfigHttpNotFound,
ConfigNoResponse,
ConfigBlockedByConnectionAllowlist,
ConfigInvalidResponse,
ConfigInvalidContentType,
IdpNotPotentiallyTrustworthy,
DisabledInSettings,
DisabledInFlags,
ErrorFetchingSignin,
InvalidSigninResponse,
AccountsHttpNotFound,
AccountsNoResponse,
AccountsBlockedByConnectionAllowlist,
AccountsInvalidResponse,
AccountsListEmpty,
AccountsInvalidContentType,
IdTokenHttpNotFound,
IdTokenNoResponse,
IdTokenBlockedByConnectionAllowlist,
IdTokenInvalidResponse,
IdTokenIdpErrorResponse,
IdTokenCrossSiteIdpErrorResponse,
IdTokenInvalidRequest,
IdTokenInvalidContentType,
ErrorIdToken,
Canceled,
RpPageNotVisible,
SilentMediationFailure,
NotSignedInWithIdp,
MissingTransientUserActivation,
ReplacedByActiveMode,
RelyingPartyOriginIsOpaque,
TypeNotMatching,
UiDismissedNoEmbargo,
CorsError,
SuppressedBySegmentationPlatform,
Unknown(String),
}
impl FederatedAuthRequestIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::ShouldEmbargo => "ShouldEmbargo",
Self::TooManyRequests => "TooManyRequests",
Self::WellKnownHttpNotFound => "WellKnownHttpNotFound",
Self::WellKnownNoResponse => "WellKnownNoResponse",
Self::WellKnownBlockedByConnectionAllowlist => "WellKnownBlockedByConnectionAllowlist",
Self::WellKnownInvalidResponse => "WellKnownInvalidResponse",
Self::WellKnownListEmpty => "WellKnownListEmpty",
Self::WellKnownInvalidContentType => "WellKnownInvalidContentType",
Self::ConfigNotInWellKnown => "ConfigNotInWellKnown",
Self::WellKnownTooBig => "WellKnownTooBig",
Self::ConfigHttpNotFound => "ConfigHttpNotFound",
Self::ConfigNoResponse => "ConfigNoResponse",
Self::ConfigBlockedByConnectionAllowlist => "ConfigBlockedByConnectionAllowlist",
Self::ConfigInvalidResponse => "ConfigInvalidResponse",
Self::ConfigInvalidContentType => "ConfigInvalidContentType",
Self::IdpNotPotentiallyTrustworthy => "IdpNotPotentiallyTrustworthy",
Self::DisabledInSettings => "DisabledInSettings",
Self::DisabledInFlags => "DisabledInFlags",
Self::ErrorFetchingSignin => "ErrorFetchingSignin",
Self::InvalidSigninResponse => "InvalidSigninResponse",
Self::AccountsHttpNotFound => "AccountsHttpNotFound",
Self::AccountsNoResponse => "AccountsNoResponse",
Self::AccountsBlockedByConnectionAllowlist => "AccountsBlockedByConnectionAllowlist",
Self::AccountsInvalidResponse => "AccountsInvalidResponse",
Self::AccountsListEmpty => "AccountsListEmpty",
Self::AccountsInvalidContentType => "AccountsInvalidContentType",
Self::IdTokenHttpNotFound => "IdTokenHttpNotFound",
Self::IdTokenNoResponse => "IdTokenNoResponse",
Self::IdTokenBlockedByConnectionAllowlist => "IdTokenBlockedByConnectionAllowlist",
Self::IdTokenInvalidResponse => "IdTokenInvalidResponse",
Self::IdTokenIdpErrorResponse => "IdTokenIdpErrorResponse",
Self::IdTokenCrossSiteIdpErrorResponse => "IdTokenCrossSiteIdpErrorResponse",
Self::IdTokenInvalidRequest => "IdTokenInvalidRequest",
Self::IdTokenInvalidContentType => "IdTokenInvalidContentType",
Self::ErrorIdToken => "ErrorIdToken",
Self::Canceled => "Canceled",
Self::RpPageNotVisible => "RpPageNotVisible",
Self::SilentMediationFailure => "SilentMediationFailure",
Self::NotSignedInWithIdp => "NotSignedInWithIdp",
Self::MissingTransientUserActivation => "MissingTransientUserActivation",
Self::ReplacedByActiveMode => "ReplacedByActiveMode",
Self::RelyingPartyOriginIsOpaque => "RelyingPartyOriginIsOpaque",
Self::TypeNotMatching => "TypeNotMatching",
Self::UiDismissedNoEmbargo => "UiDismissedNoEmbargo",
Self::CorsError => "CorsError",
Self::SuppressedBySegmentationPlatform => "SuppressedBySegmentationPlatform",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for FederatedAuthRequestIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for FederatedAuthRequestIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"ShouldEmbargo" => FederatedAuthRequestIssueReason::ShouldEmbargo,
"TooManyRequests" => FederatedAuthRequestIssueReason::TooManyRequests,
"WellKnownHttpNotFound" => FederatedAuthRequestIssueReason::WellKnownHttpNotFound,
"WellKnownNoResponse" => FederatedAuthRequestIssueReason::WellKnownNoResponse,
"WellKnownBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::WellKnownBlockedByConnectionAllowlist
}
"WellKnownInvalidResponse" => FederatedAuthRequestIssueReason::WellKnownInvalidResponse,
"WellKnownListEmpty" => FederatedAuthRequestIssueReason::WellKnownListEmpty,
"WellKnownInvalidContentType" => {
FederatedAuthRequestIssueReason::WellKnownInvalidContentType
}
"ConfigNotInWellKnown" => FederatedAuthRequestIssueReason::ConfigNotInWellKnown,
"WellKnownTooBig" => FederatedAuthRequestIssueReason::WellKnownTooBig,
"ConfigHttpNotFound" => FederatedAuthRequestIssueReason::ConfigHttpNotFound,
"ConfigNoResponse" => FederatedAuthRequestIssueReason::ConfigNoResponse,
"ConfigBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::ConfigBlockedByConnectionAllowlist
}
"ConfigInvalidResponse" => FederatedAuthRequestIssueReason::ConfigInvalidResponse,
"ConfigInvalidContentType" => FederatedAuthRequestIssueReason::ConfigInvalidContentType,
"IdpNotPotentiallyTrustworthy" => {
FederatedAuthRequestIssueReason::IdpNotPotentiallyTrustworthy
}
"DisabledInSettings" => FederatedAuthRequestIssueReason::DisabledInSettings,
"DisabledInFlags" => FederatedAuthRequestIssueReason::DisabledInFlags,
"ErrorFetchingSignin" => FederatedAuthRequestIssueReason::ErrorFetchingSignin,
"InvalidSigninResponse" => FederatedAuthRequestIssueReason::InvalidSigninResponse,
"AccountsHttpNotFound" => FederatedAuthRequestIssueReason::AccountsHttpNotFound,
"AccountsNoResponse" => FederatedAuthRequestIssueReason::AccountsNoResponse,
"AccountsBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::AccountsBlockedByConnectionAllowlist
}
"AccountsInvalidResponse" => FederatedAuthRequestIssueReason::AccountsInvalidResponse,
"AccountsListEmpty" => FederatedAuthRequestIssueReason::AccountsListEmpty,
"AccountsInvalidContentType" => {
FederatedAuthRequestIssueReason::AccountsInvalidContentType
}
"IdTokenHttpNotFound" => FederatedAuthRequestIssueReason::IdTokenHttpNotFound,
"IdTokenNoResponse" => FederatedAuthRequestIssueReason::IdTokenNoResponse,
"IdTokenBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::IdTokenBlockedByConnectionAllowlist
}
"IdTokenInvalidResponse" => FederatedAuthRequestIssueReason::IdTokenInvalidResponse,
"IdTokenIdpErrorResponse" => FederatedAuthRequestIssueReason::IdTokenIdpErrorResponse,
"IdTokenCrossSiteIdpErrorResponse" => {
FederatedAuthRequestIssueReason::IdTokenCrossSiteIdpErrorResponse
}
"IdTokenInvalidRequest" => FederatedAuthRequestIssueReason::IdTokenInvalidRequest,
"IdTokenInvalidContentType" => {
FederatedAuthRequestIssueReason::IdTokenInvalidContentType
}
"ErrorIdToken" => FederatedAuthRequestIssueReason::ErrorIdToken,
"Canceled" => FederatedAuthRequestIssueReason::Canceled,
"RpPageNotVisible" => FederatedAuthRequestIssueReason::RpPageNotVisible,
"SilentMediationFailure" => FederatedAuthRequestIssueReason::SilentMediationFailure,
"NotSignedInWithIdp" => FederatedAuthRequestIssueReason::NotSignedInWithIdp,
"MissingTransientUserActivation" => {
FederatedAuthRequestIssueReason::MissingTransientUserActivation
}
"ReplacedByActiveMode" => FederatedAuthRequestIssueReason::ReplacedByActiveMode,
"RelyingPartyOriginIsOpaque" => {
FederatedAuthRequestIssueReason::RelyingPartyOriginIsOpaque
}
"TypeNotMatching" => FederatedAuthRequestIssueReason::TypeNotMatching,
"UiDismissedNoEmbargo" => FederatedAuthRequestIssueReason::UiDismissedNoEmbargo,
"CorsError" => FederatedAuthRequestIssueReason::CorsError,
"SuppressedBySegmentationPlatform" => {
FederatedAuthRequestIssueReason::SuppressedBySegmentationPlatform
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for FederatedAuthRequestIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for FederatedAuthRequestIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FederatedAuthRequestIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"ShouldEmbargo" => FederatedAuthRequestIssueReason::ShouldEmbargo,
"TooManyRequests" => FederatedAuthRequestIssueReason::TooManyRequests,
"WellKnownHttpNotFound" => {
FederatedAuthRequestIssueReason::WellKnownHttpNotFound
}
"WellKnownNoResponse" => FederatedAuthRequestIssueReason::WellKnownNoResponse,
"WellKnownBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::WellKnownBlockedByConnectionAllowlist
}
"WellKnownInvalidResponse" => {
FederatedAuthRequestIssueReason::WellKnownInvalidResponse
}
"WellKnownListEmpty" => FederatedAuthRequestIssueReason::WellKnownListEmpty,
"WellKnownInvalidContentType" => {
FederatedAuthRequestIssueReason::WellKnownInvalidContentType
}
"ConfigNotInWellKnown" => FederatedAuthRequestIssueReason::ConfigNotInWellKnown,
"WellKnownTooBig" => FederatedAuthRequestIssueReason::WellKnownTooBig,
"ConfigHttpNotFound" => FederatedAuthRequestIssueReason::ConfigHttpNotFound,
"ConfigNoResponse" => FederatedAuthRequestIssueReason::ConfigNoResponse,
"ConfigBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::ConfigBlockedByConnectionAllowlist
}
"ConfigInvalidResponse" => {
FederatedAuthRequestIssueReason::ConfigInvalidResponse
}
"ConfigInvalidContentType" => {
FederatedAuthRequestIssueReason::ConfigInvalidContentType
}
"IdpNotPotentiallyTrustworthy" => {
FederatedAuthRequestIssueReason::IdpNotPotentiallyTrustworthy
}
"DisabledInSettings" => FederatedAuthRequestIssueReason::DisabledInSettings,
"DisabledInFlags" => FederatedAuthRequestIssueReason::DisabledInFlags,
"ErrorFetchingSignin" => FederatedAuthRequestIssueReason::ErrorFetchingSignin,
"InvalidSigninResponse" => {
FederatedAuthRequestIssueReason::InvalidSigninResponse
}
"AccountsHttpNotFound" => FederatedAuthRequestIssueReason::AccountsHttpNotFound,
"AccountsNoResponse" => FederatedAuthRequestIssueReason::AccountsNoResponse,
"AccountsBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::AccountsBlockedByConnectionAllowlist
}
"AccountsInvalidResponse" => {
FederatedAuthRequestIssueReason::AccountsInvalidResponse
}
"AccountsListEmpty" => FederatedAuthRequestIssueReason::AccountsListEmpty,
"AccountsInvalidContentType" => {
FederatedAuthRequestIssueReason::AccountsInvalidContentType
}
"IdTokenHttpNotFound" => FederatedAuthRequestIssueReason::IdTokenHttpNotFound,
"IdTokenNoResponse" => FederatedAuthRequestIssueReason::IdTokenNoResponse,
"IdTokenBlockedByConnectionAllowlist" => {
FederatedAuthRequestIssueReason::IdTokenBlockedByConnectionAllowlist
}
"IdTokenInvalidResponse" => {
FederatedAuthRequestIssueReason::IdTokenInvalidResponse
}
"IdTokenIdpErrorResponse" => {
FederatedAuthRequestIssueReason::IdTokenIdpErrorResponse
}
"IdTokenCrossSiteIdpErrorResponse" => {
FederatedAuthRequestIssueReason::IdTokenCrossSiteIdpErrorResponse
}
"IdTokenInvalidRequest" => {
FederatedAuthRequestIssueReason::IdTokenInvalidRequest
}
"IdTokenInvalidContentType" => {
FederatedAuthRequestIssueReason::IdTokenInvalidContentType
}
"ErrorIdToken" => FederatedAuthRequestIssueReason::ErrorIdToken,
"Canceled" => FederatedAuthRequestIssueReason::Canceled,
"RpPageNotVisible" => FederatedAuthRequestIssueReason::RpPageNotVisible,
"SilentMediationFailure" => {
FederatedAuthRequestIssueReason::SilentMediationFailure
}
"NotSignedInWithIdp" => FederatedAuthRequestIssueReason::NotSignedInWithIdp,
"MissingTransientUserActivation" => {
FederatedAuthRequestIssueReason::MissingTransientUserActivation
}
"ReplacedByActiveMode" => FederatedAuthRequestIssueReason::ReplacedByActiveMode,
"RelyingPartyOriginIsOpaque" => {
FederatedAuthRequestIssueReason::RelyingPartyOriginIsOpaque
}
"TypeNotMatching" => FederatedAuthRequestIssueReason::TypeNotMatching,
"UiDismissedNoEmbargo" => FederatedAuthRequestIssueReason::UiDismissedNoEmbargo,
"CorsError" => FederatedAuthRequestIssueReason::CorsError,
"SuppressedBySegmentationPlatform" => {
FederatedAuthRequestIssueReason::SuppressedBySegmentationPlatform
}
_ => FederatedAuthRequestIssueReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(FederatedAuthRequestIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct FederatedAuthUserInfoRequestIssueDetails {
#[serde(rename = "federatedAuthUserInfoRequestIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub federated_auth_user_info_request_issue_reason:
crate::audits::types::FederatedAuthUserInfoRequestIssueReason,
}
impl<'de> serde::Deserialize<'de> for FederatedAuthUserInfoRequestIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FederatedAuthUserInfoRequestIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "federatedAuthUserInfoRequestIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub federated_auth_user_info_request_issue_reason:
crate::audits::types::FederatedAuthUserInfoRequestIssueReason,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FederatedAuthUserInfoRequestIssueDetails {
federated_auth_user_info_request_issue_reason: fields
.federated_auth_user_info_request_issue_reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum FederatedAuthUserInfoRequestIssueReason {
NotSameOrigin,
NotIframe,
NotPotentiallyTrustworthy,
NoApiPermission,
NotSignedInWithIdp,
NoAccountSharingPermission,
InvalidConfigOrWellKnown,
InvalidAccountsResponse,
NoReturningUserFromFetchedAccounts,
Unknown(String),
}
impl FederatedAuthUserInfoRequestIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::NotSameOrigin => "NotSameOrigin",
Self::NotIframe => "NotIframe",
Self::NotPotentiallyTrustworthy => "NotPotentiallyTrustworthy",
Self::NoApiPermission => "NoApiPermission",
Self::NotSignedInWithIdp => "NotSignedInWithIdp",
Self::NoAccountSharingPermission => "NoAccountSharingPermission",
Self::InvalidConfigOrWellKnown => "InvalidConfigOrWellKnown",
Self::InvalidAccountsResponse => "InvalidAccountsResponse",
Self::NoReturningUserFromFetchedAccounts => "NoReturningUserFromFetchedAccounts",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for FederatedAuthUserInfoRequestIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for FederatedAuthUserInfoRequestIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"NotSameOrigin" => FederatedAuthUserInfoRequestIssueReason::NotSameOrigin,
"NotIframe" => FederatedAuthUserInfoRequestIssueReason::NotIframe,
"NotPotentiallyTrustworthy" => {
FederatedAuthUserInfoRequestIssueReason::NotPotentiallyTrustworthy
}
"NoApiPermission" => FederatedAuthUserInfoRequestIssueReason::NoApiPermission,
"NotSignedInWithIdp" => FederatedAuthUserInfoRequestIssueReason::NotSignedInWithIdp,
"NoAccountSharingPermission" => {
FederatedAuthUserInfoRequestIssueReason::NoAccountSharingPermission
}
"InvalidConfigOrWellKnown" => {
FederatedAuthUserInfoRequestIssueReason::InvalidConfigOrWellKnown
}
"InvalidAccountsResponse" => {
FederatedAuthUserInfoRequestIssueReason::InvalidAccountsResponse
}
"NoReturningUserFromFetchedAccounts" => {
FederatedAuthUserInfoRequestIssueReason::NoReturningUserFromFetchedAccounts
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for FederatedAuthUserInfoRequestIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for FederatedAuthUserInfoRequestIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FederatedAuthUserInfoRequestIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"NotSameOrigin" => FederatedAuthUserInfoRequestIssueReason::NotSameOrigin,
"NotIframe" => FederatedAuthUserInfoRequestIssueReason::NotIframe,
"NotPotentiallyTrustworthy" => {
FederatedAuthUserInfoRequestIssueReason::NotPotentiallyTrustworthy
}
"NoApiPermission" => FederatedAuthUserInfoRequestIssueReason::NoApiPermission,
"NotSignedInWithIdp" => {
FederatedAuthUserInfoRequestIssueReason::NotSignedInWithIdp
}
"NoAccountSharingPermission" => {
FederatedAuthUserInfoRequestIssueReason::NoAccountSharingPermission
}
"InvalidConfigOrWellKnown" => {
FederatedAuthUserInfoRequestIssueReason::InvalidConfigOrWellKnown
}
"InvalidAccountsResponse" => {
FederatedAuthUserInfoRequestIssueReason::InvalidAccountsResponse
}
"NoReturningUserFromFetchedAccounts" => {
FederatedAuthUserInfoRequestIssueReason::NoReturningUserFromFetchedAccounts
}
_ => FederatedAuthUserInfoRequestIssueReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(FederatedAuthUserInfoRequestIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GenericIssueDetails {
#[serde(rename = "errorType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error_type: crate::audits::types::GenericIssueErrorType,
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
#[serde(rename = "violatingNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub violating_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "violatingNodeAttribute")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub violating_node_attribute: Option<String>,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
}
impl<'de> serde::Deserialize<'de> for GenericIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GenericIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "errorType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error_type: crate::audits::types::GenericIssueErrorType,
#[serde(rename = "frameId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame_id: Option<crate::page::types::FrameId>,
#[serde(rename = "violatingNodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub violating_node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "violatingNodeAttribute")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub violating_node_attribute: Option<String>,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GenericIssueDetails {
error_type: fields.error_type,
frame_id: fields.frame_id,
violating_node_id: fields.violating_node_id,
violating_node_attribute: fields.violating_node_attribute,
request: fields.request,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum GenericIssueErrorType {
FormLabelForNameError,
FormDuplicateIdForInputError,
FormInputWithNoLabelError,
FormAutocompleteAttributeEmptyError,
FormEmptyIdAndNameAttributesForInputError,
FormAriaLabelledByToNonExistingIdError,
FormInputAssignedAutocompleteValueToIdOrNameAttributeError,
FormLabelHasNeitherForNorNestedInputError,
FormLabelForMatchesNonExistingIdError,
FormInputHasWrongButWellIntendedAutocompleteValueError,
ResponseWasBlockedByOrb,
NavigationEntryMarkedSkippable,
BackUiNavigationWouldSkipAd,
AutofillAndManualTextPolicyControlledFeaturesInfo,
AutofillPolicyControlledFeatureInfo,
ManualTextPolicyControlledFeatureInfo,
FormModelContextParameterMissingTitleAndDescription,
FormModelContextMissingToolName,
FormModelContextMissingToolDescription,
FormModelContextRequiredParameterMissingName,
FormModelContextParameterMissingName,
Unknown(String),
}
impl GenericIssueErrorType {
pub fn as_str(&self) -> &str {
match self {
Self::FormLabelForNameError => "FormLabelForNameError",
Self::FormDuplicateIdForInputError => "FormDuplicateIdForInputError",
Self::FormInputWithNoLabelError => "FormInputWithNoLabelError",
Self::FormAutocompleteAttributeEmptyError => "FormAutocompleteAttributeEmptyError",
Self::FormEmptyIdAndNameAttributesForInputError => {
"FormEmptyIdAndNameAttributesForInputError"
}
Self::FormAriaLabelledByToNonExistingIdError => {
"FormAriaLabelledByToNonExistingIdError"
}
Self::FormInputAssignedAutocompleteValueToIdOrNameAttributeError => {
"FormInputAssignedAutocompleteValueToIdOrNameAttributeError"
}
Self::FormLabelHasNeitherForNorNestedInputError => {
"FormLabelHasNeitherForNorNestedInputError"
}
Self::FormLabelForMatchesNonExistingIdError => "FormLabelForMatchesNonExistingIdError",
Self::FormInputHasWrongButWellIntendedAutocompleteValueError => {
"FormInputHasWrongButWellIntendedAutocompleteValueError"
}
Self::ResponseWasBlockedByOrb => "ResponseWasBlockedByORB",
Self::NavigationEntryMarkedSkippable => "NavigationEntryMarkedSkippable",
Self::BackUiNavigationWouldSkipAd => "BackUINavigationWouldSkipAd",
Self::AutofillAndManualTextPolicyControlledFeaturesInfo => {
"AutofillAndManualTextPolicyControlledFeaturesInfo"
}
Self::AutofillPolicyControlledFeatureInfo => "AutofillPolicyControlledFeatureInfo",
Self::ManualTextPolicyControlledFeatureInfo => "ManualTextPolicyControlledFeatureInfo",
Self::FormModelContextParameterMissingTitleAndDescription => {
"FormModelContextParameterMissingTitleAndDescription"
}
Self::FormModelContextMissingToolName => "FormModelContextMissingToolName",
Self::FormModelContextMissingToolDescription => {
"FormModelContextMissingToolDescription"
}
Self::FormModelContextRequiredParameterMissingName => {
"FormModelContextRequiredParameterMissingName"
}
Self::FormModelContextParameterMissingName => "FormModelContextParameterMissingName",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for GenericIssueErrorType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for GenericIssueErrorType {
fn from(value: String) -> Self {
match value.as_str() {
"FormLabelForNameError" => GenericIssueErrorType::FormLabelForNameError,
"FormDuplicateIdForInputError" => GenericIssueErrorType::FormDuplicateIdForInputError,
"FormInputWithNoLabelError" => GenericIssueErrorType::FormInputWithNoLabelError,
"FormAutocompleteAttributeEmptyError" => {
GenericIssueErrorType::FormAutocompleteAttributeEmptyError
}
"FormEmptyIdAndNameAttributesForInputError" => {
GenericIssueErrorType::FormEmptyIdAndNameAttributesForInputError
}
"FormAriaLabelledByToNonExistingIdError" => {
GenericIssueErrorType::FormAriaLabelledByToNonExistingIdError
}
"FormInputAssignedAutocompleteValueToIdOrNameAttributeError" => {
GenericIssueErrorType::FormInputAssignedAutocompleteValueToIdOrNameAttributeError
}
"FormLabelHasNeitherForNorNestedInputError" => {
GenericIssueErrorType::FormLabelHasNeitherForNorNestedInputError
}
"FormLabelForMatchesNonExistingIdError" => {
GenericIssueErrorType::FormLabelForMatchesNonExistingIdError
}
"FormInputHasWrongButWellIntendedAutocompleteValueError" => {
GenericIssueErrorType::FormInputHasWrongButWellIntendedAutocompleteValueError
}
"ResponseWasBlockedByORB" => GenericIssueErrorType::ResponseWasBlockedByOrb,
"NavigationEntryMarkedSkippable" => {
GenericIssueErrorType::NavigationEntryMarkedSkippable
}
"BackUINavigationWouldSkipAd" => GenericIssueErrorType::BackUiNavigationWouldSkipAd,
"AutofillAndManualTextPolicyControlledFeaturesInfo" => {
GenericIssueErrorType::AutofillAndManualTextPolicyControlledFeaturesInfo
}
"AutofillPolicyControlledFeatureInfo" => {
GenericIssueErrorType::AutofillPolicyControlledFeatureInfo
}
"ManualTextPolicyControlledFeatureInfo" => {
GenericIssueErrorType::ManualTextPolicyControlledFeatureInfo
}
"FormModelContextParameterMissingTitleAndDescription" => {
GenericIssueErrorType::FormModelContextParameterMissingTitleAndDescription
}
"FormModelContextMissingToolName" => {
GenericIssueErrorType::FormModelContextMissingToolName
}
"FormModelContextMissingToolDescription" => {
GenericIssueErrorType::FormModelContextMissingToolDescription
}
"FormModelContextRequiredParameterMissingName" => {
GenericIssueErrorType::FormModelContextRequiredParameterMissingName
}
"FormModelContextParameterMissingName" => {
GenericIssueErrorType::FormModelContextParameterMissingName
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for GenericIssueErrorType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for GenericIssueErrorType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GenericIssueErrorType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(
match v {
"FormLabelForNameError" => {
GenericIssueErrorType::FormLabelForNameError
}
"FormDuplicateIdForInputError" => {
GenericIssueErrorType::FormDuplicateIdForInputError
}
"FormInputWithNoLabelError" => {
GenericIssueErrorType::FormInputWithNoLabelError
}
"FormAutocompleteAttributeEmptyError" => {
GenericIssueErrorType::FormAutocompleteAttributeEmptyError
}
"FormEmptyIdAndNameAttributesForInputError" => {
GenericIssueErrorType::FormEmptyIdAndNameAttributesForInputError
}
"FormAriaLabelledByToNonExistingIdError" => {
GenericIssueErrorType::FormAriaLabelledByToNonExistingIdError
}
"FormInputAssignedAutocompleteValueToIdOrNameAttributeError" => {
GenericIssueErrorType::FormInputAssignedAutocompleteValueToIdOrNameAttributeError
}
"FormLabelHasNeitherForNorNestedInputError" => {
GenericIssueErrorType::FormLabelHasNeitherForNorNestedInputError
}
"FormLabelForMatchesNonExistingIdError" => {
GenericIssueErrorType::FormLabelForMatchesNonExistingIdError
}
"FormInputHasWrongButWellIntendedAutocompleteValueError" => {
GenericIssueErrorType::FormInputHasWrongButWellIntendedAutocompleteValueError
}
"ResponseWasBlockedByORB" => {
GenericIssueErrorType::ResponseWasBlockedByOrb
}
"NavigationEntryMarkedSkippable" => {
GenericIssueErrorType::NavigationEntryMarkedSkippable
}
"BackUINavigationWouldSkipAd" => {
GenericIssueErrorType::BackUiNavigationWouldSkipAd
}
"AutofillAndManualTextPolicyControlledFeaturesInfo" => {
GenericIssueErrorType::AutofillAndManualTextPolicyControlledFeaturesInfo
}
"AutofillPolicyControlledFeatureInfo" => {
GenericIssueErrorType::AutofillPolicyControlledFeatureInfo
}
"ManualTextPolicyControlledFeatureInfo" => {
GenericIssueErrorType::ManualTextPolicyControlledFeatureInfo
}
"FormModelContextParameterMissingTitleAndDescription" => {
GenericIssueErrorType::FormModelContextParameterMissingTitleAndDescription
}
"FormModelContextMissingToolName" => {
GenericIssueErrorType::FormModelContextMissingToolName
}
"FormModelContextMissingToolDescription" => {
GenericIssueErrorType::FormModelContextMissingToolDescription
}
"FormModelContextRequiredParameterMissingName" => {
GenericIssueErrorType::FormModelContextRequiredParameterMissingName
}
"FormModelContextParameterMissingName" => {
GenericIssueErrorType::FormModelContextParameterMissingName
}
_ => GenericIssueErrorType::Unknown(v.to_owned()),
},
)
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(GenericIssueErrorType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct HeavyAdIssueDetails {
#[serde(rename = "resolution")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub resolution: crate::audits::types::HeavyAdResolutionStatus,
#[serde(rename = "reason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reason: crate::audits::types::HeavyAdReason,
#[serde(rename = "frame")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame: crate::audits::types::AffectedFrame,
}
impl<'de> serde::Deserialize<'de> for HeavyAdIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = HeavyAdIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "resolution")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub resolution: crate::audits::types::HeavyAdResolutionStatus,
#[serde(rename = "reason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reason: crate::audits::types::HeavyAdReason,
#[serde(rename = "frame")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame: crate::audits::types::AffectedFrame,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(HeavyAdIssueDetails {
resolution: fields.resolution,
reason: fields.reason,
frame: fields.frame,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum HeavyAdReason {
NetworkTotalLimit,
CpuTotalLimit,
CpuPeakLimit,
Unknown(String),
}
impl HeavyAdReason {
pub fn as_str(&self) -> &str {
match self {
Self::NetworkTotalLimit => "NetworkTotalLimit",
Self::CpuTotalLimit => "CpuTotalLimit",
Self::CpuPeakLimit => "CpuPeakLimit",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for HeavyAdReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for HeavyAdReason {
fn from(value: String) -> Self {
match value.as_str() {
"NetworkTotalLimit" => HeavyAdReason::NetworkTotalLimit,
"CpuTotalLimit" => HeavyAdReason::CpuTotalLimit,
"CpuPeakLimit" => HeavyAdReason::CpuPeakLimit,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for HeavyAdReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for HeavyAdReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = HeavyAdReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"NetworkTotalLimit" => HeavyAdReason::NetworkTotalLimit,
"CpuTotalLimit" => HeavyAdReason::CpuTotalLimit,
"CpuPeakLimit" => HeavyAdReason::CpuPeakLimit,
_ => HeavyAdReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(HeavyAdReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum HeavyAdResolutionStatus {
HeavyAdBlocked,
HeavyAdWarning,
Unknown(String),
}
impl HeavyAdResolutionStatus {
pub fn as_str(&self) -> &str {
match self {
Self::HeavyAdBlocked => "HeavyAdBlocked",
Self::HeavyAdWarning => "HeavyAdWarning",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for HeavyAdResolutionStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for HeavyAdResolutionStatus {
fn from(value: String) -> Self {
match value.as_str() {
"HeavyAdBlocked" => HeavyAdResolutionStatus::HeavyAdBlocked,
"HeavyAdWarning" => HeavyAdResolutionStatus::HeavyAdWarning,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for HeavyAdResolutionStatus {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for HeavyAdResolutionStatus {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = HeavyAdResolutionStatus;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"HeavyAdBlocked" => HeavyAdResolutionStatus::HeavyAdBlocked,
"HeavyAdWarning" => HeavyAdResolutionStatus::HeavyAdWarning,
_ => HeavyAdResolutionStatus::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(HeavyAdResolutionStatus::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum InsightType {
GitHubResource,
GracePeriod,
Heuristics,
Unknown(String),
}
impl InsightType {
pub fn as_str(&self) -> &str {
match self {
Self::GitHubResource => "GitHubResource",
Self::GracePeriod => "GracePeriod",
Self::Heuristics => "Heuristics",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for InsightType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for InsightType {
fn from(value: String) -> Self {
match value.as_str() {
"GitHubResource" => InsightType::GitHubResource,
"GracePeriod" => InsightType::GracePeriod,
"Heuristics" => InsightType::Heuristics,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for InsightType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for InsightType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InsightType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"GitHubResource" => InsightType::GitHubResource,
"GracePeriod" => InsightType::GracePeriod,
"Heuristics" => InsightType::Heuristics,
_ => InsightType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(InsightType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct InspectorIssue {
#[serde(rename = "code")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub code: crate::audits::types::InspectorIssueCode,
#[serde(rename = "details")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub details: crate::audits::types::InspectorIssueDetails,
#[serde(rename = "issueId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub issue_id: Option<crate::audits::types::IssueId>,
}
impl<'de> serde::Deserialize<'de> for InspectorIssue {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InspectorIssue;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "code")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub code: crate::audits::types::InspectorIssueCode,
#[serde(rename = "details")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub details: crate::audits::types::InspectorIssueDetails,
#[serde(rename = "issueId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub issue_id: Option<crate::audits::types::IssueId>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(InspectorIssue {
code: fields.code,
details: fields.details,
issue_id: fields.issue_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum InspectorIssueCode {
CookieIssue,
MixedContentIssue,
BlockedByResponseIssue,
HeavyAdIssue,
ContentSecurityPolicyIssue,
SharedArrayBufferIssue,
CorsIssue,
QuirksModeIssue,
PartitioningBlobUrlIssue,
NavigatorUserAgentIssue,
GenericIssue,
DeprecationIssue,
ClientHintIssue,
FederatedAuthRequestIssue,
BounceTrackingIssue,
CookieDeprecationMetadataIssue,
StylesheetLoadingIssue,
FederatedAuthUserInfoRequestIssue,
PropertyRuleIssue,
SharedDictionaryIssue,
ElementAccessibilityIssue,
SriMessageSignatureIssue,
UnencodedDigestIssue,
ConnectionAllowlistIssue,
UserReidentificationIssue,
PermissionElementIssue,
PerformanceIssue,
SelectivePermissionsInterventionIssue,
EmailVerificationRequestIssue,
LazyLoadImageIssue,
Unknown(String),
}
impl InspectorIssueCode {
pub fn as_str(&self) -> &str {
match self {
Self::CookieIssue => "CookieIssue",
Self::MixedContentIssue => "MixedContentIssue",
Self::BlockedByResponseIssue => "BlockedByResponseIssue",
Self::HeavyAdIssue => "HeavyAdIssue",
Self::ContentSecurityPolicyIssue => "ContentSecurityPolicyIssue",
Self::SharedArrayBufferIssue => "SharedArrayBufferIssue",
Self::CorsIssue => "CorsIssue",
Self::QuirksModeIssue => "QuirksModeIssue",
Self::PartitioningBlobUrlIssue => "PartitioningBlobURLIssue",
Self::NavigatorUserAgentIssue => "NavigatorUserAgentIssue",
Self::GenericIssue => "GenericIssue",
Self::DeprecationIssue => "DeprecationIssue",
Self::ClientHintIssue => "ClientHintIssue",
Self::FederatedAuthRequestIssue => "FederatedAuthRequestIssue",
Self::BounceTrackingIssue => "BounceTrackingIssue",
Self::CookieDeprecationMetadataIssue => "CookieDeprecationMetadataIssue",
Self::StylesheetLoadingIssue => "StylesheetLoadingIssue",
Self::FederatedAuthUserInfoRequestIssue => "FederatedAuthUserInfoRequestIssue",
Self::PropertyRuleIssue => "PropertyRuleIssue",
Self::SharedDictionaryIssue => "SharedDictionaryIssue",
Self::ElementAccessibilityIssue => "ElementAccessibilityIssue",
Self::SriMessageSignatureIssue => "SRIMessageSignatureIssue",
Self::UnencodedDigestIssue => "UnencodedDigestIssue",
Self::ConnectionAllowlistIssue => "ConnectionAllowlistIssue",
Self::UserReidentificationIssue => "UserReidentificationIssue",
Self::PermissionElementIssue => "PermissionElementIssue",
Self::PerformanceIssue => "PerformanceIssue",
Self::SelectivePermissionsInterventionIssue => "SelectivePermissionsInterventionIssue",
Self::EmailVerificationRequestIssue => "EmailVerificationRequestIssue",
Self::LazyLoadImageIssue => "LazyLoadImageIssue",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for InspectorIssueCode {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for InspectorIssueCode {
fn from(value: String) -> Self {
match value.as_str() {
"CookieIssue" => InspectorIssueCode::CookieIssue,
"MixedContentIssue" => InspectorIssueCode::MixedContentIssue,
"BlockedByResponseIssue" => InspectorIssueCode::BlockedByResponseIssue,
"HeavyAdIssue" => InspectorIssueCode::HeavyAdIssue,
"ContentSecurityPolicyIssue" => InspectorIssueCode::ContentSecurityPolicyIssue,
"SharedArrayBufferIssue" => InspectorIssueCode::SharedArrayBufferIssue,
"CorsIssue" => InspectorIssueCode::CorsIssue,
"QuirksModeIssue" => InspectorIssueCode::QuirksModeIssue,
"PartitioningBlobURLIssue" => InspectorIssueCode::PartitioningBlobUrlIssue,
"NavigatorUserAgentIssue" => InspectorIssueCode::NavigatorUserAgentIssue,
"GenericIssue" => InspectorIssueCode::GenericIssue,
"DeprecationIssue" => InspectorIssueCode::DeprecationIssue,
"ClientHintIssue" => InspectorIssueCode::ClientHintIssue,
"FederatedAuthRequestIssue" => InspectorIssueCode::FederatedAuthRequestIssue,
"BounceTrackingIssue" => InspectorIssueCode::BounceTrackingIssue,
"CookieDeprecationMetadataIssue" => InspectorIssueCode::CookieDeprecationMetadataIssue,
"StylesheetLoadingIssue" => InspectorIssueCode::StylesheetLoadingIssue,
"FederatedAuthUserInfoRequestIssue" => {
InspectorIssueCode::FederatedAuthUserInfoRequestIssue
}
"PropertyRuleIssue" => InspectorIssueCode::PropertyRuleIssue,
"SharedDictionaryIssue" => InspectorIssueCode::SharedDictionaryIssue,
"ElementAccessibilityIssue" => InspectorIssueCode::ElementAccessibilityIssue,
"SRIMessageSignatureIssue" => InspectorIssueCode::SriMessageSignatureIssue,
"UnencodedDigestIssue" => InspectorIssueCode::UnencodedDigestIssue,
"ConnectionAllowlistIssue" => InspectorIssueCode::ConnectionAllowlistIssue,
"UserReidentificationIssue" => InspectorIssueCode::UserReidentificationIssue,
"PermissionElementIssue" => InspectorIssueCode::PermissionElementIssue,
"PerformanceIssue" => InspectorIssueCode::PerformanceIssue,
"SelectivePermissionsInterventionIssue" => {
InspectorIssueCode::SelectivePermissionsInterventionIssue
}
"EmailVerificationRequestIssue" => InspectorIssueCode::EmailVerificationRequestIssue,
"LazyLoadImageIssue" => InspectorIssueCode::LazyLoadImageIssue,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for InspectorIssueCode {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for InspectorIssueCode {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InspectorIssueCode;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"CookieIssue" => InspectorIssueCode::CookieIssue,
"MixedContentIssue" => InspectorIssueCode::MixedContentIssue,
"BlockedByResponseIssue" => InspectorIssueCode::BlockedByResponseIssue,
"HeavyAdIssue" => InspectorIssueCode::HeavyAdIssue,
"ContentSecurityPolicyIssue" => InspectorIssueCode::ContentSecurityPolicyIssue,
"SharedArrayBufferIssue" => InspectorIssueCode::SharedArrayBufferIssue,
"CorsIssue" => InspectorIssueCode::CorsIssue,
"QuirksModeIssue" => InspectorIssueCode::QuirksModeIssue,
"PartitioningBlobURLIssue" => InspectorIssueCode::PartitioningBlobUrlIssue,
"NavigatorUserAgentIssue" => InspectorIssueCode::NavigatorUserAgentIssue,
"GenericIssue" => InspectorIssueCode::GenericIssue,
"DeprecationIssue" => InspectorIssueCode::DeprecationIssue,
"ClientHintIssue" => InspectorIssueCode::ClientHintIssue,
"FederatedAuthRequestIssue" => InspectorIssueCode::FederatedAuthRequestIssue,
"BounceTrackingIssue" => InspectorIssueCode::BounceTrackingIssue,
"CookieDeprecationMetadataIssue" => {
InspectorIssueCode::CookieDeprecationMetadataIssue
}
"StylesheetLoadingIssue" => InspectorIssueCode::StylesheetLoadingIssue,
"FederatedAuthUserInfoRequestIssue" => {
InspectorIssueCode::FederatedAuthUserInfoRequestIssue
}
"PropertyRuleIssue" => InspectorIssueCode::PropertyRuleIssue,
"SharedDictionaryIssue" => InspectorIssueCode::SharedDictionaryIssue,
"ElementAccessibilityIssue" => InspectorIssueCode::ElementAccessibilityIssue,
"SRIMessageSignatureIssue" => InspectorIssueCode::SriMessageSignatureIssue,
"UnencodedDigestIssue" => InspectorIssueCode::UnencodedDigestIssue,
"ConnectionAllowlistIssue" => InspectorIssueCode::ConnectionAllowlistIssue,
"UserReidentificationIssue" => InspectorIssueCode::UserReidentificationIssue,
"PermissionElementIssue" => InspectorIssueCode::PermissionElementIssue,
"PerformanceIssue" => InspectorIssueCode::PerformanceIssue,
"SelectivePermissionsInterventionIssue" => {
InspectorIssueCode::SelectivePermissionsInterventionIssue
}
"EmailVerificationRequestIssue" => {
InspectorIssueCode::EmailVerificationRequestIssue
}
"LazyLoadImageIssue" => InspectorIssueCode::LazyLoadImageIssue,
_ => InspectorIssueCode::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(InspectorIssueCode::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct InspectorIssueDetails {
#[serde(rename = "cookieIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie_issue_details: Option<crate::audits::types::CookieIssueDetails>,
#[serde(rename = "mixedContentIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub mixed_content_issue_details: Option<crate::audits::types::MixedContentIssueDetails>,
#[serde(rename = "blockedByResponseIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub blocked_by_response_issue_details:
Option<crate::audits::types::BlockedByResponseIssueDetails>,
#[serde(rename = "heavyAdIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub heavy_ad_issue_details: Option<crate::audits::types::HeavyAdIssueDetails>,
#[serde(rename = "contentSecurityPolicyIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub content_security_policy_issue_details:
Option<crate::audits::types::ContentSecurityPolicyIssueDetails>,
#[serde(rename = "sharedArrayBufferIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub shared_array_buffer_issue_details:
Option<crate::audits::types::SharedArrayBufferIssueDetails>,
#[serde(rename = "corsIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cors_issue_details: Option<crate::audits::types::CorsIssueDetails>,
#[serde(rename = "quirksModeIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub quirks_mode_issue_details: Option<crate::audits::types::QuirksModeIssueDetails>,
#[serde(rename = "partitioningBlobURLIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub partitioning_blob_url_issue_details:
Option<crate::audits::types::PartitioningBlobUrlIssueDetails>,
#[serde(rename = "navigatorUserAgentIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub navigator_user_agent_issue_details:
Option<crate::audits::types::NavigatorUserAgentIssueDetails>,
#[serde(rename = "genericIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub generic_issue_details: Option<crate::audits::types::GenericIssueDetails>,
#[serde(rename = "deprecationIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub deprecation_issue_details: Option<crate::audits::types::DeprecationIssueDetails>,
#[serde(rename = "clientHintIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub client_hint_issue_details: Option<crate::audits::types::ClientHintIssueDetails>,
#[serde(rename = "federatedAuthRequestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub federated_auth_request_issue_details:
Option<crate::audits::types::FederatedAuthRequestIssueDetails>,
#[serde(rename = "bounceTrackingIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub bounce_tracking_issue_details: Option<crate::audits::types::BounceTrackingIssueDetails>,
#[serde(rename = "cookieDeprecationMetadataIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie_deprecation_metadata_issue_details:
Option<crate::audits::types::CookieDeprecationMetadataIssueDetails>,
#[serde(rename = "stylesheetLoadingIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stylesheet_loading_issue_details:
Option<crate::audits::types::StylesheetLoadingIssueDetails>,
#[serde(rename = "propertyRuleIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub property_rule_issue_details: Option<crate::audits::types::PropertyRuleIssueDetails>,
#[serde(rename = "federatedAuthUserInfoRequestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub federated_auth_user_info_request_issue_details:
Option<crate::audits::types::FederatedAuthUserInfoRequestIssueDetails>,
#[serde(rename = "sharedDictionaryIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub shared_dictionary_issue_details: Option<crate::audits::types::SharedDictionaryIssueDetails>,
#[serde(rename = "elementAccessibilityIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub element_accessibility_issue_details:
Option<crate::audits::types::ElementAccessibilityIssueDetails>,
#[serde(rename = "sriMessageSignatureIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub sri_message_signature_issue_details:
Option<crate::audits::types::SriMessageSignatureIssueDetails>,
#[serde(rename = "unencodedDigestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub unencoded_digest_issue_details: Option<crate::audits::types::UnencodedDigestIssueDetails>,
#[serde(rename = "connectionAllowlistIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub connection_allowlist_issue_details:
Option<crate::audits::types::ConnectionAllowlistIssueDetails>,
#[serde(rename = "userReidentificationIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub user_reidentification_issue_details:
Option<crate::audits::types::UserReidentificationIssueDetails>,
#[serde(rename = "permissionElementIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub permission_element_issue_details:
Option<crate::audits::types::PermissionElementIssueDetails>,
#[serde(rename = "performanceIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub performance_issue_details: Option<crate::audits::types::PerformanceIssueDetails>,
#[serde(rename = "selectivePermissionsInterventionIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub selective_permissions_intervention_issue_details:
Option<crate::audits::types::SelectivePermissionsInterventionIssueDetails>,
#[serde(rename = "emailVerificationRequestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub email_verification_request_issue_details:
Option<crate::audits::types::EmailVerificationRequestIssueDetails>,
#[serde(rename = "lazyLoadImageIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub lazy_load_image_issue_details: Option<crate::audits::types::LazyLoadImageIssueDetails>,
}
impl<'de> serde::Deserialize<'de> for InspectorIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = InspectorIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "cookieIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie_issue_details: Option<crate::audits::types::CookieIssueDetails>,
#[serde(rename = "mixedContentIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub mixed_content_issue_details:
Option<crate::audits::types::MixedContentIssueDetails>,
#[serde(rename = "blockedByResponseIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub blocked_by_response_issue_details:
Option<crate::audits::types::BlockedByResponseIssueDetails>,
#[serde(rename = "heavyAdIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub heavy_ad_issue_details: Option<crate::audits::types::HeavyAdIssueDetails>,
#[serde(rename = "contentSecurityPolicyIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub content_security_policy_issue_details:
Option<crate::audits::types::ContentSecurityPolicyIssueDetails>,
#[serde(rename = "sharedArrayBufferIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub shared_array_buffer_issue_details:
Option<crate::audits::types::SharedArrayBufferIssueDetails>,
#[serde(rename = "corsIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cors_issue_details: Option<crate::audits::types::CorsIssueDetails>,
#[serde(rename = "quirksModeIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub quirks_mode_issue_details:
Option<crate::audits::types::QuirksModeIssueDetails>,
#[serde(rename = "partitioningBlobURLIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub partitioning_blob_url_issue_details:
Option<crate::audits::types::PartitioningBlobUrlIssueDetails>,
#[serde(rename = "navigatorUserAgentIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub navigator_user_agent_issue_details:
Option<crate::audits::types::NavigatorUserAgentIssueDetails>,
#[serde(rename = "genericIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub generic_issue_details: Option<crate::audits::types::GenericIssueDetails>,
#[serde(rename = "deprecationIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub deprecation_issue_details:
Option<crate::audits::types::DeprecationIssueDetails>,
#[serde(rename = "clientHintIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub client_hint_issue_details:
Option<crate::audits::types::ClientHintIssueDetails>,
#[serde(rename = "federatedAuthRequestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub federated_auth_request_issue_details:
Option<crate::audits::types::FederatedAuthRequestIssueDetails>,
#[serde(rename = "bounceTrackingIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub bounce_tracking_issue_details:
Option<crate::audits::types::BounceTrackingIssueDetails>,
#[serde(rename = "cookieDeprecationMetadataIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub cookie_deprecation_metadata_issue_details:
Option<crate::audits::types::CookieDeprecationMetadataIssueDetails>,
#[serde(rename = "stylesheetLoadingIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stylesheet_loading_issue_details:
Option<crate::audits::types::StylesheetLoadingIssueDetails>,
#[serde(rename = "propertyRuleIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub property_rule_issue_details:
Option<crate::audits::types::PropertyRuleIssueDetails>,
#[serde(rename = "federatedAuthUserInfoRequestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub federated_auth_user_info_request_issue_details:
Option<crate::audits::types::FederatedAuthUserInfoRequestIssueDetails>,
#[serde(rename = "sharedDictionaryIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub shared_dictionary_issue_details:
Option<crate::audits::types::SharedDictionaryIssueDetails>,
#[serde(rename = "elementAccessibilityIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub element_accessibility_issue_details:
Option<crate::audits::types::ElementAccessibilityIssueDetails>,
#[serde(rename = "sriMessageSignatureIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub sri_message_signature_issue_details:
Option<crate::audits::types::SriMessageSignatureIssueDetails>,
#[serde(rename = "unencodedDigestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub unencoded_digest_issue_details:
Option<crate::audits::types::UnencodedDigestIssueDetails>,
#[serde(rename = "connectionAllowlistIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub connection_allowlist_issue_details:
Option<crate::audits::types::ConnectionAllowlistIssueDetails>,
#[serde(rename = "userReidentificationIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub user_reidentification_issue_details:
Option<crate::audits::types::UserReidentificationIssueDetails>,
#[serde(rename = "permissionElementIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub permission_element_issue_details:
Option<crate::audits::types::PermissionElementIssueDetails>,
#[serde(rename = "performanceIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub performance_issue_details:
Option<crate::audits::types::PerformanceIssueDetails>,
#[serde(rename = "selectivePermissionsInterventionIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub selective_permissions_intervention_issue_details:
Option<crate::audits::types::SelectivePermissionsInterventionIssueDetails>,
#[serde(rename = "emailVerificationRequestIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub email_verification_request_issue_details:
Option<crate::audits::types::EmailVerificationRequestIssueDetails>,
#[serde(rename = "lazyLoadImageIssueDetails")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub lazy_load_image_issue_details:
Option<crate::audits::types::LazyLoadImageIssueDetails>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(InspectorIssueDetails {
cookie_issue_details: fields.cookie_issue_details,
mixed_content_issue_details: fields.mixed_content_issue_details,
blocked_by_response_issue_details: fields.blocked_by_response_issue_details,
heavy_ad_issue_details: fields.heavy_ad_issue_details,
content_security_policy_issue_details: fields
.content_security_policy_issue_details,
shared_array_buffer_issue_details: fields.shared_array_buffer_issue_details,
cors_issue_details: fields.cors_issue_details,
quirks_mode_issue_details: fields.quirks_mode_issue_details,
partitioning_blob_url_issue_details: fields.partitioning_blob_url_issue_details,
navigator_user_agent_issue_details: fields.navigator_user_agent_issue_details,
generic_issue_details: fields.generic_issue_details,
deprecation_issue_details: fields.deprecation_issue_details,
client_hint_issue_details: fields.client_hint_issue_details,
federated_auth_request_issue_details: fields
.federated_auth_request_issue_details,
bounce_tracking_issue_details: fields.bounce_tracking_issue_details,
cookie_deprecation_metadata_issue_details: fields
.cookie_deprecation_metadata_issue_details,
stylesheet_loading_issue_details: fields.stylesheet_loading_issue_details,
property_rule_issue_details: fields.property_rule_issue_details,
federated_auth_user_info_request_issue_details: fields
.federated_auth_user_info_request_issue_details,
shared_dictionary_issue_details: fields.shared_dictionary_issue_details,
element_accessibility_issue_details: fields.element_accessibility_issue_details,
sri_message_signature_issue_details: fields.sri_message_signature_issue_details,
unencoded_digest_issue_details: fields.unencoded_digest_issue_details,
connection_allowlist_issue_details: fields.connection_allowlist_issue_details,
user_reidentification_issue_details: fields.user_reidentification_issue_details,
permission_element_issue_details: fields.permission_element_issue_details,
performance_issue_details: fields.performance_issue_details,
selective_permissions_intervention_issue_details: fields
.selective_permissions_intervention_issue_details,
email_verification_request_issue_details: fields
.email_verification_request_issue_details,
lazy_load_image_issue_details: fields.lazy_load_image_issue_details,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(transparent)]
pub struct IssueId(String);
impl IssueId {
pub fn new(value: String) -> Self {
Self(value)
}
pub fn into_inner(self) -> String {
self.0
}
pub fn as_str(&self) -> &str {
&self.0
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct LazyLoadImageIssueDetails {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::BackendNodeId,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
}
impl<'de> serde::Deserialize<'de> for LazyLoadImageIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = LazyLoadImageIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "nodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub node_id: crate::dom::types::BackendNodeId,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(LazyLoadImageIssueDetails {
node_id: fields.node_id,
url: fields.url,
frame_id: fields.frame_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct MixedContentIssueDetails {
#[serde(rename = "resourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub resource_type: Option<crate::audits::types::MixedContentResourceType>,
#[serde(rename = "resolutionStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub resolution_status: crate::audits::types::MixedContentResolutionStatus,
#[serde(rename = "insecureURL")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub insecure_url: String,
#[serde(rename = "mainResourceURL")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub main_resource_url: String,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
#[serde(rename = "frame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame: Option<crate::audits::types::AffectedFrame>,
}
impl<'de> serde::Deserialize<'de> for MixedContentIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = MixedContentIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "resourceType")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub resource_type: Option<crate::audits::types::MixedContentResourceType>,
#[serde(rename = "resolutionStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub resolution_status: crate::audits::types::MixedContentResolutionStatus,
#[serde(rename = "insecureURL")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub insecure_url: String,
#[serde(rename = "mainResourceURL")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub main_resource_url: String,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
#[serde(rename = "frame")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub frame: Option<crate::audits::types::AffectedFrame>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(MixedContentIssueDetails {
resource_type: fields.resource_type,
resolution_status: fields.resolution_status,
insecure_url: fields.insecure_url,
main_resource_url: fields.main_resource_url,
request: fields.request,
frame: fields.frame,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum MixedContentResolutionStatus {
MixedContentBlocked,
MixedContentAutomaticallyUpgraded,
MixedContentWarning,
Unknown(String),
}
impl MixedContentResolutionStatus {
pub fn as_str(&self) -> &str {
match self {
Self::MixedContentBlocked => "MixedContentBlocked",
Self::MixedContentAutomaticallyUpgraded => "MixedContentAutomaticallyUpgraded",
Self::MixedContentWarning => "MixedContentWarning",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for MixedContentResolutionStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for MixedContentResolutionStatus {
fn from(value: String) -> Self {
match value.as_str() {
"MixedContentBlocked" => MixedContentResolutionStatus::MixedContentBlocked,
"MixedContentAutomaticallyUpgraded" => {
MixedContentResolutionStatus::MixedContentAutomaticallyUpgraded
}
"MixedContentWarning" => MixedContentResolutionStatus::MixedContentWarning,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for MixedContentResolutionStatus {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for MixedContentResolutionStatus {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = MixedContentResolutionStatus;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"MixedContentBlocked" => MixedContentResolutionStatus::MixedContentBlocked,
"MixedContentAutomaticallyUpgraded" => {
MixedContentResolutionStatus::MixedContentAutomaticallyUpgraded
}
"MixedContentWarning" => MixedContentResolutionStatus::MixedContentWarning,
_ => MixedContentResolutionStatus::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(MixedContentResolutionStatus::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum MixedContentResourceType {
Audio,
Beacon,
CspReport,
Download,
EventSource,
Favicon,
Font,
Form,
Frame,
Image,
Import,
Json,
Manifest,
Ping,
PluginData,
PluginResource,
Prefetch,
Resource,
Script,
ServiceWorker,
SharedWorker,
SpeculationRules,
Stylesheet,
Track,
Video,
Worker,
XmlHttpRequest,
Xslt,
Unknown(String),
}
impl MixedContentResourceType {
pub fn as_str(&self) -> &str {
match self {
Self::Audio => "Audio",
Self::Beacon => "Beacon",
Self::CspReport => "CSPReport",
Self::Download => "Download",
Self::EventSource => "EventSource",
Self::Favicon => "Favicon",
Self::Font => "Font",
Self::Form => "Form",
Self::Frame => "Frame",
Self::Image => "Image",
Self::Import => "Import",
Self::Json => "JSON",
Self::Manifest => "Manifest",
Self::Ping => "Ping",
Self::PluginData => "PluginData",
Self::PluginResource => "PluginResource",
Self::Prefetch => "Prefetch",
Self::Resource => "Resource",
Self::Script => "Script",
Self::ServiceWorker => "ServiceWorker",
Self::SharedWorker => "SharedWorker",
Self::SpeculationRules => "SpeculationRules",
Self::Stylesheet => "Stylesheet",
Self::Track => "Track",
Self::Video => "Video",
Self::Worker => "Worker",
Self::XmlHttpRequest => "XMLHttpRequest",
Self::Xslt => "XSLT",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for MixedContentResourceType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for MixedContentResourceType {
fn from(value: String) -> Self {
match value.as_str() {
"Audio" => MixedContentResourceType::Audio,
"Beacon" => MixedContentResourceType::Beacon,
"CSPReport" => MixedContentResourceType::CspReport,
"Download" => MixedContentResourceType::Download,
"EventSource" => MixedContentResourceType::EventSource,
"Favicon" => MixedContentResourceType::Favicon,
"Font" => MixedContentResourceType::Font,
"Form" => MixedContentResourceType::Form,
"Frame" => MixedContentResourceType::Frame,
"Image" => MixedContentResourceType::Image,
"Import" => MixedContentResourceType::Import,
"JSON" => MixedContentResourceType::Json,
"Manifest" => MixedContentResourceType::Manifest,
"Ping" => MixedContentResourceType::Ping,
"PluginData" => MixedContentResourceType::PluginData,
"PluginResource" => MixedContentResourceType::PluginResource,
"Prefetch" => MixedContentResourceType::Prefetch,
"Resource" => MixedContentResourceType::Resource,
"Script" => MixedContentResourceType::Script,
"ServiceWorker" => MixedContentResourceType::ServiceWorker,
"SharedWorker" => MixedContentResourceType::SharedWorker,
"SpeculationRules" => MixedContentResourceType::SpeculationRules,
"Stylesheet" => MixedContentResourceType::Stylesheet,
"Track" => MixedContentResourceType::Track,
"Video" => MixedContentResourceType::Video,
"Worker" => MixedContentResourceType::Worker,
"XMLHttpRequest" => MixedContentResourceType::XmlHttpRequest,
"XSLT" => MixedContentResourceType::Xslt,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for MixedContentResourceType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for MixedContentResourceType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = MixedContentResourceType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"Audio" => MixedContentResourceType::Audio,
"Beacon" => MixedContentResourceType::Beacon,
"CSPReport" => MixedContentResourceType::CspReport,
"Download" => MixedContentResourceType::Download,
"EventSource" => MixedContentResourceType::EventSource,
"Favicon" => MixedContentResourceType::Favicon,
"Font" => MixedContentResourceType::Font,
"Form" => MixedContentResourceType::Form,
"Frame" => MixedContentResourceType::Frame,
"Image" => MixedContentResourceType::Image,
"Import" => MixedContentResourceType::Import,
"JSON" => MixedContentResourceType::Json,
"Manifest" => MixedContentResourceType::Manifest,
"Ping" => MixedContentResourceType::Ping,
"PluginData" => MixedContentResourceType::PluginData,
"PluginResource" => MixedContentResourceType::PluginResource,
"Prefetch" => MixedContentResourceType::Prefetch,
"Resource" => MixedContentResourceType::Resource,
"Script" => MixedContentResourceType::Script,
"ServiceWorker" => MixedContentResourceType::ServiceWorker,
"SharedWorker" => MixedContentResourceType::SharedWorker,
"SpeculationRules" => MixedContentResourceType::SpeculationRules,
"Stylesheet" => MixedContentResourceType::Stylesheet,
"Track" => MixedContentResourceType::Track,
"Video" => MixedContentResourceType::Video,
"Worker" => MixedContentResourceType::Worker,
"XMLHttpRequest" => MixedContentResourceType::XmlHttpRequest,
"XSLT" => MixedContentResourceType::Xslt,
_ => MixedContentResourceType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(MixedContentResourceType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct NavigatorUserAgentIssueDetails {
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "location")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<crate::audits::types::SourceCodeLocation>,
}
impl<'de> serde::Deserialize<'de> for NavigatorUserAgentIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = NavigatorUserAgentIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "location")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<crate::audits::types::SourceCodeLocation>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(NavigatorUserAgentIssueDetails {
url: fields.url,
location: fields.location,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum PartitioningBlobUrlInfo {
BlockedCrossPartitionFetching,
EnforceNoopenerForNavigation,
Unknown(String),
}
impl PartitioningBlobUrlInfo {
pub fn as_str(&self) -> &str {
match self {
Self::BlockedCrossPartitionFetching => "BlockedCrossPartitionFetching",
Self::EnforceNoopenerForNavigation => "EnforceNoopenerForNavigation",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for PartitioningBlobUrlInfo {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for PartitioningBlobUrlInfo {
fn from(value: String) -> Self {
match value.as_str() {
"BlockedCrossPartitionFetching" => {
PartitioningBlobUrlInfo::BlockedCrossPartitionFetching
}
"EnforceNoopenerForNavigation" => PartitioningBlobUrlInfo::EnforceNoopenerForNavigation,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for PartitioningBlobUrlInfo {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for PartitioningBlobUrlInfo {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PartitioningBlobUrlInfo;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"BlockedCrossPartitionFetching" => {
PartitioningBlobUrlInfo::BlockedCrossPartitionFetching
}
"EnforceNoopenerForNavigation" => {
PartitioningBlobUrlInfo::EnforceNoopenerForNavigation
}
_ => PartitioningBlobUrlInfo::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(PartitioningBlobUrlInfo::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PartitioningBlobUrlIssueDetails {
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "partitioningBlobURLInfo")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub partitioning_blob_url_info: crate::audits::types::PartitioningBlobUrlInfo,
}
impl<'de> serde::Deserialize<'de> for PartitioningBlobUrlIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PartitioningBlobUrlIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "partitioningBlobURLInfo")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub partitioning_blob_url_info: crate::audits::types::PartitioningBlobUrlInfo,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PartitioningBlobUrlIssueDetails {
url: fields.url,
partitioning_blob_url_info: fields.partitioning_blob_url_info,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PerformanceIssueDetails {
#[serde(rename = "performanceIssueType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub performance_issue_type: crate::audits::types::PerformanceIssueType,
#[serde(rename = "sourceCodeLocation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_code_location: Option<crate::audits::types::SourceCodeLocation>,
}
impl<'de> serde::Deserialize<'de> for PerformanceIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PerformanceIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "performanceIssueType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub performance_issue_type: crate::audits::types::PerformanceIssueType,
#[serde(rename = "sourceCodeLocation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_code_location: Option<crate::audits::types::SourceCodeLocation>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PerformanceIssueDetails {
performance_issue_type: fields.performance_issue_type,
source_code_location: fields.source_code_location,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum PerformanceIssueType {
DocumentCookie,
Unknown(String),
}
impl PerformanceIssueType {
pub fn as_str(&self) -> &str {
match self {
Self::DocumentCookie => "DocumentCookie",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for PerformanceIssueType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for PerformanceIssueType {
fn from(value: String) -> Self {
match value.as_str() {
"DocumentCookie" => PerformanceIssueType::DocumentCookie,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for PerformanceIssueType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for PerformanceIssueType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PerformanceIssueType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"DocumentCookie" => PerformanceIssueType::DocumentCookie,
_ => PerformanceIssueType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(PerformanceIssueType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PermissionElementIssueDetails {
#[serde(rename = "issueType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub issue_type: crate::audits::types::PermissionElementIssueType,
#[serde(rename = "type")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub r#type: Option<String>,
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "isWarning")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub is_warning: Option<bool>,
#[serde(rename = "permissionName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub permission_name: Option<String>,
#[serde(rename = "occluderNodeInfo")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub occluder_node_info: Option<String>,
#[serde(rename = "occluderParentNodeInfo")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub occluder_parent_node_info: Option<String>,
#[serde(rename = "disableReason")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub disable_reason: Option<String>,
}
impl<'de> serde::Deserialize<'de> for PermissionElementIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PermissionElementIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "issueType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub issue_type: crate::audits::types::PermissionElementIssueType,
#[serde(rename = "type")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub r#type: Option<String>,
#[serde(rename = "nodeId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub node_id: Option<crate::dom::types::BackendNodeId>,
#[serde(rename = "isWarning")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub is_warning: Option<bool>,
#[serde(rename = "permissionName")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub permission_name: Option<String>,
#[serde(rename = "occluderNodeInfo")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub occluder_node_info: Option<String>,
#[serde(rename = "occluderParentNodeInfo")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub occluder_parent_node_info: Option<String>,
#[serde(rename = "disableReason")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub disable_reason: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PermissionElementIssueDetails {
issue_type: fields.issue_type,
r#type: fields.r#type,
node_id: fields.node_id,
is_warning: fields.is_warning,
permission_name: fields.permission_name,
occluder_node_info: fields.occluder_node_info,
occluder_parent_node_info: fields.occluder_parent_node_info,
disable_reason: fields.disable_reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum PermissionElementIssueType {
InvalidType,
FencedFrameDisallowed,
CspFrameAncestorsMissing,
PermissionsPolicyBlocked,
PaddingRightUnsupported,
PaddingBottomUnsupported,
InsetBoxShadowUnsupported,
RequestInProgress,
UntrustedEvent,
RegistrationFailed,
TypeNotSupported,
InvalidTypeActivation,
SecurityChecksFailed,
ActivationDisabled,
GeolocationDeprecated,
InvalidDisplayStyle,
NonOpaqueColor,
LowContrast,
FontSizeTooSmall,
FontSizeTooLarge,
InvalidSizeValue,
NonSecureContext,
MissingTransientUserActivation,
Unknown(String),
}
impl PermissionElementIssueType {
pub fn as_str(&self) -> &str {
match self {
Self::InvalidType => "InvalidType",
Self::FencedFrameDisallowed => "FencedFrameDisallowed",
Self::CspFrameAncestorsMissing => "CspFrameAncestorsMissing",
Self::PermissionsPolicyBlocked => "PermissionsPolicyBlocked",
Self::PaddingRightUnsupported => "PaddingRightUnsupported",
Self::PaddingBottomUnsupported => "PaddingBottomUnsupported",
Self::InsetBoxShadowUnsupported => "InsetBoxShadowUnsupported",
Self::RequestInProgress => "RequestInProgress",
Self::UntrustedEvent => "UntrustedEvent",
Self::RegistrationFailed => "RegistrationFailed",
Self::TypeNotSupported => "TypeNotSupported",
Self::InvalidTypeActivation => "InvalidTypeActivation",
Self::SecurityChecksFailed => "SecurityChecksFailed",
Self::ActivationDisabled => "ActivationDisabled",
Self::GeolocationDeprecated => "GeolocationDeprecated",
Self::InvalidDisplayStyle => "InvalidDisplayStyle",
Self::NonOpaqueColor => "NonOpaqueColor",
Self::LowContrast => "LowContrast",
Self::FontSizeTooSmall => "FontSizeTooSmall",
Self::FontSizeTooLarge => "FontSizeTooLarge",
Self::InvalidSizeValue => "InvalidSizeValue",
Self::NonSecureContext => "NonSecureContext",
Self::MissingTransientUserActivation => "MissingTransientUserActivation",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for PermissionElementIssueType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for PermissionElementIssueType {
fn from(value: String) -> Self {
match value.as_str() {
"InvalidType" => PermissionElementIssueType::InvalidType,
"FencedFrameDisallowed" => PermissionElementIssueType::FencedFrameDisallowed,
"CspFrameAncestorsMissing" => PermissionElementIssueType::CspFrameAncestorsMissing,
"PermissionsPolicyBlocked" => PermissionElementIssueType::PermissionsPolicyBlocked,
"PaddingRightUnsupported" => PermissionElementIssueType::PaddingRightUnsupported,
"PaddingBottomUnsupported" => PermissionElementIssueType::PaddingBottomUnsupported,
"InsetBoxShadowUnsupported" => PermissionElementIssueType::InsetBoxShadowUnsupported,
"RequestInProgress" => PermissionElementIssueType::RequestInProgress,
"UntrustedEvent" => PermissionElementIssueType::UntrustedEvent,
"RegistrationFailed" => PermissionElementIssueType::RegistrationFailed,
"TypeNotSupported" => PermissionElementIssueType::TypeNotSupported,
"InvalidTypeActivation" => PermissionElementIssueType::InvalidTypeActivation,
"SecurityChecksFailed" => PermissionElementIssueType::SecurityChecksFailed,
"ActivationDisabled" => PermissionElementIssueType::ActivationDisabled,
"GeolocationDeprecated" => PermissionElementIssueType::GeolocationDeprecated,
"InvalidDisplayStyle" => PermissionElementIssueType::InvalidDisplayStyle,
"NonOpaqueColor" => PermissionElementIssueType::NonOpaqueColor,
"LowContrast" => PermissionElementIssueType::LowContrast,
"FontSizeTooSmall" => PermissionElementIssueType::FontSizeTooSmall,
"FontSizeTooLarge" => PermissionElementIssueType::FontSizeTooLarge,
"InvalidSizeValue" => PermissionElementIssueType::InvalidSizeValue,
"NonSecureContext" => PermissionElementIssueType::NonSecureContext,
"MissingTransientUserActivation" => {
PermissionElementIssueType::MissingTransientUserActivation
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for PermissionElementIssueType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for PermissionElementIssueType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PermissionElementIssueType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"InvalidType" => PermissionElementIssueType::InvalidType,
"FencedFrameDisallowed" => PermissionElementIssueType::FencedFrameDisallowed,
"CspFrameAncestorsMissing" => {
PermissionElementIssueType::CspFrameAncestorsMissing
}
"PermissionsPolicyBlocked" => {
PermissionElementIssueType::PermissionsPolicyBlocked
}
"PaddingRightUnsupported" => {
PermissionElementIssueType::PaddingRightUnsupported
}
"PaddingBottomUnsupported" => {
PermissionElementIssueType::PaddingBottomUnsupported
}
"InsetBoxShadowUnsupported" => {
PermissionElementIssueType::InsetBoxShadowUnsupported
}
"RequestInProgress" => PermissionElementIssueType::RequestInProgress,
"UntrustedEvent" => PermissionElementIssueType::UntrustedEvent,
"RegistrationFailed" => PermissionElementIssueType::RegistrationFailed,
"TypeNotSupported" => PermissionElementIssueType::TypeNotSupported,
"InvalidTypeActivation" => PermissionElementIssueType::InvalidTypeActivation,
"SecurityChecksFailed" => PermissionElementIssueType::SecurityChecksFailed,
"ActivationDisabled" => PermissionElementIssueType::ActivationDisabled,
"GeolocationDeprecated" => PermissionElementIssueType::GeolocationDeprecated,
"InvalidDisplayStyle" => PermissionElementIssueType::InvalidDisplayStyle,
"NonOpaqueColor" => PermissionElementIssueType::NonOpaqueColor,
"LowContrast" => PermissionElementIssueType::LowContrast,
"FontSizeTooSmall" => PermissionElementIssueType::FontSizeTooSmall,
"FontSizeTooLarge" => PermissionElementIssueType::FontSizeTooLarge,
"InvalidSizeValue" => PermissionElementIssueType::InvalidSizeValue,
"NonSecureContext" => PermissionElementIssueType::NonSecureContext,
"MissingTransientUserActivation" => {
PermissionElementIssueType::MissingTransientUserActivation
}
_ => PermissionElementIssueType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(PermissionElementIssueType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct PropertyRuleIssueDetails {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "propertyRuleIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_rule_issue_reason: crate::audits::types::PropertyRuleIssueReason,
#[serde(rename = "propertyValue")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub property_value: Option<String>,
}
impl<'de> serde::Deserialize<'de> for PropertyRuleIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PropertyRuleIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "propertyRuleIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub property_rule_issue_reason: crate::audits::types::PropertyRuleIssueReason,
#[serde(rename = "propertyValue")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub property_value: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(PropertyRuleIssueDetails {
source_code_location: fields.source_code_location,
property_rule_issue_reason: fields.property_rule_issue_reason,
property_value: fields.property_value,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum PropertyRuleIssueReason {
InvalidSyntax,
InvalidInitialValue,
InvalidInherits,
InvalidName,
Unknown(String),
}
impl PropertyRuleIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::InvalidSyntax => "InvalidSyntax",
Self::InvalidInitialValue => "InvalidInitialValue",
Self::InvalidInherits => "InvalidInherits",
Self::InvalidName => "InvalidName",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for PropertyRuleIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for PropertyRuleIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"InvalidSyntax" => PropertyRuleIssueReason::InvalidSyntax,
"InvalidInitialValue" => PropertyRuleIssueReason::InvalidInitialValue,
"InvalidInherits" => PropertyRuleIssueReason::InvalidInherits,
"InvalidName" => PropertyRuleIssueReason::InvalidName,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for PropertyRuleIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for PropertyRuleIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = PropertyRuleIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"InvalidSyntax" => PropertyRuleIssueReason::InvalidSyntax,
"InvalidInitialValue" => PropertyRuleIssueReason::InvalidInitialValue,
"InvalidInherits" => PropertyRuleIssueReason::InvalidInherits,
"InvalidName" => PropertyRuleIssueReason::InvalidName,
_ => PropertyRuleIssueReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(PropertyRuleIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct QuirksModeIssueDetails {
#[serde(rename = "isLimitedQuirksMode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_limited_quirks_mode: bool,
#[serde(rename = "documentNodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub document_node_id: crate::dom::types::BackendNodeId,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
#[serde(rename = "loaderId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub loader_id: crate::network::types::LoaderId,
}
impl<'de> serde::Deserialize<'de> for QuirksModeIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = QuirksModeIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "isLimitedQuirksMode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_limited_quirks_mode: bool,
#[serde(rename = "documentNodeId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub document_node_id: crate::dom::types::BackendNodeId,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "frameId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub frame_id: crate::page::types::FrameId,
#[serde(rename = "loaderId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub loader_id: crate::network::types::LoaderId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(QuirksModeIssueDetails {
is_limited_quirks_mode: fields.is_limited_quirks_mode,
document_node_id: fields.document_node_id,
url: fields.url,
frame_id: fields.frame_id,
loader_id: fields.loader_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum SriMessageSignatureError {
MissingSignatureHeader,
MissingSignatureInputHeader,
InvalidSignatureHeader,
InvalidSignatureInputHeader,
SignatureHeaderValueIsNotByteSequence,
SignatureHeaderValueIsParameterized,
SignatureHeaderValueIsIncorrectLength,
SignatureInputHeaderMissingLabel,
SignatureInputHeaderValueNotInnerList,
SignatureInputHeaderValueMissingComponents,
SignatureInputHeaderInvalidComponentType,
SignatureInputHeaderInvalidComponentName,
SignatureInputHeaderInvalidHeaderComponentParameter,
SignatureInputHeaderInvalidDerivedComponentParameter,
SignatureInputHeaderKeyIdLength,
SignatureInputHeaderInvalidParameter,
SignatureInputHeaderMissingRequiredParameters,
ValidationFailedSignatureExpired,
ValidationFailedInvalidLength,
ValidationFailedSignatureMismatch,
ValidationFailedIntegrityMismatch,
SignatureBaseUnknownDerivedComponent,
SignatureBaseMissingHeader,
SignatureBaseInvalidUnencodedDigest,
SignatureBaseUnsupportedComponent,
Unknown(String),
}
impl SriMessageSignatureError {
pub fn as_str(&self) -> &str {
match self {
Self::MissingSignatureHeader => "MissingSignatureHeader",
Self::MissingSignatureInputHeader => "MissingSignatureInputHeader",
Self::InvalidSignatureHeader => "InvalidSignatureHeader",
Self::InvalidSignatureInputHeader => "InvalidSignatureInputHeader",
Self::SignatureHeaderValueIsNotByteSequence => "SignatureHeaderValueIsNotByteSequence",
Self::SignatureHeaderValueIsParameterized => "SignatureHeaderValueIsParameterized",
Self::SignatureHeaderValueIsIncorrectLength => "SignatureHeaderValueIsIncorrectLength",
Self::SignatureInputHeaderMissingLabel => "SignatureInputHeaderMissingLabel",
Self::SignatureInputHeaderValueNotInnerList => "SignatureInputHeaderValueNotInnerList",
Self::SignatureInputHeaderValueMissingComponents => {
"SignatureInputHeaderValueMissingComponents"
}
Self::SignatureInputHeaderInvalidComponentType => {
"SignatureInputHeaderInvalidComponentType"
}
Self::SignatureInputHeaderInvalidComponentName => {
"SignatureInputHeaderInvalidComponentName"
}
Self::SignatureInputHeaderInvalidHeaderComponentParameter => {
"SignatureInputHeaderInvalidHeaderComponentParameter"
}
Self::SignatureInputHeaderInvalidDerivedComponentParameter => {
"SignatureInputHeaderInvalidDerivedComponentParameter"
}
Self::SignatureInputHeaderKeyIdLength => "SignatureInputHeaderKeyIdLength",
Self::SignatureInputHeaderInvalidParameter => "SignatureInputHeaderInvalidParameter",
Self::SignatureInputHeaderMissingRequiredParameters => {
"SignatureInputHeaderMissingRequiredParameters"
}
Self::ValidationFailedSignatureExpired => "ValidationFailedSignatureExpired",
Self::ValidationFailedInvalidLength => "ValidationFailedInvalidLength",
Self::ValidationFailedSignatureMismatch => "ValidationFailedSignatureMismatch",
Self::ValidationFailedIntegrityMismatch => "ValidationFailedIntegrityMismatch",
Self::SignatureBaseUnknownDerivedComponent => "SignatureBaseUnknownDerivedComponent",
Self::SignatureBaseMissingHeader => "SignatureBaseMissingHeader",
Self::SignatureBaseInvalidUnencodedDigest => "SignatureBaseInvalidUnencodedDigest",
Self::SignatureBaseUnsupportedComponent => "SignatureBaseUnsupportedComponent",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for SriMessageSignatureError {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for SriMessageSignatureError {
fn from(value: String) -> Self {
match value.as_str() {
"MissingSignatureHeader" => SriMessageSignatureError::MissingSignatureHeader,
"MissingSignatureInputHeader" => SriMessageSignatureError::MissingSignatureInputHeader,
"InvalidSignatureHeader" => SriMessageSignatureError::InvalidSignatureHeader,
"InvalidSignatureInputHeader" => SriMessageSignatureError::InvalidSignatureInputHeader,
"SignatureHeaderValueIsNotByteSequence" => {
SriMessageSignatureError::SignatureHeaderValueIsNotByteSequence
}
"SignatureHeaderValueIsParameterized" => {
SriMessageSignatureError::SignatureHeaderValueIsParameterized
}
"SignatureHeaderValueIsIncorrectLength" => {
SriMessageSignatureError::SignatureHeaderValueIsIncorrectLength
}
"SignatureInputHeaderMissingLabel" => {
SriMessageSignatureError::SignatureInputHeaderMissingLabel
}
"SignatureInputHeaderValueNotInnerList" => {
SriMessageSignatureError::SignatureInputHeaderValueNotInnerList
}
"SignatureInputHeaderValueMissingComponents" => {
SriMessageSignatureError::SignatureInputHeaderValueMissingComponents
}
"SignatureInputHeaderInvalidComponentType" => {
SriMessageSignatureError::SignatureInputHeaderInvalidComponentType
}
"SignatureInputHeaderInvalidComponentName" => {
SriMessageSignatureError::SignatureInputHeaderInvalidComponentName
}
"SignatureInputHeaderInvalidHeaderComponentParameter" => {
SriMessageSignatureError::SignatureInputHeaderInvalidHeaderComponentParameter
}
"SignatureInputHeaderInvalidDerivedComponentParameter" => {
SriMessageSignatureError::SignatureInputHeaderInvalidDerivedComponentParameter
}
"SignatureInputHeaderKeyIdLength" => {
SriMessageSignatureError::SignatureInputHeaderKeyIdLength
}
"SignatureInputHeaderInvalidParameter" => {
SriMessageSignatureError::SignatureInputHeaderInvalidParameter
}
"SignatureInputHeaderMissingRequiredParameters" => {
SriMessageSignatureError::SignatureInputHeaderMissingRequiredParameters
}
"ValidationFailedSignatureExpired" => {
SriMessageSignatureError::ValidationFailedSignatureExpired
}
"ValidationFailedInvalidLength" => {
SriMessageSignatureError::ValidationFailedInvalidLength
}
"ValidationFailedSignatureMismatch" => {
SriMessageSignatureError::ValidationFailedSignatureMismatch
}
"ValidationFailedIntegrityMismatch" => {
SriMessageSignatureError::ValidationFailedIntegrityMismatch
}
"SignatureBaseUnknownDerivedComponent" => {
SriMessageSignatureError::SignatureBaseUnknownDerivedComponent
}
"SignatureBaseMissingHeader" => SriMessageSignatureError::SignatureBaseMissingHeader,
"SignatureBaseInvalidUnencodedDigest" => {
SriMessageSignatureError::SignatureBaseInvalidUnencodedDigest
}
"SignatureBaseUnsupportedComponent" => {
SriMessageSignatureError::SignatureBaseUnsupportedComponent
}
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for SriMessageSignatureError {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for SriMessageSignatureError {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SriMessageSignatureError;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(
match v {
"MissingSignatureHeader" => {
SriMessageSignatureError::MissingSignatureHeader
}
"MissingSignatureInputHeader" => {
SriMessageSignatureError::MissingSignatureInputHeader
}
"InvalidSignatureHeader" => {
SriMessageSignatureError::InvalidSignatureHeader
}
"InvalidSignatureInputHeader" => {
SriMessageSignatureError::InvalidSignatureInputHeader
}
"SignatureHeaderValueIsNotByteSequence" => {
SriMessageSignatureError::SignatureHeaderValueIsNotByteSequence
}
"SignatureHeaderValueIsParameterized" => {
SriMessageSignatureError::SignatureHeaderValueIsParameterized
}
"SignatureHeaderValueIsIncorrectLength" => {
SriMessageSignatureError::SignatureHeaderValueIsIncorrectLength
}
"SignatureInputHeaderMissingLabel" => {
SriMessageSignatureError::SignatureInputHeaderMissingLabel
}
"SignatureInputHeaderValueNotInnerList" => {
SriMessageSignatureError::SignatureInputHeaderValueNotInnerList
}
"SignatureInputHeaderValueMissingComponents" => {
SriMessageSignatureError::SignatureInputHeaderValueMissingComponents
}
"SignatureInputHeaderInvalidComponentType" => {
SriMessageSignatureError::SignatureInputHeaderInvalidComponentType
}
"SignatureInputHeaderInvalidComponentName" => {
SriMessageSignatureError::SignatureInputHeaderInvalidComponentName
}
"SignatureInputHeaderInvalidHeaderComponentParameter" => {
SriMessageSignatureError::SignatureInputHeaderInvalidHeaderComponentParameter
}
"SignatureInputHeaderInvalidDerivedComponentParameter" => {
SriMessageSignatureError::SignatureInputHeaderInvalidDerivedComponentParameter
}
"SignatureInputHeaderKeyIdLength" => {
SriMessageSignatureError::SignatureInputHeaderKeyIdLength
}
"SignatureInputHeaderInvalidParameter" => {
SriMessageSignatureError::SignatureInputHeaderInvalidParameter
}
"SignatureInputHeaderMissingRequiredParameters" => {
SriMessageSignatureError::SignatureInputHeaderMissingRequiredParameters
}
"ValidationFailedSignatureExpired" => {
SriMessageSignatureError::ValidationFailedSignatureExpired
}
"ValidationFailedInvalidLength" => {
SriMessageSignatureError::ValidationFailedInvalidLength
}
"ValidationFailedSignatureMismatch" => {
SriMessageSignatureError::ValidationFailedSignatureMismatch
}
"ValidationFailedIntegrityMismatch" => {
SriMessageSignatureError::ValidationFailedIntegrityMismatch
}
"SignatureBaseUnknownDerivedComponent" => {
SriMessageSignatureError::SignatureBaseUnknownDerivedComponent
}
"SignatureBaseMissingHeader" => {
SriMessageSignatureError::SignatureBaseMissingHeader
}
"SignatureBaseInvalidUnencodedDigest" => {
SriMessageSignatureError::SignatureBaseInvalidUnencodedDigest
}
"SignatureBaseUnsupportedComponent" => {
SriMessageSignatureError::SignatureBaseUnsupportedComponent
}
_ => SriMessageSignatureError::Unknown(v.to_owned()),
},
)
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(SriMessageSignatureError::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SriMessageSignatureIssueDetails {
#[serde(rename = "error")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error: crate::audits::types::SriMessageSignatureError,
#[serde(rename = "signatureBase")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub signature_base: String,
#[serde(rename = "integrityAssertions")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub integrity_assertions: Vec<String>,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
impl<'de> serde::Deserialize<'de> for SriMessageSignatureIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SriMessageSignatureIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "error")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error: crate::audits::types::SriMessageSignatureError,
#[serde(rename = "signatureBase")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub signature_base: String,
#[serde(rename = "integrityAssertions")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub integrity_assertions: Vec<String>,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SriMessageSignatureIssueDetails {
error: fields.error,
signature_base: fields.signature_base,
integrity_assertions: fields.integrity_assertions,
request: fields.request,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SelectivePermissionsInterventionIssueDetails {
#[serde(rename = "apiName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub api_name: String,
#[serde(rename = "adAncestry")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub ad_ancestry: crate::network::types::AdAncestry,
#[serde(rename = "stackTrace")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<crate::runtime::types::StackTrace>,
}
impl<'de> serde::Deserialize<'de> for SelectivePermissionsInterventionIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SelectivePermissionsInterventionIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "apiName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub api_name: String,
#[serde(rename = "adAncestry")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub ad_ancestry: crate::network::types::AdAncestry,
#[serde(rename = "stackTrace")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub stack_trace: Option<crate::runtime::types::StackTrace>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SelectivePermissionsInterventionIssueDetails {
api_name: fields.api_name,
ad_ancestry: fields.ad_ancestry,
stack_trace: fields.stack_trace,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SharedArrayBufferIssueDetails {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "isWarning")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_warning: bool,
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: crate::audits::types::SharedArrayBufferIssueType,
}
impl<'de> serde::Deserialize<'de> for SharedArrayBufferIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SharedArrayBufferIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "isWarning")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub is_warning: bool,
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: crate::audits::types::SharedArrayBufferIssueType,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SharedArrayBufferIssueDetails {
source_code_location: fields.source_code_location,
is_warning: fields.is_warning,
r#type: fields.r#type,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum SharedArrayBufferIssueType {
TransferIssue,
CreationIssue,
Unknown(String),
}
impl SharedArrayBufferIssueType {
pub fn as_str(&self) -> &str {
match self {
Self::TransferIssue => "TransferIssue",
Self::CreationIssue => "CreationIssue",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for SharedArrayBufferIssueType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for SharedArrayBufferIssueType {
fn from(value: String) -> Self {
match value.as_str() {
"TransferIssue" => SharedArrayBufferIssueType::TransferIssue,
"CreationIssue" => SharedArrayBufferIssueType::CreationIssue,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for SharedArrayBufferIssueType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for SharedArrayBufferIssueType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SharedArrayBufferIssueType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"TransferIssue" => SharedArrayBufferIssueType::TransferIssue,
"CreationIssue" => SharedArrayBufferIssueType::CreationIssue,
_ => SharedArrayBufferIssueType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(SharedArrayBufferIssueType::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum SharedDictionaryError {
UseErrorCrossOriginNoCorsRequest,
UseErrorDictionaryLoadFailure,
UseErrorMatchingDictionaryNotUsed,
UseErrorUnexpectedContentDictionaryHeader,
WriteErrorCossOriginNoCorsRequest,
WriteErrorDisallowedBySettings,
WriteErrorExpiredResponse,
WriteErrorFeatureDisabled,
WriteErrorInsufficientResources,
WriteErrorInvalidMatchField,
WriteErrorInvalidStructuredHeader,
WriteErrorInvalidTtlField,
WriteErrorNavigationRequest,
WriteErrorNoMatchField,
WriteErrorNonIntegerTtlField,
WriteErrorNonListMatchDestField,
WriteErrorNonSecureContext,
WriteErrorNonStringIdField,
WriteErrorNonStringInMatchDestList,
WriteErrorInvalidMatchDestList,
WriteErrorNonStringMatchField,
WriteErrorNonTokenTypeField,
WriteErrorRequestAborted,
WriteErrorShuttingDown,
WriteErrorTooLongIdField,
WriteErrorUnsupportedType,
Unknown(String),
}
impl SharedDictionaryError {
pub fn as_str(&self) -> &str {
match self {
Self::UseErrorCrossOriginNoCorsRequest => "UseErrorCrossOriginNoCorsRequest",
Self::UseErrorDictionaryLoadFailure => "UseErrorDictionaryLoadFailure",
Self::UseErrorMatchingDictionaryNotUsed => "UseErrorMatchingDictionaryNotUsed",
Self::UseErrorUnexpectedContentDictionaryHeader => {
"UseErrorUnexpectedContentDictionaryHeader"
}
Self::WriteErrorCossOriginNoCorsRequest => "WriteErrorCossOriginNoCorsRequest",
Self::WriteErrorDisallowedBySettings => "WriteErrorDisallowedBySettings",
Self::WriteErrorExpiredResponse => "WriteErrorExpiredResponse",
Self::WriteErrorFeatureDisabled => "WriteErrorFeatureDisabled",
Self::WriteErrorInsufficientResources => "WriteErrorInsufficientResources",
Self::WriteErrorInvalidMatchField => "WriteErrorInvalidMatchField",
Self::WriteErrorInvalidStructuredHeader => "WriteErrorInvalidStructuredHeader",
Self::WriteErrorInvalidTtlField => "WriteErrorInvalidTTLField",
Self::WriteErrorNavigationRequest => "WriteErrorNavigationRequest",
Self::WriteErrorNoMatchField => "WriteErrorNoMatchField",
Self::WriteErrorNonIntegerTtlField => "WriteErrorNonIntegerTTLField",
Self::WriteErrorNonListMatchDestField => "WriteErrorNonListMatchDestField",
Self::WriteErrorNonSecureContext => "WriteErrorNonSecureContext",
Self::WriteErrorNonStringIdField => "WriteErrorNonStringIdField",
Self::WriteErrorNonStringInMatchDestList => "WriteErrorNonStringInMatchDestList",
Self::WriteErrorInvalidMatchDestList => "WriteErrorInvalidMatchDestList",
Self::WriteErrorNonStringMatchField => "WriteErrorNonStringMatchField",
Self::WriteErrorNonTokenTypeField => "WriteErrorNonTokenTypeField",
Self::WriteErrorRequestAborted => "WriteErrorRequestAborted",
Self::WriteErrorShuttingDown => "WriteErrorShuttingDown",
Self::WriteErrorTooLongIdField => "WriteErrorTooLongIdField",
Self::WriteErrorUnsupportedType => "WriteErrorUnsupportedType",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for SharedDictionaryError {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for SharedDictionaryError {
fn from(value: String) -> Self {
match value.as_str() {
"UseErrorCrossOriginNoCorsRequest" => {
SharedDictionaryError::UseErrorCrossOriginNoCorsRequest
}
"UseErrorDictionaryLoadFailure" => SharedDictionaryError::UseErrorDictionaryLoadFailure,
"UseErrorMatchingDictionaryNotUsed" => {
SharedDictionaryError::UseErrorMatchingDictionaryNotUsed
}
"UseErrorUnexpectedContentDictionaryHeader" => {
SharedDictionaryError::UseErrorUnexpectedContentDictionaryHeader
}
"WriteErrorCossOriginNoCorsRequest" => {
SharedDictionaryError::WriteErrorCossOriginNoCorsRequest
}
"WriteErrorDisallowedBySettings" => {
SharedDictionaryError::WriteErrorDisallowedBySettings
}
"WriteErrorExpiredResponse" => SharedDictionaryError::WriteErrorExpiredResponse,
"WriteErrorFeatureDisabled" => SharedDictionaryError::WriteErrorFeatureDisabled,
"WriteErrorInsufficientResources" => {
SharedDictionaryError::WriteErrorInsufficientResources
}
"WriteErrorInvalidMatchField" => SharedDictionaryError::WriteErrorInvalidMatchField,
"WriteErrorInvalidStructuredHeader" => {
SharedDictionaryError::WriteErrorInvalidStructuredHeader
}
"WriteErrorInvalidTTLField" => SharedDictionaryError::WriteErrorInvalidTtlField,
"WriteErrorNavigationRequest" => SharedDictionaryError::WriteErrorNavigationRequest,
"WriteErrorNoMatchField" => SharedDictionaryError::WriteErrorNoMatchField,
"WriteErrorNonIntegerTTLField" => SharedDictionaryError::WriteErrorNonIntegerTtlField,
"WriteErrorNonListMatchDestField" => {
SharedDictionaryError::WriteErrorNonListMatchDestField
}
"WriteErrorNonSecureContext" => SharedDictionaryError::WriteErrorNonSecureContext,
"WriteErrorNonStringIdField" => SharedDictionaryError::WriteErrorNonStringIdField,
"WriteErrorNonStringInMatchDestList" => {
SharedDictionaryError::WriteErrorNonStringInMatchDestList
}
"WriteErrorInvalidMatchDestList" => {
SharedDictionaryError::WriteErrorInvalidMatchDestList
}
"WriteErrorNonStringMatchField" => SharedDictionaryError::WriteErrorNonStringMatchField,
"WriteErrorNonTokenTypeField" => SharedDictionaryError::WriteErrorNonTokenTypeField,
"WriteErrorRequestAborted" => SharedDictionaryError::WriteErrorRequestAborted,
"WriteErrorShuttingDown" => SharedDictionaryError::WriteErrorShuttingDown,
"WriteErrorTooLongIdField" => SharedDictionaryError::WriteErrorTooLongIdField,
"WriteErrorUnsupportedType" => SharedDictionaryError::WriteErrorUnsupportedType,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for SharedDictionaryError {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for SharedDictionaryError {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SharedDictionaryError;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"UseErrorCrossOriginNoCorsRequest" => {
SharedDictionaryError::UseErrorCrossOriginNoCorsRequest
}
"UseErrorDictionaryLoadFailure" => {
SharedDictionaryError::UseErrorDictionaryLoadFailure
}
"UseErrorMatchingDictionaryNotUsed" => {
SharedDictionaryError::UseErrorMatchingDictionaryNotUsed
}
"UseErrorUnexpectedContentDictionaryHeader" => {
SharedDictionaryError::UseErrorUnexpectedContentDictionaryHeader
}
"WriteErrorCossOriginNoCorsRequest" => {
SharedDictionaryError::WriteErrorCossOriginNoCorsRequest
}
"WriteErrorDisallowedBySettings" => {
SharedDictionaryError::WriteErrorDisallowedBySettings
}
"WriteErrorExpiredResponse" => SharedDictionaryError::WriteErrorExpiredResponse,
"WriteErrorFeatureDisabled" => SharedDictionaryError::WriteErrorFeatureDisabled,
"WriteErrorInsufficientResources" => {
SharedDictionaryError::WriteErrorInsufficientResources
}
"WriteErrorInvalidMatchField" => {
SharedDictionaryError::WriteErrorInvalidMatchField
}
"WriteErrorInvalidStructuredHeader" => {
SharedDictionaryError::WriteErrorInvalidStructuredHeader
}
"WriteErrorInvalidTTLField" => SharedDictionaryError::WriteErrorInvalidTtlField,
"WriteErrorNavigationRequest" => {
SharedDictionaryError::WriteErrorNavigationRequest
}
"WriteErrorNoMatchField" => SharedDictionaryError::WriteErrorNoMatchField,
"WriteErrorNonIntegerTTLField" => {
SharedDictionaryError::WriteErrorNonIntegerTtlField
}
"WriteErrorNonListMatchDestField" => {
SharedDictionaryError::WriteErrorNonListMatchDestField
}
"WriteErrorNonSecureContext" => {
SharedDictionaryError::WriteErrorNonSecureContext
}
"WriteErrorNonStringIdField" => {
SharedDictionaryError::WriteErrorNonStringIdField
}
"WriteErrorNonStringInMatchDestList" => {
SharedDictionaryError::WriteErrorNonStringInMatchDestList
}
"WriteErrorInvalidMatchDestList" => {
SharedDictionaryError::WriteErrorInvalidMatchDestList
}
"WriteErrorNonStringMatchField" => {
SharedDictionaryError::WriteErrorNonStringMatchField
}
"WriteErrorNonTokenTypeField" => {
SharedDictionaryError::WriteErrorNonTokenTypeField
}
"WriteErrorRequestAborted" => SharedDictionaryError::WriteErrorRequestAborted,
"WriteErrorShuttingDown" => SharedDictionaryError::WriteErrorShuttingDown,
"WriteErrorTooLongIdField" => SharedDictionaryError::WriteErrorTooLongIdField,
"WriteErrorUnsupportedType" => SharedDictionaryError::WriteErrorUnsupportedType,
_ => SharedDictionaryError::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(SharedDictionaryError::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SharedDictionaryIssueDetails {
#[serde(rename = "sharedDictionaryError")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub shared_dictionary_error: crate::audits::types::SharedDictionaryError,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
impl<'de> serde::Deserialize<'de> for SharedDictionaryIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SharedDictionaryIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "sharedDictionaryError")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub shared_dictionary_error: crate::audits::types::SharedDictionaryError,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SharedDictionaryIssueDetails {
shared_dictionary_error: fields.shared_dictionary_error,
request: fields.request,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SourceCodeLocation {
#[serde(rename = "scriptId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub script_id: Option<crate::runtime::types::ScriptId>,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "lineNumber")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub line_number: i64,
#[serde(rename = "columnNumber")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub column_number: i64,
}
impl<'de> serde::Deserialize<'de> for SourceCodeLocation {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SourceCodeLocation;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "scriptId")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub script_id: Option<crate::runtime::types::ScriptId>,
#[serde(rename = "url")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub url: String,
#[serde(rename = "lineNumber")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub line_number: i64,
#[serde(rename = "columnNumber")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub column_number: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SourceCodeLocation {
script_id: fields.script_id,
url: fields.url,
line_number: fields.line_number,
column_number: fields.column_number,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum StyleSheetLoadingIssueReason {
LateImportRule,
RequestFailed,
Unknown(String),
}
impl StyleSheetLoadingIssueReason {
pub fn as_str(&self) -> &str {
match self {
Self::LateImportRule => "LateImportRule",
Self::RequestFailed => "RequestFailed",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for StyleSheetLoadingIssueReason {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for StyleSheetLoadingIssueReason {
fn from(value: String) -> Self {
match value.as_str() {
"LateImportRule" => StyleSheetLoadingIssueReason::LateImportRule,
"RequestFailed" => StyleSheetLoadingIssueReason::RequestFailed,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for StyleSheetLoadingIssueReason {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for StyleSheetLoadingIssueReason {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StyleSheetLoadingIssueReason;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"LateImportRule" => StyleSheetLoadingIssueReason::LateImportRule,
"RequestFailed" => StyleSheetLoadingIssueReason::RequestFailed,
_ => StyleSheetLoadingIssueReason::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(StyleSheetLoadingIssueReason::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct StylesheetLoadingIssueDetails {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "styleSheetLoadingIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_loading_issue_reason: crate::audits::types::StyleSheetLoadingIssueReason,
#[serde(rename = "failedRequestInfo")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub failed_request_info: Option<crate::audits::types::FailedRequestInfo>,
}
impl<'de> serde::Deserialize<'de> for StylesheetLoadingIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StylesheetLoadingIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "sourceCodeLocation")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub source_code_location: crate::audits::types::SourceCodeLocation,
#[serde(rename = "styleSheetLoadingIssueReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub style_sheet_loading_issue_reason:
crate::audits::types::StyleSheetLoadingIssueReason,
#[serde(rename = "failedRequestInfo")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub failed_request_info: Option<crate::audits::types::FailedRequestInfo>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(StylesheetLoadingIssueDetails {
source_code_location: fields.source_code_location,
style_sheet_loading_issue_reason: fields.style_sheet_loading_issue_reason,
failed_request_info: fields.failed_request_info,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum UnencodedDigestError {
MalformedDictionary,
UnknownAlgorithm,
IncorrectDigestType,
IncorrectDigestLength,
Unknown(String),
}
impl UnencodedDigestError {
pub fn as_str(&self) -> &str {
match self {
Self::MalformedDictionary => "MalformedDictionary",
Self::UnknownAlgorithm => "UnknownAlgorithm",
Self::IncorrectDigestType => "IncorrectDigestType",
Self::IncorrectDigestLength => "IncorrectDigestLength",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for UnencodedDigestError {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for UnencodedDigestError {
fn from(value: String) -> Self {
match value.as_str() {
"MalformedDictionary" => UnencodedDigestError::MalformedDictionary,
"UnknownAlgorithm" => UnencodedDigestError::UnknownAlgorithm,
"IncorrectDigestType" => UnencodedDigestError::IncorrectDigestType,
"IncorrectDigestLength" => UnencodedDigestError::IncorrectDigestLength,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for UnencodedDigestError {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for UnencodedDigestError {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = UnencodedDigestError;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"MalformedDictionary" => UnencodedDigestError::MalformedDictionary,
"UnknownAlgorithm" => UnencodedDigestError::UnknownAlgorithm,
"IncorrectDigestType" => UnencodedDigestError::IncorrectDigestType,
"IncorrectDigestLength" => UnencodedDigestError::IncorrectDigestLength,
_ => UnencodedDigestError::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(UnencodedDigestError::from(v))
}
}
d.deserialize_str(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct UnencodedDigestIssueDetails {
#[serde(rename = "error")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error: crate::audits::types::UnencodedDigestError,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
impl<'de> serde::Deserialize<'de> for UnencodedDigestIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = UnencodedDigestIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "error")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error: crate::audits::types::UnencodedDigestError,
#[serde(rename = "request")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request: crate::audits::types::AffectedRequest,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(UnencodedDigestIssueDetails {
error: fields.error,
request: fields.request,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct UserReidentificationIssueDetails {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: crate::audits::types::UserReidentificationIssueType,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
#[serde(rename = "sourceCodeLocation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_code_location: Option<crate::audits::types::SourceCodeLocation>,
}
impl<'de> serde::Deserialize<'de> for UserReidentificationIssueDetails {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = UserReidentificationIssueDetails;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "type")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub r#type: crate::audits::types::UserReidentificationIssueType,
#[serde(rename = "request")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub request: Option<crate::audits::types::AffectedRequest>,
#[serde(rename = "sourceCodeLocation")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub source_code_location: Option<crate::audits::types::SourceCodeLocation>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(UserReidentificationIssueDetails {
r#type: fields.r#type,
request: fields.request,
source_code_location: fields.source_code_location,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum UserReidentificationIssueType {
BlockedFrameNavigation,
BlockedSubresource,
NoisedCanvasReadback,
Unknown(String),
}
impl UserReidentificationIssueType {
pub fn as_str(&self) -> &str {
match self {
Self::BlockedFrameNavigation => "BlockedFrameNavigation",
Self::BlockedSubresource => "BlockedSubresource",
Self::NoisedCanvasReadback => "NoisedCanvasReadback",
Self::Unknown(value) => value,
}
}
}
impl AsRef<str> for UserReidentificationIssueType {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl From<String> for UserReidentificationIssueType {
fn from(value: String) -> Self {
match value.as_str() {
"BlockedFrameNavigation" => UserReidentificationIssueType::BlockedFrameNavigation,
"BlockedSubresource" => UserReidentificationIssueType::BlockedSubresource,
"NoisedCanvasReadback" => UserReidentificationIssueType::NoisedCanvasReadback,
_ => Self::Unknown(value),
}
}
}
impl serde::Serialize for UserReidentificationIssueType {
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
s.serialize_str(self.as_str())
}
}
impl<'de> serde::Deserialize<'de> for UserReidentificationIssueType {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = UserReidentificationIssueType;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议字符串枚举")
}
fn visit_str<E: serde::de::Error>(self, v: &str) -> Result<Self::Value, E> {
Ok(match v {
"BlockedFrameNavigation" => {
UserReidentificationIssueType::BlockedFrameNavigation
}
"BlockedSubresource" => UserReidentificationIssueType::BlockedSubresource,
"NoisedCanvasReadback" => UserReidentificationIssueType::NoisedCanvasReadback,
_ => UserReidentificationIssueType::Unknown(v.to_owned()),
})
}
fn visit_string<E: serde::de::Error>(self, v: String) -> Result<Self::Value, E> {
Ok(UserReidentificationIssueType::from(v))
}
}
d.deserialize_str(Visitor)
}
}