Skip to main content

browser_protocol/serviceworker/
mod.rs

1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3use std::borrow::Cow;
4
5
6pub type RegistrationID<'a> = Cow<'a, str>;
7
8/// ServiceWorker registration.
9
10#[derive(Debug, Clone, Serialize, Deserialize, Default)]
11#[serde(rename_all = "camelCase")]
12pub struct ServiceWorkerRegistration<'a> {
13    registrationId: RegistrationID<'a>,
14    scopeURL: Cow<'a, str>,
15    isDeleted: bool,
16}
17
18impl<'a> ServiceWorkerRegistration<'a> {
19    pub fn builder(registrationId: RegistrationID<'a>, scopeURL: impl Into<Cow<'a, str>>, isDeleted: bool) -> ServiceWorkerRegistrationBuilder<'a> {
20        ServiceWorkerRegistrationBuilder {
21            registrationId: registrationId,
22            scopeURL: scopeURL.into(),
23            isDeleted: isDeleted,
24        }
25    }
26    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
27    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
28    pub fn isDeleted(&self) -> bool { self.isDeleted }
29}
30
31
32pub struct ServiceWorkerRegistrationBuilder<'a> {
33    registrationId: RegistrationID<'a>,
34    scopeURL: Cow<'a, str>,
35    isDeleted: bool,
36}
37
38impl<'a> ServiceWorkerRegistrationBuilder<'a> {
39    pub fn build(self) -> ServiceWorkerRegistration<'a> {
40        ServiceWorkerRegistration {
41            registrationId: self.registrationId,
42            scopeURL: self.scopeURL,
43            isDeleted: self.isDeleted,
44        }
45    }
46}
47
48
49#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
50pub enum ServiceWorkerVersionRunningStatus {
51    #[default]
52    #[serde(rename = "stopped")]
53    Stopped,
54    #[serde(rename = "starting")]
55    Starting,
56    #[serde(rename = "running")]
57    Running,
58    #[serde(rename = "stopping")]
59    Stopping,
60}
61
62
63#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
64pub enum ServiceWorkerVersionStatus {
65    #[default]
66    #[serde(rename = "new")]
67    New,
68    #[serde(rename = "installing")]
69    Installing,
70    #[serde(rename = "installed")]
71    Installed,
72    #[serde(rename = "activating")]
73    Activating,
74    #[serde(rename = "activated")]
75    Activated,
76    #[serde(rename = "redundant")]
77    Redundant,
78}
79
80/// ServiceWorker version.
81
82#[derive(Debug, Clone, Serialize, Deserialize, Default)]
83#[serde(rename_all = "camelCase")]
84pub struct ServiceWorkerVersion<'a> {
85    versionId: Cow<'a, str>,
86    registrationId: RegistrationID<'a>,
87    scriptURL: Cow<'a, str>,
88    runningStatus: ServiceWorkerVersionRunningStatus,
89    status: ServiceWorkerVersionStatus,
90    /// The Last-Modified header value of the main script.
91    #[serde(skip_serializing_if = "Option::is_none")]
92    scriptLastModified: Option<f64>,
93    /// The time at which the response headers of the main script were received from the server.
94    /// For cached script it is the last time the cache entry was validated.
95    #[serde(skip_serializing_if = "Option::is_none")]
96    scriptResponseTime: Option<f64>,
97    #[serde(skip_serializing_if = "Option::is_none")]
98    controlledClients: Option<Vec<crate::target::TargetID<'a>>>,
99    #[serde(skip_serializing_if = "Option::is_none")]
100    targetId: Option<crate::target::TargetID<'a>>,
101    #[serde(skip_serializing_if = "Option::is_none")]
102    routerRules: Option<Cow<'a, str>>,
103}
104
105impl<'a> ServiceWorkerVersion<'a> {
106    pub fn builder(versionId: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, scriptURL: impl Into<Cow<'a, str>>, runningStatus: ServiceWorkerVersionRunningStatus, status: ServiceWorkerVersionStatus) -> ServiceWorkerVersionBuilder<'a> {
107        ServiceWorkerVersionBuilder {
108            versionId: versionId.into(),
109            registrationId: registrationId,
110            scriptURL: scriptURL.into(),
111            runningStatus: runningStatus,
112            status: status,
113            scriptLastModified: None,
114            scriptResponseTime: None,
115            controlledClients: None,
116            targetId: None,
117            routerRules: None,
118        }
119    }
120    pub fn versionId(&self) -> &str { self.versionId.as_ref() }
121    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
122    pub fn scriptURL(&self) -> &str { self.scriptURL.as_ref() }
123    pub fn runningStatus(&self) -> &ServiceWorkerVersionRunningStatus { &self.runningStatus }
124    pub fn status(&self) -> &ServiceWorkerVersionStatus { &self.status }
125    pub fn scriptLastModified(&self) -> Option<f64> { self.scriptLastModified }
126    pub fn scriptResponseTime(&self) -> Option<f64> { self.scriptResponseTime }
127    pub fn controlledClients(&self) -> Option<&[crate::target::TargetID<'a>]> { self.controlledClients.as_deref() }
128    pub fn targetId(&self) -> Option<&crate::target::TargetID<'a>> { self.targetId.as_ref() }
129    pub fn routerRules(&self) -> Option<&str> { self.routerRules.as_deref() }
130}
131
132
133pub struct ServiceWorkerVersionBuilder<'a> {
134    versionId: Cow<'a, str>,
135    registrationId: RegistrationID<'a>,
136    scriptURL: Cow<'a, str>,
137    runningStatus: ServiceWorkerVersionRunningStatus,
138    status: ServiceWorkerVersionStatus,
139    scriptLastModified: Option<f64>,
140    scriptResponseTime: Option<f64>,
141    controlledClients: Option<Vec<crate::target::TargetID<'a>>>,
142    targetId: Option<crate::target::TargetID<'a>>,
143    routerRules: Option<Cow<'a, str>>,
144}
145
146impl<'a> ServiceWorkerVersionBuilder<'a> {
147    /// The Last-Modified header value of the main script.
148    pub fn scriptLastModified(mut self, scriptLastModified: f64) -> Self { self.scriptLastModified = Some(scriptLastModified); self }
149    /// The time at which the response headers of the main script were received from the server.
150    /// For cached script it is the last time the cache entry was validated.
151    pub fn scriptResponseTime(mut self, scriptResponseTime: f64) -> Self { self.scriptResponseTime = Some(scriptResponseTime); self }
152    pub fn controlledClients(mut self, controlledClients: Vec<crate::target::TargetID<'a>>) -> Self { self.controlledClients = Some(controlledClients); self }
153    pub fn targetId(mut self, targetId: crate::target::TargetID<'a>) -> Self { self.targetId = Some(targetId); self }
154    pub fn routerRules(mut self, routerRules: impl Into<Cow<'a, str>>) -> Self { self.routerRules = Some(routerRules.into()); self }
155    pub fn build(self) -> ServiceWorkerVersion<'a> {
156        ServiceWorkerVersion {
157            versionId: self.versionId,
158            registrationId: self.registrationId,
159            scriptURL: self.scriptURL,
160            runningStatus: self.runningStatus,
161            status: self.status,
162            scriptLastModified: self.scriptLastModified,
163            scriptResponseTime: self.scriptResponseTime,
164            controlledClients: self.controlledClients,
165            targetId: self.targetId,
166            routerRules: self.routerRules,
167        }
168    }
169}
170
171/// ServiceWorker error message.
172
173#[derive(Debug, Clone, Serialize, Deserialize, Default)]
174#[serde(rename_all = "camelCase")]
175pub struct ServiceWorkerErrorMessage<'a> {
176    errorMessage: Cow<'a, str>,
177    registrationId: RegistrationID<'a>,
178    versionId: Cow<'a, str>,
179    sourceURL: Cow<'a, str>,
180    lineNumber: i64,
181    columnNumber: i64,
182}
183
184impl<'a> ServiceWorkerErrorMessage<'a> {
185    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> {
186        ServiceWorkerErrorMessageBuilder {
187            errorMessage: errorMessage.into(),
188            registrationId: registrationId,
189            versionId: versionId.into(),
190            sourceURL: sourceURL.into(),
191            lineNumber: lineNumber,
192            columnNumber: columnNumber,
193        }
194    }
195    pub fn errorMessage(&self) -> &str { self.errorMessage.as_ref() }
196    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
197    pub fn versionId(&self) -> &str { self.versionId.as_ref() }
198    pub fn sourceURL(&self) -> &str { self.sourceURL.as_ref() }
199    pub fn lineNumber(&self) -> i64 { self.lineNumber }
200    pub fn columnNumber(&self) -> i64 { self.columnNumber }
201}
202
203
204pub struct ServiceWorkerErrorMessageBuilder<'a> {
205    errorMessage: Cow<'a, str>,
206    registrationId: RegistrationID<'a>,
207    versionId: Cow<'a, str>,
208    sourceURL: Cow<'a, str>,
209    lineNumber: i64,
210    columnNumber: i64,
211}
212
213impl<'a> ServiceWorkerErrorMessageBuilder<'a> {
214    pub fn build(self) -> ServiceWorkerErrorMessage<'a> {
215        ServiceWorkerErrorMessage {
216            errorMessage: self.errorMessage,
217            registrationId: self.registrationId,
218            versionId: self.versionId,
219            sourceURL: self.sourceURL,
220            lineNumber: self.lineNumber,
221            columnNumber: self.columnNumber,
222        }
223    }
224}
225
226
227#[derive(Debug, Clone, Serialize, Deserialize, Default)]
228#[serde(rename_all = "camelCase")]
229pub struct DeliverPushMessageParams<'a> {
230    origin: Cow<'a, str>,
231    registrationId: RegistrationID<'a>,
232    data: Cow<'a, str>,
233}
234
235impl<'a> DeliverPushMessageParams<'a> {
236    pub fn builder(origin: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, data: impl Into<Cow<'a, str>>) -> DeliverPushMessageParamsBuilder<'a> {
237        DeliverPushMessageParamsBuilder {
238            origin: origin.into(),
239            registrationId: registrationId,
240            data: data.into(),
241        }
242    }
243    pub fn origin(&self) -> &str { self.origin.as_ref() }
244    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
245    pub fn data(&self) -> &str { self.data.as_ref() }
246}
247
248
249pub struct DeliverPushMessageParamsBuilder<'a> {
250    origin: Cow<'a, str>,
251    registrationId: RegistrationID<'a>,
252    data: Cow<'a, str>,
253}
254
255impl<'a> DeliverPushMessageParamsBuilder<'a> {
256    pub fn build(self) -> DeliverPushMessageParams<'a> {
257        DeliverPushMessageParams {
258            origin: self.origin,
259            registrationId: self.registrationId,
260            data: self.data,
261        }
262    }
263}
264
265impl<'a> DeliverPushMessageParams<'a> { pub const METHOD: &'static str = "ServiceWorker.deliverPushMessage"; }
266
267impl<'a> crate::CdpCommand<'a> for DeliverPushMessageParams<'a> {
268    const METHOD: &'static str = "ServiceWorker.deliverPushMessage";
269    type Response = crate::EmptyReturns;
270}
271
272#[derive(Debug, Clone, Serialize, Deserialize, Default)]
273pub struct DisableParams {}
274
275impl DisableParams { pub const METHOD: &'static str = "ServiceWorker.disable"; }
276
277impl<'a> crate::CdpCommand<'a> for DisableParams {
278    const METHOD: &'static str = "ServiceWorker.disable";
279    type Response = crate::EmptyReturns;
280}
281
282
283#[derive(Debug, Clone, Serialize, Deserialize, Default)]
284#[serde(rename_all = "camelCase")]
285pub struct DispatchSyncEventParams<'a> {
286    origin: Cow<'a, str>,
287    registrationId: RegistrationID<'a>,
288    tag: Cow<'a, str>,
289    lastChance: bool,
290}
291
292impl<'a> DispatchSyncEventParams<'a> {
293    pub fn builder(origin: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, tag: impl Into<Cow<'a, str>>, lastChance: bool) -> DispatchSyncEventParamsBuilder<'a> {
294        DispatchSyncEventParamsBuilder {
295            origin: origin.into(),
296            registrationId: registrationId,
297            tag: tag.into(),
298            lastChance: lastChance,
299        }
300    }
301    pub fn origin(&self) -> &str { self.origin.as_ref() }
302    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
303    pub fn tag(&self) -> &str { self.tag.as_ref() }
304    pub fn lastChance(&self) -> bool { self.lastChance }
305}
306
307
308pub struct DispatchSyncEventParamsBuilder<'a> {
309    origin: Cow<'a, str>,
310    registrationId: RegistrationID<'a>,
311    tag: Cow<'a, str>,
312    lastChance: bool,
313}
314
315impl<'a> DispatchSyncEventParamsBuilder<'a> {
316    pub fn build(self) -> DispatchSyncEventParams<'a> {
317        DispatchSyncEventParams {
318            origin: self.origin,
319            registrationId: self.registrationId,
320            tag: self.tag,
321            lastChance: self.lastChance,
322        }
323    }
324}
325
326impl<'a> DispatchSyncEventParams<'a> { pub const METHOD: &'static str = "ServiceWorker.dispatchSyncEvent"; }
327
328impl<'a> crate::CdpCommand<'a> for DispatchSyncEventParams<'a> {
329    const METHOD: &'static str = "ServiceWorker.dispatchSyncEvent";
330    type Response = crate::EmptyReturns;
331}
332
333
334#[derive(Debug, Clone, Serialize, Deserialize, Default)]
335#[serde(rename_all = "camelCase")]
336pub struct DispatchPeriodicSyncEventParams<'a> {
337    origin: Cow<'a, str>,
338    registrationId: RegistrationID<'a>,
339    tag: Cow<'a, str>,
340}
341
342impl<'a> DispatchPeriodicSyncEventParams<'a> {
343    pub fn builder(origin: impl Into<Cow<'a, str>>, registrationId: RegistrationID<'a>, tag: impl Into<Cow<'a, str>>) -> DispatchPeriodicSyncEventParamsBuilder<'a> {
344        DispatchPeriodicSyncEventParamsBuilder {
345            origin: origin.into(),
346            registrationId: registrationId,
347            tag: tag.into(),
348        }
349    }
350    pub fn origin(&self) -> &str { self.origin.as_ref() }
351    pub fn registrationId(&self) -> &RegistrationID<'a> { &self.registrationId }
352    pub fn tag(&self) -> &str { self.tag.as_ref() }
353}
354
355
356pub struct DispatchPeriodicSyncEventParamsBuilder<'a> {
357    origin: Cow<'a, str>,
358    registrationId: RegistrationID<'a>,
359    tag: Cow<'a, str>,
360}
361
362impl<'a> DispatchPeriodicSyncEventParamsBuilder<'a> {
363    pub fn build(self) -> DispatchPeriodicSyncEventParams<'a> {
364        DispatchPeriodicSyncEventParams {
365            origin: self.origin,
366            registrationId: self.registrationId,
367            tag: self.tag,
368        }
369    }
370}
371
372impl<'a> DispatchPeriodicSyncEventParams<'a> { pub const METHOD: &'static str = "ServiceWorker.dispatchPeriodicSyncEvent"; }
373
374impl<'a> crate::CdpCommand<'a> for DispatchPeriodicSyncEventParams<'a> {
375    const METHOD: &'static str = "ServiceWorker.dispatchPeriodicSyncEvent";
376    type Response = crate::EmptyReturns;
377}
378
379#[derive(Debug, Clone, Serialize, Deserialize, Default)]
380pub struct EnableParams {}
381
382impl EnableParams { pub const METHOD: &'static str = "ServiceWorker.enable"; }
383
384impl<'a> crate::CdpCommand<'a> for EnableParams {
385    const METHOD: &'static str = "ServiceWorker.enable";
386    type Response = crate::EmptyReturns;
387}
388
389
390#[derive(Debug, Clone, Serialize, Deserialize, Default)]
391#[serde(rename_all = "camelCase")]
392pub struct SetForceUpdateOnPageLoadParams {
393    forceUpdateOnPageLoad: bool,
394}
395
396impl SetForceUpdateOnPageLoadParams {
397    pub fn builder(forceUpdateOnPageLoad: bool) -> SetForceUpdateOnPageLoadParamsBuilder {
398        SetForceUpdateOnPageLoadParamsBuilder {
399            forceUpdateOnPageLoad: forceUpdateOnPageLoad,
400        }
401    }
402    pub fn forceUpdateOnPageLoad(&self) -> bool { self.forceUpdateOnPageLoad }
403}
404
405
406pub struct SetForceUpdateOnPageLoadParamsBuilder {
407    forceUpdateOnPageLoad: bool,
408}
409
410impl SetForceUpdateOnPageLoadParamsBuilder {
411    pub fn build(self) -> SetForceUpdateOnPageLoadParams {
412        SetForceUpdateOnPageLoadParams {
413            forceUpdateOnPageLoad: self.forceUpdateOnPageLoad,
414        }
415    }
416}
417
418impl SetForceUpdateOnPageLoadParams { pub const METHOD: &'static str = "ServiceWorker.setForceUpdateOnPageLoad"; }
419
420impl<'a> crate::CdpCommand<'a> for SetForceUpdateOnPageLoadParams {
421    const METHOD: &'static str = "ServiceWorker.setForceUpdateOnPageLoad";
422    type Response = crate::EmptyReturns;
423}
424
425
426#[derive(Debug, Clone, Serialize, Deserialize, Default)]
427#[serde(rename_all = "camelCase")]
428pub struct SkipWaitingParams<'a> {
429    scopeURL: Cow<'a, str>,
430}
431
432impl<'a> SkipWaitingParams<'a> {
433    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> SkipWaitingParamsBuilder<'a> {
434        SkipWaitingParamsBuilder {
435            scopeURL: scopeURL.into(),
436        }
437    }
438    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
439}
440
441
442pub struct SkipWaitingParamsBuilder<'a> {
443    scopeURL: Cow<'a, str>,
444}
445
446impl<'a> SkipWaitingParamsBuilder<'a> {
447    pub fn build(self) -> SkipWaitingParams<'a> {
448        SkipWaitingParams {
449            scopeURL: self.scopeURL,
450        }
451    }
452}
453
454impl<'a> SkipWaitingParams<'a> { pub const METHOD: &'static str = "ServiceWorker.skipWaiting"; }
455
456impl<'a> crate::CdpCommand<'a> for SkipWaitingParams<'a> {
457    const METHOD: &'static str = "ServiceWorker.skipWaiting";
458    type Response = crate::EmptyReturns;
459}
460
461
462#[derive(Debug, Clone, Serialize, Deserialize, Default)]
463#[serde(rename_all = "camelCase")]
464pub struct StartWorkerParams<'a> {
465    scopeURL: Cow<'a, str>,
466}
467
468impl<'a> StartWorkerParams<'a> {
469    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> StartWorkerParamsBuilder<'a> {
470        StartWorkerParamsBuilder {
471            scopeURL: scopeURL.into(),
472        }
473    }
474    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
475}
476
477
478pub struct StartWorkerParamsBuilder<'a> {
479    scopeURL: Cow<'a, str>,
480}
481
482impl<'a> StartWorkerParamsBuilder<'a> {
483    pub fn build(self) -> StartWorkerParams<'a> {
484        StartWorkerParams {
485            scopeURL: self.scopeURL,
486        }
487    }
488}
489
490impl<'a> StartWorkerParams<'a> { pub const METHOD: &'static str = "ServiceWorker.startWorker"; }
491
492impl<'a> crate::CdpCommand<'a> for StartWorkerParams<'a> {
493    const METHOD: &'static str = "ServiceWorker.startWorker";
494    type Response = crate::EmptyReturns;
495}
496
497#[derive(Debug, Clone, Serialize, Deserialize, Default)]
498pub struct StopAllWorkersParams {}
499
500impl StopAllWorkersParams { pub const METHOD: &'static str = "ServiceWorker.stopAllWorkers"; }
501
502impl<'a> crate::CdpCommand<'a> for StopAllWorkersParams {
503    const METHOD: &'static str = "ServiceWorker.stopAllWorkers";
504    type Response = crate::EmptyReturns;
505}
506
507
508#[derive(Debug, Clone, Serialize, Deserialize, Default)]
509#[serde(rename_all = "camelCase")]
510pub struct StopWorkerParams<'a> {
511    versionId: Cow<'a, str>,
512}
513
514impl<'a> StopWorkerParams<'a> {
515    pub fn builder(versionId: impl Into<Cow<'a, str>>) -> StopWorkerParamsBuilder<'a> {
516        StopWorkerParamsBuilder {
517            versionId: versionId.into(),
518        }
519    }
520    pub fn versionId(&self) -> &str { self.versionId.as_ref() }
521}
522
523
524pub struct StopWorkerParamsBuilder<'a> {
525    versionId: Cow<'a, str>,
526}
527
528impl<'a> StopWorkerParamsBuilder<'a> {
529    pub fn build(self) -> StopWorkerParams<'a> {
530        StopWorkerParams {
531            versionId: self.versionId,
532        }
533    }
534}
535
536impl<'a> StopWorkerParams<'a> { pub const METHOD: &'static str = "ServiceWorker.stopWorker"; }
537
538impl<'a> crate::CdpCommand<'a> for StopWorkerParams<'a> {
539    const METHOD: &'static str = "ServiceWorker.stopWorker";
540    type Response = crate::EmptyReturns;
541}
542
543
544#[derive(Debug, Clone, Serialize, Deserialize, Default)]
545#[serde(rename_all = "camelCase")]
546pub struct UnregisterParams<'a> {
547    scopeURL: Cow<'a, str>,
548}
549
550impl<'a> UnregisterParams<'a> {
551    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> UnregisterParamsBuilder<'a> {
552        UnregisterParamsBuilder {
553            scopeURL: scopeURL.into(),
554        }
555    }
556    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
557}
558
559
560pub struct UnregisterParamsBuilder<'a> {
561    scopeURL: Cow<'a, str>,
562}
563
564impl<'a> UnregisterParamsBuilder<'a> {
565    pub fn build(self) -> UnregisterParams<'a> {
566        UnregisterParams {
567            scopeURL: self.scopeURL,
568        }
569    }
570}
571
572impl<'a> UnregisterParams<'a> { pub const METHOD: &'static str = "ServiceWorker.unregister"; }
573
574impl<'a> crate::CdpCommand<'a> for UnregisterParams<'a> {
575    const METHOD: &'static str = "ServiceWorker.unregister";
576    type Response = crate::EmptyReturns;
577}
578
579
580#[derive(Debug, Clone, Serialize, Deserialize, Default)]
581#[serde(rename_all = "camelCase")]
582pub struct UpdateRegistrationParams<'a> {
583    scopeURL: Cow<'a, str>,
584}
585
586impl<'a> UpdateRegistrationParams<'a> {
587    pub fn builder(scopeURL: impl Into<Cow<'a, str>>) -> UpdateRegistrationParamsBuilder<'a> {
588        UpdateRegistrationParamsBuilder {
589            scopeURL: scopeURL.into(),
590        }
591    }
592    pub fn scopeURL(&self) -> &str { self.scopeURL.as_ref() }
593}
594
595
596pub struct UpdateRegistrationParamsBuilder<'a> {
597    scopeURL: Cow<'a, str>,
598}
599
600impl<'a> UpdateRegistrationParamsBuilder<'a> {
601    pub fn build(self) -> UpdateRegistrationParams<'a> {
602        UpdateRegistrationParams {
603            scopeURL: self.scopeURL,
604        }
605    }
606}
607
608impl<'a> UpdateRegistrationParams<'a> { pub const METHOD: &'static str = "ServiceWorker.updateRegistration"; }
609
610impl<'a> crate::CdpCommand<'a> for UpdateRegistrationParams<'a> {
611    const METHOD: &'static str = "ServiceWorker.updateRegistration";
612    type Response = crate::EmptyReturns;
613}