Skip to main content

cdp_protocol/
dom_storage.rs

1// Auto-generated from Chrome at version 146.0.7680.165 domain: DOMStorage
2#![allow(dead_code)]
3#[allow(unused_imports)]
4use super::types::*;
5#[allow(unused_imports)]
6use derive_builder::Builder;
7#[allow(unused_imports)]
8use serde::{Deserialize, Serialize};
9#[allow(unused_imports)]
10use serde_json::Value as Json;
11pub type SerializedStorageKey = String;
12pub type Item = Vec<String>;
13#[allow(deprecated)]
14#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
15#[builder(setter(into, strip_option))]
16#[serde(rename_all = "camelCase")]
17#[doc = "DOM Storage identifier."]
18pub struct StorageId {
19    #[builder(default)]
20    #[serde(skip_serializing_if = "Option::is_none")]
21    #[serde(default)]
22    #[doc = "Security origin for the storage."]
23    pub security_origin: Option<String>,
24    #[builder(default)]
25    #[serde(skip_serializing_if = "Option::is_none")]
26    #[doc = "Represents a key by which DOM Storage keys its CachedStorageAreas"]
27    pub storage_key: Option<SerializedStorageKey>,
28    #[serde(default)]
29    #[doc = "Whether the storage is local storage (not session storage)."]
30    pub is_local_storage: bool,
31}
32#[allow(deprecated)]
33#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
34#[builder(setter(into, strip_option))]
35#[serde(rename_all = "camelCase")]
36pub struct Clear {
37    pub storage_id: StorageId,
38}
39#[allow(deprecated)]
40#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
41pub struct Disable(pub Option<Json>);
42#[allow(deprecated)]
43#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
44pub struct Enable(pub Option<Json>);
45#[allow(deprecated)]
46#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
47#[builder(setter(into, strip_option))]
48#[serde(rename_all = "camelCase")]
49pub struct GetDOMStorageItems {
50    pub storage_id: StorageId,
51}
52#[allow(deprecated)]
53#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
54#[builder(setter(into, strip_option))]
55#[serde(rename_all = "camelCase")]
56pub struct RemoveDOMStorageItem {
57    pub storage_id: StorageId,
58    #[serde(default)]
59    pub key: String,
60}
61#[allow(deprecated)]
62#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
63#[builder(setter(into, strip_option))]
64#[serde(rename_all = "camelCase")]
65pub struct SetDOMStorageItem {
66    pub storage_id: StorageId,
67    #[serde(default)]
68    pub key: String,
69    #[serde(default)]
70    pub value: String,
71}
72#[allow(deprecated)]
73#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
74pub struct ClearReturnObject(pub Option<Json>);
75#[allow(deprecated)]
76#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
77#[doc = "Disables storage tracking, prevents storage events from being sent to the client."]
78pub struct DisableReturnObject(pub Option<Json>);
79#[allow(deprecated)]
80#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
81#[doc = "Enables storage tracking, storage events will now be delivered to the client."]
82pub struct EnableReturnObject(pub Option<Json>);
83#[allow(deprecated)]
84#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
85#[serde(rename_all = "camelCase")]
86pub struct GetDOMStorageItemsReturnObject {
87    pub entries: Vec<Item>,
88}
89#[allow(deprecated)]
90#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
91pub struct RemoveDOMStorageItemReturnObject(pub Option<Json>);
92#[allow(deprecated)]
93#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
94pub struct SetDOMStorageItemReturnObject(pub Option<Json>);
95#[allow(deprecated)]
96impl Method for Clear {
97    const NAME: &'static str = "DOMStorage.clear";
98    type ReturnObject = ClearReturnObject;
99}
100#[allow(deprecated)]
101impl Method for Disable {
102    const NAME: &'static str = "DOMStorage.disable";
103    type ReturnObject = DisableReturnObject;
104}
105#[allow(deprecated)]
106impl Method for Enable {
107    const NAME: &'static str = "DOMStorage.enable";
108    type ReturnObject = EnableReturnObject;
109}
110#[allow(deprecated)]
111impl Method for GetDOMStorageItems {
112    const NAME: &'static str = "DOMStorage.getDOMStorageItems";
113    type ReturnObject = GetDOMStorageItemsReturnObject;
114}
115#[allow(deprecated)]
116impl Method for RemoveDOMStorageItem {
117    const NAME: &'static str = "DOMStorage.removeDOMStorageItem";
118    type ReturnObject = RemoveDOMStorageItemReturnObject;
119}
120#[allow(deprecated)]
121impl Method for SetDOMStorageItem {
122    const NAME: &'static str = "DOMStorage.setDOMStorageItem";
123    type ReturnObject = SetDOMStorageItemReturnObject;
124}
125#[allow(dead_code)]
126pub mod events {
127    #[allow(unused_imports)]
128    use super::super::types::*;
129    #[allow(unused_imports)]
130    use derive_builder::Builder;
131    #[allow(unused_imports)]
132    use serde::{Deserialize, Serialize};
133    #[allow(unused_imports)]
134    use serde_json::Value as Json;
135    #[allow(deprecated)]
136    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
137    pub struct DomStorageItemAddedEvent {
138        pub params: DomStorageItemAddedEventParams,
139    }
140    #[allow(deprecated)]
141    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
142    #[serde(rename_all = "camelCase")]
143    pub struct DomStorageItemAddedEventParams {
144        pub storage_id: super::StorageId,
145        #[serde(default)]
146        pub key: String,
147        #[serde(default)]
148        pub new_value: String,
149    }
150    #[allow(deprecated)]
151    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
152    pub struct DomStorageItemRemovedEvent {
153        pub params: DomStorageItemRemovedEventParams,
154    }
155    #[allow(deprecated)]
156    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
157    #[serde(rename_all = "camelCase")]
158    pub struct DomStorageItemRemovedEventParams {
159        pub storage_id: super::StorageId,
160        #[serde(default)]
161        pub key: String,
162    }
163    #[allow(deprecated)]
164    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
165    pub struct DomStorageItemUpdatedEvent {
166        pub params: DomStorageItemUpdatedEventParams,
167    }
168    #[allow(deprecated)]
169    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
170    #[serde(rename_all = "camelCase")]
171    pub struct DomStorageItemUpdatedEventParams {
172        pub storage_id: super::StorageId,
173        #[serde(default)]
174        pub key: String,
175        #[serde(default)]
176        pub old_value: String,
177        #[serde(default)]
178        pub new_value: String,
179    }
180    #[allow(deprecated)]
181    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
182    pub struct DomStorageItemsClearedEvent {
183        pub params: DomStorageItemsClearedEventParams,
184    }
185    #[allow(deprecated)]
186    #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
187    #[serde(rename_all = "camelCase")]
188    pub struct DomStorageItemsClearedEventParams {
189        pub storage_id: super::StorageId,
190    }
191}