Skip to main content

browser_protocol/storage/
mod.rs

1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3use std::borrow::Cow;
4
5
6pub type SerializedStorageKey<'a> = Cow<'a, str>;
7
8/// Enum of possible storage types.
9
10#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
11pub enum StorageType {
12    #[default]
13    #[serde(rename = "cookies")]
14    Cookies,
15    #[serde(rename = "file_systems")]
16    FileSystems,
17    #[serde(rename = "indexeddb")]
18    Indexeddb,
19    #[serde(rename = "local_storage")]
20    LocalStorage,
21    #[serde(rename = "shader_cache")]
22    ShaderCache,
23    #[serde(rename = "websql")]
24    Websql,
25    #[serde(rename = "service_workers")]
26    ServiceWorkers,
27    #[serde(rename = "cache_storage")]
28    CacheStorage,
29    #[serde(rename = "interest_groups")]
30    InterestGroups,
31    #[serde(rename = "shared_storage")]
32    SharedStorage,
33    #[serde(rename = "storage_buckets")]
34    StorageBuckets,
35    #[serde(rename = "all")]
36    All,
37    #[serde(rename = "other")]
38    Other,
39}
40
41/// Usage for a storage type.
42
43#[derive(Debug, Clone, Serialize, Deserialize, Default)]
44#[serde(rename_all = "camelCase")]
45pub struct UsageForType {
46    /// Name of storage type.
47    #[serde(rename = "storageType")]
48    storage_type: StorageType,
49    /// Storage usage (bytes).
50    usage: f64,
51}
52
53impl UsageForType {
54    /// Creates a builder for this type with the required parameters:
55    /// * `storage_type`: Name of storage type.
56    /// * `usage`: Storage usage (bytes).
57    pub fn builder(storage_type: impl Into<StorageType>, usage: f64) -> UsageForTypeBuilder {
58        UsageForTypeBuilder {
59            storage_type: storage_type.into(),
60            usage: usage,
61        }
62    }
63    /// Name of storage type.
64    pub fn storage_type(&self) -> &StorageType { &self.storage_type }
65    /// Storage usage (bytes).
66    pub fn usage(&self) -> f64 { self.usage }
67}
68
69
70pub struct UsageForTypeBuilder {
71    storage_type: StorageType,
72    usage: f64,
73}
74
75impl UsageForTypeBuilder {
76    pub fn build(self) -> UsageForType {
77        UsageForType {
78            storage_type: self.storage_type,
79            usage: self.usage,
80        }
81    }
82}
83
84/// Pair of issuer origin and number of available (signed, but not used) Trust
85/// Tokens from that issuer.
86
87#[derive(Debug, Clone, Serialize, Deserialize, Default)]
88#[serde(rename_all = "camelCase")]
89pub struct TrustTokens<'a> {
90    #[serde(rename = "issuerOrigin")]
91    issuer_origin: Cow<'a, str>,
92    count: f64,
93}
94
95impl<'a> TrustTokens<'a> {
96    /// Creates a builder for this type with the required parameters:
97    /// * `issuer_origin`: 
98    /// * `count`: 
99    pub fn builder(issuer_origin: impl Into<Cow<'a, str>>, count: f64) -> TrustTokensBuilder<'a> {
100        TrustTokensBuilder {
101            issuer_origin: issuer_origin.into(),
102            count: count,
103        }
104    }
105    pub fn issuer_origin(&self) -> &str { self.issuer_origin.as_ref() }
106    pub fn count(&self) -> f64 { self.count }
107}
108
109
110pub struct TrustTokensBuilder<'a> {
111    issuer_origin: Cow<'a, str>,
112    count: f64,
113}
114
115impl<'a> TrustTokensBuilder<'a> {
116    pub fn build(self) -> TrustTokens<'a> {
117        TrustTokens {
118            issuer_origin: self.issuer_origin,
119            count: self.count,
120        }
121    }
122}
123
124/// Protected audience interest group auction identifier.
125
126pub type InterestGroupAuctionId<'a> = Cow<'a, str>;
127
128/// Enum of interest group access types.
129
130#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
131pub enum InterestGroupAccessType {
132    #[default]
133    #[serde(rename = "join")]
134    Join,
135    #[serde(rename = "leave")]
136    Leave,
137    #[serde(rename = "update")]
138    Update,
139    #[serde(rename = "loaded")]
140    Loaded,
141    #[serde(rename = "bid")]
142    Bid,
143    #[serde(rename = "win")]
144    Win,
145    #[serde(rename = "additionalBid")]
146    AdditionalBid,
147    #[serde(rename = "additionalBidWin")]
148    AdditionalBidWin,
149    #[serde(rename = "topLevelBid")]
150    TopLevelBid,
151    #[serde(rename = "topLevelAdditionalBid")]
152    TopLevelAdditionalBid,
153    #[serde(rename = "clear")]
154    Clear,
155}
156
157/// Enum of auction events.
158
159#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
160pub enum InterestGroupAuctionEventType {
161    #[default]
162    #[serde(rename = "started")]
163    Started,
164    #[serde(rename = "configResolved")]
165    ConfigResolved,
166}
167
168/// Enum of network fetches auctions can do.
169
170#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
171pub enum InterestGroupAuctionFetchType {
172    #[default]
173    #[serde(rename = "bidderJs")]
174    BidderJs,
175    #[serde(rename = "bidderWasm")]
176    BidderWasm,
177    #[serde(rename = "sellerJs")]
178    SellerJs,
179    #[serde(rename = "bidderTrustedSignals")]
180    BidderTrustedSignals,
181    #[serde(rename = "sellerTrustedSignals")]
182    SellerTrustedSignals,
183}
184
185/// Enum of shared storage access scopes.
186
187#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
188pub enum SharedStorageAccessScope {
189    #[default]
190    #[serde(rename = "window")]
191    Window,
192    #[serde(rename = "sharedStorageWorklet")]
193    SharedStorageWorklet,
194    #[serde(rename = "protectedAudienceWorklet")]
195    ProtectedAudienceWorklet,
196    #[serde(rename = "header")]
197    Header,
198}
199
200/// Enum of shared storage access methods.
201
202#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
203pub enum SharedStorageAccessMethod {
204    #[default]
205    #[serde(rename = "addModule")]
206    AddModule,
207    #[serde(rename = "createWorklet")]
208    CreateWorklet,
209    #[serde(rename = "selectURL")]
210    SelectURL,
211    #[serde(rename = "run")]
212    Run,
213    #[serde(rename = "batchUpdate")]
214    BatchUpdate,
215    #[serde(rename = "set")]
216    Set,
217    #[serde(rename = "append")]
218    Append,
219    #[serde(rename = "delete")]
220    Delete,
221    #[serde(rename = "clear")]
222    Clear,
223    #[serde(rename = "get")]
224    Get,
225    #[serde(rename = "keys")]
226    Keys,
227    #[serde(rename = "values")]
228    Values,
229    #[serde(rename = "entries")]
230    Entries,
231    #[serde(rename = "length")]
232    Length,
233    #[serde(rename = "remainingBudget")]
234    RemainingBudget,
235}
236
237/// Struct for a single key-value pair in an origin's shared storage.
238
239#[derive(Debug, Clone, Serialize, Deserialize, Default)]
240#[serde(rename_all = "camelCase")]
241pub struct SharedStorageEntry<'a> {
242    key: Cow<'a, str>,
243    value: Cow<'a, str>,
244}
245
246impl<'a> SharedStorageEntry<'a> {
247    /// Creates a builder for this type with the required parameters:
248    /// * `key`: 
249    /// * `value`: 
250    pub fn builder(key: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SharedStorageEntryBuilder<'a> {
251        SharedStorageEntryBuilder {
252            key: key.into(),
253            value: value.into(),
254        }
255    }
256    pub fn key(&self) -> &str { self.key.as_ref() }
257    pub fn value(&self) -> &str { self.value.as_ref() }
258}
259
260
261pub struct SharedStorageEntryBuilder<'a> {
262    key: Cow<'a, str>,
263    value: Cow<'a, str>,
264}
265
266impl<'a> SharedStorageEntryBuilder<'a> {
267    pub fn build(self) -> SharedStorageEntry<'a> {
268        SharedStorageEntry {
269            key: self.key,
270            value: self.value,
271        }
272    }
273}
274
275/// Details for an origin's shared storage.
276
277#[derive(Debug, Clone, Serialize, Deserialize, Default)]
278#[serde(rename_all = "camelCase")]
279pub struct SharedStorageMetadata {
280    /// Time when the origin's shared storage was last created.
281    #[serde(rename = "creationTime")]
282    creation_time: crate::network::TimeSinceEpoch,
283    /// Number of key-value pairs stored in origin's shared storage.
284    length: u64,
285    /// Current amount of bits of entropy remaining in the navigation budget.
286    #[serde(rename = "remainingBudget")]
287    remaining_budget: f64,
288    /// Total number of bytes stored as key-value pairs in origin's shared
289    /// storage.
290    #[serde(rename = "bytesUsed")]
291    bytes_used: i64,
292}
293
294impl SharedStorageMetadata {
295    /// Creates a builder for this type with the required parameters:
296    /// * `creation_time`: Time when the origin's shared storage was last created.
297    /// * `length`: Number of key-value pairs stored in origin's shared storage.
298    /// * `remaining_budget`: Current amount of bits of entropy remaining in the navigation budget.
299    /// * `bytes_used`: Total number of bytes stored as key-value pairs in origin's shared storage.
300    pub fn builder(creation_time: crate::network::TimeSinceEpoch, length: u64, remaining_budget: f64, bytes_used: i64) -> SharedStorageMetadataBuilder {
301        SharedStorageMetadataBuilder {
302            creation_time: creation_time,
303            length: length,
304            remaining_budget: remaining_budget,
305            bytes_used: bytes_used,
306        }
307    }
308    /// Time when the origin's shared storage was last created.
309    pub fn creation_time(&self) -> &crate::network::TimeSinceEpoch { &self.creation_time }
310    /// Number of key-value pairs stored in origin's shared storage.
311    pub fn length(&self) -> u64 { self.length }
312    /// Current amount of bits of entropy remaining in the navigation budget.
313    pub fn remaining_budget(&self) -> f64 { self.remaining_budget }
314    /// Total number of bytes stored as key-value pairs in origin's shared
315    /// storage.
316    pub fn bytes_used(&self) -> i64 { self.bytes_used }
317}
318
319
320pub struct SharedStorageMetadataBuilder {
321    creation_time: crate::network::TimeSinceEpoch,
322    length: u64,
323    remaining_budget: f64,
324    bytes_used: i64,
325}
326
327impl SharedStorageMetadataBuilder {
328    pub fn build(self) -> SharedStorageMetadata {
329        SharedStorageMetadata {
330            creation_time: self.creation_time,
331            length: self.length,
332            remaining_budget: self.remaining_budget,
333            bytes_used: self.bytes_used,
334        }
335    }
336}
337
338/// Represents a dictionary object passed in as privateAggregationConfig to
339/// run or selectURL.
340
341#[derive(Debug, Clone, Serialize, Deserialize, Default)]
342#[serde(rename_all = "camelCase")]
343pub struct SharedStoragePrivateAggregationConfig<'a> {
344    /// The chosen aggregation service deployment.
345    #[serde(skip_serializing_if = "Option::is_none", rename = "aggregationCoordinatorOrigin")]
346    aggregation_coordinator_origin: Option<Cow<'a, str>>,
347    /// The context ID provided.
348    #[serde(skip_serializing_if = "Option::is_none", rename = "contextId")]
349    context_id: Option<Cow<'a, str>>,
350    /// Configures the maximum size allowed for filtering IDs.
351    #[serde(rename = "filteringIdMaxBytes")]
352    filtering_id_max_bytes: u64,
353    /// The limit on the number of contributions in the final report.
354    #[serde(skip_serializing_if = "Option::is_none", rename = "maxContributions")]
355    max_contributions: Option<i64>,
356}
357
358impl<'a> SharedStoragePrivateAggregationConfig<'a> {
359    /// Creates a builder for this type with the required parameters:
360    /// * `filtering_id_max_bytes`: Configures the maximum size allowed for filtering IDs.
361    pub fn builder(filtering_id_max_bytes: u64) -> SharedStoragePrivateAggregationConfigBuilder<'a> {
362        SharedStoragePrivateAggregationConfigBuilder {
363            aggregation_coordinator_origin: None,
364            context_id: None,
365            filtering_id_max_bytes: filtering_id_max_bytes,
366            max_contributions: None,
367        }
368    }
369    /// The chosen aggregation service deployment.
370    pub fn aggregation_coordinator_origin(&self) -> Option<&str> { self.aggregation_coordinator_origin.as_deref() }
371    /// The context ID provided.
372    pub fn context_id(&self) -> Option<&str> { self.context_id.as_deref() }
373    /// Configures the maximum size allowed for filtering IDs.
374    pub fn filtering_id_max_bytes(&self) -> u64 { self.filtering_id_max_bytes }
375    /// The limit on the number of contributions in the final report.
376    pub fn max_contributions(&self) -> Option<i64> { self.max_contributions }
377}
378
379
380pub struct SharedStoragePrivateAggregationConfigBuilder<'a> {
381    aggregation_coordinator_origin: Option<Cow<'a, str>>,
382    context_id: Option<Cow<'a, str>>,
383    filtering_id_max_bytes: u64,
384    max_contributions: Option<i64>,
385}
386
387impl<'a> SharedStoragePrivateAggregationConfigBuilder<'a> {
388    /// The chosen aggregation service deployment.
389    pub fn aggregation_coordinator_origin(mut self, aggregation_coordinator_origin: impl Into<Cow<'a, str>>) -> Self { self.aggregation_coordinator_origin = Some(aggregation_coordinator_origin.into()); self }
390    /// The context ID provided.
391    pub fn context_id(mut self, context_id: impl Into<Cow<'a, str>>) -> Self { self.context_id = Some(context_id.into()); self }
392    /// The limit on the number of contributions in the final report.
393    pub fn max_contributions(mut self, max_contributions: i64) -> Self { self.max_contributions = Some(max_contributions); self }
394    pub fn build(self) -> SharedStoragePrivateAggregationConfig<'a> {
395        SharedStoragePrivateAggregationConfig {
396            aggregation_coordinator_origin: self.aggregation_coordinator_origin,
397            context_id: self.context_id,
398            filtering_id_max_bytes: self.filtering_id_max_bytes,
399            max_contributions: self.max_contributions,
400        }
401    }
402}
403
404/// Pair of reporting metadata details for a candidate URL for 'selectURL()'.
405
406#[derive(Debug, Clone, Serialize, Deserialize, Default)]
407#[serde(rename_all = "camelCase")]
408pub struct SharedStorageReportingMetadata<'a> {
409    #[serde(rename = "eventType")]
410    event_type: Cow<'a, str>,
411    #[serde(rename = "reportingUrl")]
412    reporting_url: Cow<'a, str>,
413}
414
415impl<'a> SharedStorageReportingMetadata<'a> {
416    /// Creates a builder for this type with the required parameters:
417    /// * `event_type`: 
418    /// * `reporting_url`: 
419    pub fn builder(event_type: impl Into<Cow<'a, str>>, reporting_url: impl Into<Cow<'a, str>>) -> SharedStorageReportingMetadataBuilder<'a> {
420        SharedStorageReportingMetadataBuilder {
421            event_type: event_type.into(),
422            reporting_url: reporting_url.into(),
423        }
424    }
425    pub fn event_type(&self) -> &str { self.event_type.as_ref() }
426    pub fn reporting_url(&self) -> &str { self.reporting_url.as_ref() }
427}
428
429
430pub struct SharedStorageReportingMetadataBuilder<'a> {
431    event_type: Cow<'a, str>,
432    reporting_url: Cow<'a, str>,
433}
434
435impl<'a> SharedStorageReportingMetadataBuilder<'a> {
436    pub fn build(self) -> SharedStorageReportingMetadata<'a> {
437        SharedStorageReportingMetadata {
438            event_type: self.event_type,
439            reporting_url: self.reporting_url,
440        }
441    }
442}
443
444/// Bundles a candidate URL with its reporting metadata.
445
446#[derive(Debug, Clone, Serialize, Deserialize, Default)]
447#[serde(rename_all = "camelCase")]
448pub struct SharedStorageUrlWithMetadata<'a> {
449    /// Spec of candidate URL.
450    url: Cow<'a, str>,
451    /// Any associated reporting metadata.
452    #[serde(rename = "reportingMetadata")]
453    reporting_metadata: Vec<SharedStorageReportingMetadata<'a>>,
454}
455
456impl<'a> SharedStorageUrlWithMetadata<'a> {
457    /// Creates a builder for this type with the required parameters:
458    /// * `url`: Spec of candidate URL.
459    /// * `reporting_metadata`: Any associated reporting metadata.
460    pub fn builder(url: impl Into<Cow<'a, str>>, reporting_metadata: Vec<SharedStorageReportingMetadata<'a>>) -> SharedStorageUrlWithMetadataBuilder<'a> {
461        SharedStorageUrlWithMetadataBuilder {
462            url: url.into(),
463            reporting_metadata: reporting_metadata,
464        }
465    }
466    /// Spec of candidate URL.
467    pub fn url(&self) -> &str { self.url.as_ref() }
468    /// Any associated reporting metadata.
469    pub fn reporting_metadata(&self) -> &[SharedStorageReportingMetadata<'a>] { &self.reporting_metadata }
470}
471
472
473pub struct SharedStorageUrlWithMetadataBuilder<'a> {
474    url: Cow<'a, str>,
475    reporting_metadata: Vec<SharedStorageReportingMetadata<'a>>,
476}
477
478impl<'a> SharedStorageUrlWithMetadataBuilder<'a> {
479    pub fn build(self) -> SharedStorageUrlWithMetadata<'a> {
480        SharedStorageUrlWithMetadata {
481            url: self.url,
482            reporting_metadata: self.reporting_metadata,
483        }
484    }
485}
486
487/// Bundles the parameters for shared storage access events whose
488/// presence/absence can vary according to SharedStorageAccessType.
489
490#[derive(Debug, Clone, Serialize, Deserialize, Default)]
491#[serde(rename_all = "camelCase")]
492pub struct SharedStorageAccessParams<'a> {
493    /// Spec of the module script URL.
494    /// Present only for SharedStorageAccessMethods: addModule and
495    /// createWorklet.
496    #[serde(skip_serializing_if = "Option::is_none", rename = "scriptSourceUrl")]
497    script_source_url: Option<Cow<'a, str>>,
498    /// String denoting "context-origin", "script-origin", or a custom
499    /// origin to be used as the worklet's data origin.
500    /// Present only for SharedStorageAccessMethod: createWorklet.
501    #[serde(skip_serializing_if = "Option::is_none", rename = "dataOrigin")]
502    data_origin: Option<Cow<'a, str>>,
503    /// Name of the registered operation to be run.
504    /// Present only for SharedStorageAccessMethods: run and selectURL.
505    #[serde(skip_serializing_if = "Option::is_none", rename = "operationName")]
506    operation_name: Option<Cow<'a, str>>,
507    /// ID of the operation call.
508    /// Present only for SharedStorageAccessMethods: run and selectURL.
509    #[serde(skip_serializing_if = "Option::is_none", rename = "operationId")]
510    operation_id: Option<Cow<'a, str>>,
511    /// Whether or not to keep the worket alive for future run or selectURL
512    /// calls.
513    /// Present only for SharedStorageAccessMethods: run and selectURL.
514    #[serde(skip_serializing_if = "Option::is_none", rename = "keepAlive")]
515    keep_alive: Option<bool>,
516    /// Configures the private aggregation options.
517    /// Present only for SharedStorageAccessMethods: run and selectURL.
518    #[serde(skip_serializing_if = "Option::is_none", rename = "privateAggregationConfig")]
519    private_aggregation_config: Option<SharedStoragePrivateAggregationConfig<'a>>,
520    /// The operation's serialized data in bytes (converted to a string).
521    /// Present only for SharedStorageAccessMethods: run and selectURL.
522    /// TODO(crbug.com/401011862): Consider updating this parameter to binary.
523    #[serde(skip_serializing_if = "Option::is_none", rename = "serializedData")]
524    serialized_data: Option<Cow<'a, str>>,
525    /// Array of candidate URLs' specs, along with any associated metadata.
526    /// Present only for SharedStorageAccessMethod: selectURL.
527    #[serde(skip_serializing_if = "Option::is_none", rename = "urlsWithMetadata")]
528    urls_with_metadata: Option<Vec<SharedStorageUrlWithMetadata<'a>>>,
529    /// Spec of the URN:UUID generated for a selectURL call.
530    /// Present only for SharedStorageAccessMethod: selectURL.
531    #[serde(skip_serializing_if = "Option::is_none", rename = "urnUuid")]
532    urn_uuid: Option<Cow<'a, str>>,
533    /// Key for a specific entry in an origin's shared storage.
534    /// Present only for SharedStorageAccessMethods: set, append, delete, and
535    /// get.
536    #[serde(skip_serializing_if = "Option::is_none")]
537    key: Option<Cow<'a, str>>,
538    /// Value for a specific entry in an origin's shared storage.
539    /// Present only for SharedStorageAccessMethods: set and append.
540    #[serde(skip_serializing_if = "Option::is_none")]
541    value: Option<Cow<'a, str>>,
542    /// Whether or not to set an entry for a key if that key is already present.
543    /// Present only for SharedStorageAccessMethod: set.
544    #[serde(skip_serializing_if = "Option::is_none", rename = "ignoreIfPresent")]
545    ignore_if_present: Option<bool>,
546    /// A number denoting the (0-based) order of the worklet's
547    /// creation relative to all other shared storage worklets created by
548    /// documents using the current storage partition.
549    /// Present only for SharedStorageAccessMethods: addModule, createWorklet.
550    #[serde(skip_serializing_if = "Option::is_none", rename = "workletOrdinal")]
551    worklet_ordinal: Option<i64>,
552    /// Hex representation of the DevTools token used as the TargetID for the
553    /// associated shared storage worklet.
554    /// Present only for SharedStorageAccessMethods: addModule, createWorklet,
555    /// run, selectURL, and any other SharedStorageAccessMethod when the
556    /// SharedStorageAccessScope is sharedStorageWorklet.
557    #[serde(skip_serializing_if = "Option::is_none", rename = "workletTargetId")]
558    worklet_target_id: Option<crate::target::TargetID<'a>>,
559    /// Name of the lock to be acquired, if present.
560    /// Optionally present only for SharedStorageAccessMethods: batchUpdate,
561    /// set, append, delete, and clear.
562    #[serde(skip_serializing_if = "Option::is_none", rename = "withLock")]
563    with_lock: Option<Cow<'a, str>>,
564    /// If the method has been called as part of a batchUpdate, then this
565    /// number identifies the batch to which it belongs.
566    /// Optionally present only for SharedStorageAccessMethods:
567    /// batchUpdate (required), set, append, delete, and clear.
568    #[serde(skip_serializing_if = "Option::is_none", rename = "batchUpdateId")]
569    batch_update_id: Option<Cow<'a, str>>,
570    /// Number of modifier methods sent in batch.
571    /// Present only for SharedStorageAccessMethod: batchUpdate.
572    #[serde(skip_serializing_if = "Option::is_none", rename = "batchSize")]
573    batch_size: Option<u64>,
574}
575
576impl<'a> SharedStorageAccessParams<'a> {
577    /// Creates a builder for this type.
578    pub fn builder() -> SharedStorageAccessParamsBuilder<'a> {
579        SharedStorageAccessParamsBuilder {
580            script_source_url: None,
581            data_origin: None,
582            operation_name: None,
583            operation_id: None,
584            keep_alive: None,
585            private_aggregation_config: None,
586            serialized_data: None,
587            urls_with_metadata: None,
588            urn_uuid: None,
589            key: None,
590            value: None,
591            ignore_if_present: None,
592            worklet_ordinal: None,
593            worklet_target_id: None,
594            with_lock: None,
595            batch_update_id: None,
596            batch_size: None,
597        }
598    }
599    /// Spec of the module script URL.
600    /// Present only for SharedStorageAccessMethods: addModule and
601    /// createWorklet.
602    pub fn script_source_url(&self) -> Option<&str> { self.script_source_url.as_deref() }
603    /// String denoting "context-origin", "script-origin", or a custom
604    /// origin to be used as the worklet's data origin.
605    /// Present only for SharedStorageAccessMethod: createWorklet.
606    pub fn data_origin(&self) -> Option<&str> { self.data_origin.as_deref() }
607    /// Name of the registered operation to be run.
608    /// Present only for SharedStorageAccessMethods: run and selectURL.
609    pub fn operation_name(&self) -> Option<&str> { self.operation_name.as_deref() }
610    /// ID of the operation call.
611    /// Present only for SharedStorageAccessMethods: run and selectURL.
612    pub fn operation_id(&self) -> Option<&str> { self.operation_id.as_deref() }
613    /// Whether or not to keep the worket alive for future run or selectURL
614    /// calls.
615    /// Present only for SharedStorageAccessMethods: run and selectURL.
616    pub fn keep_alive(&self) -> Option<bool> { self.keep_alive }
617    /// Configures the private aggregation options.
618    /// Present only for SharedStorageAccessMethods: run and selectURL.
619    pub fn private_aggregation_config(&self) -> Option<&SharedStoragePrivateAggregationConfig<'a>> { self.private_aggregation_config.as_ref() }
620    /// The operation's serialized data in bytes (converted to a string).
621    /// Present only for SharedStorageAccessMethods: run and selectURL.
622    /// TODO(crbug.com/401011862): Consider updating this parameter to binary.
623    pub fn serialized_data(&self) -> Option<&str> { self.serialized_data.as_deref() }
624    /// Array of candidate URLs' specs, along with any associated metadata.
625    /// Present only for SharedStorageAccessMethod: selectURL.
626    pub fn urls_with_metadata(&self) -> Option<&[SharedStorageUrlWithMetadata<'a>]> { self.urls_with_metadata.as_deref() }
627    /// Spec of the URN:UUID generated for a selectURL call.
628    /// Present only for SharedStorageAccessMethod: selectURL.
629    pub fn urn_uuid(&self) -> Option<&str> { self.urn_uuid.as_deref() }
630    /// Key for a specific entry in an origin's shared storage.
631    /// Present only for SharedStorageAccessMethods: set, append, delete, and
632    /// get.
633    pub fn key(&self) -> Option<&str> { self.key.as_deref() }
634    /// Value for a specific entry in an origin's shared storage.
635    /// Present only for SharedStorageAccessMethods: set and append.
636    pub fn value(&self) -> Option<&str> { self.value.as_deref() }
637    /// Whether or not to set an entry for a key if that key is already present.
638    /// Present only for SharedStorageAccessMethod: set.
639    pub fn ignore_if_present(&self) -> Option<bool> { self.ignore_if_present }
640    /// A number denoting the (0-based) order of the worklet's
641    /// creation relative to all other shared storage worklets created by
642    /// documents using the current storage partition.
643    /// Present only for SharedStorageAccessMethods: addModule, createWorklet.
644    pub fn worklet_ordinal(&self) -> Option<i64> { self.worklet_ordinal }
645    /// Hex representation of the DevTools token used as the TargetID for the
646    /// associated shared storage worklet.
647    /// Present only for SharedStorageAccessMethods: addModule, createWorklet,
648    /// run, selectURL, and any other SharedStorageAccessMethod when the
649    /// SharedStorageAccessScope is sharedStorageWorklet.
650    pub fn worklet_target_id(&self) -> Option<&crate::target::TargetID<'a>> { self.worklet_target_id.as_ref() }
651    /// Name of the lock to be acquired, if present.
652    /// Optionally present only for SharedStorageAccessMethods: batchUpdate,
653    /// set, append, delete, and clear.
654    pub fn with_lock(&self) -> Option<&str> { self.with_lock.as_deref() }
655    /// If the method has been called as part of a batchUpdate, then this
656    /// number identifies the batch to which it belongs.
657    /// Optionally present only for SharedStorageAccessMethods:
658    /// batchUpdate (required), set, append, delete, and clear.
659    pub fn batch_update_id(&self) -> Option<&str> { self.batch_update_id.as_deref() }
660    /// Number of modifier methods sent in batch.
661    /// Present only for SharedStorageAccessMethod: batchUpdate.
662    pub fn batch_size(&self) -> Option<u64> { self.batch_size }
663}
664
665#[derive(Default)]
666pub struct SharedStorageAccessParamsBuilder<'a> {
667    script_source_url: Option<Cow<'a, str>>,
668    data_origin: Option<Cow<'a, str>>,
669    operation_name: Option<Cow<'a, str>>,
670    operation_id: Option<Cow<'a, str>>,
671    keep_alive: Option<bool>,
672    private_aggregation_config: Option<SharedStoragePrivateAggregationConfig<'a>>,
673    serialized_data: Option<Cow<'a, str>>,
674    urls_with_metadata: Option<Vec<SharedStorageUrlWithMetadata<'a>>>,
675    urn_uuid: Option<Cow<'a, str>>,
676    key: Option<Cow<'a, str>>,
677    value: Option<Cow<'a, str>>,
678    ignore_if_present: Option<bool>,
679    worklet_ordinal: Option<i64>,
680    worklet_target_id: Option<crate::target::TargetID<'a>>,
681    with_lock: Option<Cow<'a, str>>,
682    batch_update_id: Option<Cow<'a, str>>,
683    batch_size: Option<u64>,
684}
685
686impl<'a> SharedStorageAccessParamsBuilder<'a> {
687    /// Spec of the module script URL.
688    /// Present only for SharedStorageAccessMethods: addModule and
689    /// createWorklet.
690    pub fn script_source_url(mut self, script_source_url: impl Into<Cow<'a, str>>) -> Self { self.script_source_url = Some(script_source_url.into()); self }
691    /// String denoting "context-origin", "script-origin", or a custom
692    /// origin to be used as the worklet's data origin.
693    /// Present only for SharedStorageAccessMethod: createWorklet.
694    pub fn data_origin(mut self, data_origin: impl Into<Cow<'a, str>>) -> Self { self.data_origin = Some(data_origin.into()); self }
695    /// Name of the registered operation to be run.
696    /// Present only for SharedStorageAccessMethods: run and selectURL.
697    pub fn operation_name(mut self, operation_name: impl Into<Cow<'a, str>>) -> Self { self.operation_name = Some(operation_name.into()); self }
698    /// ID of the operation call.
699    /// Present only for SharedStorageAccessMethods: run and selectURL.
700    pub fn operation_id(mut self, operation_id: impl Into<Cow<'a, str>>) -> Self { self.operation_id = Some(operation_id.into()); self }
701    /// Whether or not to keep the worket alive for future run or selectURL
702    /// calls.
703    /// Present only for SharedStorageAccessMethods: run and selectURL.
704    pub fn keep_alive(mut self, keep_alive: bool) -> Self { self.keep_alive = Some(keep_alive); self }
705    /// Configures the private aggregation options.
706    /// Present only for SharedStorageAccessMethods: run and selectURL.
707    pub fn private_aggregation_config(mut self, private_aggregation_config: SharedStoragePrivateAggregationConfig<'a>) -> Self { self.private_aggregation_config = Some(private_aggregation_config); self }
708    /// The operation's serialized data in bytes (converted to a string).
709    /// Present only for SharedStorageAccessMethods: run and selectURL.
710    /// TODO(crbug.com/401011862): Consider updating this parameter to binary.
711    pub fn serialized_data(mut self, serialized_data: impl Into<Cow<'a, str>>) -> Self { self.serialized_data = Some(serialized_data.into()); self }
712    /// Array of candidate URLs' specs, along with any associated metadata.
713    /// Present only for SharedStorageAccessMethod: selectURL.
714    pub fn urls_with_metadata(mut self, urls_with_metadata: Vec<SharedStorageUrlWithMetadata<'a>>) -> Self { self.urls_with_metadata = Some(urls_with_metadata); self }
715    /// Spec of the URN:UUID generated for a selectURL call.
716    /// Present only for SharedStorageAccessMethod: selectURL.
717    pub fn urn_uuid(mut self, urn_uuid: impl Into<Cow<'a, str>>) -> Self { self.urn_uuid = Some(urn_uuid.into()); self }
718    /// Key for a specific entry in an origin's shared storage.
719    /// Present only for SharedStorageAccessMethods: set, append, delete, and
720    /// get.
721    pub fn key(mut self, key: impl Into<Cow<'a, str>>) -> Self { self.key = Some(key.into()); self }
722    /// Value for a specific entry in an origin's shared storage.
723    /// Present only for SharedStorageAccessMethods: set and append.
724    pub fn value(mut self, value: impl Into<Cow<'a, str>>) -> Self { self.value = Some(value.into()); self }
725    /// Whether or not to set an entry for a key if that key is already present.
726    /// Present only for SharedStorageAccessMethod: set.
727    pub fn ignore_if_present(mut self, ignore_if_present: bool) -> Self { self.ignore_if_present = Some(ignore_if_present); self }
728    /// A number denoting the (0-based) order of the worklet's
729    /// creation relative to all other shared storage worklets created by
730    /// documents using the current storage partition.
731    /// Present only for SharedStorageAccessMethods: addModule, createWorklet.
732    pub fn worklet_ordinal(mut self, worklet_ordinal: i64) -> Self { self.worklet_ordinal = Some(worklet_ordinal); self }
733    /// Hex representation of the DevTools token used as the TargetID for the
734    /// associated shared storage worklet.
735    /// Present only for SharedStorageAccessMethods: addModule, createWorklet,
736    /// run, selectURL, and any other SharedStorageAccessMethod when the
737    /// SharedStorageAccessScope is sharedStorageWorklet.
738    pub fn worklet_target_id(mut self, worklet_target_id: crate::target::TargetID<'a>) -> Self { self.worklet_target_id = Some(worklet_target_id); self }
739    /// Name of the lock to be acquired, if present.
740    /// Optionally present only for SharedStorageAccessMethods: batchUpdate,
741    /// set, append, delete, and clear.
742    pub fn with_lock(mut self, with_lock: impl Into<Cow<'a, str>>) -> Self { self.with_lock = Some(with_lock.into()); self }
743    /// If the method has been called as part of a batchUpdate, then this
744    /// number identifies the batch to which it belongs.
745    /// Optionally present only for SharedStorageAccessMethods:
746    /// batchUpdate (required), set, append, delete, and clear.
747    pub fn batch_update_id(mut self, batch_update_id: impl Into<Cow<'a, str>>) -> Self { self.batch_update_id = Some(batch_update_id.into()); self }
748    /// Number of modifier methods sent in batch.
749    /// Present only for SharedStorageAccessMethod: batchUpdate.
750    pub fn batch_size(mut self, batch_size: u64) -> Self { self.batch_size = Some(batch_size); self }
751    pub fn build(self) -> SharedStorageAccessParams<'a> {
752        SharedStorageAccessParams {
753            script_source_url: self.script_source_url,
754            data_origin: self.data_origin,
755            operation_name: self.operation_name,
756            operation_id: self.operation_id,
757            keep_alive: self.keep_alive,
758            private_aggregation_config: self.private_aggregation_config,
759            serialized_data: self.serialized_data,
760            urls_with_metadata: self.urls_with_metadata,
761            urn_uuid: self.urn_uuid,
762            key: self.key,
763            value: self.value,
764            ignore_if_present: self.ignore_if_present,
765            worklet_ordinal: self.worklet_ordinal,
766            worklet_target_id: self.worklet_target_id,
767            with_lock: self.with_lock,
768            batch_update_id: self.batch_update_id,
769            batch_size: self.batch_size,
770        }
771    }
772}
773
774
775#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
776pub enum StorageBucketsDurability {
777    #[default]
778    #[serde(rename = "relaxed")]
779    Relaxed,
780    #[serde(rename = "strict")]
781    Strict,
782}
783
784
785#[derive(Debug, Clone, Serialize, Deserialize, Default)]
786#[serde(rename_all = "camelCase")]
787pub struct StorageBucket<'a> {
788    #[serde(rename = "storageKey")]
789    storage_key: SerializedStorageKey<'a>,
790    /// If not specified, it is the default bucket of the storageKey.
791    #[serde(skip_serializing_if = "Option::is_none")]
792    name: Option<Cow<'a, str>>,
793}
794
795impl<'a> StorageBucket<'a> {
796    /// Creates a builder for this type with the required parameters:
797    /// * `storage_key`: 
798    pub fn builder(storage_key: impl Into<SerializedStorageKey<'a>>) -> StorageBucketBuilder<'a> {
799        StorageBucketBuilder {
800            storage_key: storage_key.into(),
801            name: None,
802        }
803    }
804    pub fn storage_key(&self) -> &SerializedStorageKey<'a> { &self.storage_key }
805    /// If not specified, it is the default bucket of the storageKey.
806    pub fn name(&self) -> Option<&str> { self.name.as_deref() }
807}
808
809
810pub struct StorageBucketBuilder<'a> {
811    storage_key: SerializedStorageKey<'a>,
812    name: Option<Cow<'a, str>>,
813}
814
815impl<'a> StorageBucketBuilder<'a> {
816    /// If not specified, it is the default bucket of the storageKey.
817    pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
818    pub fn build(self) -> StorageBucket<'a> {
819        StorageBucket {
820            storage_key: self.storage_key,
821            name: self.name,
822        }
823    }
824}
825
826
827#[derive(Debug, Clone, Serialize, Deserialize, Default)]
828#[serde(rename_all = "camelCase")]
829pub struct StorageBucketInfo<'a> {
830    bucket: StorageBucket<'a>,
831    id: Cow<'a, str>,
832    expiration: crate::network::TimeSinceEpoch,
833    /// Storage quota (bytes).
834    quota: f64,
835    persistent: bool,
836    durability: StorageBucketsDurability,
837}
838
839impl<'a> StorageBucketInfo<'a> {
840    /// Creates a builder for this type with the required parameters:
841    /// * `bucket`: 
842    /// * `id`: 
843    /// * `expiration`: 
844    /// * `quota`: Storage quota (bytes).
845    /// * `persistent`: 
846    /// * `durability`: 
847    pub fn builder(bucket: StorageBucket<'a>, id: impl Into<Cow<'a, str>>, expiration: crate::network::TimeSinceEpoch, quota: f64, persistent: bool, durability: impl Into<StorageBucketsDurability>) -> StorageBucketInfoBuilder<'a> {
848        StorageBucketInfoBuilder {
849            bucket: bucket,
850            id: id.into(),
851            expiration: expiration,
852            quota: quota,
853            persistent: persistent,
854            durability: durability.into(),
855        }
856    }
857    pub fn bucket(&self) -> &StorageBucket<'a> { &self.bucket }
858    pub fn id(&self) -> &str { self.id.as_ref() }
859    pub fn expiration(&self) -> &crate::network::TimeSinceEpoch { &self.expiration }
860    /// Storage quota (bytes).
861    pub fn quota(&self) -> f64 { self.quota }
862    pub fn persistent(&self) -> bool { self.persistent }
863    pub fn durability(&self) -> &StorageBucketsDurability { &self.durability }
864}
865
866
867pub struct StorageBucketInfoBuilder<'a> {
868    bucket: StorageBucket<'a>,
869    id: Cow<'a, str>,
870    expiration: crate::network::TimeSinceEpoch,
871    quota: f64,
872    persistent: bool,
873    durability: StorageBucketsDurability,
874}
875
876impl<'a> StorageBucketInfoBuilder<'a> {
877    pub fn build(self) -> StorageBucketInfo<'a> {
878        StorageBucketInfo {
879            bucket: self.bucket,
880            id: self.id,
881            expiration: self.expiration,
882            quota: self.quota,
883            persistent: self.persistent,
884            durability: self.durability,
885        }
886    }
887}
888
889/// A single Related Website Set object.
890
891#[derive(Debug, Clone, Serialize, Deserialize, Default)]
892#[serde(rename_all = "camelCase")]
893pub struct RelatedWebsiteSet<'a> {
894    /// The primary site of this set, along with the ccTLDs if there is any.
895    #[serde(rename = "primarySites")]
896    primary_sites: Vec<Cow<'a, str>>,
897    /// The associated sites of this set, along with the ccTLDs if there is any.
898    #[serde(rename = "associatedSites")]
899    associated_sites: Vec<Cow<'a, str>>,
900    /// The service sites of this set, along with the ccTLDs if there is any.
901    #[serde(rename = "serviceSites")]
902    service_sites: Vec<Cow<'a, str>>,
903}
904
905impl<'a> RelatedWebsiteSet<'a> {
906    /// Creates a builder for this type with the required parameters:
907    /// * `primary_sites`: The primary site of this set, along with the ccTLDs if there is any.
908    /// * `associated_sites`: The associated sites of this set, along with the ccTLDs if there is any.
909    /// * `service_sites`: The service sites of this set, along with the ccTLDs if there is any.
910    pub fn builder(primary_sites: Vec<Cow<'a, str>>, associated_sites: Vec<Cow<'a, str>>, service_sites: Vec<Cow<'a, str>>) -> RelatedWebsiteSetBuilder<'a> {
911        RelatedWebsiteSetBuilder {
912            primary_sites: primary_sites,
913            associated_sites: associated_sites,
914            service_sites: service_sites,
915        }
916    }
917    /// The primary site of this set, along with the ccTLDs if there is any.
918    pub fn primary_sites(&self) -> &[Cow<'a, str>] { &self.primary_sites }
919    /// The associated sites of this set, along with the ccTLDs if there is any.
920    pub fn associated_sites(&self) -> &[Cow<'a, str>] { &self.associated_sites }
921    /// The service sites of this set, along with the ccTLDs if there is any.
922    pub fn service_sites(&self) -> &[Cow<'a, str>] { &self.service_sites }
923}
924
925
926pub struct RelatedWebsiteSetBuilder<'a> {
927    primary_sites: Vec<Cow<'a, str>>,
928    associated_sites: Vec<Cow<'a, str>>,
929    service_sites: Vec<Cow<'a, str>>,
930}
931
932impl<'a> RelatedWebsiteSetBuilder<'a> {
933    pub fn build(self) -> RelatedWebsiteSet<'a> {
934        RelatedWebsiteSet {
935            primary_sites: self.primary_sites,
936            associated_sites: self.associated_sites,
937            service_sites: self.service_sites,
938        }
939    }
940}
941
942/// Returns a storage key given a frame id.
943/// Deprecated. Please use Storage.getStorageKey instead.
944
945#[derive(Debug, Clone, Serialize, Deserialize, Default)]
946#[serde(rename_all = "camelCase")]
947pub struct GetStorageKeyForFrameParams<'a> {
948    #[serde(rename = "frameId")]
949    frame_id: crate::page::FrameId<'a>,
950}
951
952impl<'a> GetStorageKeyForFrameParams<'a> {
953    /// Creates a builder for this type with the required parameters:
954    /// * `frame_id`: 
955    pub fn builder(frame_id: crate::page::FrameId<'a>) -> GetStorageKeyForFrameParamsBuilder<'a> {
956        GetStorageKeyForFrameParamsBuilder {
957            frame_id: frame_id,
958        }
959    }
960    pub fn frame_id(&self) -> &crate::page::FrameId<'a> { &self.frame_id }
961}
962
963
964pub struct GetStorageKeyForFrameParamsBuilder<'a> {
965    frame_id: crate::page::FrameId<'a>,
966}
967
968impl<'a> GetStorageKeyForFrameParamsBuilder<'a> {
969    pub fn build(self) -> GetStorageKeyForFrameParams<'a> {
970        GetStorageKeyForFrameParams {
971            frame_id: self.frame_id,
972        }
973    }
974}
975
976/// Returns a storage key given a frame id.
977/// Deprecated. Please use Storage.getStorageKey instead.
978
979#[derive(Debug, Clone, Serialize, Deserialize, Default)]
980#[serde(rename_all = "camelCase")]
981pub struct GetStorageKeyForFrameReturns<'a> {
982    #[serde(rename = "storageKey")]
983    storage_key: SerializedStorageKey<'a>,
984}
985
986impl<'a> GetStorageKeyForFrameReturns<'a> {
987    /// Creates a builder for this type with the required parameters:
988    /// * `storage_key`: 
989    pub fn builder(storage_key: impl Into<SerializedStorageKey<'a>>) -> GetStorageKeyForFrameReturnsBuilder<'a> {
990        GetStorageKeyForFrameReturnsBuilder {
991            storage_key: storage_key.into(),
992        }
993    }
994    pub fn storage_key(&self) -> &SerializedStorageKey<'a> { &self.storage_key }
995}
996
997
998pub struct GetStorageKeyForFrameReturnsBuilder<'a> {
999    storage_key: SerializedStorageKey<'a>,
1000}
1001
1002impl<'a> GetStorageKeyForFrameReturnsBuilder<'a> {
1003    pub fn build(self) -> GetStorageKeyForFrameReturns<'a> {
1004        GetStorageKeyForFrameReturns {
1005            storage_key: self.storage_key,
1006        }
1007    }
1008}
1009
1010impl<'a> GetStorageKeyForFrameParams<'a> { pub const METHOD: &'static str = "Storage.getStorageKeyForFrame"; }
1011
1012impl<'a> crate::CdpCommand<'a> for GetStorageKeyForFrameParams<'a> {
1013    const METHOD: &'static str = "Storage.getStorageKeyForFrame";
1014    type Response = GetStorageKeyForFrameReturns<'a>;
1015}
1016
1017/// Returns storage key for the given frame. If no frame ID is provided,
1018/// the storage key of the target executing this command is returned.
1019
1020#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1021#[serde(rename_all = "camelCase")]
1022pub struct GetStorageKeyParams<'a> {
1023    #[serde(skip_serializing_if = "Option::is_none", rename = "frameId")]
1024    frame_id: Option<crate::page::FrameId<'a>>,
1025}
1026
1027impl<'a> GetStorageKeyParams<'a> {
1028    /// Creates a builder for this type.
1029    pub fn builder() -> GetStorageKeyParamsBuilder<'a> {
1030        GetStorageKeyParamsBuilder {
1031            frame_id: None,
1032        }
1033    }
1034    pub fn frame_id(&self) -> Option<&crate::page::FrameId<'a>> { self.frame_id.as_ref() }
1035}
1036
1037#[derive(Default)]
1038pub struct GetStorageKeyParamsBuilder<'a> {
1039    frame_id: Option<crate::page::FrameId<'a>>,
1040}
1041
1042impl<'a> GetStorageKeyParamsBuilder<'a> {
1043    pub fn frame_id(mut self, frame_id: crate::page::FrameId<'a>) -> Self { self.frame_id = Some(frame_id); self }
1044    pub fn build(self) -> GetStorageKeyParams<'a> {
1045        GetStorageKeyParams {
1046            frame_id: self.frame_id,
1047        }
1048    }
1049}
1050
1051/// Returns storage key for the given frame. If no frame ID is provided,
1052/// the storage key of the target executing this command is returned.
1053
1054#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1055#[serde(rename_all = "camelCase")]
1056pub struct GetStorageKeyReturns<'a> {
1057    #[serde(rename = "storageKey")]
1058    storage_key: SerializedStorageKey<'a>,
1059}
1060
1061impl<'a> GetStorageKeyReturns<'a> {
1062    /// Creates a builder for this type with the required parameters:
1063    /// * `storage_key`: 
1064    pub fn builder(storage_key: impl Into<SerializedStorageKey<'a>>) -> GetStorageKeyReturnsBuilder<'a> {
1065        GetStorageKeyReturnsBuilder {
1066            storage_key: storage_key.into(),
1067        }
1068    }
1069    pub fn storage_key(&self) -> &SerializedStorageKey<'a> { &self.storage_key }
1070}
1071
1072
1073pub struct GetStorageKeyReturnsBuilder<'a> {
1074    storage_key: SerializedStorageKey<'a>,
1075}
1076
1077impl<'a> GetStorageKeyReturnsBuilder<'a> {
1078    pub fn build(self) -> GetStorageKeyReturns<'a> {
1079        GetStorageKeyReturns {
1080            storage_key: self.storage_key,
1081        }
1082    }
1083}
1084
1085impl<'a> GetStorageKeyParams<'a> { pub const METHOD: &'static str = "Storage.getStorageKey"; }
1086
1087impl<'a> crate::CdpCommand<'a> for GetStorageKeyParams<'a> {
1088    const METHOD: &'static str = "Storage.getStorageKey";
1089    type Response = GetStorageKeyReturns<'a>;
1090}
1091
1092/// Clears storage for origin.
1093
1094#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1095#[serde(rename_all = "camelCase")]
1096pub struct ClearDataForOriginParams<'a> {
1097    /// Security origin.
1098    origin: Cow<'a, str>,
1099    /// Comma separated list of StorageType to clear.
1100    #[serde(rename = "storageTypes")]
1101    storage_types: Cow<'a, str>,
1102}
1103
1104impl<'a> ClearDataForOriginParams<'a> {
1105    /// Creates a builder for this type with the required parameters:
1106    /// * `origin`: Security origin.
1107    /// * `storage_types`: Comma separated list of StorageType to clear.
1108    pub fn builder(origin: impl Into<Cow<'a, str>>, storage_types: impl Into<Cow<'a, str>>) -> ClearDataForOriginParamsBuilder<'a> {
1109        ClearDataForOriginParamsBuilder {
1110            origin: origin.into(),
1111            storage_types: storage_types.into(),
1112        }
1113    }
1114    /// Security origin.
1115    pub fn origin(&self) -> &str { self.origin.as_ref() }
1116    /// Comma separated list of StorageType to clear.
1117    pub fn storage_types(&self) -> &str { self.storage_types.as_ref() }
1118}
1119
1120
1121pub struct ClearDataForOriginParamsBuilder<'a> {
1122    origin: Cow<'a, str>,
1123    storage_types: Cow<'a, str>,
1124}
1125
1126impl<'a> ClearDataForOriginParamsBuilder<'a> {
1127    pub fn build(self) -> ClearDataForOriginParams<'a> {
1128        ClearDataForOriginParams {
1129            origin: self.origin,
1130            storage_types: self.storage_types,
1131        }
1132    }
1133}
1134
1135impl<'a> ClearDataForOriginParams<'a> { pub const METHOD: &'static str = "Storage.clearDataForOrigin"; }
1136
1137impl<'a> crate::CdpCommand<'a> for ClearDataForOriginParams<'a> {
1138    const METHOD: &'static str = "Storage.clearDataForOrigin";
1139    type Response = crate::EmptyReturns;
1140}
1141
1142/// Clears storage for storage key.
1143
1144#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1145#[serde(rename_all = "camelCase")]
1146pub struct ClearDataForStorageKeyParams<'a> {
1147    /// Storage key.
1148    #[serde(rename = "storageKey")]
1149    storage_key: Cow<'a, str>,
1150    /// Comma separated list of StorageType to clear.
1151    #[serde(rename = "storageTypes")]
1152    storage_types: Cow<'a, str>,
1153}
1154
1155impl<'a> ClearDataForStorageKeyParams<'a> {
1156    /// Creates a builder for this type with the required parameters:
1157    /// * `storage_key`: Storage key.
1158    /// * `storage_types`: Comma separated list of StorageType to clear.
1159    pub fn builder(storage_key: impl Into<Cow<'a, str>>, storage_types: impl Into<Cow<'a, str>>) -> ClearDataForStorageKeyParamsBuilder<'a> {
1160        ClearDataForStorageKeyParamsBuilder {
1161            storage_key: storage_key.into(),
1162            storage_types: storage_types.into(),
1163        }
1164    }
1165    /// Storage key.
1166    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
1167    /// Comma separated list of StorageType to clear.
1168    pub fn storage_types(&self) -> &str { self.storage_types.as_ref() }
1169}
1170
1171
1172pub struct ClearDataForStorageKeyParamsBuilder<'a> {
1173    storage_key: Cow<'a, str>,
1174    storage_types: Cow<'a, str>,
1175}
1176
1177impl<'a> ClearDataForStorageKeyParamsBuilder<'a> {
1178    pub fn build(self) -> ClearDataForStorageKeyParams<'a> {
1179        ClearDataForStorageKeyParams {
1180            storage_key: self.storage_key,
1181            storage_types: self.storage_types,
1182        }
1183    }
1184}
1185
1186impl<'a> ClearDataForStorageKeyParams<'a> { pub const METHOD: &'static str = "Storage.clearDataForStorageKey"; }
1187
1188impl<'a> crate::CdpCommand<'a> for ClearDataForStorageKeyParams<'a> {
1189    const METHOD: &'static str = "Storage.clearDataForStorageKey";
1190    type Response = crate::EmptyReturns;
1191}
1192
1193/// Returns all browser cookies.
1194
1195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1196#[serde(rename_all = "camelCase")]
1197pub struct GetCookiesParams<'a> {
1198    /// Browser context to use when called on the browser endpoint.
1199    #[serde(skip_serializing_if = "Option::is_none", rename = "browserContextId")]
1200    browser_context_id: Option<crate::browser::BrowserContextID<'a>>,
1201}
1202
1203impl<'a> GetCookiesParams<'a> {
1204    /// Creates a builder for this type.
1205    pub fn builder() -> GetCookiesParamsBuilder<'a> {
1206        GetCookiesParamsBuilder {
1207            browser_context_id: None,
1208        }
1209    }
1210    /// Browser context to use when called on the browser endpoint.
1211    pub fn browser_context_id(&self) -> Option<&crate::browser::BrowserContextID<'a>> { self.browser_context_id.as_ref() }
1212}
1213
1214#[derive(Default)]
1215pub struct GetCookiesParamsBuilder<'a> {
1216    browser_context_id: Option<crate::browser::BrowserContextID<'a>>,
1217}
1218
1219impl<'a> GetCookiesParamsBuilder<'a> {
1220    /// Browser context to use when called on the browser endpoint.
1221    pub fn browser_context_id(mut self, browser_context_id: crate::browser::BrowserContextID<'a>) -> Self { self.browser_context_id = Some(browser_context_id); self }
1222    pub fn build(self) -> GetCookiesParams<'a> {
1223        GetCookiesParams {
1224            browser_context_id: self.browser_context_id,
1225        }
1226    }
1227}
1228
1229/// Returns all browser cookies.
1230
1231#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1232#[serde(rename_all = "camelCase")]
1233pub struct GetCookiesReturns<'a> {
1234    /// Array of cookie objects.
1235    cookies: Vec<crate::network::Cookie<'a>>,
1236}
1237
1238impl<'a> GetCookiesReturns<'a> {
1239    /// Creates a builder for this type with the required parameters:
1240    /// * `cookies`: Array of cookie objects.
1241    pub fn builder(cookies: Vec<crate::network::Cookie<'a>>) -> GetCookiesReturnsBuilder<'a> {
1242        GetCookiesReturnsBuilder {
1243            cookies: cookies,
1244        }
1245    }
1246    /// Array of cookie objects.
1247    pub fn cookies(&self) -> &[crate::network::Cookie<'a>] { &self.cookies }
1248}
1249
1250
1251pub struct GetCookiesReturnsBuilder<'a> {
1252    cookies: Vec<crate::network::Cookie<'a>>,
1253}
1254
1255impl<'a> GetCookiesReturnsBuilder<'a> {
1256    pub fn build(self) -> GetCookiesReturns<'a> {
1257        GetCookiesReturns {
1258            cookies: self.cookies,
1259        }
1260    }
1261}
1262
1263impl<'a> GetCookiesParams<'a> { pub const METHOD: &'static str = "Storage.getCookies"; }
1264
1265impl<'a> crate::CdpCommand<'a> for GetCookiesParams<'a> {
1266    const METHOD: &'static str = "Storage.getCookies";
1267    type Response = GetCookiesReturns<'a>;
1268}
1269
1270/// Sets given cookies.
1271
1272#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1273#[serde(rename_all = "camelCase")]
1274pub struct SetCookiesParams<'a> {
1275    /// Cookies to be set.
1276    cookies: Vec<crate::network::CookieParam<'a>>,
1277    /// Browser context to use when called on the browser endpoint.
1278    #[serde(skip_serializing_if = "Option::is_none", rename = "browserContextId")]
1279    browser_context_id: Option<crate::browser::BrowserContextID<'a>>,
1280}
1281
1282impl<'a> SetCookiesParams<'a> {
1283    /// Creates a builder for this type with the required parameters:
1284    /// * `cookies`: Cookies to be set.
1285    pub fn builder(cookies: Vec<crate::network::CookieParam<'a>>) -> SetCookiesParamsBuilder<'a> {
1286        SetCookiesParamsBuilder {
1287            cookies: cookies,
1288            browser_context_id: None,
1289        }
1290    }
1291    /// Cookies to be set.
1292    pub fn cookies(&self) -> &[crate::network::CookieParam<'a>] { &self.cookies }
1293    /// Browser context to use when called on the browser endpoint.
1294    pub fn browser_context_id(&self) -> Option<&crate::browser::BrowserContextID<'a>> { self.browser_context_id.as_ref() }
1295}
1296
1297
1298pub struct SetCookiesParamsBuilder<'a> {
1299    cookies: Vec<crate::network::CookieParam<'a>>,
1300    browser_context_id: Option<crate::browser::BrowserContextID<'a>>,
1301}
1302
1303impl<'a> SetCookiesParamsBuilder<'a> {
1304    /// Browser context to use when called on the browser endpoint.
1305    pub fn browser_context_id(mut self, browser_context_id: crate::browser::BrowserContextID<'a>) -> Self { self.browser_context_id = Some(browser_context_id); self }
1306    pub fn build(self) -> SetCookiesParams<'a> {
1307        SetCookiesParams {
1308            cookies: self.cookies,
1309            browser_context_id: self.browser_context_id,
1310        }
1311    }
1312}
1313
1314impl<'a> SetCookiesParams<'a> { pub const METHOD: &'static str = "Storage.setCookies"; }
1315
1316impl<'a> crate::CdpCommand<'a> for SetCookiesParams<'a> {
1317    const METHOD: &'static str = "Storage.setCookies";
1318    type Response = crate::EmptyReturns;
1319}
1320
1321/// Clears cookies.
1322
1323#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1324#[serde(rename_all = "camelCase")]
1325pub struct ClearCookiesParams<'a> {
1326    /// Browser context to use when called on the browser endpoint.
1327    #[serde(skip_serializing_if = "Option::is_none", rename = "browserContextId")]
1328    browser_context_id: Option<crate::browser::BrowserContextID<'a>>,
1329}
1330
1331impl<'a> ClearCookiesParams<'a> {
1332    /// Creates a builder for this type.
1333    pub fn builder() -> ClearCookiesParamsBuilder<'a> {
1334        ClearCookiesParamsBuilder {
1335            browser_context_id: None,
1336        }
1337    }
1338    /// Browser context to use when called on the browser endpoint.
1339    pub fn browser_context_id(&self) -> Option<&crate::browser::BrowserContextID<'a>> { self.browser_context_id.as_ref() }
1340}
1341
1342#[derive(Default)]
1343pub struct ClearCookiesParamsBuilder<'a> {
1344    browser_context_id: Option<crate::browser::BrowserContextID<'a>>,
1345}
1346
1347impl<'a> ClearCookiesParamsBuilder<'a> {
1348    /// Browser context to use when called on the browser endpoint.
1349    pub fn browser_context_id(mut self, browser_context_id: crate::browser::BrowserContextID<'a>) -> Self { self.browser_context_id = Some(browser_context_id); self }
1350    pub fn build(self) -> ClearCookiesParams<'a> {
1351        ClearCookiesParams {
1352            browser_context_id: self.browser_context_id,
1353        }
1354    }
1355}
1356
1357impl<'a> ClearCookiesParams<'a> { pub const METHOD: &'static str = "Storage.clearCookies"; }
1358
1359impl<'a> crate::CdpCommand<'a> for ClearCookiesParams<'a> {
1360    const METHOD: &'static str = "Storage.clearCookies";
1361    type Response = crate::EmptyReturns;
1362}
1363
1364/// Returns usage and quota in bytes.
1365
1366#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1367#[serde(rename_all = "camelCase")]
1368pub struct GetUsageAndQuotaParams<'a> {
1369    /// Security origin.
1370    origin: Cow<'a, str>,
1371}
1372
1373impl<'a> GetUsageAndQuotaParams<'a> {
1374    /// Creates a builder for this type with the required parameters:
1375    /// * `origin`: Security origin.
1376    pub fn builder(origin: impl Into<Cow<'a, str>>) -> GetUsageAndQuotaParamsBuilder<'a> {
1377        GetUsageAndQuotaParamsBuilder {
1378            origin: origin.into(),
1379        }
1380    }
1381    /// Security origin.
1382    pub fn origin(&self) -> &str { self.origin.as_ref() }
1383}
1384
1385
1386pub struct GetUsageAndQuotaParamsBuilder<'a> {
1387    origin: Cow<'a, str>,
1388}
1389
1390impl<'a> GetUsageAndQuotaParamsBuilder<'a> {
1391    pub fn build(self) -> GetUsageAndQuotaParams<'a> {
1392        GetUsageAndQuotaParams {
1393            origin: self.origin,
1394        }
1395    }
1396}
1397
1398/// Returns usage and quota in bytes.
1399
1400#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1401#[serde(rename_all = "camelCase")]
1402pub struct GetUsageAndQuotaReturns {
1403    /// Storage usage (bytes).
1404    usage: f64,
1405    /// Storage quota (bytes).
1406    quota: f64,
1407    /// Whether or not the origin has an active storage quota override
1408    #[serde(rename = "overrideActive")]
1409    override_active: bool,
1410    /// Storage usage per type (bytes).
1411    #[serde(rename = "usageBreakdown")]
1412    usage_breakdown: Vec<UsageForType>,
1413}
1414
1415impl GetUsageAndQuotaReturns {
1416    /// Creates a builder for this type with the required parameters:
1417    /// * `usage`: Storage usage (bytes).
1418    /// * `quota`: Storage quota (bytes).
1419    /// * `override_active`: Whether or not the origin has an active storage quota override
1420    /// * `usage_breakdown`: Storage usage per type (bytes).
1421    pub fn builder(usage: f64, quota: f64, override_active: bool, usage_breakdown: Vec<UsageForType>) -> GetUsageAndQuotaReturnsBuilder {
1422        GetUsageAndQuotaReturnsBuilder {
1423            usage: usage,
1424            quota: quota,
1425            override_active: override_active,
1426            usage_breakdown: usage_breakdown,
1427        }
1428    }
1429    /// Storage usage (bytes).
1430    pub fn usage(&self) -> f64 { self.usage }
1431    /// Storage quota (bytes).
1432    pub fn quota(&self) -> f64 { self.quota }
1433    /// Whether or not the origin has an active storage quota override
1434    pub fn override_active(&self) -> bool { self.override_active }
1435    /// Storage usage per type (bytes).
1436    pub fn usage_breakdown(&self) -> &[UsageForType] { &self.usage_breakdown }
1437}
1438
1439
1440pub struct GetUsageAndQuotaReturnsBuilder {
1441    usage: f64,
1442    quota: f64,
1443    override_active: bool,
1444    usage_breakdown: Vec<UsageForType>,
1445}
1446
1447impl GetUsageAndQuotaReturnsBuilder {
1448    pub fn build(self) -> GetUsageAndQuotaReturns {
1449        GetUsageAndQuotaReturns {
1450            usage: self.usage,
1451            quota: self.quota,
1452            override_active: self.override_active,
1453            usage_breakdown: self.usage_breakdown,
1454        }
1455    }
1456}
1457
1458impl<'a> GetUsageAndQuotaParams<'a> { pub const METHOD: &'static str = "Storage.getUsageAndQuota"; }
1459
1460impl<'a> crate::CdpCommand<'a> for GetUsageAndQuotaParams<'a> {
1461    const METHOD: &'static str = "Storage.getUsageAndQuota";
1462    type Response = GetUsageAndQuotaReturns;
1463}
1464
1465/// Override quota for the specified origin
1466
1467#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1468#[serde(rename_all = "camelCase")]
1469pub struct OverrideQuotaForOriginParams<'a> {
1470    /// Security origin.
1471    origin: Cow<'a, str>,
1472    /// The quota size (in bytes) to override the original quota with.
1473    /// If this is called multiple times, the overridden quota will be equal to
1474    /// the quotaSize provided in the final call. If this is called without
1475    /// specifying a quotaSize, the quota will be reset to the default value for
1476    /// the specified origin. If this is called multiple times with different
1477    /// origins, the override will be maintained for each origin until it is
1478    /// disabled (called without a quotaSize).
1479    #[serde(skip_serializing_if = "Option::is_none", rename = "quotaSize")]
1480    quota_size: Option<f64>,
1481}
1482
1483impl<'a> OverrideQuotaForOriginParams<'a> {
1484    /// Creates a builder for this type with the required parameters:
1485    /// * `origin`: Security origin.
1486    pub fn builder(origin: impl Into<Cow<'a, str>>) -> OverrideQuotaForOriginParamsBuilder<'a> {
1487        OverrideQuotaForOriginParamsBuilder {
1488            origin: origin.into(),
1489            quota_size: None,
1490        }
1491    }
1492    /// Security origin.
1493    pub fn origin(&self) -> &str { self.origin.as_ref() }
1494    /// The quota size (in bytes) to override the original quota with.
1495    /// If this is called multiple times, the overridden quota will be equal to
1496    /// the quotaSize provided in the final call. If this is called without
1497    /// specifying a quotaSize, the quota will be reset to the default value for
1498    /// the specified origin. If this is called multiple times with different
1499    /// origins, the override will be maintained for each origin until it is
1500    /// disabled (called without a quotaSize).
1501    pub fn quota_size(&self) -> Option<f64> { self.quota_size }
1502}
1503
1504
1505pub struct OverrideQuotaForOriginParamsBuilder<'a> {
1506    origin: Cow<'a, str>,
1507    quota_size: Option<f64>,
1508}
1509
1510impl<'a> OverrideQuotaForOriginParamsBuilder<'a> {
1511    /// The quota size (in bytes) to override the original quota with.
1512    /// If this is called multiple times, the overridden quota will be equal to
1513    /// the quotaSize provided in the final call. If this is called without
1514    /// specifying a quotaSize, the quota will be reset to the default value for
1515    /// the specified origin. If this is called multiple times with different
1516    /// origins, the override will be maintained for each origin until it is
1517    /// disabled (called without a quotaSize).
1518    pub fn quota_size(mut self, quota_size: f64) -> Self { self.quota_size = Some(quota_size); self }
1519    pub fn build(self) -> OverrideQuotaForOriginParams<'a> {
1520        OverrideQuotaForOriginParams {
1521            origin: self.origin,
1522            quota_size: self.quota_size,
1523        }
1524    }
1525}
1526
1527impl<'a> OverrideQuotaForOriginParams<'a> { pub const METHOD: &'static str = "Storage.overrideQuotaForOrigin"; }
1528
1529impl<'a> crate::CdpCommand<'a> for OverrideQuotaForOriginParams<'a> {
1530    const METHOD: &'static str = "Storage.overrideQuotaForOrigin";
1531    type Response = crate::EmptyReturns;
1532}
1533
1534/// Registers origin to be notified when an update occurs to its cache storage list.
1535
1536#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1537#[serde(rename_all = "camelCase")]
1538pub struct TrackCacheStorageForOriginParams<'a> {
1539    /// Security origin.
1540    origin: Cow<'a, str>,
1541}
1542
1543impl<'a> TrackCacheStorageForOriginParams<'a> {
1544    /// Creates a builder for this type with the required parameters:
1545    /// * `origin`: Security origin.
1546    pub fn builder(origin: impl Into<Cow<'a, str>>) -> TrackCacheStorageForOriginParamsBuilder<'a> {
1547        TrackCacheStorageForOriginParamsBuilder {
1548            origin: origin.into(),
1549        }
1550    }
1551    /// Security origin.
1552    pub fn origin(&self) -> &str { self.origin.as_ref() }
1553}
1554
1555
1556pub struct TrackCacheStorageForOriginParamsBuilder<'a> {
1557    origin: Cow<'a, str>,
1558}
1559
1560impl<'a> TrackCacheStorageForOriginParamsBuilder<'a> {
1561    pub fn build(self) -> TrackCacheStorageForOriginParams<'a> {
1562        TrackCacheStorageForOriginParams {
1563            origin: self.origin,
1564        }
1565    }
1566}
1567
1568impl<'a> TrackCacheStorageForOriginParams<'a> { pub const METHOD: &'static str = "Storage.trackCacheStorageForOrigin"; }
1569
1570impl<'a> crate::CdpCommand<'a> for TrackCacheStorageForOriginParams<'a> {
1571    const METHOD: &'static str = "Storage.trackCacheStorageForOrigin";
1572    type Response = crate::EmptyReturns;
1573}
1574
1575/// Registers storage key to be notified when an update occurs to its cache storage list.
1576
1577#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1578#[serde(rename_all = "camelCase")]
1579pub struct TrackCacheStorageForStorageKeyParams<'a> {
1580    /// Storage key.
1581    #[serde(rename = "storageKey")]
1582    storage_key: Cow<'a, str>,
1583}
1584
1585impl<'a> TrackCacheStorageForStorageKeyParams<'a> {
1586    /// Creates a builder for this type with the required parameters:
1587    /// * `storage_key`: Storage key.
1588    pub fn builder(storage_key: impl Into<Cow<'a, str>>) -> TrackCacheStorageForStorageKeyParamsBuilder<'a> {
1589        TrackCacheStorageForStorageKeyParamsBuilder {
1590            storage_key: storage_key.into(),
1591        }
1592    }
1593    /// Storage key.
1594    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
1595}
1596
1597
1598pub struct TrackCacheStorageForStorageKeyParamsBuilder<'a> {
1599    storage_key: Cow<'a, str>,
1600}
1601
1602impl<'a> TrackCacheStorageForStorageKeyParamsBuilder<'a> {
1603    pub fn build(self) -> TrackCacheStorageForStorageKeyParams<'a> {
1604        TrackCacheStorageForStorageKeyParams {
1605            storage_key: self.storage_key,
1606        }
1607    }
1608}
1609
1610impl<'a> TrackCacheStorageForStorageKeyParams<'a> { pub const METHOD: &'static str = "Storage.trackCacheStorageForStorageKey"; }
1611
1612impl<'a> crate::CdpCommand<'a> for TrackCacheStorageForStorageKeyParams<'a> {
1613    const METHOD: &'static str = "Storage.trackCacheStorageForStorageKey";
1614    type Response = crate::EmptyReturns;
1615}
1616
1617/// Registers origin to be notified when an update occurs to its IndexedDB.
1618
1619#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1620#[serde(rename_all = "camelCase")]
1621pub struct TrackIndexedDBForOriginParams<'a> {
1622    /// Security origin.
1623    origin: Cow<'a, str>,
1624}
1625
1626impl<'a> TrackIndexedDBForOriginParams<'a> {
1627    /// Creates a builder for this type with the required parameters:
1628    /// * `origin`: Security origin.
1629    pub fn builder(origin: impl Into<Cow<'a, str>>) -> TrackIndexedDBForOriginParamsBuilder<'a> {
1630        TrackIndexedDBForOriginParamsBuilder {
1631            origin: origin.into(),
1632        }
1633    }
1634    /// Security origin.
1635    pub fn origin(&self) -> &str { self.origin.as_ref() }
1636}
1637
1638
1639pub struct TrackIndexedDBForOriginParamsBuilder<'a> {
1640    origin: Cow<'a, str>,
1641}
1642
1643impl<'a> TrackIndexedDBForOriginParamsBuilder<'a> {
1644    pub fn build(self) -> TrackIndexedDBForOriginParams<'a> {
1645        TrackIndexedDBForOriginParams {
1646            origin: self.origin,
1647        }
1648    }
1649}
1650
1651impl<'a> TrackIndexedDBForOriginParams<'a> { pub const METHOD: &'static str = "Storage.trackIndexedDBForOrigin"; }
1652
1653impl<'a> crate::CdpCommand<'a> for TrackIndexedDBForOriginParams<'a> {
1654    const METHOD: &'static str = "Storage.trackIndexedDBForOrigin";
1655    type Response = crate::EmptyReturns;
1656}
1657
1658/// Registers storage key to be notified when an update occurs to its IndexedDB.
1659
1660#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1661#[serde(rename_all = "camelCase")]
1662pub struct TrackIndexedDBForStorageKeyParams<'a> {
1663    /// Storage key.
1664    #[serde(rename = "storageKey")]
1665    storage_key: Cow<'a, str>,
1666}
1667
1668impl<'a> TrackIndexedDBForStorageKeyParams<'a> {
1669    /// Creates a builder for this type with the required parameters:
1670    /// * `storage_key`: Storage key.
1671    pub fn builder(storage_key: impl Into<Cow<'a, str>>) -> TrackIndexedDBForStorageKeyParamsBuilder<'a> {
1672        TrackIndexedDBForStorageKeyParamsBuilder {
1673            storage_key: storage_key.into(),
1674        }
1675    }
1676    /// Storage key.
1677    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
1678}
1679
1680
1681pub struct TrackIndexedDBForStorageKeyParamsBuilder<'a> {
1682    storage_key: Cow<'a, str>,
1683}
1684
1685impl<'a> TrackIndexedDBForStorageKeyParamsBuilder<'a> {
1686    pub fn build(self) -> TrackIndexedDBForStorageKeyParams<'a> {
1687        TrackIndexedDBForStorageKeyParams {
1688            storage_key: self.storage_key,
1689        }
1690    }
1691}
1692
1693impl<'a> TrackIndexedDBForStorageKeyParams<'a> { pub const METHOD: &'static str = "Storage.trackIndexedDBForStorageKey"; }
1694
1695impl<'a> crate::CdpCommand<'a> for TrackIndexedDBForStorageKeyParams<'a> {
1696    const METHOD: &'static str = "Storage.trackIndexedDBForStorageKey";
1697    type Response = crate::EmptyReturns;
1698}
1699
1700/// Unregisters origin from receiving notifications for cache storage.
1701
1702#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1703#[serde(rename_all = "camelCase")]
1704pub struct UntrackCacheStorageForOriginParams<'a> {
1705    /// Security origin.
1706    origin: Cow<'a, str>,
1707}
1708
1709impl<'a> UntrackCacheStorageForOriginParams<'a> {
1710    /// Creates a builder for this type with the required parameters:
1711    /// * `origin`: Security origin.
1712    pub fn builder(origin: impl Into<Cow<'a, str>>) -> UntrackCacheStorageForOriginParamsBuilder<'a> {
1713        UntrackCacheStorageForOriginParamsBuilder {
1714            origin: origin.into(),
1715        }
1716    }
1717    /// Security origin.
1718    pub fn origin(&self) -> &str { self.origin.as_ref() }
1719}
1720
1721
1722pub struct UntrackCacheStorageForOriginParamsBuilder<'a> {
1723    origin: Cow<'a, str>,
1724}
1725
1726impl<'a> UntrackCacheStorageForOriginParamsBuilder<'a> {
1727    pub fn build(self) -> UntrackCacheStorageForOriginParams<'a> {
1728        UntrackCacheStorageForOriginParams {
1729            origin: self.origin,
1730        }
1731    }
1732}
1733
1734impl<'a> UntrackCacheStorageForOriginParams<'a> { pub const METHOD: &'static str = "Storage.untrackCacheStorageForOrigin"; }
1735
1736impl<'a> crate::CdpCommand<'a> for UntrackCacheStorageForOriginParams<'a> {
1737    const METHOD: &'static str = "Storage.untrackCacheStorageForOrigin";
1738    type Response = crate::EmptyReturns;
1739}
1740
1741/// Unregisters storage key from receiving notifications for cache storage.
1742
1743#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1744#[serde(rename_all = "camelCase")]
1745pub struct UntrackCacheStorageForStorageKeyParams<'a> {
1746    /// Storage key.
1747    #[serde(rename = "storageKey")]
1748    storage_key: Cow<'a, str>,
1749}
1750
1751impl<'a> UntrackCacheStorageForStorageKeyParams<'a> {
1752    /// Creates a builder for this type with the required parameters:
1753    /// * `storage_key`: Storage key.
1754    pub fn builder(storage_key: impl Into<Cow<'a, str>>) -> UntrackCacheStorageForStorageKeyParamsBuilder<'a> {
1755        UntrackCacheStorageForStorageKeyParamsBuilder {
1756            storage_key: storage_key.into(),
1757        }
1758    }
1759    /// Storage key.
1760    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
1761}
1762
1763
1764pub struct UntrackCacheStorageForStorageKeyParamsBuilder<'a> {
1765    storage_key: Cow<'a, str>,
1766}
1767
1768impl<'a> UntrackCacheStorageForStorageKeyParamsBuilder<'a> {
1769    pub fn build(self) -> UntrackCacheStorageForStorageKeyParams<'a> {
1770        UntrackCacheStorageForStorageKeyParams {
1771            storage_key: self.storage_key,
1772        }
1773    }
1774}
1775
1776impl<'a> UntrackCacheStorageForStorageKeyParams<'a> { pub const METHOD: &'static str = "Storage.untrackCacheStorageForStorageKey"; }
1777
1778impl<'a> crate::CdpCommand<'a> for UntrackCacheStorageForStorageKeyParams<'a> {
1779    const METHOD: &'static str = "Storage.untrackCacheStorageForStorageKey";
1780    type Response = crate::EmptyReturns;
1781}
1782
1783/// Unregisters origin from receiving notifications for IndexedDB.
1784
1785#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1786#[serde(rename_all = "camelCase")]
1787pub struct UntrackIndexedDBForOriginParams<'a> {
1788    /// Security origin.
1789    origin: Cow<'a, str>,
1790}
1791
1792impl<'a> UntrackIndexedDBForOriginParams<'a> {
1793    /// Creates a builder for this type with the required parameters:
1794    /// * `origin`: Security origin.
1795    pub fn builder(origin: impl Into<Cow<'a, str>>) -> UntrackIndexedDBForOriginParamsBuilder<'a> {
1796        UntrackIndexedDBForOriginParamsBuilder {
1797            origin: origin.into(),
1798        }
1799    }
1800    /// Security origin.
1801    pub fn origin(&self) -> &str { self.origin.as_ref() }
1802}
1803
1804
1805pub struct UntrackIndexedDBForOriginParamsBuilder<'a> {
1806    origin: Cow<'a, str>,
1807}
1808
1809impl<'a> UntrackIndexedDBForOriginParamsBuilder<'a> {
1810    pub fn build(self) -> UntrackIndexedDBForOriginParams<'a> {
1811        UntrackIndexedDBForOriginParams {
1812            origin: self.origin,
1813        }
1814    }
1815}
1816
1817impl<'a> UntrackIndexedDBForOriginParams<'a> { pub const METHOD: &'static str = "Storage.untrackIndexedDBForOrigin"; }
1818
1819impl<'a> crate::CdpCommand<'a> for UntrackIndexedDBForOriginParams<'a> {
1820    const METHOD: &'static str = "Storage.untrackIndexedDBForOrigin";
1821    type Response = crate::EmptyReturns;
1822}
1823
1824/// Unregisters storage key from receiving notifications for IndexedDB.
1825
1826#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1827#[serde(rename_all = "camelCase")]
1828pub struct UntrackIndexedDBForStorageKeyParams<'a> {
1829    /// Storage key.
1830    #[serde(rename = "storageKey")]
1831    storage_key: Cow<'a, str>,
1832}
1833
1834impl<'a> UntrackIndexedDBForStorageKeyParams<'a> {
1835    /// Creates a builder for this type with the required parameters:
1836    /// * `storage_key`: Storage key.
1837    pub fn builder(storage_key: impl Into<Cow<'a, str>>) -> UntrackIndexedDBForStorageKeyParamsBuilder<'a> {
1838        UntrackIndexedDBForStorageKeyParamsBuilder {
1839            storage_key: storage_key.into(),
1840        }
1841    }
1842    /// Storage key.
1843    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
1844}
1845
1846
1847pub struct UntrackIndexedDBForStorageKeyParamsBuilder<'a> {
1848    storage_key: Cow<'a, str>,
1849}
1850
1851impl<'a> UntrackIndexedDBForStorageKeyParamsBuilder<'a> {
1852    pub fn build(self) -> UntrackIndexedDBForStorageKeyParams<'a> {
1853        UntrackIndexedDBForStorageKeyParams {
1854            storage_key: self.storage_key,
1855        }
1856    }
1857}
1858
1859impl<'a> UntrackIndexedDBForStorageKeyParams<'a> { pub const METHOD: &'static str = "Storage.untrackIndexedDBForStorageKey"; }
1860
1861impl<'a> crate::CdpCommand<'a> for UntrackIndexedDBForStorageKeyParams<'a> {
1862    const METHOD: &'static str = "Storage.untrackIndexedDBForStorageKey";
1863    type Response = crate::EmptyReturns;
1864}
1865
1866/// Returns the number of stored Trust Tokens per issuer for the
1867/// current browsing context.
1868
1869#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1870#[serde(rename_all = "camelCase")]
1871pub struct GetTrustTokensReturns<'a> {
1872    tokens: Vec<TrustTokens<'a>>,
1873}
1874
1875impl<'a> GetTrustTokensReturns<'a> {
1876    /// Creates a builder for this type with the required parameters:
1877    /// * `tokens`: 
1878    pub fn builder(tokens: Vec<TrustTokens<'a>>) -> GetTrustTokensReturnsBuilder<'a> {
1879        GetTrustTokensReturnsBuilder {
1880            tokens: tokens,
1881        }
1882    }
1883    pub fn tokens(&self) -> &[TrustTokens<'a>] { &self.tokens }
1884}
1885
1886
1887pub struct GetTrustTokensReturnsBuilder<'a> {
1888    tokens: Vec<TrustTokens<'a>>,
1889}
1890
1891impl<'a> GetTrustTokensReturnsBuilder<'a> {
1892    pub fn build(self) -> GetTrustTokensReturns<'a> {
1893        GetTrustTokensReturns {
1894            tokens: self.tokens,
1895        }
1896    }
1897}
1898
1899#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1900pub struct GetTrustTokensParams {}
1901
1902impl GetTrustTokensParams { pub const METHOD: &'static str = "Storage.getTrustTokens"; }
1903
1904impl<'a> crate::CdpCommand<'a> for GetTrustTokensParams {
1905    const METHOD: &'static str = "Storage.getTrustTokens";
1906    type Response = GetTrustTokensReturns<'a>;
1907}
1908
1909/// Removes all Trust Tokens issued by the provided issuerOrigin.
1910/// Leaves other stored data, including the issuer's Redemption Records, intact.
1911
1912#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1913#[serde(rename_all = "camelCase")]
1914pub struct ClearTrustTokensParams<'a> {
1915    #[serde(rename = "issuerOrigin")]
1916    issuer_origin: Cow<'a, str>,
1917}
1918
1919impl<'a> ClearTrustTokensParams<'a> {
1920    /// Creates a builder for this type with the required parameters:
1921    /// * `issuer_origin`: 
1922    pub fn builder(issuer_origin: impl Into<Cow<'a, str>>) -> ClearTrustTokensParamsBuilder<'a> {
1923        ClearTrustTokensParamsBuilder {
1924            issuer_origin: issuer_origin.into(),
1925        }
1926    }
1927    pub fn issuer_origin(&self) -> &str { self.issuer_origin.as_ref() }
1928}
1929
1930
1931pub struct ClearTrustTokensParamsBuilder<'a> {
1932    issuer_origin: Cow<'a, str>,
1933}
1934
1935impl<'a> ClearTrustTokensParamsBuilder<'a> {
1936    pub fn build(self) -> ClearTrustTokensParams<'a> {
1937        ClearTrustTokensParams {
1938            issuer_origin: self.issuer_origin,
1939        }
1940    }
1941}
1942
1943/// Removes all Trust Tokens issued by the provided issuerOrigin.
1944/// Leaves other stored data, including the issuer's Redemption Records, intact.
1945
1946#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1947#[serde(rename_all = "camelCase")]
1948pub struct ClearTrustTokensReturns {
1949    /// True if any tokens were deleted, false otherwise.
1950    #[serde(rename = "didDeleteTokens")]
1951    did_delete_tokens: bool,
1952}
1953
1954impl ClearTrustTokensReturns {
1955    /// Creates a builder for this type with the required parameters:
1956    /// * `did_delete_tokens`: True if any tokens were deleted, false otherwise.
1957    pub fn builder(did_delete_tokens: bool) -> ClearTrustTokensReturnsBuilder {
1958        ClearTrustTokensReturnsBuilder {
1959            did_delete_tokens: did_delete_tokens,
1960        }
1961    }
1962    /// True if any tokens were deleted, false otherwise.
1963    pub fn did_delete_tokens(&self) -> bool { self.did_delete_tokens }
1964}
1965
1966
1967pub struct ClearTrustTokensReturnsBuilder {
1968    did_delete_tokens: bool,
1969}
1970
1971impl ClearTrustTokensReturnsBuilder {
1972    pub fn build(self) -> ClearTrustTokensReturns {
1973        ClearTrustTokensReturns {
1974            did_delete_tokens: self.did_delete_tokens,
1975        }
1976    }
1977}
1978
1979impl<'a> ClearTrustTokensParams<'a> { pub const METHOD: &'static str = "Storage.clearTrustTokens"; }
1980
1981impl<'a> crate::CdpCommand<'a> for ClearTrustTokensParams<'a> {
1982    const METHOD: &'static str = "Storage.clearTrustTokens";
1983    type Response = ClearTrustTokensReturns;
1984}
1985
1986/// Gets details for a named interest group.
1987
1988#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1989#[serde(rename_all = "camelCase")]
1990pub struct GetInterestGroupDetailsParams<'a> {
1991    #[serde(rename = "ownerOrigin")]
1992    owner_origin: Cow<'a, str>,
1993    name: Cow<'a, str>,
1994}
1995
1996impl<'a> GetInterestGroupDetailsParams<'a> {
1997    /// Creates a builder for this type with the required parameters:
1998    /// * `owner_origin`: 
1999    /// * `name`: 
2000    pub fn builder(owner_origin: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>) -> GetInterestGroupDetailsParamsBuilder<'a> {
2001        GetInterestGroupDetailsParamsBuilder {
2002            owner_origin: owner_origin.into(),
2003            name: name.into(),
2004        }
2005    }
2006    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2007    pub fn name(&self) -> &str { self.name.as_ref() }
2008}
2009
2010
2011pub struct GetInterestGroupDetailsParamsBuilder<'a> {
2012    owner_origin: Cow<'a, str>,
2013    name: Cow<'a, str>,
2014}
2015
2016impl<'a> GetInterestGroupDetailsParamsBuilder<'a> {
2017    pub fn build(self) -> GetInterestGroupDetailsParams<'a> {
2018        GetInterestGroupDetailsParams {
2019            owner_origin: self.owner_origin,
2020            name: self.name,
2021        }
2022    }
2023}
2024
2025/// Gets details for a named interest group.
2026
2027#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2028#[serde(rename_all = "camelCase")]
2029pub struct GetInterestGroupDetailsReturns {
2030    /// This largely corresponds to:
2031    /// <https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup>
2032    /// but has absolute expirationTime instead of relative lifetimeMs and
2033    /// also adds joiningOrigin.
2034    details: serde_json::Map<String, JsonValue>,
2035}
2036
2037impl GetInterestGroupDetailsReturns {
2038    /// Creates a builder for this type with the required parameters:
2039    /// * `details`: This largely corresponds to: <https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup> but has absolute expirationTime instead of relative lifetimeMs and also adds joiningOrigin.
2040    pub fn builder(details: serde_json::Map<String, JsonValue>) -> GetInterestGroupDetailsReturnsBuilder {
2041        GetInterestGroupDetailsReturnsBuilder {
2042            details: details,
2043        }
2044    }
2045    /// This largely corresponds to:
2046    /// <https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup>
2047    /// but has absolute expirationTime instead of relative lifetimeMs and
2048    /// also adds joiningOrigin.
2049    pub fn details(&self) -> &serde_json::Map<String, JsonValue> { &self.details }
2050}
2051
2052
2053pub struct GetInterestGroupDetailsReturnsBuilder {
2054    details: serde_json::Map<String, JsonValue>,
2055}
2056
2057impl GetInterestGroupDetailsReturnsBuilder {
2058    pub fn build(self) -> GetInterestGroupDetailsReturns {
2059        GetInterestGroupDetailsReturns {
2060            details: self.details,
2061        }
2062    }
2063}
2064
2065impl<'a> GetInterestGroupDetailsParams<'a> { pub const METHOD: &'static str = "Storage.getInterestGroupDetails"; }
2066
2067impl<'a> crate::CdpCommand<'a> for GetInterestGroupDetailsParams<'a> {
2068    const METHOD: &'static str = "Storage.getInterestGroupDetails";
2069    type Response = GetInterestGroupDetailsReturns;
2070}
2071
2072/// Enables/Disables issuing of interestGroupAccessed events.
2073
2074#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2075#[serde(rename_all = "camelCase")]
2076pub struct SetInterestGroupTrackingParams {
2077    enable: bool,
2078}
2079
2080impl SetInterestGroupTrackingParams {
2081    /// Creates a builder for this type with the required parameters:
2082    /// * `enable`: 
2083    pub fn builder(enable: bool) -> SetInterestGroupTrackingParamsBuilder {
2084        SetInterestGroupTrackingParamsBuilder {
2085            enable: enable,
2086        }
2087    }
2088    pub fn enable(&self) -> bool { self.enable }
2089}
2090
2091
2092pub struct SetInterestGroupTrackingParamsBuilder {
2093    enable: bool,
2094}
2095
2096impl SetInterestGroupTrackingParamsBuilder {
2097    pub fn build(self) -> SetInterestGroupTrackingParams {
2098        SetInterestGroupTrackingParams {
2099            enable: self.enable,
2100        }
2101    }
2102}
2103
2104impl SetInterestGroupTrackingParams { pub const METHOD: &'static str = "Storage.setInterestGroupTracking"; }
2105
2106impl<'a> crate::CdpCommand<'a> for SetInterestGroupTrackingParams {
2107    const METHOD: &'static str = "Storage.setInterestGroupTracking";
2108    type Response = crate::EmptyReturns;
2109}
2110
2111/// Enables/Disables issuing of interestGroupAuctionEventOccurred and
2112/// interestGroupAuctionNetworkRequestCreated.
2113
2114#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2115#[serde(rename_all = "camelCase")]
2116pub struct SetInterestGroupAuctionTrackingParams {
2117    enable: bool,
2118}
2119
2120impl SetInterestGroupAuctionTrackingParams {
2121    /// Creates a builder for this type with the required parameters:
2122    /// * `enable`: 
2123    pub fn builder(enable: bool) -> SetInterestGroupAuctionTrackingParamsBuilder {
2124        SetInterestGroupAuctionTrackingParamsBuilder {
2125            enable: enable,
2126        }
2127    }
2128    pub fn enable(&self) -> bool { self.enable }
2129}
2130
2131
2132pub struct SetInterestGroupAuctionTrackingParamsBuilder {
2133    enable: bool,
2134}
2135
2136impl SetInterestGroupAuctionTrackingParamsBuilder {
2137    pub fn build(self) -> SetInterestGroupAuctionTrackingParams {
2138        SetInterestGroupAuctionTrackingParams {
2139            enable: self.enable,
2140        }
2141    }
2142}
2143
2144impl SetInterestGroupAuctionTrackingParams { pub const METHOD: &'static str = "Storage.setInterestGroupAuctionTracking"; }
2145
2146impl<'a> crate::CdpCommand<'a> for SetInterestGroupAuctionTrackingParams {
2147    const METHOD: &'static str = "Storage.setInterestGroupAuctionTracking";
2148    type Response = crate::EmptyReturns;
2149}
2150
2151/// Gets metadata for an origin's shared storage.
2152
2153#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2154#[serde(rename_all = "camelCase")]
2155pub struct GetSharedStorageMetadataParams<'a> {
2156    #[serde(rename = "ownerOrigin")]
2157    owner_origin: Cow<'a, str>,
2158}
2159
2160impl<'a> GetSharedStorageMetadataParams<'a> {
2161    /// Creates a builder for this type with the required parameters:
2162    /// * `owner_origin`: 
2163    pub fn builder(owner_origin: impl Into<Cow<'a, str>>) -> GetSharedStorageMetadataParamsBuilder<'a> {
2164        GetSharedStorageMetadataParamsBuilder {
2165            owner_origin: owner_origin.into(),
2166        }
2167    }
2168    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2169}
2170
2171
2172pub struct GetSharedStorageMetadataParamsBuilder<'a> {
2173    owner_origin: Cow<'a, str>,
2174}
2175
2176impl<'a> GetSharedStorageMetadataParamsBuilder<'a> {
2177    pub fn build(self) -> GetSharedStorageMetadataParams<'a> {
2178        GetSharedStorageMetadataParams {
2179            owner_origin: self.owner_origin,
2180        }
2181    }
2182}
2183
2184/// Gets metadata for an origin's shared storage.
2185
2186#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2187#[serde(rename_all = "camelCase")]
2188pub struct GetSharedStorageMetadataReturns {
2189    metadata: SharedStorageMetadata,
2190}
2191
2192impl GetSharedStorageMetadataReturns {
2193    /// Creates a builder for this type with the required parameters:
2194    /// * `metadata`: 
2195    pub fn builder(metadata: SharedStorageMetadata) -> GetSharedStorageMetadataReturnsBuilder {
2196        GetSharedStorageMetadataReturnsBuilder {
2197            metadata: metadata,
2198        }
2199    }
2200    pub fn metadata(&self) -> &SharedStorageMetadata { &self.metadata }
2201}
2202
2203
2204pub struct GetSharedStorageMetadataReturnsBuilder {
2205    metadata: SharedStorageMetadata,
2206}
2207
2208impl GetSharedStorageMetadataReturnsBuilder {
2209    pub fn build(self) -> GetSharedStorageMetadataReturns {
2210        GetSharedStorageMetadataReturns {
2211            metadata: self.metadata,
2212        }
2213    }
2214}
2215
2216impl<'a> GetSharedStorageMetadataParams<'a> { pub const METHOD: &'static str = "Storage.getSharedStorageMetadata"; }
2217
2218impl<'a> crate::CdpCommand<'a> for GetSharedStorageMetadataParams<'a> {
2219    const METHOD: &'static str = "Storage.getSharedStorageMetadata";
2220    type Response = GetSharedStorageMetadataReturns;
2221}
2222
2223/// Gets the entries in an given origin's shared storage.
2224
2225#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2226#[serde(rename_all = "camelCase")]
2227pub struct GetSharedStorageEntriesParams<'a> {
2228    #[serde(rename = "ownerOrigin")]
2229    owner_origin: Cow<'a, str>,
2230}
2231
2232impl<'a> GetSharedStorageEntriesParams<'a> {
2233    /// Creates a builder for this type with the required parameters:
2234    /// * `owner_origin`: 
2235    pub fn builder(owner_origin: impl Into<Cow<'a, str>>) -> GetSharedStorageEntriesParamsBuilder<'a> {
2236        GetSharedStorageEntriesParamsBuilder {
2237            owner_origin: owner_origin.into(),
2238        }
2239    }
2240    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2241}
2242
2243
2244pub struct GetSharedStorageEntriesParamsBuilder<'a> {
2245    owner_origin: Cow<'a, str>,
2246}
2247
2248impl<'a> GetSharedStorageEntriesParamsBuilder<'a> {
2249    pub fn build(self) -> GetSharedStorageEntriesParams<'a> {
2250        GetSharedStorageEntriesParams {
2251            owner_origin: self.owner_origin,
2252        }
2253    }
2254}
2255
2256/// Gets the entries in an given origin's shared storage.
2257
2258#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2259#[serde(rename_all = "camelCase")]
2260pub struct GetSharedStorageEntriesReturns<'a> {
2261    entries: Vec<SharedStorageEntry<'a>>,
2262}
2263
2264impl<'a> GetSharedStorageEntriesReturns<'a> {
2265    /// Creates a builder for this type with the required parameters:
2266    /// * `entries`: 
2267    pub fn builder(entries: Vec<SharedStorageEntry<'a>>) -> GetSharedStorageEntriesReturnsBuilder<'a> {
2268        GetSharedStorageEntriesReturnsBuilder {
2269            entries: entries,
2270        }
2271    }
2272    pub fn entries(&self) -> &[SharedStorageEntry<'a>] { &self.entries }
2273}
2274
2275
2276pub struct GetSharedStorageEntriesReturnsBuilder<'a> {
2277    entries: Vec<SharedStorageEntry<'a>>,
2278}
2279
2280impl<'a> GetSharedStorageEntriesReturnsBuilder<'a> {
2281    pub fn build(self) -> GetSharedStorageEntriesReturns<'a> {
2282        GetSharedStorageEntriesReturns {
2283            entries: self.entries,
2284        }
2285    }
2286}
2287
2288impl<'a> GetSharedStorageEntriesParams<'a> { pub const METHOD: &'static str = "Storage.getSharedStorageEntries"; }
2289
2290impl<'a> crate::CdpCommand<'a> for GetSharedStorageEntriesParams<'a> {
2291    const METHOD: &'static str = "Storage.getSharedStorageEntries";
2292    type Response = GetSharedStorageEntriesReturns<'a>;
2293}
2294
2295/// Sets entry with 'key' and 'value' for a given origin's shared storage.
2296
2297#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2298#[serde(rename_all = "camelCase")]
2299pub struct SetSharedStorageEntryParams<'a> {
2300    #[serde(rename = "ownerOrigin")]
2301    owner_origin: Cow<'a, str>,
2302    key: Cow<'a, str>,
2303    value: Cow<'a, str>,
2304    /// If 'ignoreIfPresent' is included and true, then only sets the entry if
2305    /// 'key' doesn't already exist.
2306    #[serde(skip_serializing_if = "Option::is_none", rename = "ignoreIfPresent")]
2307    ignore_if_present: Option<bool>,
2308}
2309
2310impl<'a> SetSharedStorageEntryParams<'a> {
2311    /// Creates a builder for this type with the required parameters:
2312    /// * `owner_origin`: 
2313    /// * `key`: 
2314    /// * `value`: 
2315    pub fn builder(owner_origin: impl Into<Cow<'a, str>>, key: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SetSharedStorageEntryParamsBuilder<'a> {
2316        SetSharedStorageEntryParamsBuilder {
2317            owner_origin: owner_origin.into(),
2318            key: key.into(),
2319            value: value.into(),
2320            ignore_if_present: None,
2321        }
2322    }
2323    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2324    pub fn key(&self) -> &str { self.key.as_ref() }
2325    pub fn value(&self) -> &str { self.value.as_ref() }
2326    /// If 'ignoreIfPresent' is included and true, then only sets the entry if
2327    /// 'key' doesn't already exist.
2328    pub fn ignore_if_present(&self) -> Option<bool> { self.ignore_if_present }
2329}
2330
2331
2332pub struct SetSharedStorageEntryParamsBuilder<'a> {
2333    owner_origin: Cow<'a, str>,
2334    key: Cow<'a, str>,
2335    value: Cow<'a, str>,
2336    ignore_if_present: Option<bool>,
2337}
2338
2339impl<'a> SetSharedStorageEntryParamsBuilder<'a> {
2340    /// If 'ignoreIfPresent' is included and true, then only sets the entry if
2341    /// 'key' doesn't already exist.
2342    pub fn ignore_if_present(mut self, ignore_if_present: bool) -> Self { self.ignore_if_present = Some(ignore_if_present); self }
2343    pub fn build(self) -> SetSharedStorageEntryParams<'a> {
2344        SetSharedStorageEntryParams {
2345            owner_origin: self.owner_origin,
2346            key: self.key,
2347            value: self.value,
2348            ignore_if_present: self.ignore_if_present,
2349        }
2350    }
2351}
2352
2353impl<'a> SetSharedStorageEntryParams<'a> { pub const METHOD: &'static str = "Storage.setSharedStorageEntry"; }
2354
2355impl<'a> crate::CdpCommand<'a> for SetSharedStorageEntryParams<'a> {
2356    const METHOD: &'static str = "Storage.setSharedStorageEntry";
2357    type Response = crate::EmptyReturns;
2358}
2359
2360/// Deletes entry for 'key' (if it exists) for a given origin's shared storage.
2361
2362#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2363#[serde(rename_all = "camelCase")]
2364pub struct DeleteSharedStorageEntryParams<'a> {
2365    #[serde(rename = "ownerOrigin")]
2366    owner_origin: Cow<'a, str>,
2367    key: Cow<'a, str>,
2368}
2369
2370impl<'a> DeleteSharedStorageEntryParams<'a> {
2371    /// Creates a builder for this type with the required parameters:
2372    /// * `owner_origin`: 
2373    /// * `key`: 
2374    pub fn builder(owner_origin: impl Into<Cow<'a, str>>, key: impl Into<Cow<'a, str>>) -> DeleteSharedStorageEntryParamsBuilder<'a> {
2375        DeleteSharedStorageEntryParamsBuilder {
2376            owner_origin: owner_origin.into(),
2377            key: key.into(),
2378        }
2379    }
2380    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2381    pub fn key(&self) -> &str { self.key.as_ref() }
2382}
2383
2384
2385pub struct DeleteSharedStorageEntryParamsBuilder<'a> {
2386    owner_origin: Cow<'a, str>,
2387    key: Cow<'a, str>,
2388}
2389
2390impl<'a> DeleteSharedStorageEntryParamsBuilder<'a> {
2391    pub fn build(self) -> DeleteSharedStorageEntryParams<'a> {
2392        DeleteSharedStorageEntryParams {
2393            owner_origin: self.owner_origin,
2394            key: self.key,
2395        }
2396    }
2397}
2398
2399impl<'a> DeleteSharedStorageEntryParams<'a> { pub const METHOD: &'static str = "Storage.deleteSharedStorageEntry"; }
2400
2401impl<'a> crate::CdpCommand<'a> for DeleteSharedStorageEntryParams<'a> {
2402    const METHOD: &'static str = "Storage.deleteSharedStorageEntry";
2403    type Response = crate::EmptyReturns;
2404}
2405
2406/// Clears all entries for a given origin's shared storage.
2407
2408#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2409#[serde(rename_all = "camelCase")]
2410pub struct ClearSharedStorageEntriesParams<'a> {
2411    #[serde(rename = "ownerOrigin")]
2412    owner_origin: Cow<'a, str>,
2413}
2414
2415impl<'a> ClearSharedStorageEntriesParams<'a> {
2416    /// Creates a builder for this type with the required parameters:
2417    /// * `owner_origin`: 
2418    pub fn builder(owner_origin: impl Into<Cow<'a, str>>) -> ClearSharedStorageEntriesParamsBuilder<'a> {
2419        ClearSharedStorageEntriesParamsBuilder {
2420            owner_origin: owner_origin.into(),
2421        }
2422    }
2423    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2424}
2425
2426
2427pub struct ClearSharedStorageEntriesParamsBuilder<'a> {
2428    owner_origin: Cow<'a, str>,
2429}
2430
2431impl<'a> ClearSharedStorageEntriesParamsBuilder<'a> {
2432    pub fn build(self) -> ClearSharedStorageEntriesParams<'a> {
2433        ClearSharedStorageEntriesParams {
2434            owner_origin: self.owner_origin,
2435        }
2436    }
2437}
2438
2439impl<'a> ClearSharedStorageEntriesParams<'a> { pub const METHOD: &'static str = "Storage.clearSharedStorageEntries"; }
2440
2441impl<'a> crate::CdpCommand<'a> for ClearSharedStorageEntriesParams<'a> {
2442    const METHOD: &'static str = "Storage.clearSharedStorageEntries";
2443    type Response = crate::EmptyReturns;
2444}
2445
2446/// Resets the budget for 'ownerOrigin' by clearing all budget withdrawals.
2447
2448#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2449#[serde(rename_all = "camelCase")]
2450pub struct ResetSharedStorageBudgetParams<'a> {
2451    #[serde(rename = "ownerOrigin")]
2452    owner_origin: Cow<'a, str>,
2453}
2454
2455impl<'a> ResetSharedStorageBudgetParams<'a> {
2456    /// Creates a builder for this type with the required parameters:
2457    /// * `owner_origin`: 
2458    pub fn builder(owner_origin: impl Into<Cow<'a, str>>) -> ResetSharedStorageBudgetParamsBuilder<'a> {
2459        ResetSharedStorageBudgetParamsBuilder {
2460            owner_origin: owner_origin.into(),
2461        }
2462    }
2463    pub fn owner_origin(&self) -> &str { self.owner_origin.as_ref() }
2464}
2465
2466
2467pub struct ResetSharedStorageBudgetParamsBuilder<'a> {
2468    owner_origin: Cow<'a, str>,
2469}
2470
2471impl<'a> ResetSharedStorageBudgetParamsBuilder<'a> {
2472    pub fn build(self) -> ResetSharedStorageBudgetParams<'a> {
2473        ResetSharedStorageBudgetParams {
2474            owner_origin: self.owner_origin,
2475        }
2476    }
2477}
2478
2479impl<'a> ResetSharedStorageBudgetParams<'a> { pub const METHOD: &'static str = "Storage.resetSharedStorageBudget"; }
2480
2481impl<'a> crate::CdpCommand<'a> for ResetSharedStorageBudgetParams<'a> {
2482    const METHOD: &'static str = "Storage.resetSharedStorageBudget";
2483    type Response = crate::EmptyReturns;
2484}
2485
2486/// Enables/disables issuing of sharedStorageAccessed events.
2487
2488#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2489#[serde(rename_all = "camelCase")]
2490pub struct SetSharedStorageTrackingParams {
2491    enable: bool,
2492}
2493
2494impl SetSharedStorageTrackingParams {
2495    /// Creates a builder for this type with the required parameters:
2496    /// * `enable`: 
2497    pub fn builder(enable: bool) -> SetSharedStorageTrackingParamsBuilder {
2498        SetSharedStorageTrackingParamsBuilder {
2499            enable: enable,
2500        }
2501    }
2502    pub fn enable(&self) -> bool { self.enable }
2503}
2504
2505
2506pub struct SetSharedStorageTrackingParamsBuilder {
2507    enable: bool,
2508}
2509
2510impl SetSharedStorageTrackingParamsBuilder {
2511    pub fn build(self) -> SetSharedStorageTrackingParams {
2512        SetSharedStorageTrackingParams {
2513            enable: self.enable,
2514        }
2515    }
2516}
2517
2518impl SetSharedStorageTrackingParams { pub const METHOD: &'static str = "Storage.setSharedStorageTracking"; }
2519
2520impl<'a> crate::CdpCommand<'a> for SetSharedStorageTrackingParams {
2521    const METHOD: &'static str = "Storage.setSharedStorageTracking";
2522    type Response = crate::EmptyReturns;
2523}
2524
2525/// Set tracking for a storage key's buckets.
2526
2527#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2528#[serde(rename_all = "camelCase")]
2529pub struct SetStorageBucketTrackingParams<'a> {
2530    #[serde(rename = "storageKey")]
2531    storage_key: Cow<'a, str>,
2532    enable: bool,
2533}
2534
2535impl<'a> SetStorageBucketTrackingParams<'a> {
2536    /// Creates a builder for this type with the required parameters:
2537    /// * `storage_key`: 
2538    /// * `enable`: 
2539    pub fn builder(storage_key: impl Into<Cow<'a, str>>, enable: bool) -> SetStorageBucketTrackingParamsBuilder<'a> {
2540        SetStorageBucketTrackingParamsBuilder {
2541            storage_key: storage_key.into(),
2542            enable: enable,
2543        }
2544    }
2545    pub fn storage_key(&self) -> &str { self.storage_key.as_ref() }
2546    pub fn enable(&self) -> bool { self.enable }
2547}
2548
2549
2550pub struct SetStorageBucketTrackingParamsBuilder<'a> {
2551    storage_key: Cow<'a, str>,
2552    enable: bool,
2553}
2554
2555impl<'a> SetStorageBucketTrackingParamsBuilder<'a> {
2556    pub fn build(self) -> SetStorageBucketTrackingParams<'a> {
2557        SetStorageBucketTrackingParams {
2558            storage_key: self.storage_key,
2559            enable: self.enable,
2560        }
2561    }
2562}
2563
2564impl<'a> SetStorageBucketTrackingParams<'a> { pub const METHOD: &'static str = "Storage.setStorageBucketTracking"; }
2565
2566impl<'a> crate::CdpCommand<'a> for SetStorageBucketTrackingParams<'a> {
2567    const METHOD: &'static str = "Storage.setStorageBucketTracking";
2568    type Response = crate::EmptyReturns;
2569}
2570
2571/// Deletes the Storage Bucket with the given storage key and bucket name.
2572
2573#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2574#[serde(rename_all = "camelCase")]
2575pub struct DeleteStorageBucketParams<'a> {
2576    bucket: StorageBucket<'a>,
2577}
2578
2579impl<'a> DeleteStorageBucketParams<'a> {
2580    /// Creates a builder for this type with the required parameters:
2581    /// * `bucket`: 
2582    pub fn builder(bucket: StorageBucket<'a>) -> DeleteStorageBucketParamsBuilder<'a> {
2583        DeleteStorageBucketParamsBuilder {
2584            bucket: bucket,
2585        }
2586    }
2587    pub fn bucket(&self) -> &StorageBucket<'a> { &self.bucket }
2588}
2589
2590
2591pub struct DeleteStorageBucketParamsBuilder<'a> {
2592    bucket: StorageBucket<'a>,
2593}
2594
2595impl<'a> DeleteStorageBucketParamsBuilder<'a> {
2596    pub fn build(self) -> DeleteStorageBucketParams<'a> {
2597        DeleteStorageBucketParams {
2598            bucket: self.bucket,
2599        }
2600    }
2601}
2602
2603impl<'a> DeleteStorageBucketParams<'a> { pub const METHOD: &'static str = "Storage.deleteStorageBucket"; }
2604
2605impl<'a> crate::CdpCommand<'a> for DeleteStorageBucketParams<'a> {
2606    const METHOD: &'static str = "Storage.deleteStorageBucket";
2607    type Response = crate::EmptyReturns;
2608}
2609
2610/// Deletes state for sites identified as potential bounce trackers, immediately.
2611
2612#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2613#[serde(rename_all = "camelCase")]
2614pub struct RunBounceTrackingMitigationsReturns<'a> {
2615    #[serde(rename = "deletedSites")]
2616    deleted_sites: Vec<Cow<'a, str>>,
2617}
2618
2619impl<'a> RunBounceTrackingMitigationsReturns<'a> {
2620    /// Creates a builder for this type with the required parameters:
2621    /// * `deleted_sites`: 
2622    pub fn builder(deleted_sites: Vec<Cow<'a, str>>) -> RunBounceTrackingMitigationsReturnsBuilder<'a> {
2623        RunBounceTrackingMitigationsReturnsBuilder {
2624            deleted_sites: deleted_sites,
2625        }
2626    }
2627    pub fn deleted_sites(&self) -> &[Cow<'a, str>] { &self.deleted_sites }
2628}
2629
2630
2631pub struct RunBounceTrackingMitigationsReturnsBuilder<'a> {
2632    deleted_sites: Vec<Cow<'a, str>>,
2633}
2634
2635impl<'a> RunBounceTrackingMitigationsReturnsBuilder<'a> {
2636    pub fn build(self) -> RunBounceTrackingMitigationsReturns<'a> {
2637        RunBounceTrackingMitigationsReturns {
2638            deleted_sites: self.deleted_sites,
2639        }
2640    }
2641}
2642
2643#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2644pub struct RunBounceTrackingMitigationsParams {}
2645
2646impl RunBounceTrackingMitigationsParams { pub const METHOD: &'static str = "Storage.runBounceTrackingMitigations"; }
2647
2648impl<'a> crate::CdpCommand<'a> for RunBounceTrackingMitigationsParams {
2649    const METHOD: &'static str = "Storage.runBounceTrackingMitigations";
2650    type Response = RunBounceTrackingMitigationsReturns<'a>;
2651}
2652
2653/// Returns the effective Related Website Sets in use by this profile for the browser
2654/// session. The effective Related Website Sets will not change during a browser session.
2655
2656#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2657#[serde(rename_all = "camelCase")]
2658pub struct GetRelatedWebsiteSetsReturns<'a> {
2659    sets: Vec<RelatedWebsiteSet<'a>>,
2660}
2661
2662impl<'a> GetRelatedWebsiteSetsReturns<'a> {
2663    /// Creates a builder for this type with the required parameters:
2664    /// * `sets`: 
2665    pub fn builder(sets: Vec<RelatedWebsiteSet<'a>>) -> GetRelatedWebsiteSetsReturnsBuilder<'a> {
2666        GetRelatedWebsiteSetsReturnsBuilder {
2667            sets: sets,
2668        }
2669    }
2670    pub fn sets(&self) -> &[RelatedWebsiteSet<'a>] { &self.sets }
2671}
2672
2673
2674pub struct GetRelatedWebsiteSetsReturnsBuilder<'a> {
2675    sets: Vec<RelatedWebsiteSet<'a>>,
2676}
2677
2678impl<'a> GetRelatedWebsiteSetsReturnsBuilder<'a> {
2679    pub fn build(self) -> GetRelatedWebsiteSetsReturns<'a> {
2680        GetRelatedWebsiteSetsReturns {
2681            sets: self.sets,
2682        }
2683    }
2684}
2685
2686#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2687pub struct GetRelatedWebsiteSetsParams {}
2688
2689impl GetRelatedWebsiteSetsParams { pub const METHOD: &'static str = "Storage.getRelatedWebsiteSets"; }
2690
2691impl<'a> crate::CdpCommand<'a> for GetRelatedWebsiteSetsParams {
2692    const METHOD: &'static str = "Storage.getRelatedWebsiteSets";
2693    type Response = GetRelatedWebsiteSetsReturns<'a>;
2694}
2695
2696
2697#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2698#[serde(rename_all = "camelCase")]
2699pub struct SetProtectedAudienceKAnonymityParams<'a> {
2700    owner: Cow<'a, str>,
2701    name: Cow<'a, str>,
2702    hashes: Vec<Cow<'a, str>>,
2703}
2704
2705impl<'a> SetProtectedAudienceKAnonymityParams<'a> {
2706    /// Creates a builder for this type with the required parameters:
2707    /// * `owner`: 
2708    /// * `name`: 
2709    /// * `hashes`: 
2710    pub fn builder(owner: impl Into<Cow<'a, str>>, name: impl Into<Cow<'a, str>>, hashes: Vec<Cow<'a, str>>) -> SetProtectedAudienceKAnonymityParamsBuilder<'a> {
2711        SetProtectedAudienceKAnonymityParamsBuilder {
2712            owner: owner.into(),
2713            name: name.into(),
2714            hashes: hashes,
2715        }
2716    }
2717    pub fn owner(&self) -> &str { self.owner.as_ref() }
2718    pub fn name(&self) -> &str { self.name.as_ref() }
2719    pub fn hashes(&self) -> &[Cow<'a, str>] { &self.hashes }
2720}
2721
2722
2723pub struct SetProtectedAudienceKAnonymityParamsBuilder<'a> {
2724    owner: Cow<'a, str>,
2725    name: Cow<'a, str>,
2726    hashes: Vec<Cow<'a, str>>,
2727}
2728
2729impl<'a> SetProtectedAudienceKAnonymityParamsBuilder<'a> {
2730    pub fn build(self) -> SetProtectedAudienceKAnonymityParams<'a> {
2731        SetProtectedAudienceKAnonymityParams {
2732            owner: self.owner,
2733            name: self.name,
2734            hashes: self.hashes,
2735        }
2736    }
2737}
2738
2739impl<'a> SetProtectedAudienceKAnonymityParams<'a> { pub const METHOD: &'static str = "Storage.setProtectedAudienceKAnonymity"; }
2740
2741impl<'a> crate::CdpCommand<'a> for SetProtectedAudienceKAnonymityParams<'a> {
2742    const METHOD: &'static str = "Storage.setProtectedAudienceKAnonymity";
2743    type Response = crate::EmptyReturns;
2744}