rustenium_cdp_definitions/browser_protocol/log/
commands.rs1use serde::{Deserialize, Serialize};
2#[doc = "Clears the log.\n[clear](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-clear)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct ClearParams {}
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6pub enum ClearMethod {
7 #[serde(rename = "Log.clear")]
8 Clear,
9}
10#[doc = "Clears the log.\n[clear](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-clear)"]
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub struct Clear {
13 pub method: ClearMethod,
14 pub params: ClearParams,
15}
16impl Clear {
17 pub const IDENTIFIER: &'static str = "Log.clear";
18 pub fn identifier(&self) -> &'static str {
19 Self::IDENTIFIER
20 }
21}
22impl crate::CommandResult for Clear {
23 type Result = super::results::ClearResult;
24}
25#[doc = "Disables log domain, prevents further log entries from being reported to the client.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-disable)"]
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub struct DisableParams {}
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub enum DisableMethod {
30 #[serde(rename = "Log.disable")]
31 Disable,
32}
33#[doc = "Disables log domain, prevents further log entries from being reported to the client.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-disable)"]
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct Disable {
36 pub method: DisableMethod,
37 pub params: DisableParams,
38}
39impl Disable {
40 pub const IDENTIFIER: &'static str = "Log.disable";
41 pub fn identifier(&self) -> &'static str {
42 Self::IDENTIFIER
43 }
44}
45impl crate::CommandResult for Disable {
46 type Result = super::results::DisableResult;
47}
48#[doc = "Enables log domain, sends the entries collected so far to the client by means of the\n`entryAdded` notification.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-enable)"]
49#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
50pub struct EnableParams {}
51#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
52pub enum EnableMethod {
53 #[serde(rename = "Log.enable")]
54 Enable,
55}
56#[doc = "Enables log domain, sends the entries collected so far to the client by means of the\n`entryAdded` notification.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-enable)"]
57#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
58pub struct Enable {
59 pub method: EnableMethod,
60 pub params: EnableParams,
61}
62impl Enable {
63 pub const IDENTIFIER: &'static str = "Log.enable";
64 pub fn identifier(&self) -> &'static str {
65 Self::IDENTIFIER
66 }
67}
68impl crate::CommandResult for Enable {
69 type Result = super::results::EnableResult;
70}
71#[doc = "start violation reporting.\n[startViolationsReport](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-startViolationsReport)"]
72#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
73pub struct StartViolationsReportParams {
74 #[doc = "Configuration for violations."]
75 #[serde(rename = "config")]
76 #[serde(skip_serializing_if = "Vec::is_empty")]
77 pub config: Vec<super::types::ViolationSetting>,
78}
79impl StartViolationsReportParams {
80 pub fn new(config: Vec<super::types::ViolationSetting>) -> Self {
81 Self { config }
82 }
83}
84#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
85pub enum StartViolationsReportMethod {
86 #[serde(rename = "Log.startViolationsReport")]
87 StartViolationsReport,
88}
89#[doc = "start violation reporting.\n[startViolationsReport](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-startViolationsReport)"]
90#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
91pub struct StartViolationsReport {
92 pub method: StartViolationsReportMethod,
93 pub params: StartViolationsReportParams,
94}
95impl StartViolationsReport {
96 pub const IDENTIFIER: &'static str = "Log.startViolationsReport";
97 pub fn identifier(&self) -> &'static str {
98 Self::IDENTIFIER
99 }
100}
101impl crate::CommandResult for StartViolationsReport {
102 type Result = super::results::StartViolationsReportResult;
103}
104#[doc = "Stop violation reporting.\n[stopViolationsReport](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-stopViolationsReport)"]
105#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
106pub struct StopViolationsReportParams {}
107#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
108pub enum StopViolationsReportMethod {
109 #[serde(rename = "Log.stopViolationsReport")]
110 StopViolationsReport,
111}
112#[doc = "Stop violation reporting.\n[stopViolationsReport](https://chromedevtools.github.io/devtools-protocol/tot/Log/#method-stopViolationsReport)"]
113#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
114pub struct StopViolationsReport {
115 pub method: StopViolationsReportMethod,
116 pub params: StopViolationsReportParams,
117}
118impl StopViolationsReport {
119 pub const IDENTIFIER: &'static str = "Log.stopViolationsReport";
120 pub fn identifier(&self) -> &'static str {
121 Self::IDENTIFIER
122 }
123}
124impl crate::CommandResult for StopViolationsReport {
125 type Result = super::results::StopViolationsReportResult;
126}
127group_enum ! (LogCommands { Clear (Clear) , Disable (Disable) , Enable (Enable) , StartViolationsReport (StartViolationsReport) , StopViolationsReport (StopViolationsReport) } + identifiable);