#[derive(Debug, Clone, serde::Serialize)]
pub struct CertificateErrorParams {
#[serde(rename = "eventId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub event_id: i64,
#[serde(rename = "errorType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error_type: String,
#[serde(rename = "requestURL")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_url: String,
}
impl<'de> serde::Deserialize<'de> for CertificateErrorParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CertificateErrorParams;
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 = "eventId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub event_id: i64,
#[serde(rename = "errorType")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error_type: String,
#[serde(rename = "requestURL")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_url: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CertificateErrorParams {
event_id: fields.event_id,
error_type: fields.error_type,
request_url: fields.request_url,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct CertificateError;
impl ydp_core::Event for CertificateError {
type Params = CertificateErrorParams;
const METHOD: &'static str = "Security.certificateError";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SecurityStateChangedParams {
#[serde(rename = "securityState")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub security_state: crate::security::types::SecurityState,
#[serde(rename = "schemeIsCryptographic")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub scheme_is_cryptographic: bool,
#[serde(rename = "explanations")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub explanations: Vec<crate::security::types::SecurityStateExplanation>,
#[serde(rename = "insecureContentStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub insecure_content_status: crate::security::types::InsecureContentStatus,
#[serde(rename = "summary")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub summary: Option<String>,
}
impl<'de> serde::Deserialize<'de> for SecurityStateChangedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SecurityStateChangedParams;
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 = "securityState")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub security_state: crate::security::types::SecurityState,
#[serde(rename = "schemeIsCryptographic")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub scheme_is_cryptographic: bool,
#[serde(rename = "explanations")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub explanations: Vec<crate::security::types::SecurityStateExplanation>,
#[serde(rename = "insecureContentStatus")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub insecure_content_status: crate::security::types::InsecureContentStatus,
#[serde(rename = "summary")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub summary: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SecurityStateChangedParams {
security_state: fields.security_state,
scheme_is_cryptographic: fields.scheme_is_cryptographic,
explanations: fields.explanations,
insecure_content_status: fields.insecure_content_status,
summary: fields.summary,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SecurityStateChanged;
impl ydp_core::Event for SecurityStateChanged {
type Params = SecurityStateChangedParams;
const METHOD: &'static str = "Security.securityStateChanged";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct VisibleSecurityStateChangedParams {
#[serde(rename = "visibleSecurityState")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub visible_security_state: crate::security::types::VisibleSecurityState,
}
impl<'de> serde::Deserialize<'de> for VisibleSecurityStateChangedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = VisibleSecurityStateChangedParams;
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 = "visibleSecurityState")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub visible_security_state: crate::security::types::VisibleSecurityState,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(VisibleSecurityStateChangedParams {
visible_security_state: fields.visible_security_state,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct VisibleSecurityStateChanged;
impl ydp_core::Event for VisibleSecurityStateChanged {
type Params = VisibleSecurityStateChangedParams;
const METHOD: &'static str = "Security.visibleSecurityStateChanged";
}