#[derive(Debug, Clone, serde::Serialize)]
pub struct BeginTransactionRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
}
impl<'de> serde::Deserialize<'de> for BeginTransactionRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = BeginTransactionRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(BeginTransactionRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct BeginTransactionRequested;
impl ydp_core::Event for BeginTransactionRequested {
type Params = BeginTransactionRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.beginTransactionRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct CancelRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
}
impl<'de> serde::Deserialize<'de> for CancelRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = CancelRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(CancelRequestedParams {
request_id: fields.request_id,
context_id: fields.context_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct CancelRequested;
impl ydp_core::Event for CancelRequested {
type Params = CancelRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.cancelRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ConnectRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
#[serde(rename = "reader")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reader: String,
#[serde(rename = "shareMode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub share_mode: crate::smart_card_emulation::types::ShareMode,
#[serde(rename = "preferredProtocols")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub preferred_protocols: crate::smart_card_emulation::types::ProtocolSet,
}
impl<'de> serde::Deserialize<'de> for ConnectRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ConnectRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
#[serde(rename = "reader")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reader: String,
#[serde(rename = "shareMode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub share_mode: crate::smart_card_emulation::types::ShareMode,
#[serde(rename = "preferredProtocols")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub preferred_protocols: crate::smart_card_emulation::types::ProtocolSet,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ConnectRequestedParams {
request_id: fields.request_id,
context_id: fields.context_id,
reader: fields.reader,
share_mode: fields.share_mode,
preferred_protocols: fields.preferred_protocols,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ConnectRequested;
impl ydp_core::Event for ConnectRequested {
type Params = ConnectRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.connectRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ControlRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "controlCode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub control_code: i64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: String,
}
impl<'de> serde::Deserialize<'de> for ControlRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ControlRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "controlCode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub control_code: i64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ControlRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
control_code: fields.control_code,
data: fields.data,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ControlRequested;
impl ydp_core::Event for ControlRequested {
type Params = ControlRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.controlRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct DisconnectRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "disposition")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disposition: crate::smart_card_emulation::types::Disposition,
}
impl<'de> serde::Deserialize<'de> for DisconnectRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisconnectRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "disposition")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disposition: crate::smart_card_emulation::types::Disposition,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisconnectRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
disposition: fields.disposition,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct DisconnectRequested;
impl ydp_core::Event for DisconnectRequested {
type Params = DisconnectRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.disconnectRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct EndTransactionRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "disposition")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disposition: crate::smart_card_emulation::types::Disposition,
}
impl<'de> serde::Deserialize<'de> for EndTransactionRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EndTransactionRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "disposition")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub disposition: crate::smart_card_emulation::types::Disposition,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EndTransactionRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
disposition: fields.disposition,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct EndTransactionRequested;
impl ydp_core::Event for EndTransactionRequested {
type Params = EndTransactionRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.endTransactionRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct EstablishContextRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
}
impl<'de> serde::Deserialize<'de> for EstablishContextRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EstablishContextRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EstablishContextRequestedParams {
request_id: fields.request_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct EstablishContextRequested;
impl ydp_core::Event for EstablishContextRequested {
type Params = EstablishContextRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.establishContextRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetAttribRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "attribId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub attrib_id: i64,
}
impl<'de> serde::Deserialize<'de> for GetAttribRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetAttribRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "attribId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub attrib_id: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetAttribRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
attrib_id: fields.attrib_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetAttribRequested;
impl ydp_core::Event for GetAttribRequested {
type Params = GetAttribRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.getAttribRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetStatusChangeRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
#[serde(rename = "readerStates")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reader_states: Vec<crate::smart_card_emulation::types::ReaderStateIn>,
#[serde(rename = "timeout")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timeout: Option<i64>,
}
impl<'de> serde::Deserialize<'de> for GetStatusChangeRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetStatusChangeRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
#[serde(rename = "readerStates")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub reader_states: Vec<crate::smart_card_emulation::types::ReaderStateIn>,
#[serde(rename = "timeout")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub timeout: Option<i64>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetStatusChangeRequestedParams {
request_id: fields.request_id,
context_id: fields.context_id,
reader_states: fields.reader_states,
timeout: fields.timeout,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetStatusChangeRequested;
impl ydp_core::Event for GetStatusChangeRequested {
type Params = GetStatusChangeRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.getStatusChangeRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ListReadersRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
}
impl<'de> serde::Deserialize<'de> for ListReadersRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ListReadersRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ListReadersRequestedParams {
request_id: fields.request_id,
context_id: fields.context_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ListReadersRequested;
impl ydp_core::Event for ListReadersRequested {
type Params = ListReadersRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.listReadersRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ReleaseContextRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
}
impl<'de> serde::Deserialize<'de> for ReleaseContextRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ReleaseContextRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "contextId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub context_id: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ReleaseContextRequestedParams {
request_id: fields.request_id,
context_id: fields.context_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ReleaseContextRequested;
impl ydp_core::Event for ReleaseContextRequested {
type Params = ReleaseContextRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.releaseContextRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct SetAttribRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "attribId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub attrib_id: i64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: String,
}
impl<'de> serde::Deserialize<'de> for SetAttribRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = SetAttribRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "attribId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub attrib_id: i64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(SetAttribRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
attrib_id: fields.attrib_id,
data: fields.data,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct SetAttribRequested;
impl ydp_core::Event for SetAttribRequested {
type Params = SetAttribRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.setAttribRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct StatusRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
}
impl<'de> serde::Deserialize<'de> for StatusRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = StatusRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(StatusRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct StatusRequested;
impl ydp_core::Event for StatusRequested {
type Params = StatusRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.statusRequested";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct TransmitRequestedParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: String,
#[serde(rename = "protocol")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub protocol: Option<crate::smart_card_emulation::types::Protocol>,
}
impl<'de> serde::Deserialize<'de> for TransmitRequestedParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TransmitRequestedParams;
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(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: String,
#[serde(rename = "handle")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub handle: i64,
#[serde(rename = "data")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub data: String,
#[serde(rename = "protocol")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub protocol: Option<crate::smart_card_emulation::types::Protocol>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(TransmitRequestedParams {
request_id: fields.request_id,
handle: fields.handle,
data: fields.data,
protocol: fields.protocol,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct TransmitRequested;
impl ydp_core::Event for TransmitRequested {
type Params = TransmitRequestedParams;
const METHOD: &'static str = "SmartCardEmulation.transmitRequested";
}