browser-protocol 0.1.3

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
use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
use std::borrow::Cow;


pub type RegistrationID<'a> = Cow<'a, str>;

/// ServiceWorker registration.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ServiceWorkerRegistration<'a> {
    registrationId: RegistrationID<'a>,
    scopeURL: Cow<'a, str>,
    isDeleted: bool,
}

impl<'a> ServiceWorkerRegistration<'a> {
    pub fn builder(registrationId: RegistrationID<'a>, scopeURL: impl Into<Cow<'a, str>>, isDeleted: bool) -> ServiceWorkerRegistrationBuilder<'a> {
        ServiceWorkerRegistrationBuilder {
            registrationId: registrationId,
            scopeURL: scopeURL.into(),
            isDeleted: isDeleted,
        }
    }
    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
    pub fn isDeleted(&self) -> bool { self.isDeleted }
}


pub struct ServiceWorkerRegistrationBuilder<'a> {
    registrationId: RegistrationID<'a>,
    scopeURL: Cow<'a, str>,
    isDeleted: bool,
}

impl<'a> ServiceWorkerRegistrationBuilder<'a> {
    pub fn build(self) -> ServiceWorkerRegistration<'a> {
        ServiceWorkerRegistration {
            registrationId: self.registrationId,
            scopeURL: self.scopeURL,
            isDeleted: self.isDeleted,
        }
    }
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ServiceWorkerVersionRunningStatus {
    #[default]
    #[serde(rename = "stopped")]
    Stopped,
    #[serde(rename = "starting")]
    Starting,
    #[serde(rename = "running")]
    Running,
    #[serde(rename = "stopping")]
    Stopping,
}


#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub enum ServiceWorkerVersionStatus {
    #[default]
    #[serde(rename = "new")]
    New,
    #[serde(rename = "installing")]
    Installing,
    #[serde(rename = "installed")]
    Installed,
    #[serde(rename = "activating")]
    Activating,
    #[serde(rename = "activated")]
    Activated,
    #[serde(rename = "redundant")]
    Redundant,
}

/// ServiceWorker version.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ServiceWorkerVersion<'a> {
    versionId: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    scriptURL: Cow<'a, str>,
    runningStatus: ServiceWorkerVersionRunningStatus,
    status: ServiceWorkerVersionStatus,
    /// The Last-Modified header value of the main script.
    #[serde(skip_serializing_if = "Option::is_none")]
    scriptLastModified: Option<f64>,
    /// The time at which the response headers of the main script were received from the server.
    /// For cached script it is the last time the cache entry was validated.
    #[serde(skip_serializing_if = "Option::is_none")]
    scriptResponseTime: Option<f64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    controlledClients: Option<Vec<crate::target::TargetID<'a>>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    targetId: Option<crate::target::TargetID<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    routerRules: Option<Cow<'a, str>>,
}

impl<'a> ServiceWorkerVersion<'a> {
    pub fn builder(versionId: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, scriptURL: impl Into<Cow<'a, str>>, runningStatus: ServiceWorkerVersionRunningStatus, status: ServiceWorkerVersionStatus) -> ServiceWorkerVersionBuilder<'a> {
        ServiceWorkerVersionBuilder {
            versionId: versionId.into(),
            registrationId: registrationId,
            scriptURL: scriptURL.into(),
            runningStatus: runningStatus,
            status: status,
            scriptLastModified: None,
            scriptResponseTime: None,
            controlledClients: None,
            targetId: None,
            routerRules: None,
        }
    }
    pub fn versionId(&self) -> &str { self.versionId.as_ref() }
    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
    pub fn scriptURL(&self) -> &str { self.scriptURL.as_ref() }
    pub fn runningStatus(&self) -> &ServiceWorkerVersionRunningStatus { &self.runningStatus }
    pub fn status(&self) -> &ServiceWorkerVersionStatus { &self.status }
    pub fn scriptLastModified(&self) -> Option<f64> { self.scriptLastModified }
    pub fn scriptResponseTime(&self) -> Option<f64> { self.scriptResponseTime }
    pub fn controlledClients(&self) -> Option<&[crate::target::TargetID<'a>]> { self.controlledClients.as_deref() }
    pub fn targetId(&self) -> Option<&crate::target::TargetID<'a>> { self.targetId.as_ref() }
    pub fn routerRules(&self) -> Option<&str> { self.routerRules.as_deref() }
}


pub struct ServiceWorkerVersionBuilder<'a> {
    versionId: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    scriptURL: Cow<'a, str>,
    runningStatus: ServiceWorkerVersionRunningStatus,
    status: ServiceWorkerVersionStatus,
    scriptLastModified: Option<f64>,
    scriptResponseTime: Option<f64>,
    controlledClients: Option<Vec<crate::target::TargetID<'a>>>,
    targetId: Option<crate::target::TargetID<'a>>,
    routerRules: Option<Cow<'a, str>>,
}

impl<'a> ServiceWorkerVersionBuilder<'a> {
    /// The Last-Modified header value of the main script.
    pub fn scriptLastModified(mut self, scriptLastModified: f64) -> Self { self.scriptLastModified = Some(scriptLastModified); self }
    /// The time at which the response headers of the main script were received from the server.
    /// For cached script it is the last time the cache entry was validated.
    pub fn scriptResponseTime(mut self, scriptResponseTime: f64) -> Self { self.scriptResponseTime = Some(scriptResponseTime); self }
    pub fn controlledClients(mut self, controlledClients: Vec<crate::target::TargetID<'a>>) -> Self { self.controlledClients = Some(controlledClients); self }
    pub fn targetId(mut self, targetId: crate::target::TargetID<'a>) -> Self { self.targetId = Some(targetId); self }
    pub fn routerRules(mut self, routerRules: impl Into<Cow<'a, str>>) -> Self { self.routerRules = Some(routerRules.into()); self }
    pub fn build(self) -> ServiceWorkerVersion<'a> {
        ServiceWorkerVersion {
            versionId: self.versionId,
            registrationId: self.registrationId,
            scriptURL: self.scriptURL,
            runningStatus: self.runningStatus,
            status: self.status,
            scriptLastModified: self.scriptLastModified,
            scriptResponseTime: self.scriptResponseTime,
            controlledClients: self.controlledClients,
            targetId: self.targetId,
            routerRules: self.routerRules,
        }
    }
}

/// ServiceWorker error message.

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ServiceWorkerErrorMessage<'a> {
    errorMessage: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    versionId: Cow<'a, str>,
    sourceURL: Cow<'a, str>,
    lineNumber: i64,
    columnNumber: i64,
}

impl<'a> ServiceWorkerErrorMessage<'a> {
    pub fn builder(errorMessage: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, versionId: impl Into<Cow<'a, str>>, sourceURL: impl Into<Cow<'a, str>>, lineNumber: i64, columnNumber: i64) -> ServiceWorkerErrorMessageBuilder<'a> {
        ServiceWorkerErrorMessageBuilder {
            errorMessage: errorMessage.into(),
            registrationId: registrationId,
            versionId: versionId.into(),
            sourceURL: sourceURL.into(),
            lineNumber: lineNumber,
            columnNumber: columnNumber,
        }
    }
    pub fn errorMessage(&self) -> &str { self.errorMessage.as_ref() }
    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
    pub fn versionId(&self) -> &str { self.versionId.as_ref() }
    pub fn sourceURL(&self) -> &str { self.sourceURL.as_ref() }
    pub fn lineNumber(&self) -> i64 { self.lineNumber }
    pub fn columnNumber(&self) -> i64 { self.columnNumber }
}


pub struct ServiceWorkerErrorMessageBuilder<'a> {
    errorMessage: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    versionId: Cow<'a, str>,
    sourceURL: Cow<'a, str>,
    lineNumber: i64,
    columnNumber: i64,
}

impl<'a> ServiceWorkerErrorMessageBuilder<'a> {
    pub fn build(self) -> ServiceWorkerErrorMessage<'a> {
        ServiceWorkerErrorMessage {
            errorMessage: self.errorMessage,
            registrationId: self.registrationId,
            versionId: self.versionId,
            sourceURL: self.sourceURL,
            lineNumber: self.lineNumber,
            columnNumber: self.columnNumber,
        }
    }
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeliverPushMessageParams<'a> {
    origin: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    data: Cow<'a, str>,
}

impl<'a> DeliverPushMessageParams<'a> {
    pub fn builder(origin: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, data: impl Into<Cow<'a, str>>) -> DeliverPushMessageParamsBuilder<'a> {
        DeliverPushMessageParamsBuilder {
            origin: origin.into(),
            registrationId: registrationId,
            data: data.into(),
        }
    }
    pub fn origin(&self) -> &str { self.origin.as_ref() }
    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
    pub fn data(&self) -> &str { self.data.as_ref() }
}


pub struct DeliverPushMessageParamsBuilder<'a> {
    origin: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    data: Cow<'a, str>,
}

impl<'a> DeliverPushMessageParamsBuilder<'a> {
    pub fn build(self) -> DeliverPushMessageParams<'a> {
        DeliverPushMessageParams {
            origin: self.origin,
            registrationId: self.registrationId,
            data: self.data,
        }
    }
}

impl<'a> DeliverPushMessageParams<'a> { pub const METHOD: &'static str = "ServiceWorker.deliverPushMessage"; }

impl<'a> crate::CdpCommand<'a> for DeliverPushMessageParams<'a> {
    const METHOD: &'static str = "ServiceWorker.deliverPushMessage";
    type Response = crate::EmptyReturns;
}

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

impl DisableParams { pub const METHOD: &'static str = "ServiceWorker.disable"; }

impl<'a> crate::CdpCommand<'a> for DisableParams {
    const METHOD: &'static str = "ServiceWorker.disable";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DispatchSyncEventParams<'a> {
    origin: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    tag: Cow<'a, str>,
    lastChance: bool,
}

impl<'a> DispatchSyncEventParams<'a> {
    pub fn builder(origin: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, tag: impl Into<Cow<'a, str>>, lastChance: bool) -> DispatchSyncEventParamsBuilder<'a> {
        DispatchSyncEventParamsBuilder {
            origin: origin.into(),
            registrationId: registrationId,
            tag: tag.into(),
            lastChance: lastChance,
        }
    }
    pub fn origin(&self) -> &str { self.origin.as_ref() }
    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
    pub fn tag(&self) -> &str { self.tag.as_ref() }
    pub fn lastChance(&self) -> bool { self.lastChance }
}


pub struct DispatchSyncEventParamsBuilder<'a> {
    origin: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    tag: Cow<'a, str>,
    lastChance: bool,
}

impl<'a> DispatchSyncEventParamsBuilder<'a> {
    pub fn build(self) -> DispatchSyncEventParams<'a> {
        DispatchSyncEventParams {
            origin: self.origin,
            registrationId: self.registrationId,
            tag: self.tag,
            lastChance: self.lastChance,
        }
    }
}

impl<'a> DispatchSyncEventParams<'a> { pub const METHOD: &'static str = "ServiceWorker.dispatchSyncEvent"; }

impl<'a> crate::CdpCommand<'a> for DispatchSyncEventParams<'a> {
    const METHOD: &'static str = "ServiceWorker.dispatchSyncEvent";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DispatchPeriodicSyncEventParams<'a> {
    origin: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    tag: Cow<'a, str>,
}

impl<'a> DispatchPeriodicSyncEventParams<'a> {
    pub fn builder(origin: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, tag: impl Into<Cow<'a, str>>) -> DispatchPeriodicSyncEventParamsBuilder<'a> {
        DispatchPeriodicSyncEventParamsBuilder {
            origin: origin.into(),
            registrationId: registrationId,
            tag: tag.into(),
        }
    }
    pub fn origin(&self) -> &str { self.origin.as_ref() }
    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
    pub fn tag(&self) -> &str { self.tag.as_ref() }
}


pub struct DispatchPeriodicSyncEventParamsBuilder<'a> {
    origin: Cow<'a, str>,
    registrationId: RegistrationID<'a>,
    tag: Cow<'a, str>,
}

impl<'a> DispatchPeriodicSyncEventParamsBuilder<'a> {
    pub fn build(self) -> DispatchPeriodicSyncEventParams<'a> {
        DispatchPeriodicSyncEventParams {
            origin: self.origin,
            registrationId: self.registrationId,
            tag: self.tag,
        }
    }
}

impl<'a> DispatchPeriodicSyncEventParams<'a> { pub const METHOD: &'static str = "ServiceWorker.dispatchPeriodicSyncEvent"; }

impl<'a> crate::CdpCommand<'a> for DispatchPeriodicSyncEventParams<'a> {
    const METHOD: &'static str = "ServiceWorker.dispatchPeriodicSyncEvent";
    type Response = crate::EmptyReturns;
}

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

impl EnableParams { pub const METHOD: &'static str = "ServiceWorker.enable"; }

impl<'a> crate::CdpCommand<'a> for EnableParams {
    const METHOD: &'static str = "ServiceWorker.enable";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetForceUpdateOnPageLoadParams {
    forceUpdateOnPageLoad: bool,
}

impl SetForceUpdateOnPageLoadParams {
    pub fn builder(forceUpdateOnPageLoad: bool) -> SetForceUpdateOnPageLoadParamsBuilder {
        SetForceUpdateOnPageLoadParamsBuilder {
            forceUpdateOnPageLoad: forceUpdateOnPageLoad,
        }
    }
    pub fn forceUpdateOnPageLoad(&self) -> bool { self.forceUpdateOnPageLoad }
}


pub struct SetForceUpdateOnPageLoadParamsBuilder {
    forceUpdateOnPageLoad: bool,
}

impl SetForceUpdateOnPageLoadParamsBuilder {
    pub fn build(self) -> SetForceUpdateOnPageLoadParams {
        SetForceUpdateOnPageLoadParams {
            forceUpdateOnPageLoad: self.forceUpdateOnPageLoad,
        }
    }
}

impl SetForceUpdateOnPageLoadParams { pub const METHOD: &'static str = "ServiceWorker.setForceUpdateOnPageLoad"; }

impl<'a> crate::CdpCommand<'a> for SetForceUpdateOnPageLoadParams {
    const METHOD: &'static str = "ServiceWorker.setForceUpdateOnPageLoad";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SkipWaitingParams<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> SkipWaitingParams<'a> {
    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> SkipWaitingParamsBuilder<'a> {
        SkipWaitingParamsBuilder {
            scopeURL: scopeURL.into(),
        }
    }
    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
}


pub struct SkipWaitingParamsBuilder<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> SkipWaitingParamsBuilder<'a> {
    pub fn build(self) -> SkipWaitingParams<'a> {
        SkipWaitingParams {
            scopeURL: self.scopeURL,
        }
    }
}

impl<'a> SkipWaitingParams<'a> { pub const METHOD: &'static str = "ServiceWorker.skipWaiting"; }

impl<'a> crate::CdpCommand<'a> for SkipWaitingParams<'a> {
    const METHOD: &'static str = "ServiceWorker.skipWaiting";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StartWorkerParams<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> StartWorkerParams<'a> {
    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> StartWorkerParamsBuilder<'a> {
        StartWorkerParamsBuilder {
            scopeURL: scopeURL.into(),
        }
    }
    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
}


pub struct StartWorkerParamsBuilder<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> StartWorkerParamsBuilder<'a> {
    pub fn build(self) -> StartWorkerParams<'a> {
        StartWorkerParams {
            scopeURL: self.scopeURL,
        }
    }
}

impl<'a> StartWorkerParams<'a> { pub const METHOD: &'static str = "ServiceWorker.startWorker"; }

impl<'a> crate::CdpCommand<'a> for StartWorkerParams<'a> {
    const METHOD: &'static str = "ServiceWorker.startWorker";
    type Response = crate::EmptyReturns;
}

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

impl StopAllWorkersParams { pub const METHOD: &'static str = "ServiceWorker.stopAllWorkers"; }

impl<'a> crate::CdpCommand<'a> for StopAllWorkersParams {
    const METHOD: &'static str = "ServiceWorker.stopAllWorkers";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct StopWorkerParams<'a> {
    versionId: Cow<'a, str>,
}

impl<'a> StopWorkerParams<'a> {
    pub fn builder(versionId: impl Into<Cow<'a, str>>) -> StopWorkerParamsBuilder<'a> {
        StopWorkerParamsBuilder {
            versionId: versionId.into(),
        }
    }
    pub fn versionId(&self) -> &str { self.versionId.as_ref() }
}


pub struct StopWorkerParamsBuilder<'a> {
    versionId: Cow<'a, str>,
}

impl<'a> StopWorkerParamsBuilder<'a> {
    pub fn build(self) -> StopWorkerParams<'a> {
        StopWorkerParams {
            versionId: self.versionId,
        }
    }
}

impl<'a> StopWorkerParams<'a> { pub const METHOD: &'static str = "ServiceWorker.stopWorker"; }

impl<'a> crate::CdpCommand<'a> for StopWorkerParams<'a> {
    const METHOD: &'static str = "ServiceWorker.stopWorker";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UnregisterParams<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> UnregisterParams<'a> {
    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> UnregisterParamsBuilder<'a> {
        UnregisterParamsBuilder {
            scopeURL: scopeURL.into(),
        }
    }
    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
}


pub struct UnregisterParamsBuilder<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> UnregisterParamsBuilder<'a> {
    pub fn build(self) -> UnregisterParams<'a> {
        UnregisterParams {
            scopeURL: self.scopeURL,
        }
    }
}

impl<'a> UnregisterParams<'a> { pub const METHOD: &'static str = "ServiceWorker.unregister"; }

impl<'a> crate::CdpCommand<'a> for UnregisterParams<'a> {
    const METHOD: &'static str = "ServiceWorker.unregister";
    type Response = crate::EmptyReturns;
}


#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct UpdateRegistrationParams<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> UpdateRegistrationParams<'a> {
    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> UpdateRegistrationParamsBuilder<'a> {
        UpdateRegistrationParamsBuilder {
            scopeURL: scopeURL.into(),
        }
    }
    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
}


pub struct UpdateRegistrationParamsBuilder<'a> {
    scopeURL: Cow<'a, str>,
}

impl<'a> UpdateRegistrationParamsBuilder<'a> {
    pub fn build(self) -> UpdateRegistrationParams<'a> {
        UpdateRegistrationParams {
            scopeURL: self.scopeURL,
        }
    }
}

impl<'a> UpdateRegistrationParams<'a> { pub const METHOD: &'static str = "ServiceWorker.updateRegistration"; }

impl<'a> crate::CdpCommand<'a> for UpdateRegistrationParams<'a> {
    const METHOD: &'static str = "ServiceWorker.updateRegistration";
    type Response = crate::EmptyReturns;
}