1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// @generated by `just generate-methods` from protocol/*.json.
// Do not edit by hand; edit xtask/ and regenerate.
//! This domain allows interacting with the Digital Credentials API for
//! automation.
//!
//! Types, command parameters and event payloads for the `DigitalCredentials`
//! domain. The method-name constants for the same domain are in
//! [`crate::methods`].
//!
//! This domain is experimental and may change without notice.
use serde::{Deserialize, Serialize};
/// The type of virtual wallet action.
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum VirtualWalletAction {
/// `respond`
#[serde(rename = "respond")]
Respond,
/// `decline`
#[serde(rename = "decline")]
Decline,
/// `wait`
#[serde(rename = "wait")]
Wait,
/// `clear`
#[serde(rename = "clear")]
Clear,
/// A value this vendored schema does not list. Chrome adds values ahead of
/// the published protocol, so an unrecognised one is kept as it arrived
/// rather than failing the payload it came in.
#[serde(untagged)]
Unrecognized(String),
}
/// Sets the behavior of the virtual wallet for digital credential requests
/// issued from this frame.
///
/// Parameters of `DigitalCredentials.setVirtualWalletBehavior`.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetVirtualWalletBehaviorParams {
/// The action of the virtual wallet.
pub action: VirtualWalletAction,
/// The protocol identifier (e.g. "openid4vp"). Required when |action| is
/// "respond", forbidden otherwise.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
/// The response data object returned by the wallet. Required when |action| is
/// "respond", forbidden otherwise.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub response: Option<serde_json::Value>,
/// The frame to scope the virtual wallet behavior to.
#[serde(rename = "frameId", default, skip_serializing_if = "Option::is_none")]
pub frame_id: Option<crate::protocol::page::FrameId>,
}
impl crate::typed::Command for SetVirtualWalletBehaviorParams {
const METHOD: &'static str = "DigitalCredentials.setVirtualWalletBehavior";
type Returns = crate::typed::NoReturns;
}