browser-protocol 0.1.2

Generated Rust types and commands for the Chrome DevTools Protocol (browser-protocol)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;


pub type SerializedStorageKey = String;

/// Enum of possible storage types.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum StorageType {
    #[default]
    Cookies,
    FileSystems,
    Indexeddb,
    LocalStorage,
    ShaderCache,
    Websql,
    ServiceWorkers,
    CacheStorage,
    InterestGroups,
    SharedStorage,
    StorageBuckets,
    All,
    Other,
}

/// Usage for a storage type.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UsageForType {
    /// Name of storage type.

    pub storageType: StorageType,
    /// Storage usage (bytes).

    pub usage: f64,
}

/// Pair of issuer origin and number of available (signed, but not used) Trust
/// Tokens from that issuer.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrustTokens {

    pub issuerOrigin: String,

    pub count: f64,
}

/// Protected audience interest group auction identifier.

pub type InterestGroupAuctionId = String;

/// Enum of interest group access types.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum InterestGroupAccessType {
    #[default]
    Join,
    Leave,
    Update,
    Loaded,
    Bid,
    Win,
    AdditionalBid,
    AdditionalBidWin,
    TopLevelBid,
    TopLevelAdditionalBid,
    Clear,
}

/// Enum of auction events.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum InterestGroupAuctionEventType {
    #[default]
    Started,
    ConfigResolved,
}

/// Enum of network fetches auctions can do.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum InterestGroupAuctionFetchType {
    #[default]
    BidderJs,
    BidderWasm,
    SellerJs,
    BidderTrustedSignals,
    SellerTrustedSignals,
}

/// Enum of shared storage access scopes.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum SharedStorageAccessScope {
    #[default]
    Window,
    SharedStorageWorklet,
    ProtectedAudienceWorklet,
    Header,
}

/// Enum of shared storage access methods.

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum SharedStorageAccessMethod {
    #[default]
    AddModule,
    CreateWorklet,
    SelectURL,
    Run,
    BatchUpdate,
    Set,
    Append,
    Delete,
    Clear,
    Get,
    Keys,
    Values,
    Entries,
    Length,
    RemainingBudget,
}

/// Struct for a single key-value pair in an origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SharedStorageEntry {

    pub key: String,

    pub value: String,
}

/// Details for an origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SharedStorageMetadata {
    /// Time when the origin's shared storage was last created.

    pub creationTime: crate::network::TimeSinceEpoch,
    /// Number of key-value pairs stored in origin's shared storage.

    pub length: u64,
    /// Current amount of bits of entropy remaining in the navigation budget.

    pub remainingBudget: f64,
    /// Total number of bytes stored as key-value pairs in origin's shared
    /// storage.

    pub bytesUsed: i64,
}

/// Represents a dictionary object passed in as privateAggregationConfig to
/// run or selectURL.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SharedStoragePrivateAggregationConfig {
    /// The chosen aggregation service deployment.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub aggregationCoordinatorOrigin: Option<String>,
    /// The context ID provided.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub contextId: Option<String>,
    /// Configures the maximum size allowed for filtering IDs.

    pub filteringIdMaxBytes: u64,
    /// The limit on the number of contributions in the final report.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub maxContributions: Option<i64>,
}

/// Pair of reporting metadata details for a candidate URL for 'selectURL()'.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SharedStorageReportingMetadata {

    pub eventType: String,

    pub reportingUrl: String,
}

/// Bundles a candidate URL with its reporting metadata.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SharedStorageUrlWithMetadata {
    /// Spec of candidate URL.

    pub url: String,
    /// Any associated reporting metadata.

    pub reportingMetadata: Vec<SharedStorageReportingMetadata>,
}

/// Bundles the parameters for shared storage access events whose
/// presence/absence can vary according to SharedStorageAccessType.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SharedStorageAccessParams {
    /// Spec of the module script URL.
    /// Present only for SharedStorageAccessMethods: addModule and
    /// createWorklet.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub scriptSourceUrl: Option<String>,
    /// String denoting "context-origin", "script-origin", or a custom
    /// origin to be used as the worklet's data origin.
    /// Present only for SharedStorageAccessMethod: createWorklet.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub dataOrigin: Option<String>,
    /// Name of the registered operation to be run.
    /// Present only for SharedStorageAccessMethods: run and selectURL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub operationName: Option<String>,
    /// ID of the operation call.
    /// Present only for SharedStorageAccessMethods: run and selectURL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub operationId: Option<String>,
    /// Whether or not to keep the worket alive for future run or selectURL
    /// calls.
    /// Present only for SharedStorageAccessMethods: run and selectURL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub keepAlive: Option<bool>,
    /// Configures the private aggregation options.
    /// Present only for SharedStorageAccessMethods: run and selectURL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub privateAggregationConfig: Option<SharedStoragePrivateAggregationConfig>,
    /// The operation's serialized data in bytes (converted to a string).
    /// Present only for SharedStorageAccessMethods: run and selectURL.
    /// TODO(crbug.com/401011862): Consider updating this parameter to binary.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub serializedData: Option<String>,
    /// Array of candidate URLs' specs, along with any associated metadata.
    /// Present only for SharedStorageAccessMethod: selectURL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub urlsWithMetadata: Option<Vec<SharedStorageUrlWithMetadata>>,
    /// Spec of the URN:UUID generated for a selectURL call.
    /// Present only for SharedStorageAccessMethod: selectURL.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub urnUuid: Option<String>,
    /// Key for a specific entry in an origin's shared storage.
    /// Present only for SharedStorageAccessMethods: set, append, delete, and
    /// get.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub key: Option<String>,
    /// Value for a specific entry in an origin's shared storage.
    /// Present only for SharedStorageAccessMethods: set and append.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    /// Whether or not to set an entry for a key if that key is already present.
    /// Present only for SharedStorageAccessMethod: set.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub ignoreIfPresent: Option<bool>,
    /// A number denoting the (0-based) order of the worklet's
    /// creation relative to all other shared storage worklets created by
    /// documents using the current storage partition.
    /// Present only for SharedStorageAccessMethods: addModule, createWorklet.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub workletOrdinal: Option<i64>,
    /// Hex representation of the DevTools token used as the TargetID for the
    /// associated shared storage worklet.
    /// Present only for SharedStorageAccessMethods: addModule, createWorklet,
    /// run, selectURL, and any other SharedStorageAccessMethod when the
    /// SharedStorageAccessScope is sharedStorageWorklet.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub workletTargetId: Option<crate::target::TargetID>,
    /// Name of the lock to be acquired, if present.
    /// Optionally present only for SharedStorageAccessMethods: batchUpdate,
    /// set, append, delete, and clear.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub withLock: Option<String>,
    /// If the method has been called as part of a batchUpdate, then this
    /// number identifies the batch to which it belongs.
    /// Optionally present only for SharedStorageAccessMethods:
    /// batchUpdate (required), set, append, delete, and clear.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub batchUpdateId: Option<String>,
    /// Number of modifier methods sent in batch.
    /// Present only for SharedStorageAccessMethod: batchUpdate.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub batchSize: Option<u64>,
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum StorageBucketsDurability {
    #[default]
    Relaxed,
    Strict,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StorageBucket {

    pub storageKey: SerializedStorageKey,
    /// If not specified, it is the default bucket of the storageKey.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StorageBucketInfo {

    pub bucket: StorageBucket,

    pub id: String,

    pub expiration: crate::network::TimeSinceEpoch,
    /// Storage quota (bytes).

    pub quota: f64,

    pub persistent: bool,

    pub durability: StorageBucketsDurability,
}

/// A single Related Website Set object.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RelatedWebsiteSet {
    /// The primary site of this set, along with the ccTLDs if there is any.

    pub primarySites: Vec<String>,
    /// The associated sites of this set, along with the ccTLDs if there is any.

    pub associatedSites: Vec<String>,
    /// The service sites of this set, along with the ccTLDs if there is any.

    pub serviceSites: Vec<String>,
}

/// Returns a storage key given a frame id.
/// Deprecated. Please use Storage.getStorageKey instead.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetStorageKeyForFrameParams {

    pub frameId: crate::page::FrameId,
}

/// Returns a storage key given a frame id.
/// Deprecated. Please use Storage.getStorageKey instead.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetStorageKeyForFrameReturns {

    pub storageKey: SerializedStorageKey,
}

impl GetStorageKeyForFrameParams { pub const METHOD: &'static str = "Storage.getStorageKeyForFrame"; }

impl crate::CdpCommand for GetStorageKeyForFrameParams {
    const METHOD: &'static str = "Storage.getStorageKeyForFrame";
    type Response = GetStorageKeyForFrameReturns;
}

/// Returns storage key for the given frame. If no frame ID is provided,
/// the storage key of the target executing this command is returned.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetStorageKeyParams {

    #[serde(skip_serializing_if = "Option::is_none")]
    pub frameId: Option<crate::page::FrameId>,
}

/// Returns storage key for the given frame. If no frame ID is provided,
/// the storage key of the target executing this command is returned.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetStorageKeyReturns {

    pub storageKey: SerializedStorageKey,
}

impl GetStorageKeyParams { pub const METHOD: &'static str = "Storage.getStorageKey"; }

impl crate::CdpCommand for GetStorageKeyParams {
    const METHOD: &'static str = "Storage.getStorageKey";
    type Response = GetStorageKeyReturns;
}

/// Clears storage for origin.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearDataForOriginParams {
    /// Security origin.

    pub origin: String,
    /// Comma separated list of StorageType to clear.

    pub storageTypes: String,
}

impl ClearDataForOriginParams { pub const METHOD: &'static str = "Storage.clearDataForOrigin"; }

impl crate::CdpCommand for ClearDataForOriginParams {
    const METHOD: &'static str = "Storage.clearDataForOrigin";
    type Response = crate::EmptyReturns;
}

/// Clears storage for storage key.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearDataForStorageKeyParams {
    /// Storage key.

    pub storageKey: String,
    /// Comma separated list of StorageType to clear.

    pub storageTypes: String,
}

impl ClearDataForStorageKeyParams { pub const METHOD: &'static str = "Storage.clearDataForStorageKey"; }

impl crate::CdpCommand for ClearDataForStorageKeyParams {
    const METHOD: &'static str = "Storage.clearDataForStorageKey";
    type Response = crate::EmptyReturns;
}

/// Returns all browser cookies.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetCookiesParams {
    /// Browser context to use when called on the browser endpoint.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub browserContextId: Option<crate::browser::BrowserContextID>,
}

/// Returns all browser cookies.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetCookiesReturns {
    /// Array of cookie objects.

    pub cookies: Vec<crate::network::Cookie>,
}

impl GetCookiesParams { pub const METHOD: &'static str = "Storage.getCookies"; }

impl crate::CdpCommand for GetCookiesParams {
    const METHOD: &'static str = "Storage.getCookies";
    type Response = GetCookiesReturns;
}

/// Sets given cookies.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetCookiesParams {
    /// Cookies to be set.

    pub cookies: Vec<crate::network::CookieParam>,
    /// Browser context to use when called on the browser endpoint.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub browserContextId: Option<crate::browser::BrowserContextID>,
}

impl SetCookiesParams { pub const METHOD: &'static str = "Storage.setCookies"; }

impl crate::CdpCommand for SetCookiesParams {
    const METHOD: &'static str = "Storage.setCookies";
    type Response = crate::EmptyReturns;
}

/// Clears cookies.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearCookiesParams {
    /// Browser context to use when called on the browser endpoint.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub browserContextId: Option<crate::browser::BrowserContextID>,
}

impl ClearCookiesParams { pub const METHOD: &'static str = "Storage.clearCookies"; }

impl crate::CdpCommand for ClearCookiesParams {
    const METHOD: &'static str = "Storage.clearCookies";
    type Response = crate::EmptyReturns;
}

/// Returns usage and quota in bytes.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetUsageAndQuotaParams {
    /// Security origin.

    pub origin: String,
}

/// Returns usage and quota in bytes.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetUsageAndQuotaReturns {
    /// Storage usage (bytes).

    pub usage: f64,
    /// Storage quota (bytes).

    pub quota: f64,
    /// Whether or not the origin has an active storage quota override

    pub overrideActive: bool,
    /// Storage usage per type (bytes).

    pub usageBreakdown: Vec<UsageForType>,
}

impl GetUsageAndQuotaParams { pub const METHOD: &'static str = "Storage.getUsageAndQuota"; }

impl crate::CdpCommand for GetUsageAndQuotaParams {
    const METHOD: &'static str = "Storage.getUsageAndQuota";
    type Response = GetUsageAndQuotaReturns;
}

/// Override quota for the specified origin

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct OverrideQuotaForOriginParams {
    /// Security origin.

    pub origin: String,
    /// The quota size (in bytes) to override the original quota with.
    /// If this is called multiple times, the overridden quota will be equal to
    /// the quotaSize provided in the final call. If this is called without
    /// specifying a quotaSize, the quota will be reset to the default value for
    /// the specified origin. If this is called multiple times with different
    /// origins, the override will be maintained for each origin until it is
    /// disabled (called without a quotaSize).

    #[serde(skip_serializing_if = "Option::is_none")]
    pub quotaSize: Option<f64>,
}

impl OverrideQuotaForOriginParams { pub const METHOD: &'static str = "Storage.overrideQuotaForOrigin"; }

impl crate::CdpCommand for OverrideQuotaForOriginParams {
    const METHOD: &'static str = "Storage.overrideQuotaForOrigin";
    type Response = crate::EmptyReturns;
}

/// Registers origin to be notified when an update occurs to its cache storage list.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrackCacheStorageForOriginParams {
    /// Security origin.

    pub origin: String,
}

impl TrackCacheStorageForOriginParams { pub const METHOD: &'static str = "Storage.trackCacheStorageForOrigin"; }

impl crate::CdpCommand for TrackCacheStorageForOriginParams {
    const METHOD: &'static str = "Storage.trackCacheStorageForOrigin";
    type Response = crate::EmptyReturns;
}

/// Registers storage key to be notified when an update occurs to its cache storage list.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrackCacheStorageForStorageKeyParams {
    /// Storage key.

    pub storageKey: String,
}

impl TrackCacheStorageForStorageKeyParams { pub const METHOD: &'static str = "Storage.trackCacheStorageForStorageKey"; }

impl crate::CdpCommand for TrackCacheStorageForStorageKeyParams {
    const METHOD: &'static str = "Storage.trackCacheStorageForStorageKey";
    type Response = crate::EmptyReturns;
}

/// Registers origin to be notified when an update occurs to its IndexedDB.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrackIndexedDBForOriginParams {
    /// Security origin.

    pub origin: String,
}

impl TrackIndexedDBForOriginParams { pub const METHOD: &'static str = "Storage.trackIndexedDBForOrigin"; }

impl crate::CdpCommand for TrackIndexedDBForOriginParams {
    const METHOD: &'static str = "Storage.trackIndexedDBForOrigin";
    type Response = crate::EmptyReturns;
}

/// Registers storage key to be notified when an update occurs to its IndexedDB.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrackIndexedDBForStorageKeyParams {
    /// Storage key.

    pub storageKey: String,
}

impl TrackIndexedDBForStorageKeyParams { pub const METHOD: &'static str = "Storage.trackIndexedDBForStorageKey"; }

impl crate::CdpCommand for TrackIndexedDBForStorageKeyParams {
    const METHOD: &'static str = "Storage.trackIndexedDBForStorageKey";
    type Response = crate::EmptyReturns;
}

/// Unregisters origin from receiving notifications for cache storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UntrackCacheStorageForOriginParams {
    /// Security origin.

    pub origin: String,
}

impl UntrackCacheStorageForOriginParams { pub const METHOD: &'static str = "Storage.untrackCacheStorageForOrigin"; }

impl crate::CdpCommand for UntrackCacheStorageForOriginParams {
    const METHOD: &'static str = "Storage.untrackCacheStorageForOrigin";
    type Response = crate::EmptyReturns;
}

/// Unregisters storage key from receiving notifications for cache storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UntrackCacheStorageForStorageKeyParams {
    /// Storage key.

    pub storageKey: String,
}

impl UntrackCacheStorageForStorageKeyParams { pub const METHOD: &'static str = "Storage.untrackCacheStorageForStorageKey"; }

impl crate::CdpCommand for UntrackCacheStorageForStorageKeyParams {
    const METHOD: &'static str = "Storage.untrackCacheStorageForStorageKey";
    type Response = crate::EmptyReturns;
}

/// Unregisters origin from receiving notifications for IndexedDB.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UntrackIndexedDBForOriginParams {
    /// Security origin.

    pub origin: String,
}

impl UntrackIndexedDBForOriginParams { pub const METHOD: &'static str = "Storage.untrackIndexedDBForOrigin"; }

impl crate::CdpCommand for UntrackIndexedDBForOriginParams {
    const METHOD: &'static str = "Storage.untrackIndexedDBForOrigin";
    type Response = crate::EmptyReturns;
}

/// Unregisters storage key from receiving notifications for IndexedDB.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UntrackIndexedDBForStorageKeyParams {
    /// Storage key.

    pub storageKey: String,
}

impl UntrackIndexedDBForStorageKeyParams { pub const METHOD: &'static str = "Storage.untrackIndexedDBForStorageKey"; }

impl crate::CdpCommand for UntrackIndexedDBForStorageKeyParams {
    const METHOD: &'static str = "Storage.untrackIndexedDBForStorageKey";
    type Response = crate::EmptyReturns;
}

/// Returns the number of stored Trust Tokens per issuer for the
/// current browsing context.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetTrustTokensReturns {

    pub tokens: Vec<TrustTokens>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetTrustTokensParams {}

impl GetTrustTokensParams { pub const METHOD: &'static str = "Storage.getTrustTokens"; }

impl crate::CdpCommand for GetTrustTokensParams {
    const METHOD: &'static str = "Storage.getTrustTokens";
    type Response = GetTrustTokensReturns;
}

/// Removes all Trust Tokens issued by the provided issuerOrigin.
/// Leaves other stored data, including the issuer's Redemption Records, intact.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearTrustTokensParams {

    pub issuerOrigin: String,
}

/// Removes all Trust Tokens issued by the provided issuerOrigin.
/// Leaves other stored data, including the issuer's Redemption Records, intact.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearTrustTokensReturns {
    /// True if any tokens were deleted, false otherwise.

    pub didDeleteTokens: bool,
}

impl ClearTrustTokensParams { pub const METHOD: &'static str = "Storage.clearTrustTokens"; }

impl crate::CdpCommand for ClearTrustTokensParams {
    const METHOD: &'static str = "Storage.clearTrustTokens";
    type Response = ClearTrustTokensReturns;
}

/// Gets details for a named interest group.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetInterestGroupDetailsParams {

    pub ownerOrigin: String,

    pub name: String,
}

/// Gets details for a named interest group.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetInterestGroupDetailsReturns {
    /// This largely corresponds to:
    /// https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup
    /// but has absolute expirationTime instead of relative lifetimeMs and
    /// also adds joiningOrigin.

    pub details: serde_json::Map<String, JsonValue>,
}

impl GetInterestGroupDetailsParams { pub const METHOD: &'static str = "Storage.getInterestGroupDetails"; }

impl crate::CdpCommand for GetInterestGroupDetailsParams {
    const METHOD: &'static str = "Storage.getInterestGroupDetails";
    type Response = GetInterestGroupDetailsReturns;
}

/// Enables/Disables issuing of interestGroupAccessed events.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetInterestGroupTrackingParams {

    pub enable: bool,
}

impl SetInterestGroupTrackingParams { pub const METHOD: &'static str = "Storage.setInterestGroupTracking"; }

impl crate::CdpCommand for SetInterestGroupTrackingParams {
    const METHOD: &'static str = "Storage.setInterestGroupTracking";
    type Response = crate::EmptyReturns;
}

/// Enables/Disables issuing of interestGroupAuctionEventOccurred and
/// interestGroupAuctionNetworkRequestCreated.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetInterestGroupAuctionTrackingParams {

    pub enable: bool,
}

impl SetInterestGroupAuctionTrackingParams { pub const METHOD: &'static str = "Storage.setInterestGroupAuctionTracking"; }

impl crate::CdpCommand for SetInterestGroupAuctionTrackingParams {
    const METHOD: &'static str = "Storage.setInterestGroupAuctionTracking";
    type Response = crate::EmptyReturns;
}

/// Gets metadata for an origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSharedStorageMetadataParams {

    pub ownerOrigin: String,
}

/// Gets metadata for an origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSharedStorageMetadataReturns {

    pub metadata: SharedStorageMetadata,
}

impl GetSharedStorageMetadataParams { pub const METHOD: &'static str = "Storage.getSharedStorageMetadata"; }

impl crate::CdpCommand for GetSharedStorageMetadataParams {
    const METHOD: &'static str = "Storage.getSharedStorageMetadata";
    type Response = GetSharedStorageMetadataReturns;
}

/// Gets the entries in an given origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSharedStorageEntriesParams {

    pub ownerOrigin: String,
}

/// Gets the entries in an given origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetSharedStorageEntriesReturns {

    pub entries: Vec<SharedStorageEntry>,
}

impl GetSharedStorageEntriesParams { pub const METHOD: &'static str = "Storage.getSharedStorageEntries"; }

impl crate::CdpCommand for GetSharedStorageEntriesParams {
    const METHOD: &'static str = "Storage.getSharedStorageEntries";
    type Response = GetSharedStorageEntriesReturns;
}

/// Sets entry with 'key' and 'value' for a given origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSharedStorageEntryParams {

    pub ownerOrigin: String,

    pub key: String,

    pub value: String,
    /// If 'ignoreIfPresent' is included and true, then only sets the entry if
    /// 'key' doesn't already exist.

    #[serde(skip_serializing_if = "Option::is_none")]
    pub ignoreIfPresent: Option<bool>,
}

impl SetSharedStorageEntryParams { pub const METHOD: &'static str = "Storage.setSharedStorageEntry"; }

impl crate::CdpCommand for SetSharedStorageEntryParams {
    const METHOD: &'static str = "Storage.setSharedStorageEntry";
    type Response = crate::EmptyReturns;
}

/// Deletes entry for 'key' (if it exists) for a given origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeleteSharedStorageEntryParams {

    pub ownerOrigin: String,

    pub key: String,
}

impl DeleteSharedStorageEntryParams { pub const METHOD: &'static str = "Storage.deleteSharedStorageEntry"; }

impl crate::CdpCommand for DeleteSharedStorageEntryParams {
    const METHOD: &'static str = "Storage.deleteSharedStorageEntry";
    type Response = crate::EmptyReturns;
}

/// Clears all entries for a given origin's shared storage.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearSharedStorageEntriesParams {

    pub ownerOrigin: String,
}

impl ClearSharedStorageEntriesParams { pub const METHOD: &'static str = "Storage.clearSharedStorageEntries"; }

impl crate::CdpCommand for ClearSharedStorageEntriesParams {
    const METHOD: &'static str = "Storage.clearSharedStorageEntries";
    type Response = crate::EmptyReturns;
}

/// Resets the budget for 'ownerOrigin' by clearing all budget withdrawals.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ResetSharedStorageBudgetParams {

    pub ownerOrigin: String,
}

impl ResetSharedStorageBudgetParams { pub const METHOD: &'static str = "Storage.resetSharedStorageBudget"; }

impl crate::CdpCommand for ResetSharedStorageBudgetParams {
    const METHOD: &'static str = "Storage.resetSharedStorageBudget";
    type Response = crate::EmptyReturns;
}

/// Enables/disables issuing of sharedStorageAccessed events.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetSharedStorageTrackingParams {

    pub enable: bool,
}

impl SetSharedStorageTrackingParams { pub const METHOD: &'static str = "Storage.setSharedStorageTracking"; }

impl crate::CdpCommand for SetSharedStorageTrackingParams {
    const METHOD: &'static str = "Storage.setSharedStorageTracking";
    type Response = crate::EmptyReturns;
}

/// Set tracking for a storage key's buckets.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetStorageBucketTrackingParams {

    pub storageKey: String,

    pub enable: bool,
}

impl SetStorageBucketTrackingParams { pub const METHOD: &'static str = "Storage.setStorageBucketTracking"; }

impl crate::CdpCommand for SetStorageBucketTrackingParams {
    const METHOD: &'static str = "Storage.setStorageBucketTracking";
    type Response = crate::EmptyReturns;
}

/// Deletes the Storage Bucket with the given storage key and bucket name.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeleteStorageBucketParams {

    pub bucket: StorageBucket,
}

impl DeleteStorageBucketParams { pub const METHOD: &'static str = "Storage.deleteStorageBucket"; }

impl crate::CdpCommand for DeleteStorageBucketParams {
    const METHOD: &'static str = "Storage.deleteStorageBucket";
    type Response = crate::EmptyReturns;
}

/// Deletes state for sites identified as potential bounce trackers, immediately.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RunBounceTrackingMitigationsReturns {

    pub deletedSites: Vec<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct RunBounceTrackingMitigationsParams {}

impl RunBounceTrackingMitigationsParams { pub const METHOD: &'static str = "Storage.runBounceTrackingMitigations"; }

impl crate::CdpCommand for RunBounceTrackingMitigationsParams {
    const METHOD: &'static str = "Storage.runBounceTrackingMitigations";
    type Response = RunBounceTrackingMitigationsReturns;
}

/// Returns the effective Related Website Sets in use by this profile for the browser
/// session. The effective Related Website Sets will not change during a browser session.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetRelatedWebsiteSetsReturns {

    pub sets: Vec<RelatedWebsiteSet>,
}

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetRelatedWebsiteSetsParams {}

impl GetRelatedWebsiteSetsParams { pub const METHOD: &'static str = "Storage.getRelatedWebsiteSets"; }

impl crate::CdpCommand for GetRelatedWebsiteSetsParams {
    const METHOD: &'static str = "Storage.getRelatedWebsiteSets";
    type Response = GetRelatedWebsiteSetsReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetProtectedAudienceKAnonymityParams {

    pub owner: String,

    pub name: String,

    pub hashes: Vec<String>,
}

impl SetProtectedAudienceKAnonymityParams { pub const METHOD: &'static str = "Storage.setProtectedAudienceKAnonymity"; }

impl crate::CdpCommand for SetProtectedAudienceKAnonymityParams {
    const METHOD: &'static str = "Storage.setProtectedAudienceKAnonymity";
    type Response = crate::EmptyReturns;
}