Skip to main content

rustenium_cdp_definitions/browser_protocol/overlay/
command_builders.rs

1use super::commands::*;
2#[derive(Debug, Clone, Default)]
3pub struct DisableBuilder;
4impl DisableBuilder {
5    pub fn new() -> Self {
6        Self
7    }
8    pub fn build(self) -> Disable {
9        Disable {
10            method: DisableMethod::Disable,
11            params: DisableParams {},
12        }
13    }
14}
15impl Disable {
16    pub fn builder() -> DisableBuilder {
17        DisableBuilder
18    }
19}
20#[derive(Debug, Clone, Default)]
21pub struct EnableBuilder;
22impl EnableBuilder {
23    pub fn new() -> Self {
24        Self
25    }
26    pub fn build(self) -> Enable {
27        Enable {
28            method: EnableMethod::Enable,
29            params: EnableParams {},
30        }
31    }
32}
33impl Enable {
34    pub fn builder() -> EnableBuilder {
35        EnableBuilder
36    }
37}
38impl GetHighlightObjectForTest {
39    pub fn builder() -> GetHighlightObjectForTestBuilder {
40        <GetHighlightObjectForTestBuilder as Default>::default()
41    }
42}
43#[derive(Default, Clone)]
44pub struct GetHighlightObjectForTestBuilder {
45    node_id: Option<crate::browser_protocol::dom::types::NodeId>,
46    include_distance: Option<bool>,
47    include_style: Option<bool>,
48    color_format: Option<super::types::ColorFormat>,
49    show_accessibility_info: Option<bool>,
50}
51impl GetHighlightObjectForTestBuilder {
52    pub fn node_id(
53        mut self,
54        node_id: impl Into<crate::browser_protocol::dom::types::NodeId>,
55    ) -> Self {
56        self.node_id = Some(node_id.into());
57        self
58    }
59    pub fn include_distance(mut self, include_distance: impl Into<bool>) -> Self {
60        self.include_distance = Some(include_distance.into());
61        self
62    }
63    pub fn include_style(mut self, include_style: impl Into<bool>) -> Self {
64        self.include_style = Some(include_style.into());
65        self
66    }
67    pub fn color_format(mut self, color_format: impl Into<super::types::ColorFormat>) -> Self {
68        self.color_format = Some(color_format.into());
69        self
70    }
71    pub fn show_accessibility_info(mut self, show_accessibility_info: impl Into<bool>) -> Self {
72        self.show_accessibility_info = Some(show_accessibility_info.into());
73        self
74    }
75    pub fn build(self) -> Result<GetHighlightObjectForTest, String> {
76        Ok(GetHighlightObjectForTest {
77            method: GetHighlightObjectForTestMethod::GetHighlightObjectForTest,
78            params: GetHighlightObjectForTestParams {
79                node_id: self
80                    .node_id
81                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(node_id)))?,
82                include_distance: self.include_distance,
83                include_style: self.include_style,
84                color_format: self.color_format,
85                show_accessibility_info: self.show_accessibility_info,
86            },
87        })
88    }
89}
90impl GetGridHighlightObjectsForTest {
91    pub fn builder() -> GetGridHighlightObjectsForTestBuilder {
92        <GetGridHighlightObjectsForTestBuilder as Default>::default()
93    }
94}
95#[derive(Default, Clone)]
96pub struct GetGridHighlightObjectsForTestBuilder {
97    node_ids: Option<Vec<crate::browser_protocol::dom::types::NodeId>>,
98}
99impl GetGridHighlightObjectsForTestBuilder {
100    pub fn node_id(
101        mut self,
102        node_id: impl Into<crate::browser_protocol::dom::types::NodeId>,
103    ) -> Self {
104        let v = self.node_ids.get_or_insert(Vec::new());
105        v.push(node_id.into());
106        self
107    }
108    pub fn node_ids<I, S>(mut self, node_ids: I) -> Self
109    where
110        I: IntoIterator<Item = S>,
111        S: Into<crate::browser_protocol::dom::types::NodeId>,
112    {
113        let v = self.node_ids.get_or_insert(Vec::new());
114        for val in node_ids {
115            v.push(val.into());
116        }
117        self
118    }
119    pub fn build(self) -> Result<GetGridHighlightObjectsForTest, String> {
120        Ok(GetGridHighlightObjectsForTest {
121            method: GetGridHighlightObjectsForTestMethod::GetGridHighlightObjectsForTest,
122            params: GetGridHighlightObjectsForTestParams {
123                node_ids: self.node_ids.ok_or_else(|| {
124                    format!("Field `{}` is mandatory.", std::stringify!(node_ids))
125                })?,
126            },
127        })
128    }
129}
130impl GetSourceOrderHighlightObjectForTest {
131    pub fn builder() -> GetSourceOrderHighlightObjectForTestBuilder {
132        <GetSourceOrderHighlightObjectForTestBuilder as Default>::default()
133    }
134}
135#[derive(Default, Clone)]
136pub struct GetSourceOrderHighlightObjectForTestBuilder {
137    node_id: Option<crate::browser_protocol::dom::types::NodeId>,
138}
139impl GetSourceOrderHighlightObjectForTestBuilder {
140    pub fn node_id(
141        mut self,
142        node_id: impl Into<crate::browser_protocol::dom::types::NodeId>,
143    ) -> Self {
144        self.node_id = Some(node_id.into());
145        self
146    }
147    pub fn build(self) -> Result<GetSourceOrderHighlightObjectForTest, String> {
148        Ok(GetSourceOrderHighlightObjectForTest {
149            method:
150                GetSourceOrderHighlightObjectForTestMethod::GetSourceOrderHighlightObjectForTest,
151            params: GetSourceOrderHighlightObjectForTestParams {
152                node_id: self
153                    .node_id
154                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(node_id)))?,
155            },
156        })
157    }
158}
159#[derive(Debug, Clone, Default)]
160pub struct HideHighlightBuilder;
161impl HideHighlightBuilder {
162    pub fn new() -> Self {
163        Self
164    }
165    pub fn build(self) -> HideHighlight {
166        HideHighlight {
167            method: HideHighlightMethod::HideHighlight,
168            params: HideHighlightParams {},
169        }
170    }
171}
172impl HideHighlight {
173    pub fn builder() -> HideHighlightBuilder {
174        HideHighlightBuilder
175    }
176}
177impl HighlightNode {
178    pub fn builder() -> HighlightNodeBuilder {
179        <HighlightNodeBuilder as Default>::default()
180    }
181}
182#[derive(Default, Clone)]
183pub struct HighlightNodeBuilder {
184    highlight_config: Option<super::types::HighlightConfig>,
185    node_id: Option<crate::browser_protocol::dom::types::NodeId>,
186    backend_node_id: Option<crate::browser_protocol::dom::types::BackendNodeId>,
187    object_id: Option<crate::js_protocol::runtime::types::RemoteObjectId>,
188    selector: Option<String>,
189}
190impl HighlightNodeBuilder {
191    pub fn highlight_config(
192        mut self,
193        highlight_config: impl Into<super::types::HighlightConfig>,
194    ) -> Self {
195        self.highlight_config = Some(highlight_config.into());
196        self
197    }
198    pub fn node_id(
199        mut self,
200        node_id: impl Into<crate::browser_protocol::dom::types::NodeId>,
201    ) -> Self {
202        self.node_id = Some(node_id.into());
203        self
204    }
205    pub fn backend_node_id(
206        mut self,
207        backend_node_id: impl Into<crate::browser_protocol::dom::types::BackendNodeId>,
208    ) -> Self {
209        self.backend_node_id = Some(backend_node_id.into());
210        self
211    }
212    pub fn object_id(
213        mut self,
214        object_id: impl Into<crate::js_protocol::runtime::types::RemoteObjectId>,
215    ) -> Self {
216        self.object_id = Some(object_id.into());
217        self
218    }
219    pub fn selector(mut self, selector: impl Into<String>) -> Self {
220        self.selector = Some(selector.into());
221        self
222    }
223    pub fn build(self) -> Result<HighlightNode, String> {
224        Ok(HighlightNode {
225            method: HighlightNodeMethod::HighlightNode,
226            params: HighlightNodeParams {
227                highlight_config: self.highlight_config.ok_or_else(|| {
228                    format!(
229                        "Field `{}` is mandatory.",
230                        std::stringify!(highlight_config)
231                    )
232                })?,
233                node_id: self.node_id,
234                backend_node_id: self.backend_node_id,
235                object_id: self.object_id,
236                selector: self.selector,
237            },
238        })
239    }
240}
241impl HighlightQuad {
242    pub fn builder() -> HighlightQuadBuilder {
243        <HighlightQuadBuilder as Default>::default()
244    }
245}
246#[derive(Default, Clone)]
247pub struct HighlightQuadBuilder {
248    quad: Option<crate::browser_protocol::dom::types::Quad>,
249    color: Option<crate::browser_protocol::dom::types::Rgba>,
250    outline_color: Option<crate::browser_protocol::dom::types::Rgba>,
251}
252impl HighlightQuadBuilder {
253    pub fn quad(mut self, quad: impl Into<crate::browser_protocol::dom::types::Quad>) -> Self {
254        self.quad = Some(quad.into());
255        self
256    }
257    pub fn color(mut self, color: impl Into<crate::browser_protocol::dom::types::Rgba>) -> Self {
258        self.color = Some(color.into());
259        self
260    }
261    pub fn outline_color(
262        mut self,
263        outline_color: impl Into<crate::browser_protocol::dom::types::Rgba>,
264    ) -> Self {
265        self.outline_color = Some(outline_color.into());
266        self
267    }
268    pub fn build(self) -> Result<HighlightQuad, String> {
269        Ok(HighlightQuad {
270            method: HighlightQuadMethod::HighlightQuad,
271            params: HighlightQuadParams {
272                quad: self
273                    .quad
274                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(quad)))?,
275                color: self.color,
276                outline_color: self.outline_color,
277            },
278        })
279    }
280}
281impl HighlightRect {
282    pub fn builder() -> HighlightRectBuilder {
283        <HighlightRectBuilder as Default>::default()
284    }
285}
286#[derive(Default, Clone)]
287pub struct HighlightRectBuilder {
288    x: Option<i64>,
289    y: Option<i64>,
290    width: Option<i64>,
291    height: Option<i64>,
292    color: Option<crate::browser_protocol::dom::types::Rgba>,
293    outline_color: Option<crate::browser_protocol::dom::types::Rgba>,
294}
295impl HighlightRectBuilder {
296    pub fn x(mut self, x: impl Into<i64>) -> Self {
297        self.x = Some(x.into());
298        self
299    }
300    pub fn y(mut self, y: impl Into<i64>) -> Self {
301        self.y = Some(y.into());
302        self
303    }
304    pub fn width(mut self, width: impl Into<i64>) -> Self {
305        self.width = Some(width.into());
306        self
307    }
308    pub fn height(mut self, height: impl Into<i64>) -> Self {
309        self.height = Some(height.into());
310        self
311    }
312    pub fn color(mut self, color: impl Into<crate::browser_protocol::dom::types::Rgba>) -> Self {
313        self.color = Some(color.into());
314        self
315    }
316    pub fn outline_color(
317        mut self,
318        outline_color: impl Into<crate::browser_protocol::dom::types::Rgba>,
319    ) -> Self {
320        self.outline_color = Some(outline_color.into());
321        self
322    }
323    pub fn build(self) -> Result<HighlightRect, String> {
324        Ok(HighlightRect {
325            method: HighlightRectMethod::HighlightRect,
326            params: HighlightRectParams {
327                x: self
328                    .x
329                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(x)))?,
330                y: self
331                    .y
332                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(y)))?,
333                width: self
334                    .width
335                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(width)))?,
336                height: self
337                    .height
338                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(height)))?,
339                color: self.color,
340                outline_color: self.outline_color,
341            },
342        })
343    }
344}
345impl HighlightSourceOrder {
346    pub fn builder() -> HighlightSourceOrderBuilder {
347        <HighlightSourceOrderBuilder as Default>::default()
348    }
349}
350#[derive(Default, Clone)]
351pub struct HighlightSourceOrderBuilder {
352    source_order_config: Option<super::types::SourceOrderConfig>,
353    node_id: Option<crate::browser_protocol::dom::types::NodeId>,
354    backend_node_id: Option<crate::browser_protocol::dom::types::BackendNodeId>,
355    object_id: Option<crate::js_protocol::runtime::types::RemoteObjectId>,
356}
357impl HighlightSourceOrderBuilder {
358    pub fn source_order_config(
359        mut self,
360        source_order_config: impl Into<super::types::SourceOrderConfig>,
361    ) -> Self {
362        self.source_order_config = Some(source_order_config.into());
363        self
364    }
365    pub fn node_id(
366        mut self,
367        node_id: impl Into<crate::browser_protocol::dom::types::NodeId>,
368    ) -> Self {
369        self.node_id = Some(node_id.into());
370        self
371    }
372    pub fn backend_node_id(
373        mut self,
374        backend_node_id: impl Into<crate::browser_protocol::dom::types::BackendNodeId>,
375    ) -> Self {
376        self.backend_node_id = Some(backend_node_id.into());
377        self
378    }
379    pub fn object_id(
380        mut self,
381        object_id: impl Into<crate::js_protocol::runtime::types::RemoteObjectId>,
382    ) -> Self {
383        self.object_id = Some(object_id.into());
384        self
385    }
386    pub fn build(self) -> Result<HighlightSourceOrder, String> {
387        Ok(HighlightSourceOrder {
388            method: HighlightSourceOrderMethod::HighlightSourceOrder,
389            params: HighlightSourceOrderParams {
390                source_order_config: self.source_order_config.ok_or_else(|| {
391                    format!(
392                        "Field `{}` is mandatory.",
393                        std::stringify!(source_order_config)
394                    )
395                })?,
396                node_id: self.node_id,
397                backend_node_id: self.backend_node_id,
398                object_id: self.object_id,
399            },
400        })
401    }
402}
403impl SetInspectMode {
404    pub fn builder() -> SetInspectModeBuilder {
405        <SetInspectModeBuilder as Default>::default()
406    }
407}
408#[derive(Default, Clone)]
409pub struct SetInspectModeBuilder {
410    mode: Option<super::types::InspectMode>,
411    highlight_config: Option<super::types::HighlightConfig>,
412}
413impl SetInspectModeBuilder {
414    pub fn mode(mut self, mode: impl Into<super::types::InspectMode>) -> Self {
415        self.mode = Some(mode.into());
416        self
417    }
418    pub fn highlight_config(
419        mut self,
420        highlight_config: impl Into<super::types::HighlightConfig>,
421    ) -> Self {
422        self.highlight_config = Some(highlight_config.into());
423        self
424    }
425    pub fn build(self) -> Result<SetInspectMode, String> {
426        Ok(SetInspectMode {
427            method: SetInspectModeMethod::SetInspectMode,
428            params: SetInspectModeParams {
429                mode: self
430                    .mode
431                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(mode)))?,
432                highlight_config: self.highlight_config,
433            },
434        })
435    }
436}
437impl SetShowAdHighlights {
438    pub fn builder() -> SetShowAdHighlightsBuilder {
439        <SetShowAdHighlightsBuilder as Default>::default()
440    }
441}
442#[derive(Default, Clone)]
443pub struct SetShowAdHighlightsBuilder {
444    show: Option<bool>,
445}
446impl SetShowAdHighlightsBuilder {
447    pub fn show(mut self, show: impl Into<bool>) -> Self {
448        self.show = Some(show.into());
449        self
450    }
451    pub fn build(self) -> Result<SetShowAdHighlights, String> {
452        Ok(SetShowAdHighlights {
453            method: SetShowAdHighlightsMethod::SetShowAdHighlights,
454            params: SetShowAdHighlightsParams {
455                show: self
456                    .show
457                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(show)))?,
458            },
459        })
460    }
461}
462impl SetPausedInDebuggerMessage {
463    pub fn builder() -> SetPausedInDebuggerMessageBuilder {
464        <SetPausedInDebuggerMessageBuilder as Default>::default()
465    }
466}
467#[derive(Default, Clone)]
468pub struct SetPausedInDebuggerMessageBuilder {
469    message: Option<String>,
470}
471impl SetPausedInDebuggerMessageBuilder {
472    pub fn message(mut self, message: impl Into<String>) -> Self {
473        self.message = Some(message.into());
474        self
475    }
476    pub fn build(self) -> SetPausedInDebuggerMessage {
477        SetPausedInDebuggerMessage {
478            method: SetPausedInDebuggerMessageMethod::SetPausedInDebuggerMessage,
479            params: SetPausedInDebuggerMessageParams {
480                message: self.message,
481            },
482        }
483    }
484}
485impl SetShowDebugBorders {
486    pub fn builder() -> SetShowDebugBordersBuilder {
487        <SetShowDebugBordersBuilder as Default>::default()
488    }
489}
490#[derive(Default, Clone)]
491pub struct SetShowDebugBordersBuilder {
492    show: Option<bool>,
493}
494impl SetShowDebugBordersBuilder {
495    pub fn show(mut self, show: impl Into<bool>) -> Self {
496        self.show = Some(show.into());
497        self
498    }
499    pub fn build(self) -> Result<SetShowDebugBorders, String> {
500        Ok(SetShowDebugBorders {
501            method: SetShowDebugBordersMethod::SetShowDebugBorders,
502            params: SetShowDebugBordersParams {
503                show: self
504                    .show
505                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(show)))?,
506            },
507        })
508    }
509}
510impl SetShowFpsCounter {
511    pub fn builder() -> SetShowFpsCounterBuilder {
512        <SetShowFpsCounterBuilder as Default>::default()
513    }
514}
515#[derive(Default, Clone)]
516pub struct SetShowFpsCounterBuilder {
517    show: Option<bool>,
518}
519impl SetShowFpsCounterBuilder {
520    pub fn show(mut self, show: impl Into<bool>) -> Self {
521        self.show = Some(show.into());
522        self
523    }
524    pub fn build(self) -> Result<SetShowFpsCounter, String> {
525        Ok(SetShowFpsCounter {
526            method: SetShowFpsCounterMethod::SetShowFpsCounter,
527            params: SetShowFpsCounterParams {
528                show: self
529                    .show
530                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(show)))?,
531            },
532        })
533    }
534}
535impl SetShowGridOverlays {
536    pub fn builder() -> SetShowGridOverlaysBuilder {
537        <SetShowGridOverlaysBuilder as Default>::default()
538    }
539}
540#[derive(Default, Clone)]
541pub struct SetShowGridOverlaysBuilder {
542    grid_node_highlight_configs: Option<Vec<super::types::GridNodeHighlightConfig>>,
543}
544impl SetShowGridOverlaysBuilder {
545    pub fn grid_node_highlight_config(
546        mut self,
547        grid_node_highlight_config: impl Into<super::types::GridNodeHighlightConfig>,
548    ) -> Self {
549        let v = self.grid_node_highlight_configs.get_or_insert(Vec::new());
550        v.push(grid_node_highlight_config.into());
551        self
552    }
553    pub fn grid_node_highlight_configs<I, S>(mut self, grid_node_highlight_configs: I) -> Self
554    where
555        I: IntoIterator<Item = S>,
556        S: Into<super::types::GridNodeHighlightConfig>,
557    {
558        let v = self.grid_node_highlight_configs.get_or_insert(Vec::new());
559        for val in grid_node_highlight_configs {
560            v.push(val.into());
561        }
562        self
563    }
564    pub fn build(self) -> Result<SetShowGridOverlays, String> {
565        Ok(SetShowGridOverlays {
566            method: SetShowGridOverlaysMethod::SetShowGridOverlays,
567            params: SetShowGridOverlaysParams {
568                grid_node_highlight_configs: self.grid_node_highlight_configs.ok_or_else(|| {
569                    format!(
570                        "Field `{}` is mandatory.",
571                        std::stringify!(grid_node_highlight_configs)
572                    )
573                })?,
574            },
575        })
576    }
577}
578impl SetShowFlexOverlays {
579    pub fn builder() -> SetShowFlexOverlaysBuilder {
580        <SetShowFlexOverlaysBuilder as Default>::default()
581    }
582}
583#[derive(Default, Clone)]
584pub struct SetShowFlexOverlaysBuilder {
585    flex_node_highlight_configs: Option<Vec<super::types::FlexNodeHighlightConfig>>,
586}
587impl SetShowFlexOverlaysBuilder {
588    pub fn flex_node_highlight_config(
589        mut self,
590        flex_node_highlight_config: impl Into<super::types::FlexNodeHighlightConfig>,
591    ) -> Self {
592        let v = self.flex_node_highlight_configs.get_or_insert(Vec::new());
593        v.push(flex_node_highlight_config.into());
594        self
595    }
596    pub fn flex_node_highlight_configs<I, S>(mut self, flex_node_highlight_configs: I) -> Self
597    where
598        I: IntoIterator<Item = S>,
599        S: Into<super::types::FlexNodeHighlightConfig>,
600    {
601        let v = self.flex_node_highlight_configs.get_or_insert(Vec::new());
602        for val in flex_node_highlight_configs {
603            v.push(val.into());
604        }
605        self
606    }
607    pub fn build(self) -> Result<SetShowFlexOverlays, String> {
608        Ok(SetShowFlexOverlays {
609            method: SetShowFlexOverlaysMethod::SetShowFlexOverlays,
610            params: SetShowFlexOverlaysParams {
611                flex_node_highlight_configs: self.flex_node_highlight_configs.ok_or_else(|| {
612                    format!(
613                        "Field `{}` is mandatory.",
614                        std::stringify!(flex_node_highlight_configs)
615                    )
616                })?,
617            },
618        })
619    }
620}
621impl SetShowScrollSnapOverlays {
622    pub fn builder() -> SetShowScrollSnapOverlaysBuilder {
623        <SetShowScrollSnapOverlaysBuilder as Default>::default()
624    }
625}
626#[derive(Default, Clone)]
627pub struct SetShowScrollSnapOverlaysBuilder {
628    scroll_snap_highlight_configs: Option<Vec<super::types::ScrollSnapHighlightConfig>>,
629}
630impl SetShowScrollSnapOverlaysBuilder {
631    pub fn scroll_snap_highlight_config(
632        mut self,
633        scroll_snap_highlight_config: impl Into<super::types::ScrollSnapHighlightConfig>,
634    ) -> Self {
635        let v = self.scroll_snap_highlight_configs.get_or_insert(Vec::new());
636        v.push(scroll_snap_highlight_config.into());
637        self
638    }
639    pub fn scroll_snap_highlight_configs<I, S>(mut self, scroll_snap_highlight_configs: I) -> Self
640    where
641        I: IntoIterator<Item = S>,
642        S: Into<super::types::ScrollSnapHighlightConfig>,
643    {
644        let v = self.scroll_snap_highlight_configs.get_or_insert(Vec::new());
645        for val in scroll_snap_highlight_configs {
646            v.push(val.into());
647        }
648        self
649    }
650    pub fn build(self) -> Result<SetShowScrollSnapOverlays, String> {
651        Ok(SetShowScrollSnapOverlays {
652            method: SetShowScrollSnapOverlaysMethod::SetShowScrollSnapOverlays,
653            params: SetShowScrollSnapOverlaysParams {
654                scroll_snap_highlight_configs: self.scroll_snap_highlight_configs.ok_or_else(
655                    || {
656                        format!(
657                            "Field `{}` is mandatory.",
658                            std::stringify!(scroll_snap_highlight_configs)
659                        )
660                    },
661                )?,
662            },
663        })
664    }
665}
666impl SetShowContainerQueryOverlays {
667    pub fn builder() -> SetShowContainerQueryOverlaysBuilder {
668        <SetShowContainerQueryOverlaysBuilder as Default>::default()
669    }
670}
671#[derive(Default, Clone)]
672pub struct SetShowContainerQueryOverlaysBuilder {
673    container_query_highlight_configs: Option<Vec<super::types::ContainerQueryHighlightConfig>>,
674}
675impl SetShowContainerQueryOverlaysBuilder {
676    pub fn container_query_highlight_config(
677        mut self,
678        container_query_highlight_config: impl Into<super::types::ContainerQueryHighlightConfig>,
679    ) -> Self {
680        let v = self
681            .container_query_highlight_configs
682            .get_or_insert(Vec::new());
683        v.push(container_query_highlight_config.into());
684        self
685    }
686    pub fn container_query_highlight_configs<I, S>(
687        mut self,
688        container_query_highlight_configs: I,
689    ) -> Self
690    where
691        I: IntoIterator<Item = S>,
692        S: Into<super::types::ContainerQueryHighlightConfig>,
693    {
694        let v = self
695            .container_query_highlight_configs
696            .get_or_insert(Vec::new());
697        for val in container_query_highlight_configs {
698            v.push(val.into());
699        }
700        self
701    }
702    pub fn build(self) -> Result<SetShowContainerQueryOverlays, String> {
703        Ok(SetShowContainerQueryOverlays {
704            method: SetShowContainerQueryOverlaysMethod::SetShowContainerQueryOverlays,
705            params: SetShowContainerQueryOverlaysParams {
706                container_query_highlight_configs: self
707                    .container_query_highlight_configs
708                    .ok_or_else(|| {
709                        format!(
710                            "Field `{}` is mandatory.",
711                            std::stringify!(container_query_highlight_configs)
712                        )
713                    })?,
714            },
715        })
716    }
717}
718impl SetShowInspectedElementAnchor {
719    pub fn builder() -> SetShowInspectedElementAnchorBuilder {
720        <SetShowInspectedElementAnchorBuilder as Default>::default()
721    }
722}
723#[derive(Default, Clone)]
724pub struct SetShowInspectedElementAnchorBuilder {
725    inspected_element_anchor_config: Option<super::types::InspectedElementAnchorConfig>,
726}
727impl SetShowInspectedElementAnchorBuilder {
728    pub fn inspected_element_anchor_config(
729        mut self,
730        inspected_element_anchor_config: impl Into<super::types::InspectedElementAnchorConfig>,
731    ) -> Self {
732        self.inspected_element_anchor_config = Some(inspected_element_anchor_config.into());
733        self
734    }
735    pub fn build(self) -> Result<SetShowInspectedElementAnchor, String> {
736        Ok(SetShowInspectedElementAnchor {
737            method: SetShowInspectedElementAnchorMethod::SetShowInspectedElementAnchor,
738            params: SetShowInspectedElementAnchorParams {
739                inspected_element_anchor_config: self.inspected_element_anchor_config.ok_or_else(
740                    || {
741                        format!(
742                            "Field `{}` is mandatory.",
743                            std::stringify!(inspected_element_anchor_config)
744                        )
745                    },
746                )?,
747            },
748        })
749    }
750}
751impl SetShowPaintRects {
752    pub fn builder() -> SetShowPaintRectsBuilder {
753        <SetShowPaintRectsBuilder as Default>::default()
754    }
755}
756#[derive(Default, Clone)]
757pub struct SetShowPaintRectsBuilder {
758    result: Option<bool>,
759}
760impl SetShowPaintRectsBuilder {
761    pub fn result(mut self, result: impl Into<bool>) -> Self {
762        self.result = Some(result.into());
763        self
764    }
765    pub fn build(self) -> Result<SetShowPaintRects, String> {
766        Ok(SetShowPaintRects {
767            method: SetShowPaintRectsMethod::SetShowPaintRects,
768            params: SetShowPaintRectsParams {
769                result: self
770                    .result
771                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(result)))?,
772            },
773        })
774    }
775}
776impl SetShowLayoutShiftRegions {
777    pub fn builder() -> SetShowLayoutShiftRegionsBuilder {
778        <SetShowLayoutShiftRegionsBuilder as Default>::default()
779    }
780}
781#[derive(Default, Clone)]
782pub struct SetShowLayoutShiftRegionsBuilder {
783    result: Option<bool>,
784}
785impl SetShowLayoutShiftRegionsBuilder {
786    pub fn result(mut self, result: impl Into<bool>) -> Self {
787        self.result = Some(result.into());
788        self
789    }
790    pub fn build(self) -> Result<SetShowLayoutShiftRegions, String> {
791        Ok(SetShowLayoutShiftRegions {
792            method: SetShowLayoutShiftRegionsMethod::SetShowLayoutShiftRegions,
793            params: SetShowLayoutShiftRegionsParams {
794                result: self
795                    .result
796                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(result)))?,
797            },
798        })
799    }
800}
801impl SetShowScrollBottleneckRects {
802    pub fn builder() -> SetShowScrollBottleneckRectsBuilder {
803        <SetShowScrollBottleneckRectsBuilder as Default>::default()
804    }
805}
806#[derive(Default, Clone)]
807pub struct SetShowScrollBottleneckRectsBuilder {
808    show: Option<bool>,
809}
810impl SetShowScrollBottleneckRectsBuilder {
811    pub fn show(mut self, show: impl Into<bool>) -> Self {
812        self.show = Some(show.into());
813        self
814    }
815    pub fn build(self) -> Result<SetShowScrollBottleneckRects, String> {
816        Ok(SetShowScrollBottleneckRects {
817            method: SetShowScrollBottleneckRectsMethod::SetShowScrollBottleneckRects,
818            params: SetShowScrollBottleneckRectsParams {
819                show: self
820                    .show
821                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(show)))?,
822            },
823        })
824    }
825}
826impl SetShowViewportSizeOnResize {
827    pub fn builder() -> SetShowViewportSizeOnResizeBuilder {
828        <SetShowViewportSizeOnResizeBuilder as Default>::default()
829    }
830}
831#[derive(Default, Clone)]
832pub struct SetShowViewportSizeOnResizeBuilder {
833    show: Option<bool>,
834}
835impl SetShowViewportSizeOnResizeBuilder {
836    pub fn show(mut self, show: impl Into<bool>) -> Self {
837        self.show = Some(show.into());
838        self
839    }
840    pub fn build(self) -> Result<SetShowViewportSizeOnResize, String> {
841        Ok(SetShowViewportSizeOnResize {
842            method: SetShowViewportSizeOnResizeMethod::SetShowViewportSizeOnResize,
843            params: SetShowViewportSizeOnResizeParams {
844                show: self
845                    .show
846                    .ok_or_else(|| format!("Field `{}` is mandatory.", std::stringify!(show)))?,
847            },
848        })
849    }
850}
851impl SetShowHinge {
852    pub fn builder() -> SetShowHingeBuilder {
853        <SetShowHingeBuilder as Default>::default()
854    }
855}
856#[derive(Default, Clone)]
857pub struct SetShowHingeBuilder {
858    hinge_config: Option<super::types::HingeConfig>,
859}
860impl SetShowHingeBuilder {
861    pub fn hinge_config(mut self, hinge_config: impl Into<super::types::HingeConfig>) -> Self {
862        self.hinge_config = Some(hinge_config.into());
863        self
864    }
865    pub fn build(self) -> SetShowHinge {
866        SetShowHinge {
867            method: SetShowHingeMethod::SetShowHinge,
868            params: SetShowHingeParams {
869                hinge_config: self.hinge_config,
870            },
871        }
872    }
873}
874impl SetShowIsolatedElements {
875    pub fn builder() -> SetShowIsolatedElementsBuilder {
876        <SetShowIsolatedElementsBuilder as Default>::default()
877    }
878}
879#[derive(Default, Clone)]
880pub struct SetShowIsolatedElementsBuilder {
881    isolated_element_highlight_configs: Option<Vec<super::types::IsolatedElementHighlightConfig>>,
882}
883impl SetShowIsolatedElementsBuilder {
884    pub fn isolated_element_highlight_config(
885        mut self,
886        isolated_element_highlight_config: impl Into<super::types::IsolatedElementHighlightConfig>,
887    ) -> Self {
888        let v = self
889            .isolated_element_highlight_configs
890            .get_or_insert(Vec::new());
891        v.push(isolated_element_highlight_config.into());
892        self
893    }
894    pub fn isolated_element_highlight_configs<I, S>(
895        mut self,
896        isolated_element_highlight_configs: I,
897    ) -> Self
898    where
899        I: IntoIterator<Item = S>,
900        S: Into<super::types::IsolatedElementHighlightConfig>,
901    {
902        let v = self
903            .isolated_element_highlight_configs
904            .get_or_insert(Vec::new());
905        for val in isolated_element_highlight_configs {
906            v.push(val.into());
907        }
908        self
909    }
910    pub fn build(self) -> Result<SetShowIsolatedElements, String> {
911        Ok(SetShowIsolatedElements {
912            method: SetShowIsolatedElementsMethod::SetShowIsolatedElements,
913            params: SetShowIsolatedElementsParams {
914                isolated_element_highlight_configs: self
915                    .isolated_element_highlight_configs
916                    .ok_or_else(|| {
917                        format!(
918                            "Field `{}` is mandatory.",
919                            std::stringify!(isolated_element_highlight_configs)
920                        )
921                    })?,
922            },
923        })
924    }
925}
926impl SetShowWindowControlsOverlay {
927    pub fn builder() -> SetShowWindowControlsOverlayBuilder {
928        <SetShowWindowControlsOverlayBuilder as Default>::default()
929    }
930}
931#[derive(Default, Clone)]
932pub struct SetShowWindowControlsOverlayBuilder {
933    window_controls_overlay_config: Option<super::types::WindowControlsOverlayConfig>,
934}
935impl SetShowWindowControlsOverlayBuilder {
936    pub fn window_controls_overlay_config(
937        mut self,
938        window_controls_overlay_config: impl Into<super::types::WindowControlsOverlayConfig>,
939    ) -> Self {
940        self.window_controls_overlay_config = Some(window_controls_overlay_config.into());
941        self
942    }
943    pub fn build(self) -> SetShowWindowControlsOverlay {
944        SetShowWindowControlsOverlay {
945            method: SetShowWindowControlsOverlayMethod::SetShowWindowControlsOverlay,
946            params: SetShowWindowControlsOverlayParams {
947                window_controls_overlay_config: self.window_controls_overlay_config,
948            },
949        }
950    }
951}