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