#[derive(Debug, Clone, serde::Serialize)]
pub struct SetVirtualWalletBehaviorParams {
#[serde(rename = "action")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub action: crate::digital_credentials::types::VirtualWalletAction,
#[serde(rename = "protocol")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub protocol: Option<String>,
#[serde(rename = "response")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response: Option<std::collections::BTreeMap<String, serde_json::Value>>,
#[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>,
}
impl<'de> serde::Deserialize<'de> for SetVirtualWalletBehaviorParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetVirtualWalletBehaviorParams;
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 = "action")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub action: crate::digital_credentials::types::VirtualWalletAction,
#[serde(rename = "protocol")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub protocol: Option<String>,
#[serde(rename = "response")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response: Option<std::collections::BTreeMap<String, serde_json::Value>>,
#[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>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetVirtualWalletBehaviorParams {
action: fields.action,
protocol: fields.protocol,
response: fields.response,
frame_id: fields.frame_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetVirtualWalletBehavior;
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetVirtualWalletBehaviorResponse {}
impl<'de> serde::Deserialize<'de> for SetVirtualWalletBehaviorResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetVirtualWalletBehaviorResponse;
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 {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetVirtualWalletBehaviorResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for SetVirtualWalletBehavior {
type Params = SetVirtualWalletBehaviorParams;
type Response = SetVirtualWalletBehaviorResponse;
const METHOD: &'static str = "DigitalCredentials.setVirtualWalletBehavior";
}