use serde::{Deserialize, Serialize};
pub type SerializedStorageKey = String;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StorageId {
#[serde(
rename = "securityOrigin",
default,
skip_serializing_if = "Option::is_none"
)]
pub security_origin: Option<String>,
#[serde(
rename = "storageKey",
default,
skip_serializing_if = "Option::is_none"
)]
pub storage_key: Option<SerializedStorageKey>,
#[serde(rename = "isLocalStorage")]
pub is_local_storage: bool,
}
pub type Item = Vec<String>;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ClearParams {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
}
impl crate::typed::Command for ClearParams {
const METHOD: &'static str = "DOMStorage.clear";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
impl crate::typed::Command for DisableParams {
const METHOD: &'static str = "DOMStorage.disable";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}
impl crate::typed::Command for EnableParams {
const METHOD: &'static str = "DOMStorage.enable";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetDomStorageItemsParams {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetDomStorageItemsReturns {
pub entries: Vec<Item>,
}
impl crate::typed::Command for GetDomStorageItemsParams {
const METHOD: &'static str = "DOMStorage.getDOMStorageItems";
type Returns = GetDomStorageItemsReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct RemoveDomStorageItemParams {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
pub key: String,
}
impl crate::typed::Command for RemoveDomStorageItemParams {
const METHOD: &'static str = "DOMStorage.removeDOMStorageItem";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SetDomStorageItemParams {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
pub key: String,
pub value: String,
}
impl crate::typed::Command for SetDomStorageItemParams {
const METHOD: &'static str = "DOMStorage.setDOMStorageItem";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DomStorageItemAddedEvent {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
pub key: String,
#[serde(rename = "newValue")]
pub new_value: String,
}
impl crate::typed::Event for DomStorageItemAddedEvent {
const METHOD: &'static str = "DOMStorage.domStorageItemAdded";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DomStorageItemRemovedEvent {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
pub key: String,
}
impl crate::typed::Event for DomStorageItemRemovedEvent {
const METHOD: &'static str = "DOMStorage.domStorageItemRemoved";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DomStorageItemUpdatedEvent {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
pub key: String,
#[serde(rename = "oldValue")]
pub old_value: String,
#[serde(rename = "newValue")]
pub new_value: String,
}
impl crate::typed::Event for DomStorageItemUpdatedEvent {
const METHOD: &'static str = "DOMStorage.domStorageItemUpdated";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DomStorageItemsClearedEvent {
#[serde(rename = "storageId")]
pub storage_id: StorageId,
}
impl crate::typed::Event for DomStorageItemsClearedEvent {
const METHOD: &'static str = "DOMStorage.domStorageItemsCleared";
}