Skip to main content

cdp_protocol/
extensions.rs

1// Auto-generated from Chrome at version 146.0.7680.165 domain: Extensions
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;
11#[allow(deprecated)]
12#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
13pub enum StorageArea {
14    #[serde(rename = "session")]
15    Session,
16    #[serde(rename = "local")]
17    Local,
18    #[serde(rename = "sync")]
19    Sync,
20    #[serde(rename = "managed")]
21    Managed,
22}
23#[allow(deprecated)]
24#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
25#[builder(setter(into, strip_option))]
26#[serde(rename_all = "camelCase")]
27#[doc = "Runs an extension default action.\n Available if the client is connected using the --remote-debugging-pipe\n flag and the --enable-unsafe-extension-debugging flag is set."]
28pub struct TriggerAction {
29    #[serde(default)]
30    #[doc = "Extension id."]
31    pub id: String,
32    #[serde(default)]
33    #[doc = "A tab target ID to trigger the default extension action on."]
34    pub target_id: String,
35}
36#[allow(deprecated)]
37#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
38#[builder(setter(into, strip_option))]
39#[serde(rename_all = "camelCase")]
40#[doc = "Installs an unpacked extension from the filesystem similar to\n --load-extension CLI flags. Returns extension ID once the extension\n has been installed. Available if the client is connected using the\n --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging\n flag is set."]
41pub struct LoadUnpacked {
42    #[serde(default)]
43    #[doc = "Absolute file path."]
44    pub path: String,
45    #[builder(default)]
46    #[serde(skip_serializing_if = "Option::is_none")]
47    #[serde(default)]
48    #[doc = "Enable the extension in incognito"]
49    pub enable_in_incognito: Option<bool>,
50}
51#[allow(deprecated)]
52#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
53#[builder(setter(into, strip_option))]
54#[serde(rename_all = "camelCase")]
55#[doc = "Uninstalls an unpacked extension (others not supported) from the profile.\n Available if the client is connected using the --remote-debugging-pipe flag\n and the --enable-unsafe-extension-debugging."]
56pub struct Uninstall {
57    #[serde(default)]
58    #[doc = "Extension id."]
59    pub id: String,
60}
61#[allow(deprecated)]
62#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
63#[builder(setter(into, strip_option))]
64#[serde(rename_all = "camelCase")]
65#[doc = "Gets data from extension storage in the given `storageArea`. If `keys` is\n specified, these are used to filter the result."]
66pub struct GetStorageItems {
67    #[serde(default)]
68    #[doc = "ID of extension."]
69    pub id: String,
70    #[doc = "StorageArea to retrieve data from."]
71    pub storage_area: StorageArea,
72    #[builder(default)]
73    #[serde(skip_serializing_if = "Option::is_none")]
74    #[serde(default)]
75    #[doc = "Keys to retrieve."]
76    pub keys: Option<Vec<String>>,
77}
78#[allow(deprecated)]
79#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
80#[builder(setter(into, strip_option))]
81#[serde(rename_all = "camelCase")]
82#[doc = "Removes `keys` from extension storage in the given `storageArea`."]
83pub struct RemoveStorageItems {
84    #[serde(default)]
85    #[doc = "ID of extension."]
86    pub id: String,
87    #[doc = "StorageArea to remove data from."]
88    pub storage_area: StorageArea,
89    #[serde(default)]
90    #[doc = "Keys to remove."]
91    pub keys: Vec<String>,
92}
93#[allow(deprecated)]
94#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
95#[builder(setter(into, strip_option))]
96#[serde(rename_all = "camelCase")]
97#[doc = "Clears extension storage in the given `storageArea`."]
98pub struct ClearStorageItems {
99    #[serde(default)]
100    #[doc = "ID of extension."]
101    pub id: String,
102    #[doc = "StorageArea to remove data from."]
103    pub storage_area: StorageArea,
104}
105#[allow(deprecated)]
106#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
107#[builder(setter(into, strip_option))]
108#[serde(rename_all = "camelCase")]
109#[doc = "Sets `values` in extension storage in the given `storageArea`. The provided `values`\n will be merged with existing values in the storage area."]
110pub struct SetStorageItems {
111    #[serde(default)]
112    #[doc = "ID of extension."]
113    pub id: String,
114    #[doc = "StorageArea to set data in."]
115    pub storage_area: StorageArea,
116    #[serde(default)]
117    #[doc = "Values to set."]
118    pub values: Json,
119}
120#[allow(deprecated)]
121#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
122#[doc = "Runs an extension default action.\n Available if the client is connected using the --remote-debugging-pipe\n flag and the --enable-unsafe-extension-debugging flag is set."]
123pub struct TriggerActionReturnObject(pub Option<Json>);
124#[allow(deprecated)]
125#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
126#[serde(rename_all = "camelCase")]
127#[doc = "Installs an unpacked extension from the filesystem similar to\n --load-extension CLI flags. Returns extension ID once the extension\n has been installed. Available if the client is connected using the\n --remote-debugging-pipe flag and the --enable-unsafe-extension-debugging\n flag is set."]
128pub struct LoadUnpackedReturnObject {
129    #[serde(default)]
130    #[doc = "Extension id."]
131    pub id: String,
132}
133#[allow(deprecated)]
134#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
135#[doc = "Uninstalls an unpacked extension (others not supported) from the profile.\n Available if the client is connected using the --remote-debugging-pipe flag\n and the --enable-unsafe-extension-debugging."]
136pub struct UninstallReturnObject(pub Option<Json>);
137#[allow(deprecated)]
138#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
139#[serde(rename_all = "camelCase")]
140#[doc = "Gets data from extension storage in the given `storageArea`. If `keys` is\n specified, these are used to filter the result."]
141pub struct GetStorageItemsReturnObject {
142    #[serde(default)]
143    pub data: Json,
144}
145#[allow(deprecated)]
146#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
147#[doc = "Removes `keys` from extension storage in the given `storageArea`."]
148pub struct RemoveStorageItemsReturnObject(pub Option<Json>);
149#[allow(deprecated)]
150#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
151#[doc = "Clears extension storage in the given `storageArea`."]
152pub struct ClearStorageItemsReturnObject(pub Option<Json>);
153#[allow(deprecated)]
154#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
155#[doc = "Sets `values` in extension storage in the given `storageArea`. The provided `values`\n will be merged with existing values in the storage area."]
156pub struct SetStorageItemsReturnObject(pub Option<Json>);
157#[allow(deprecated)]
158impl Method for TriggerAction {
159    const NAME: &'static str = "Extensions.triggerAction";
160    type ReturnObject = TriggerActionReturnObject;
161}
162#[allow(deprecated)]
163impl Method for LoadUnpacked {
164    const NAME: &'static str = "Extensions.loadUnpacked";
165    type ReturnObject = LoadUnpackedReturnObject;
166}
167#[allow(deprecated)]
168impl Method for Uninstall {
169    const NAME: &'static str = "Extensions.uninstall";
170    type ReturnObject = UninstallReturnObject;
171}
172#[allow(deprecated)]
173impl Method for GetStorageItems {
174    const NAME: &'static str = "Extensions.getStorageItems";
175    type ReturnObject = GetStorageItemsReturnObject;
176}
177#[allow(deprecated)]
178impl Method for RemoveStorageItems {
179    const NAME: &'static str = "Extensions.removeStorageItems";
180    type ReturnObject = RemoveStorageItemsReturnObject;
181}
182#[allow(deprecated)]
183impl Method for ClearStorageItems {
184    const NAME: &'static str = "Extensions.clearStorageItems";
185    type ReturnObject = ClearStorageItemsReturnObject;
186}
187#[allow(deprecated)]
188impl Method for SetStorageItems {
189    const NAME: &'static str = "Extensions.setStorageItems";
190    type ReturnObject = SetStorageItemsReturnObject;
191}
192#[allow(dead_code)]
193pub mod events {
194    #[allow(unused_imports)]
195    use super::super::types::*;
196    #[allow(unused_imports)]
197    use derive_builder::Builder;
198    #[allow(unused_imports)]
199    use serde::{Deserialize, Serialize};
200    #[allow(unused_imports)]
201    use serde_json::Value as Json;
202}