Skip to main content

rustenium_cdp_definitions/browser_protocol/fed_cm/
events.rs

1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct DialogShownParams {
4    #[serde(rename = "dialogId")]
5    pub dialog_id: String,
6    #[serde(rename = "dialogType")]
7    pub dialog_type: super::types::DialogType,
8    #[serde(rename = "accounts")]
9    #[serde(skip_serializing_if = "Vec::is_empty")]
10    pub accounts: Vec<super::types::Account>,
11    #[doc = "These exist primarily so that the caller can verify the\nRP context was used appropriately."]
12    #[serde(rename = "title")]
13    pub title: String,
14    #[serde(rename = "subtitle")]
15    #[serde(skip_serializing_if = "Option::is_none")]
16    #[serde(default)]
17    pub subtitle: Option<String>,
18}
19#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
20pub enum DialogShownMethod {
21    #[serde(rename = "FedCm.dialogShown")]
22    DialogShown,
23}
24#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
25pub struct DialogShown {
26    pub method: DialogShownMethod,
27    pub params: DialogShownParams,
28}
29impl DialogShown {
30    pub const IDENTIFIER: &'static str = "FedCm.dialogShown";
31    pub fn identifier(&self) -> &'static str {
32        Self::IDENTIFIER
33    }
34}
35#[doc = "Triggered when a dialog is closed, either by user action, JS abort,\nor a command below.\n[dialogClosed](https://chromedevtools.github.io/devtools-protocol/tot/FedCm/#event-dialogClosed)"]
36#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
37pub struct DialogClosedParams {
38    #[serde(rename = "dialogId")]
39    pub dialog_id: String,
40}
41#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
42pub enum DialogClosedMethod {
43    #[serde(rename = "FedCm.dialogClosed")]
44    DialogClosed,
45}
46#[doc = "Triggered when a dialog is closed, either by user action, JS abort,\nor a command below.\n[dialogClosed](https://chromedevtools.github.io/devtools-protocol/tot/FedCm/#event-dialogClosed)"]
47#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
48pub struct DialogClosed {
49    pub method: DialogClosedMethod,
50    pub params: DialogClosedParams,
51}
52impl DialogClosed {
53    pub const IDENTIFIER: &'static str = "FedCm.dialogClosed";
54    pub fn identifier(&self) -> &'static str {
55        Self::IDENTIFIER
56    }
57}
58group_enum ! (FedCmEvents { DialogShown (DialogShown) , DialogClosed (DialogClosed) } + identifiable);