rustenium-cdp-definitions 0.1.1

Generated Chrome DevTools Protocol type definitions for Rustenium
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
use super::commands::*;
impl AwaitPromise {
    pub fn builder() -> AwaitPromiseBuilder {
        <AwaitPromiseBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct AwaitPromiseBuilder {
    promise_object_id: Option<super::types::RemoteObjectId>,
    return_by_value: Option<bool>,
    generate_preview: Option<bool>,
}
impl AwaitPromiseBuilder {
    pub fn promise_object_id(
        mut self,
        promise_object_id: impl Into<super::types::RemoteObjectId>,
    ) -> Self {
        self.promise_object_id = Some(promise_object_id.into());
        self
    }
    pub fn return_by_value(mut self, return_by_value: impl Into<bool>) -> Self {
        self.return_by_value = Some(return_by_value.into());
        self
    }
    pub fn generate_preview(mut self, generate_preview: impl Into<bool>) -> Self {
        self.generate_preview = Some(generate_preview.into());
        self
    }
    pub fn build(self) -> Result<AwaitPromise, String> {
        Ok(AwaitPromise {
            method: AwaitPromiseMethod::AwaitPromise,
            params: AwaitPromiseParams {
                promise_object_id: self.promise_object_id.ok_or_else(|| {
                    format!(
                        "Field `{}` is mandatory.",
                        std::stringify!(promise_object_id)
                    )
                })?,
                return_by_value: self.return_by_value,
                generate_preview: self.generate_preview,
            },
        })
    }
}
impl CallFunctionOn {
    pub fn builder() -> CallFunctionOnBuilder {
        <CallFunctionOnBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct CallFunctionOnBuilder {
    function_declaration: Option<String>,
    object_id: Option<super::types::RemoteObjectId>,
    arguments: Option<Vec<super::types::CallArgument>>,
    silent: Option<bool>,
    return_by_value: Option<bool>,
    generate_preview: Option<bool>,
    user_gesture: Option<bool>,
    await_promise: Option<bool>,
    execution_context_id: Option<super::types::ExecutionContextId>,
    object_group: Option<String>,
    throw_on_side_effect: Option<bool>,
    unique_context_id: Option<String>,
    serialization_options: Option<super::types::SerializationOptions>,
}
impl CallFunctionOnBuilder {
    pub fn function_declaration(mut self, function_declaration: impl Into<String>) -> Self {
        self.function_declaration = Some(function_declaration.into());
        self
    }
    pub fn object_id(mut self, object_id: impl Into<super::types::RemoteObjectId>) -> Self {
        self.object_id = Some(object_id.into());
        self
    }
    pub fn argument(mut self, argument: impl Into<super::types::CallArgument>) -> Self {
        let v = self.arguments.get_or_insert(Vec::new());
        v.push(argument.into());
        self
    }
    pub fn arguments<I, S>(mut self, arguments: I) -> Self
    where
        I: IntoIterator<Item = S>,
        S: Into<super::types::CallArgument>,
    {
        let v = self.arguments.get_or_insert(Vec::new());
        for val in arguments {
            v.push(val.into());
        }
        self
    }
    pub fn silent(mut self, silent: impl Into<bool>) -> Self {
        self.silent = Some(silent.into());
        self
    }
    pub fn return_by_value(mut self, return_by_value: impl Into<bool>) -> Self {
        self.return_by_value = Some(return_by_value.into());
        self
    }
    pub fn generate_preview(mut self, generate_preview: impl Into<bool>) -> Self {
        self.generate_preview = Some(generate_preview.into());
        self
    }
    pub fn user_gesture(mut self, user_gesture: impl Into<bool>) -> Self {
        self.user_gesture = Some(user_gesture.into());
        self
    }
    pub fn await_promise(mut self, await_promise: impl Into<bool>) -> Self {
        self.await_promise = Some(await_promise.into());
        self
    }
    pub fn execution_context_id(
        mut self,
        execution_context_id: impl Into<super::types::ExecutionContextId>,
    ) -> Self {
        self.execution_context_id = Some(execution_context_id.into());
        self
    }
    pub fn object_group(mut self, object_group: impl Into<String>) -> Self {
        self.object_group = Some(object_group.into());
        self
    }
    pub fn throw_on_side_effect(mut self, throw_on_side_effect: impl Into<bool>) -> Self {
        self.throw_on_side_effect = Some(throw_on_side_effect.into());
        self
    }
    pub fn unique_context_id(mut self, unique_context_id: impl Into<String>) -> Self {
        self.unique_context_id = Some(unique_context_id.into());
        self
    }
    pub fn serialization_options(
        mut self,
        serialization_options: impl Into<super::types::SerializationOptions>,
    ) -> Self {
        self.serialization_options = Some(serialization_options.into());
        self
    }
    pub fn build(self) -> Result<CallFunctionOn, String> {
        Ok(CallFunctionOn {
            method: CallFunctionOnMethod::CallFunctionOn,
            params: CallFunctionOnParams {
                function_declaration: self.function_declaration.ok_or_else(|| {
                    format!(
                        "Field `{}` is mandatory.",
                        std::stringify!(function_declaration)
                    )
                })?,
                object_id: self.object_id,
                arguments: self.arguments,
                silent: self.silent,
                return_by_value: self.return_by_value,
                generate_preview: self.generate_preview,
                user_gesture: self.user_gesture,
                await_promise: self.await_promise,
                execution_context_id: self.execution_context_id,
                object_group: self.object_group,
                throw_on_side_effect: self.throw_on_side_effect,
                unique_context_id: self.unique_context_id,
                serialization_options: self.serialization_options,
            },
        })
    }
}
impl CompileScript {
    pub fn builder() -> CompileScriptBuilder {
        <CompileScriptBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct CompileScriptBuilder {
    expression: Option<String>,
    source_url: Option<String>,
    persist_script: Option<bool>,
    execution_context_id: Option<super::types::ExecutionContextId>,
}
impl CompileScriptBuilder {
    pub fn expression(mut self, expression: impl Into<String>) -> Self {
        self.expression = Some(expression.into());
        self
    }
    pub fn source_url(mut self, source_url: impl Into<String>) -> Self {
        self.source_url = Some(source_url.into());
        self
    }
    pub fn persist_script(mut self, persist_script: impl Into<bool>) -> Self {
        self.persist_script = Some(persist_script.into());
        self
    }
    pub fn execution_context_id(
        mut self,
        execution_context_id: impl Into<super::types::ExecutionContextId>,
    ) -> Self {
        self.execution_context_id = Some(execution_context_id.into());
        self
    }
    pub fn build(self) -> Result<CompileScript, String> {
        Ok(CompileScript {
            method: CompileScriptMethod::CompileScript,
            params: CompileScriptParams {
                expression: self.expression.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(expression))
                })?,
                source_url: self.source_url.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(source_url))
                })?,
                persist_script: self.persist_script.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(persist_script))
                })?,
                execution_context_id: self.execution_context_id,
            },
        })
    }
}
#[derive(Debug, Clone, Default)]
pub struct DisableBuilder;
impl DisableBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> Disable {
        Disable {
            method: DisableMethod::Disable,
            params: DisableParams {},
        }
    }
}
impl Disable {
    pub fn builder() -> DisableBuilder {
        DisableBuilder
    }
}
#[derive(Debug, Clone, Default)]
pub struct DiscardConsoleEntriesBuilder;
impl DiscardConsoleEntriesBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> DiscardConsoleEntries {
        DiscardConsoleEntries {
            method: DiscardConsoleEntriesMethod::DiscardConsoleEntries,
            params: DiscardConsoleEntriesParams {},
        }
    }
}
impl DiscardConsoleEntries {
    pub fn builder() -> DiscardConsoleEntriesBuilder {
        DiscardConsoleEntriesBuilder
    }
}
#[derive(Debug, Clone, Default)]
pub struct EnableBuilder;
impl EnableBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> Enable {
        Enable {
            method: EnableMethod::Enable,
            params: EnableParams {},
        }
    }
}
impl Enable {
    pub fn builder() -> EnableBuilder {
        EnableBuilder
    }
}
impl Evaluate {
    pub fn builder() -> EvaluateBuilder {
        <EvaluateBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct EvaluateBuilder {
    expression: Option<String>,
    object_group: Option<String>,
    include_command_line_api: Option<bool>,
    silent: Option<bool>,
    context_id: Option<super::types::ExecutionContextId>,
    return_by_value: Option<bool>,
    generate_preview: Option<bool>,
    user_gesture: Option<bool>,
    await_promise: Option<bool>,
    throw_on_side_effect: Option<bool>,
    timeout: Option<super::types::TimeDelta>,
    disable_breaks: Option<bool>,
    repl_mode: Option<bool>,
    allow_unsafe_eval_blocked_by_csp: Option<bool>,
    unique_context_id: Option<String>,
    serialization_options: Option<super::types::SerializationOptions>,
}
impl EvaluateBuilder {
    pub fn expression(mut self, expression: impl Into<String>) -> Self {
        self.expression = Some(expression.into());
        self
    }
    pub fn object_group(mut self, object_group: impl Into<String>) -> Self {
        self.object_group = Some(object_group.into());
        self
    }
    pub fn include_command_line_api(mut self, include_command_line_api: impl Into<bool>) -> Self {
        self.include_command_line_api = Some(include_command_line_api.into());
        self
    }
    pub fn silent(mut self, silent: impl Into<bool>) -> Self {
        self.silent = Some(silent.into());
        self
    }
    pub fn context_id(mut self, context_id: impl Into<super::types::ExecutionContextId>) -> Self {
        self.context_id = Some(context_id.into());
        self
    }
    pub fn return_by_value(mut self, return_by_value: impl Into<bool>) -> Self {
        self.return_by_value = Some(return_by_value.into());
        self
    }
    pub fn generate_preview(mut self, generate_preview: impl Into<bool>) -> Self {
        self.generate_preview = Some(generate_preview.into());
        self
    }
    pub fn user_gesture(mut self, user_gesture: impl Into<bool>) -> Self {
        self.user_gesture = Some(user_gesture.into());
        self
    }
    pub fn await_promise(mut self, await_promise: impl Into<bool>) -> Self {
        self.await_promise = Some(await_promise.into());
        self
    }
    pub fn throw_on_side_effect(mut self, throw_on_side_effect: impl Into<bool>) -> Self {
        self.throw_on_side_effect = Some(throw_on_side_effect.into());
        self
    }
    pub fn timeout(mut self, timeout: impl Into<super::types::TimeDelta>) -> Self {
        self.timeout = Some(timeout.into());
        self
    }
    pub fn disable_breaks(mut self, disable_breaks: impl Into<bool>) -> Self {
        self.disable_breaks = Some(disable_breaks.into());
        self
    }
    pub fn repl_mode(mut self, repl_mode: impl Into<bool>) -> Self {
        self.repl_mode = Some(repl_mode.into());
        self
    }
    pub fn allow_unsafe_eval_blocked_by_csp(
        mut self,
        allow_unsafe_eval_blocked_by_csp: impl Into<bool>,
    ) -> Self {
        self.allow_unsafe_eval_blocked_by_csp = Some(allow_unsafe_eval_blocked_by_csp.into());
        self
    }
    pub fn unique_context_id(mut self, unique_context_id: impl Into<String>) -> Self {
        self.unique_context_id = Some(unique_context_id.into());
        self
    }
    pub fn serialization_options(
        mut self,
        serialization_options: impl Into<super::types::SerializationOptions>,
    ) -> Self {
        self.serialization_options = Some(serialization_options.into());
        self
    }
    pub fn build(self) -> Result<Evaluate, String> {
        Ok(Evaluate {
            method: EvaluateMethod::Evaluate,
            params: EvaluateParams {
                expression: self.expression.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(expression))
                })?,
                object_group: self.object_group,
                include_command_line_api: self.include_command_line_api,
                silent: self.silent,
                context_id: self.context_id,
                return_by_value: self.return_by_value,
                generate_preview: self.generate_preview,
                user_gesture: self.user_gesture,
                await_promise: self.await_promise,
                throw_on_side_effect: self.throw_on_side_effect,
                timeout: self.timeout,
                disable_breaks: self.disable_breaks,
                repl_mode: self.repl_mode,
                allow_unsafe_eval_blocked_by_csp: self.allow_unsafe_eval_blocked_by_csp,
                unique_context_id: self.unique_context_id,
                serialization_options: self.serialization_options,
            },
        })
    }
}
#[derive(Debug, Clone, Default)]
pub struct GetIsolateIdBuilder;
impl GetIsolateIdBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> GetIsolateId {
        GetIsolateId {
            method: GetIsolateIdMethod::GetIsolateId,
            params: GetIsolateIdParams {},
        }
    }
}
impl GetIsolateId {
    pub fn builder() -> GetIsolateIdBuilder {
        GetIsolateIdBuilder
    }
}
#[derive(Debug, Clone, Default)]
pub struct GetHeapUsageBuilder;
impl GetHeapUsageBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> GetHeapUsage {
        GetHeapUsage {
            method: GetHeapUsageMethod::GetHeapUsage,
            params: GetHeapUsageParams {},
        }
    }
}
impl GetHeapUsage {
    pub fn builder() -> GetHeapUsageBuilder {
        GetHeapUsageBuilder
    }
}
impl GetProperties {
    pub fn builder() -> GetPropertiesBuilder {
        <GetPropertiesBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct GetPropertiesBuilder {
    object_id: Option<super::types::RemoteObjectId>,
    own_properties: Option<bool>,
    accessor_properties_only: Option<bool>,
    generate_preview: Option<bool>,
    non_indexed_properties_only: Option<bool>,
}
impl GetPropertiesBuilder {
    pub fn object_id(mut self, object_id: impl Into<super::types::RemoteObjectId>) -> Self {
        self.object_id = Some(object_id.into());
        self
    }
    pub fn own_properties(mut self, own_properties: impl Into<bool>) -> Self {
        self.own_properties = Some(own_properties.into());
        self
    }
    pub fn accessor_properties_only(mut self, accessor_properties_only: impl Into<bool>) -> Self {
        self.accessor_properties_only = Some(accessor_properties_only.into());
        self
    }
    pub fn generate_preview(mut self, generate_preview: impl Into<bool>) -> Self {
        self.generate_preview = Some(generate_preview.into());
        self
    }
    pub fn non_indexed_properties_only(
        mut self,
        non_indexed_properties_only: impl Into<bool>,
    ) -> Self {
        self.non_indexed_properties_only = Some(non_indexed_properties_only.into());
        self
    }
    pub fn build(self) -> Result<GetProperties, String> {
        Ok(GetProperties {
            method: GetPropertiesMethod::GetProperties,
            params: GetPropertiesParams {
                object_id: self.object_id.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(object_id))
                })?,
                own_properties: self.own_properties,
                accessor_properties_only: self.accessor_properties_only,
                generate_preview: self.generate_preview,
                non_indexed_properties_only: self.non_indexed_properties_only,
            },
        })
    }
}
impl GlobalLexicalScopeNames {
    pub fn builder() -> GlobalLexicalScopeNamesBuilder {
        <GlobalLexicalScopeNamesBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct GlobalLexicalScopeNamesBuilder {
    execution_context_id: Option<super::types::ExecutionContextId>,
}
impl GlobalLexicalScopeNamesBuilder {
    pub fn execution_context_id(
        mut self,
        execution_context_id: impl Into<super::types::ExecutionContextId>,
    ) -> Self {
        self.execution_context_id = Some(execution_context_id.into());
        self
    }
    pub fn build(self) -> GlobalLexicalScopeNames {
        GlobalLexicalScopeNames {
            method: GlobalLexicalScopeNamesMethod::GlobalLexicalScopeNames,
            params: GlobalLexicalScopeNamesParams {
                execution_context_id: self.execution_context_id,
            },
        }
    }
}
impl QueryObjects {
    pub fn builder() -> QueryObjectsBuilder {
        <QueryObjectsBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct QueryObjectsBuilder {
    prototype_object_id: Option<super::types::RemoteObjectId>,
    object_group: Option<String>,
}
impl QueryObjectsBuilder {
    pub fn prototype_object_id(
        mut self,
        prototype_object_id: impl Into<super::types::RemoteObjectId>,
    ) -> Self {
        self.prototype_object_id = Some(prototype_object_id.into());
        self
    }
    pub fn object_group(mut self, object_group: impl Into<String>) -> Self {
        self.object_group = Some(object_group.into());
        self
    }
    pub fn build(self) -> Result<QueryObjects, String> {
        Ok(QueryObjects {
            method: QueryObjectsMethod::QueryObjects,
            params: QueryObjectsParams {
                prototype_object_id: self.prototype_object_id.ok_or_else(|| {
                    format!(
                        "Field `{}` is mandatory.",
                        std::stringify!(prototype_object_id)
                    )
                })?,
                object_group: self.object_group,
            },
        })
    }
}
impl ReleaseObject {
    pub fn builder() -> ReleaseObjectBuilder {
        <ReleaseObjectBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct ReleaseObjectBuilder {
    object_id: Option<super::types::RemoteObjectId>,
}
impl ReleaseObjectBuilder {
    pub fn object_id(mut self, object_id: impl Into<super::types::RemoteObjectId>) -> Self {
        self.object_id = Some(object_id.into());
        self
    }
    pub fn build(self) -> Result<ReleaseObject, String> {
        Ok(ReleaseObject {
            method: ReleaseObjectMethod::ReleaseObject,
            params: ReleaseObjectParams {
                object_id: self.object_id.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(object_id))
                })?,
            },
        })
    }
}
impl ReleaseObjectGroup {
    pub fn builder() -> ReleaseObjectGroupBuilder {
        <ReleaseObjectGroupBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct ReleaseObjectGroupBuilder {
    object_group: Option<String>,
}
impl ReleaseObjectGroupBuilder {
    pub fn object_group(mut self, object_group: impl Into<String>) -> Self {
        self.object_group = Some(object_group.into());
        self
    }
    pub fn build(self) -> Result<ReleaseObjectGroup, String> {
        Ok(ReleaseObjectGroup {
            method: ReleaseObjectGroupMethod::ReleaseObjectGroup,
            params: ReleaseObjectGroupParams {
                object_group: self.object_group.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(object_group))
                })?,
            },
        })
    }
}
#[derive(Debug, Clone, Default)]
pub struct RunIfWaitingForDebuggerBuilder;
impl RunIfWaitingForDebuggerBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> RunIfWaitingForDebugger {
        RunIfWaitingForDebugger {
            method: RunIfWaitingForDebuggerMethod::RunIfWaitingForDebugger,
            params: RunIfWaitingForDebuggerParams {},
        }
    }
}
impl RunIfWaitingForDebugger {
    pub fn builder() -> RunIfWaitingForDebuggerBuilder {
        RunIfWaitingForDebuggerBuilder
    }
}
impl RunScript {
    pub fn builder() -> RunScriptBuilder {
        <RunScriptBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct RunScriptBuilder {
    script_id: Option<super::types::ScriptId>,
    execution_context_id: Option<super::types::ExecutionContextId>,
    object_group: Option<String>,
    silent: Option<bool>,
    include_command_line_api: Option<bool>,
    return_by_value: Option<bool>,
    generate_preview: Option<bool>,
    await_promise: Option<bool>,
}
impl RunScriptBuilder {
    pub fn script_id(mut self, script_id: impl Into<super::types::ScriptId>) -> Self {
        self.script_id = Some(script_id.into());
        self
    }
    pub fn execution_context_id(
        mut self,
        execution_context_id: impl Into<super::types::ExecutionContextId>,
    ) -> Self {
        self.execution_context_id = Some(execution_context_id.into());
        self
    }
    pub fn object_group(mut self, object_group: impl Into<String>) -> Self {
        self.object_group = Some(object_group.into());
        self
    }
    pub fn silent(mut self, silent: impl Into<bool>) -> Self {
        self.silent = Some(silent.into());
        self
    }
    pub fn include_command_line_api(mut self, include_command_line_api: impl Into<bool>) -> Self {
        self.include_command_line_api = Some(include_command_line_api.into());
        self
    }
    pub fn return_by_value(mut self, return_by_value: impl Into<bool>) -> Self {
        self.return_by_value = Some(return_by_value.into());
        self
    }
    pub fn generate_preview(mut self, generate_preview: impl Into<bool>) -> Self {
        self.generate_preview = Some(generate_preview.into());
        self
    }
    pub fn await_promise(mut self, await_promise: impl Into<bool>) -> Self {
        self.await_promise = Some(await_promise.into());
        self
    }
    pub fn build(self) -> Result<RunScript, String> {
        Ok(RunScript {
            method: RunScriptMethod::RunScript,
            params: RunScriptParams {
                script_id: self.script_id.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(script_id))
                })?,
                execution_context_id: self.execution_context_id,
                object_group: self.object_group,
                silent: self.silent,
                include_command_line_api: self.include_command_line_api,
                return_by_value: self.return_by_value,
                generate_preview: self.generate_preview,
                await_promise: self.await_promise,
            },
        })
    }
}
impl SetAsyncCallStackDepth {
    pub fn builder() -> SetAsyncCallStackDepthBuilder {
        <SetAsyncCallStackDepthBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct SetAsyncCallStackDepthBuilder {
    max_depth: Option<i64>,
}
impl SetAsyncCallStackDepthBuilder {
    pub fn max_depth(mut self, max_depth: impl Into<i64>) -> Self {
        self.max_depth = Some(max_depth.into());
        self
    }
    pub fn build(self) -> Result<SetAsyncCallStackDepth, String> {
        Ok(SetAsyncCallStackDepth {
            method: SetAsyncCallStackDepthMethod::SetAsyncCallStackDepth,
            params: SetAsyncCallStackDepthParams {
                max_depth: self.max_depth.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(max_depth))
                })?,
            },
        })
    }
}
impl SetCustomObjectFormatterEnabled {
    pub fn builder() -> SetCustomObjectFormatterEnabledBuilder {
        <SetCustomObjectFormatterEnabledBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct SetCustomObjectFormatterEnabledBuilder {
    enabled: Option<bool>,
}
impl SetCustomObjectFormatterEnabledBuilder {
    pub fn enabled(mut self, enabled: impl Into<bool>) -> Self {
        self.enabled = Some(enabled.into());
        self
    }
    pub fn build(self) -> Result<SetCustomObjectFormatterEnabled, String> {
        Ok(SetCustomObjectFormatterEnabled {
            method: SetCustomObjectFormatterEnabledMethod::SetCustomObjectFormatterEnabled,
            params: SetCustomObjectFormatterEnabledParams {
                enabled: self
                    .enabled
                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(enabled)))?,
            },
        })
    }
}
impl SetMaxCallStackSizeToCapture {
    pub fn builder() -> SetMaxCallStackSizeToCaptureBuilder {
        <SetMaxCallStackSizeToCaptureBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct SetMaxCallStackSizeToCaptureBuilder {
    size: Option<i64>,
}
impl SetMaxCallStackSizeToCaptureBuilder {
    pub fn size(mut self, size: impl Into<i64>) -> Self {
        self.size = Some(size.into());
        self
    }
    pub fn build(self) -> Result<SetMaxCallStackSizeToCapture, String> {
        Ok(SetMaxCallStackSizeToCapture {
            method: SetMaxCallStackSizeToCaptureMethod::SetMaxCallStackSizeToCapture,
            params: SetMaxCallStackSizeToCaptureParams {
                size: self
                    .size
                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(size)))?,
            },
        })
    }
}
#[derive(Debug, Clone, Default)]
pub struct TerminateExecutionBuilder;
impl TerminateExecutionBuilder {
    pub fn new() -> Self {
        Self
    }
    pub fn build(self) -> TerminateExecution {
        TerminateExecution {
            method: TerminateExecutionMethod::TerminateExecution,
            params: TerminateExecutionParams {},
        }
    }
}
impl TerminateExecution {
    pub fn builder() -> TerminateExecutionBuilder {
        TerminateExecutionBuilder
    }
}
impl AddBinding {
    pub fn builder() -> AddBindingBuilder {
        <AddBindingBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct AddBindingBuilder {
    name: Option<String>,
    execution_context_name: Option<String>,
}
impl AddBindingBuilder {
    pub fn name(mut self, name: impl Into<String>) -> Self {
        self.name = Some(name.into());
        self
    }
    pub fn execution_context_name(mut self, execution_context_name: impl Into<String>) -> Self {
        self.execution_context_name = Some(execution_context_name.into());
        self
    }
    pub fn build(self) -> Result<AddBinding, String> {
        Ok(AddBinding {
            method: AddBindingMethod::AddBinding,
            params: AddBindingParams {
                name: self
                    .name
                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(name)))?,
                execution_context_name: self.execution_context_name,
            },
        })
    }
}
impl RemoveBinding {
    pub fn builder() -> RemoveBindingBuilder {
        <RemoveBindingBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct RemoveBindingBuilder {
    name: Option<String>,
}
impl RemoveBindingBuilder {
    pub fn name(mut self, name: impl Into<String>) -> Self {
        self.name = Some(name.into());
        self
    }
    pub fn build(self) -> Result<RemoveBinding, String> {
        Ok(RemoveBinding {
            method: RemoveBindingMethod::RemoveBinding,
            params: RemoveBindingParams {
                name: self
                    .name
                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(name)))?,
            },
        })
    }
}
impl GetExceptionDetails {
    pub fn builder() -> GetExceptionDetailsBuilder {
        <GetExceptionDetailsBuilder as Default>::default()
    }
}
#[derive(Default, Clone)]
pub struct GetExceptionDetailsBuilder {
    error_object_id: Option<super::types::RemoteObjectId>,
}
impl GetExceptionDetailsBuilder {
    pub fn error_object_id(
        mut self,
        error_object_id: impl Into<super::types::RemoteObjectId>,
    ) -> Self {
        self.error_object_id = Some(error_object_id.into());
        self
    }
    pub fn build(self) -> Result<GetExceptionDetails, String> {
        Ok(GetExceptionDetails {
            method: GetExceptionDetailsMethod::GetExceptionDetails,
            params: GetExceptionDetailsParams {
                error_object_id: self.error_object_id.ok_or_else(|| {
                    format!("Field `{}` is mandatory.", std::stringify!(error_object_id))
                })?,
            },
        })
    }
}