Skip to main content

browser_protocol/dom/
mod.rs

1//! This domain exposes DOM read/write operations. Each DOM Node is represented with its mirror object
2//! that has an 'id'. This 'id' can be used to get additional information on the Node, resolve it into
3//! the JavaScript object wrapper, etc. It is important that client receives DOM events only for the
4//! nodes that are known to the client. Backend keeps track of the nodes that were sent to the client
5//! and never sends the same node twice. It is client's responsibility to collect information about
6//! the nodes that were sent to the client. Note that 'iframe' owner elements will return
7//! corresponding document elements as their child nodes.
8
9
10use serde::{Serialize, Deserialize};
11use serde_json::Value as JsonValue;
12use std::borrow::Cow;
13
14/// Unique DOM node identifier.
15
16pub type NodeId = i64;
17
18/// Unique DOM node identifier used to reference a node that may not have been pushed to the
19/// front-end.
20
21pub type BackendNodeId = i64;
22
23/// Unique identifier for a CSS stylesheet.
24
25pub type StyleSheetId<'a> = Cow<'a, str>;
26
27/// Backend node with a friendly name.
28
29#[derive(Debug, Clone, Serialize, Deserialize, Default)]
30#[serde(rename_all = "camelCase")]
31pub struct BackendNode<'a> {
32    /// 'Node''s nodeType.
33    nodeType: i64,
34    /// 'Node''s nodeName.
35    nodeName: Cow<'a, str>,
36    backendNodeId: BackendNodeId,
37}
38
39impl<'a> BackendNode<'a> {
40    pub fn builder(nodeType: i64, nodeName: impl Into<Cow<'a, str>>, backendNodeId: BackendNodeId) -> BackendNodeBuilder<'a> {
41        BackendNodeBuilder {
42            nodeType: nodeType,
43            nodeName: nodeName.into(),
44            backendNodeId: backendNodeId,
45        }
46    }
47    pub fn nodeType(&self) -> i64 { self.nodeType }
48    pub fn nodeName(&self) -> &str { self.nodeName.as_ref() }
49    pub fn backendNodeId(&self) -> &BackendNodeId { &self.backendNodeId }
50}
51
52
53pub struct BackendNodeBuilder<'a> {
54    nodeType: i64,
55    nodeName: Cow<'a, str>,
56    backendNodeId: BackendNodeId,
57}
58
59impl<'a> BackendNodeBuilder<'a> {
60    pub fn build(self) -> BackendNode<'a> {
61        BackendNode {
62            nodeType: self.nodeType,
63            nodeName: self.nodeName,
64            backendNodeId: self.backendNodeId,
65        }
66    }
67}
68
69/// Pseudo element type.
70
71#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
72pub enum PseudoType {
73    #[default]
74    #[serde(rename = "first-line")]
75    FirstLine,
76    #[serde(rename = "first-letter")]
77    FirstLetter,
78    #[serde(rename = "checkmark")]
79    Checkmark,
80    #[serde(rename = "before")]
81    Before,
82    #[serde(rename = "after")]
83    After,
84    #[serde(rename = "expand-icon")]
85    ExpandIcon,
86    #[serde(rename = "picker-icon")]
87    PickerIcon,
88    #[serde(rename = "interest-hint")]
89    InterestHint,
90    #[serde(rename = "marker")]
91    Marker,
92    #[serde(rename = "backdrop")]
93    Backdrop,
94    #[serde(rename = "column")]
95    Column,
96    #[serde(rename = "selection")]
97    Selection,
98    #[serde(rename = "search-text")]
99    SearchText,
100    #[serde(rename = "target-text")]
101    TargetText,
102    #[serde(rename = "spelling-error")]
103    SpellingError,
104    #[serde(rename = "grammar-error")]
105    GrammarError,
106    #[serde(rename = "highlight")]
107    Highlight,
108    #[serde(rename = "first-line-inherited")]
109    FirstLineInherited,
110    #[serde(rename = "scroll-marker")]
111    ScrollMarker,
112    #[serde(rename = "scroll-marker-group")]
113    ScrollMarkerGroup,
114    #[serde(rename = "scroll-button")]
115    ScrollButton,
116    #[serde(rename = "scrollbar")]
117    Scrollbar,
118    #[serde(rename = "scrollbar-thumb")]
119    ScrollbarThumb,
120    #[serde(rename = "scrollbar-button")]
121    ScrollbarButton,
122    #[serde(rename = "scrollbar-track")]
123    ScrollbarTrack,
124    #[serde(rename = "scrollbar-track-piece")]
125    ScrollbarTrackPiece,
126    #[serde(rename = "scrollbar-corner")]
127    ScrollbarCorner,
128    #[serde(rename = "resizer")]
129    Resizer,
130    #[serde(rename = "input-list-button")]
131    InputListButton,
132    #[serde(rename = "view-transition")]
133    ViewTransition,
134    #[serde(rename = "view-transition-group")]
135    ViewTransitionGroup,
136    #[serde(rename = "view-transition-image-pair")]
137    ViewTransitionImagePair,
138    #[serde(rename = "view-transition-group-children")]
139    ViewTransitionGroupChildren,
140    #[serde(rename = "view-transition-old")]
141    ViewTransitionOld,
142    #[serde(rename = "view-transition-new")]
143    ViewTransitionNew,
144    #[serde(rename = "placeholder")]
145    Placeholder,
146    #[serde(rename = "file-selector-button")]
147    FileSelectorButton,
148    #[serde(rename = "details-content")]
149    DetailsContent,
150    #[serde(rename = "picker")]
151    Picker,
152    #[serde(rename = "permission-icon")]
153    PermissionIcon,
154    #[serde(rename = "overscroll-area-parent")]
155    OverscrollAreaParent,
156}
157
158/// Shadow root type.
159
160#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
161pub enum ShadowRootType {
162    #[default]
163    #[serde(rename = "user-agent")]
164    UserAgent,
165    #[serde(rename = "open")]
166    Open,
167    #[serde(rename = "closed")]
168    Closed,
169}
170
171/// Document compatibility mode.
172
173#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
174pub enum CompatibilityMode {
175    #[default]
176    #[serde(rename = "QuirksMode")]
177    QuirksMode,
178    #[serde(rename = "LimitedQuirksMode")]
179    LimitedQuirksMode,
180    #[serde(rename = "NoQuirksMode")]
181    NoQuirksMode,
182}
183
184/// ContainerSelector physical axes
185
186#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
187pub enum PhysicalAxes {
188    #[default]
189    #[serde(rename = "Horizontal")]
190    Horizontal,
191    #[serde(rename = "Vertical")]
192    Vertical,
193    #[serde(rename = "Both")]
194    Both,
195}
196
197/// ContainerSelector logical axes
198
199#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
200pub enum LogicalAxes {
201    #[default]
202    #[serde(rename = "Inline")]
203    Inline,
204    #[serde(rename = "Block")]
205    Block,
206    #[serde(rename = "Both")]
207    Both,
208}
209
210/// Physical scroll orientation
211
212#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
213pub enum ScrollOrientation {
214    #[default]
215    #[serde(rename = "horizontal")]
216    Horizontal,
217    #[serde(rename = "vertical")]
218    Vertical,
219}
220
221/// DOM interaction is implemented in terms of mirror objects that represent the actual DOM nodes.
222/// DOMNode is a base node mirror type.
223
224#[derive(Debug, Clone, Serialize, Deserialize, Default)]
225#[serde(rename_all = "camelCase")]
226pub struct Node<'a> {
227    /// Node identifier that is passed into the rest of the DOM messages as the 'nodeId'. Backend
228    /// will only push node with given 'id' once. It is aware of all requested nodes and will only
229    /// fire DOM events for nodes known to the client.
230    nodeId: NodeId,
231    /// The id of the parent node if any.
232    #[serde(skip_serializing_if = "Option::is_none")]
233    parentId: Option<NodeId>,
234    /// The BackendNodeId for this node.
235    backendNodeId: BackendNodeId,
236    /// 'Node''s nodeType.
237    nodeType: i64,
238    /// 'Node''s nodeName.
239    nodeName: Cow<'a, str>,
240    /// 'Node''s localName.
241    localName: Cow<'a, str>,
242    /// 'Node''s nodeValue.
243    nodeValue: Cow<'a, str>,
244    /// Child count for 'Container' nodes.
245    #[serde(skip_serializing_if = "Option::is_none")]
246    childNodeCount: Option<u64>,
247    /// Child nodes of this node when requested with children.
248    #[serde(skip_serializing_if = "Option::is_none")]
249    children: Option<Vec<Box<Node<'a>>>>,
250    /// Attributes of the 'Element' node in the form of flat array '[name1, value1, name2, value2]'.
251    #[serde(skip_serializing_if = "Option::is_none")]
252    attributes: Option<Vec<Cow<'a, str>>>,
253    /// Document URL that 'Document' or 'FrameOwner' node points to.
254    #[serde(skip_serializing_if = "Option::is_none")]
255    documentURL: Option<Cow<'a, str>>,
256    /// Base URL that 'Document' or 'FrameOwner' node uses for URL completion.
257    #[serde(skip_serializing_if = "Option::is_none")]
258    baseURL: Option<Cow<'a, str>>,
259    /// 'DocumentType''s publicId.
260    #[serde(skip_serializing_if = "Option::is_none")]
261    publicId: Option<Cow<'a, str>>,
262    /// 'DocumentType''s systemId.
263    #[serde(skip_serializing_if = "Option::is_none")]
264    systemId: Option<Cow<'a, str>>,
265    /// 'DocumentType''s internalSubset.
266    #[serde(skip_serializing_if = "Option::is_none")]
267    internalSubset: Option<Cow<'a, str>>,
268    /// 'Document''s XML version in case of XML documents.
269    #[serde(skip_serializing_if = "Option::is_none")]
270    xmlVersion: Option<Cow<'a, str>>,
271    /// 'Attr''s name.
272    #[serde(skip_serializing_if = "Option::is_none")]
273    name: Option<Cow<'a, str>>,
274    /// 'Attr''s value.
275    #[serde(skip_serializing_if = "Option::is_none")]
276    value: Option<Cow<'a, str>>,
277    /// Pseudo element type for this node.
278    #[serde(skip_serializing_if = "Option::is_none")]
279    pseudoType: Option<PseudoType>,
280    /// Pseudo element identifier for this node. Only present if there is a
281    /// valid pseudoType.
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pseudoIdentifier: Option<Cow<'a, str>>,
284    /// Shadow root type.
285    #[serde(skip_serializing_if = "Option::is_none")]
286    shadowRootType: Option<ShadowRootType>,
287    /// Frame ID for frame owner elements.
288    #[serde(skip_serializing_if = "Option::is_none")]
289    frameId: Option<crate::page::FrameId<'a>>,
290    /// Content document for frame owner elements.
291    #[serde(skip_serializing_if = "Option::is_none")]
292    contentDocument: Option<Box<Node<'a>>>,
293    /// Shadow root list for given element host.
294    #[serde(skip_serializing_if = "Option::is_none")]
295    shadowRoots: Option<Vec<Box<Node<'a>>>>,
296    /// Content document fragment for template elements.
297    #[serde(skip_serializing_if = "Option::is_none")]
298    templateContent: Option<Box<Node<'a>>>,
299    /// Pseudo elements associated with this node.
300    #[serde(skip_serializing_if = "Option::is_none")]
301    pseudoElements: Option<Vec<Box<Node<'a>>>>,
302    /// Deprecated, as the HTML Imports API has been removed (crbug.com/937746).
303    /// This property used to return the imported document for the HTMLImport links.
304    /// The property is always undefined now.
305    #[serde(skip_serializing_if = "Option::is_none")]
306    importedDocument: Option<Box<Node<'a>>>,
307    /// Distributed nodes for given insertion point.
308    #[serde(skip_serializing_if = "Option::is_none")]
309    distributedNodes: Option<Vec<BackendNode<'a>>>,
310    /// Whether the node is SVG.
311    #[serde(skip_serializing_if = "Option::is_none")]
312    isSVG: Option<bool>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    compatibilityMode: Option<CompatibilityMode>,
315    #[serde(skip_serializing_if = "Option::is_none")]
316    assignedSlot: Option<BackendNode<'a>>,
317    #[serde(skip_serializing_if = "Option::is_none")]
318    isScrollable: Option<bool>,
319    #[serde(skip_serializing_if = "Option::is_none")]
320    affectedByStartingStyles: Option<bool>,
321    #[serde(skip_serializing_if = "Option::is_none")]
322    adoptedStyleSheets: Option<Vec<StyleSheetId<'a>>>,
323    #[serde(skip_serializing_if = "Option::is_none")]
324    adProvenance: Option<crate::network::AdProvenance<'a>>,
325}
326
327impl<'a> Node<'a> {
328    pub fn builder(nodeId: NodeId, backendNodeId: BackendNodeId, nodeType: i64, nodeName: impl Into<Cow<'a, str>>, localName: impl Into<Cow<'a, str>>, nodeValue: impl Into<Cow<'a, str>>) -> NodeBuilder<'a> {
329        NodeBuilder {
330            nodeId: nodeId,
331            parentId: None,
332            backendNodeId: backendNodeId,
333            nodeType: nodeType,
334            nodeName: nodeName.into(),
335            localName: localName.into(),
336            nodeValue: nodeValue.into(),
337            childNodeCount: None,
338            children: None,
339            attributes: None,
340            documentURL: None,
341            baseURL: None,
342            publicId: None,
343            systemId: None,
344            internalSubset: None,
345            xmlVersion: None,
346            name: None,
347            value: None,
348            pseudoType: None,
349            pseudoIdentifier: None,
350            shadowRootType: None,
351            frameId: None,
352            contentDocument: None,
353            shadowRoots: None,
354            templateContent: None,
355            pseudoElements: None,
356            importedDocument: None,
357            distributedNodes: None,
358            isSVG: None,
359            compatibilityMode: None,
360            assignedSlot: None,
361            isScrollable: None,
362            affectedByStartingStyles: None,
363            adoptedStyleSheets: None,
364            adProvenance: None,
365        }
366    }
367    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
368    pub fn parentId(&self) -> Option<&NodeId> { self.parentId.as_ref() }
369    pub fn backendNodeId(&self) -> &BackendNodeId { &self.backendNodeId }
370    pub fn nodeType(&self) -> i64 { self.nodeType }
371    pub fn nodeName(&self) -> &str { self.nodeName.as_ref() }
372    pub fn localName(&self) -> &str { self.localName.as_ref() }
373    pub fn nodeValue(&self) -> &str { self.nodeValue.as_ref() }
374    pub fn childNodeCount(&self) -> Option<u64> { self.childNodeCount }
375    pub fn children(&self) -> Option<&[Box<Node<'a>>]> { self.children.as_deref() }
376    pub fn attributes(&self) -> Option<&[Cow<'a, str>]> { self.attributes.as_deref() }
377    pub fn documentURL(&self) -> Option<&str> { self.documentURL.as_deref() }
378    pub fn baseURL(&self) -> Option<&str> { self.baseURL.as_deref() }
379    pub fn publicId(&self) -> Option<&str> { self.publicId.as_deref() }
380    pub fn systemId(&self) -> Option<&str> { self.systemId.as_deref() }
381    pub fn internalSubset(&self) -> Option<&str> { self.internalSubset.as_deref() }
382    pub fn xmlVersion(&self) -> Option<&str> { self.xmlVersion.as_deref() }
383    pub fn name(&self) -> Option<&str> { self.name.as_deref() }
384    pub fn value(&self) -> Option<&str> { self.value.as_deref() }
385    pub fn pseudoType(&self) -> Option<&PseudoType> { self.pseudoType.as_ref() }
386    pub fn pseudoIdentifier(&self) -> Option<&str> { self.pseudoIdentifier.as_deref() }
387    pub fn shadowRootType(&self) -> Option<&ShadowRootType> { self.shadowRootType.as_ref() }
388    pub fn frameId(&self) -> Option<&crate::page::FrameId<'a>> { self.frameId.as_ref() }
389    pub fn contentDocument(&self) -> Option<&Node<'a>> { self.contentDocument.as_deref() }
390    pub fn shadowRoots(&self) -> Option<&[Box<Node<'a>>]> { self.shadowRoots.as_deref() }
391    pub fn templateContent(&self) -> Option<&Node<'a>> { self.templateContent.as_deref() }
392    pub fn pseudoElements(&self) -> Option<&[Box<Node<'a>>]> { self.pseudoElements.as_deref() }
393    pub fn importedDocument(&self) -> Option<&Node<'a>> { self.importedDocument.as_deref() }
394    pub fn distributedNodes(&self) -> Option<&[BackendNode<'a>]> { self.distributedNodes.as_deref() }
395    pub fn isSVG(&self) -> Option<bool> { self.isSVG }
396    pub fn compatibilityMode(&self) -> Option<&CompatibilityMode> { self.compatibilityMode.as_ref() }
397    pub fn assignedSlot(&self) -> Option<&BackendNode<'a>> { self.assignedSlot.as_ref() }
398    pub fn isScrollable(&self) -> Option<bool> { self.isScrollable }
399    pub fn affectedByStartingStyles(&self) -> Option<bool> { self.affectedByStartingStyles }
400    pub fn adoptedStyleSheets(&self) -> Option<&[StyleSheetId<'a>]> { self.adoptedStyleSheets.as_deref() }
401    pub fn adProvenance(&self) -> Option<&crate::network::AdProvenance<'a>> { self.adProvenance.as_ref() }
402}
403
404
405pub struct NodeBuilder<'a> {
406    nodeId: NodeId,
407    parentId: Option<NodeId>,
408    backendNodeId: BackendNodeId,
409    nodeType: i64,
410    nodeName: Cow<'a, str>,
411    localName: Cow<'a, str>,
412    nodeValue: Cow<'a, str>,
413    childNodeCount: Option<u64>,
414    children: Option<Vec<Box<Node<'a>>>>,
415    attributes: Option<Vec<Cow<'a, str>>>,
416    documentURL: Option<Cow<'a, str>>,
417    baseURL: Option<Cow<'a, str>>,
418    publicId: Option<Cow<'a, str>>,
419    systemId: Option<Cow<'a, str>>,
420    internalSubset: Option<Cow<'a, str>>,
421    xmlVersion: Option<Cow<'a, str>>,
422    name: Option<Cow<'a, str>>,
423    value: Option<Cow<'a, str>>,
424    pseudoType: Option<PseudoType>,
425    pseudoIdentifier: Option<Cow<'a, str>>,
426    shadowRootType: Option<ShadowRootType>,
427    frameId: Option<crate::page::FrameId<'a>>,
428    contentDocument: Option<Box<Node<'a>>>,
429    shadowRoots: Option<Vec<Box<Node<'a>>>>,
430    templateContent: Option<Box<Node<'a>>>,
431    pseudoElements: Option<Vec<Box<Node<'a>>>>,
432    importedDocument: Option<Box<Node<'a>>>,
433    distributedNodes: Option<Vec<BackendNode<'a>>>,
434    isSVG: Option<bool>,
435    compatibilityMode: Option<CompatibilityMode>,
436    assignedSlot: Option<BackendNode<'a>>,
437    isScrollable: Option<bool>,
438    affectedByStartingStyles: Option<bool>,
439    adoptedStyleSheets: Option<Vec<StyleSheetId<'a>>>,
440    adProvenance: Option<crate::network::AdProvenance<'a>>,
441}
442
443impl<'a> NodeBuilder<'a> {
444    /// The id of the parent node if any.
445    pub fn parentId(mut self, parentId: NodeId) -> Self { self.parentId = Some(parentId); self }
446    /// Child count for 'Container' nodes.
447    pub fn childNodeCount(mut self, childNodeCount: u64) -> Self { self.childNodeCount = Some(childNodeCount); self }
448    /// Child nodes of this node when requested with children.
449    pub fn children(mut self, children: Vec<Box<Node<'a>>>) -> Self { self.children = Some(children); self }
450    /// Attributes of the 'Element' node in the form of flat array '[name1, value1, name2, value2]'.
451    pub fn attributes(mut self, attributes: Vec<Cow<'a, str>>) -> Self { self.attributes = Some(attributes); self }
452    /// Document URL that 'Document' or 'FrameOwner' node points to.
453    pub fn documentURL(mut self, documentURL: impl Into<Cow<'a, str>>) -> Self { self.documentURL = Some(documentURL.into()); self }
454    /// Base URL that 'Document' or 'FrameOwner' node uses for URL completion.
455    pub fn baseURL(mut self, baseURL: impl Into<Cow<'a, str>>) -> Self { self.baseURL = Some(baseURL.into()); self }
456    /// 'DocumentType''s publicId.
457    pub fn publicId(mut self, publicId: impl Into<Cow<'a, str>>) -> Self { self.publicId = Some(publicId.into()); self }
458    /// 'DocumentType''s systemId.
459    pub fn systemId(mut self, systemId: impl Into<Cow<'a, str>>) -> Self { self.systemId = Some(systemId.into()); self }
460    /// 'DocumentType''s internalSubset.
461    pub fn internalSubset(mut self, internalSubset: impl Into<Cow<'a, str>>) -> Self { self.internalSubset = Some(internalSubset.into()); self }
462    /// 'Document''s XML version in case of XML documents.
463    pub fn xmlVersion(mut self, xmlVersion: impl Into<Cow<'a, str>>) -> Self { self.xmlVersion = Some(xmlVersion.into()); self }
464    /// 'Attr''s name.
465    pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
466    /// 'Attr''s value.
467    pub fn value(mut self, value: impl Into<Cow<'a, str>>) -> Self { self.value = Some(value.into()); self }
468    /// Pseudo element type for this node.
469    pub fn pseudoType(mut self, pseudoType: PseudoType) -> Self { self.pseudoType = Some(pseudoType); self }
470    /// Pseudo element identifier for this node. Only present if there is a
471    /// valid pseudoType.
472    pub fn pseudoIdentifier(mut self, pseudoIdentifier: impl Into<Cow<'a, str>>) -> Self { self.pseudoIdentifier = Some(pseudoIdentifier.into()); self }
473    /// Shadow root type.
474    pub fn shadowRootType(mut self, shadowRootType: ShadowRootType) -> Self { self.shadowRootType = Some(shadowRootType); self }
475    /// Frame ID for frame owner elements.
476    pub fn frameId(mut self, frameId: crate::page::FrameId<'a>) -> Self { self.frameId = Some(frameId); self }
477    /// Content document for frame owner elements.
478    pub fn contentDocument(mut self, contentDocument: Box<Node<'a>>) -> Self { self.contentDocument = Some(contentDocument); self }
479    /// Shadow root list for given element host.
480    pub fn shadowRoots(mut self, shadowRoots: Vec<Box<Node<'a>>>) -> Self { self.shadowRoots = Some(shadowRoots); self }
481    /// Content document fragment for template elements.
482    pub fn templateContent(mut self, templateContent: Box<Node<'a>>) -> Self { self.templateContent = Some(templateContent); self }
483    /// Pseudo elements associated with this node.
484    pub fn pseudoElements(mut self, pseudoElements: Vec<Box<Node<'a>>>) -> Self { self.pseudoElements = Some(pseudoElements); self }
485    /// Deprecated, as the HTML Imports API has been removed (crbug.com/937746).
486    /// This property used to return the imported document for the HTMLImport links.
487    /// The property is always undefined now.
488    pub fn importedDocument(mut self, importedDocument: Box<Node<'a>>) -> Self { self.importedDocument = Some(importedDocument); self }
489    /// Distributed nodes for given insertion point.
490    pub fn distributedNodes(mut self, distributedNodes: Vec<BackendNode<'a>>) -> Self { self.distributedNodes = Some(distributedNodes); self }
491    /// Whether the node is SVG.
492    pub fn isSVG(mut self, isSVG: bool) -> Self { self.isSVG = Some(isSVG); self }
493    pub fn compatibilityMode(mut self, compatibilityMode: CompatibilityMode) -> Self { self.compatibilityMode = Some(compatibilityMode); self }
494    pub fn assignedSlot(mut self, assignedSlot: BackendNode<'a>) -> Self { self.assignedSlot = Some(assignedSlot); self }
495    pub fn isScrollable(mut self, isScrollable: bool) -> Self { self.isScrollable = Some(isScrollable); self }
496    pub fn affectedByStartingStyles(mut self, affectedByStartingStyles: bool) -> Self { self.affectedByStartingStyles = Some(affectedByStartingStyles); self }
497    pub fn adoptedStyleSheets(mut self, adoptedStyleSheets: Vec<StyleSheetId<'a>>) -> Self { self.adoptedStyleSheets = Some(adoptedStyleSheets); self }
498    pub fn adProvenance(mut self, adProvenance: crate::network::AdProvenance<'a>) -> Self { self.adProvenance = Some(adProvenance); self }
499    pub fn build(self) -> Node<'a> {
500        Node {
501            nodeId: self.nodeId,
502            parentId: self.parentId,
503            backendNodeId: self.backendNodeId,
504            nodeType: self.nodeType,
505            nodeName: self.nodeName,
506            localName: self.localName,
507            nodeValue: self.nodeValue,
508            childNodeCount: self.childNodeCount,
509            children: self.children,
510            attributes: self.attributes,
511            documentURL: self.documentURL,
512            baseURL: self.baseURL,
513            publicId: self.publicId,
514            systemId: self.systemId,
515            internalSubset: self.internalSubset,
516            xmlVersion: self.xmlVersion,
517            name: self.name,
518            value: self.value,
519            pseudoType: self.pseudoType,
520            pseudoIdentifier: self.pseudoIdentifier,
521            shadowRootType: self.shadowRootType,
522            frameId: self.frameId,
523            contentDocument: self.contentDocument,
524            shadowRoots: self.shadowRoots,
525            templateContent: self.templateContent,
526            pseudoElements: self.pseudoElements,
527            importedDocument: self.importedDocument,
528            distributedNodes: self.distributedNodes,
529            isSVG: self.isSVG,
530            compatibilityMode: self.compatibilityMode,
531            assignedSlot: self.assignedSlot,
532            isScrollable: self.isScrollable,
533            affectedByStartingStyles: self.affectedByStartingStyles,
534            adoptedStyleSheets: self.adoptedStyleSheets,
535            adProvenance: self.adProvenance,
536        }
537    }
538}
539
540/// A structure to hold the top-level node of a detached tree and an array of its retained descendants.
541
542#[derive(Debug, Clone, Serialize, Deserialize, Default)]
543#[serde(rename_all = "camelCase")]
544pub struct DetachedElementInfo<'a> {
545    treeNode: Node<'a>,
546    retainedNodeIds: Vec<NodeId>,
547}
548
549impl<'a> DetachedElementInfo<'a> {
550    pub fn builder(treeNode: Node<'a>, retainedNodeIds: Vec<NodeId>) -> DetachedElementInfoBuilder<'a> {
551        DetachedElementInfoBuilder {
552            treeNode: treeNode,
553            retainedNodeIds: retainedNodeIds,
554        }
555    }
556    pub fn treeNode(&self) -> &Node<'a> { &self.treeNode }
557    pub fn retainedNodeIds(&self) -> &[NodeId] { &self.retainedNodeIds }
558}
559
560
561pub struct DetachedElementInfoBuilder<'a> {
562    treeNode: Node<'a>,
563    retainedNodeIds: Vec<NodeId>,
564}
565
566impl<'a> DetachedElementInfoBuilder<'a> {
567    pub fn build(self) -> DetachedElementInfo<'a> {
568        DetachedElementInfo {
569            treeNode: self.treeNode,
570            retainedNodeIds: self.retainedNodeIds,
571        }
572    }
573}
574
575/// A structure holding an RGBA color.
576
577#[derive(Debug, Clone, Serialize, Deserialize, Default)]
578#[serde(rename_all = "camelCase")]
579pub struct RGBA {
580    /// The red component, in the [0-255] range.
581    r: i64,
582    /// The green component, in the [0-255] range.
583    g: i64,
584    /// The blue component, in the [0-255] range.
585    b: i64,
586    /// The alpha component, in the [0-1] range (default: 1).
587    #[serde(skip_serializing_if = "Option::is_none")]
588    a: Option<f64>,
589}
590
591impl RGBA {
592    pub fn builder(r: i64, g: i64, b: i64) -> RGBABuilder {
593        RGBABuilder {
594            r: r,
595            g: g,
596            b: b,
597            a: None,
598        }
599    }
600    pub fn r(&self) -> i64 { self.r }
601    pub fn g(&self) -> i64 { self.g }
602    pub fn b(&self) -> i64 { self.b }
603    pub fn a(&self) -> Option<f64> { self.a }
604}
605
606
607pub struct RGBABuilder {
608    r: i64,
609    g: i64,
610    b: i64,
611    a: Option<f64>,
612}
613
614impl RGBABuilder {
615    /// The alpha component, in the [0-1] range (default: 1).
616    pub fn a(mut self, a: f64) -> Self { self.a = Some(a); self }
617    pub fn build(self) -> RGBA {
618        RGBA {
619            r: self.r,
620            g: self.g,
621            b: self.b,
622            a: self.a,
623        }
624    }
625}
626
627/// An array of quad vertices, x immediately followed by y for each point, points clock-wise.
628
629pub type Quad = Vec<f64>;
630
631/// Box model.
632
633#[derive(Debug, Clone, Serialize, Deserialize, Default)]
634#[serde(rename_all = "camelCase")]
635pub struct BoxModel {
636    /// Content box
637    content: Quad,
638    /// Padding box
639    padding: Quad,
640    /// Border box
641    border: Quad,
642    /// Margin box
643    margin: Quad,
644    /// Node width
645    width: u64,
646    /// Node height
647    height: i64,
648    /// Shape outside coordinates
649    #[serde(skip_serializing_if = "Option::is_none")]
650    shapeOutside: Option<ShapeOutsideInfo>,
651}
652
653impl BoxModel {
654    pub fn builder(content: Quad, padding: Quad, border: Quad, margin: Quad, width: u64, height: i64) -> BoxModelBuilder {
655        BoxModelBuilder {
656            content: content,
657            padding: padding,
658            border: border,
659            margin: margin,
660            width: width,
661            height: height,
662            shapeOutside: None,
663        }
664    }
665    pub fn content(&self) -> &Quad { &self.content }
666    pub fn padding(&self) -> &Quad { &self.padding }
667    pub fn border(&self) -> &Quad { &self.border }
668    pub fn margin(&self) -> &Quad { &self.margin }
669    pub fn width(&self) -> u64 { self.width }
670    pub fn height(&self) -> i64 { self.height }
671    pub fn shapeOutside(&self) -> Option<&ShapeOutsideInfo> { self.shapeOutside.as_ref() }
672}
673
674
675pub struct BoxModelBuilder {
676    content: Quad,
677    padding: Quad,
678    border: Quad,
679    margin: Quad,
680    width: u64,
681    height: i64,
682    shapeOutside: Option<ShapeOutsideInfo>,
683}
684
685impl BoxModelBuilder {
686    /// Shape outside coordinates
687    pub fn shapeOutside(mut self, shapeOutside: ShapeOutsideInfo) -> Self { self.shapeOutside = Some(shapeOutside); self }
688    pub fn build(self) -> BoxModel {
689        BoxModel {
690            content: self.content,
691            padding: self.padding,
692            border: self.border,
693            margin: self.margin,
694            width: self.width,
695            height: self.height,
696            shapeOutside: self.shapeOutside,
697        }
698    }
699}
700
701/// CSS Shape Outside details.
702
703#[derive(Debug, Clone, Serialize, Deserialize, Default)]
704#[serde(rename_all = "camelCase")]
705pub struct ShapeOutsideInfo {
706    /// Shape bounds
707    bounds: Quad,
708    /// Shape coordinate details
709    shape: Vec<JsonValue>,
710    /// Margin shape bounds
711    marginShape: Vec<JsonValue>,
712}
713
714impl ShapeOutsideInfo {
715    pub fn builder(bounds: Quad, shape: Vec<JsonValue>, marginShape: Vec<JsonValue>) -> ShapeOutsideInfoBuilder {
716        ShapeOutsideInfoBuilder {
717            bounds: bounds,
718            shape: shape,
719            marginShape: marginShape,
720        }
721    }
722    pub fn bounds(&self) -> &Quad { &self.bounds }
723    pub fn shape(&self) -> &[JsonValue] { &self.shape }
724    pub fn marginShape(&self) -> &[JsonValue] { &self.marginShape }
725}
726
727
728pub struct ShapeOutsideInfoBuilder {
729    bounds: Quad,
730    shape: Vec<JsonValue>,
731    marginShape: Vec<JsonValue>,
732}
733
734impl ShapeOutsideInfoBuilder {
735    pub fn build(self) -> ShapeOutsideInfo {
736        ShapeOutsideInfo {
737            bounds: self.bounds,
738            shape: self.shape,
739            marginShape: self.marginShape,
740        }
741    }
742}
743
744/// Rectangle.
745
746#[derive(Debug, Clone, Serialize, Deserialize, Default)]
747#[serde(rename_all = "camelCase")]
748pub struct Rect {
749    /// X coordinate
750    x: f64,
751    /// Y coordinate
752    y: f64,
753    /// Rectangle width
754    width: f64,
755    /// Rectangle height
756    height: f64,
757}
758
759impl Rect {
760    pub fn builder(x: f64, y: f64, width: f64, height: f64) -> RectBuilder {
761        RectBuilder {
762            x: x,
763            y: y,
764            width: width,
765            height: height,
766        }
767    }
768    pub fn x(&self) -> f64 { self.x }
769    pub fn y(&self) -> f64 { self.y }
770    pub fn width(&self) -> f64 { self.width }
771    pub fn height(&self) -> f64 { self.height }
772}
773
774
775pub struct RectBuilder {
776    x: f64,
777    y: f64,
778    width: f64,
779    height: f64,
780}
781
782impl RectBuilder {
783    pub fn build(self) -> Rect {
784        Rect {
785            x: self.x,
786            y: self.y,
787            width: self.width,
788            height: self.height,
789        }
790    }
791}
792
793
794#[derive(Debug, Clone, Serialize, Deserialize, Default)]
795#[serde(rename_all = "camelCase")]
796pub struct CSSComputedStyleProperty<'a> {
797    /// Computed style property name.
798    name: Cow<'a, str>,
799    /// Computed style property value.
800    value: Cow<'a, str>,
801}
802
803impl<'a> CSSComputedStyleProperty<'a> {
804    pub fn builder(name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> CSSComputedStylePropertyBuilder<'a> {
805        CSSComputedStylePropertyBuilder {
806            name: name.into(),
807            value: value.into(),
808        }
809    }
810    pub fn name(&self) -> &str { self.name.as_ref() }
811    pub fn value(&self) -> &str { self.value.as_ref() }
812}
813
814
815pub struct CSSComputedStylePropertyBuilder<'a> {
816    name: Cow<'a, str>,
817    value: Cow<'a, str>,
818}
819
820impl<'a> CSSComputedStylePropertyBuilder<'a> {
821    pub fn build(self) -> CSSComputedStyleProperty<'a> {
822        CSSComputedStyleProperty {
823            name: self.name,
824            value: self.value,
825        }
826    }
827}
828
829/// Collects class names for the node with given id and all of it's child nodes.
830
831#[derive(Debug, Clone, Serialize, Deserialize, Default)]
832#[serde(rename_all = "camelCase")]
833pub struct CollectClassNamesFromSubtreeParams {
834    /// Id of the node to collect class names.
835    nodeId: NodeId,
836}
837
838impl CollectClassNamesFromSubtreeParams {
839    pub fn builder(nodeId: NodeId) -> CollectClassNamesFromSubtreeParamsBuilder {
840        CollectClassNamesFromSubtreeParamsBuilder {
841            nodeId: nodeId,
842        }
843    }
844    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
845}
846
847
848pub struct CollectClassNamesFromSubtreeParamsBuilder {
849    nodeId: NodeId,
850}
851
852impl CollectClassNamesFromSubtreeParamsBuilder {
853    pub fn build(self) -> CollectClassNamesFromSubtreeParams {
854        CollectClassNamesFromSubtreeParams {
855            nodeId: self.nodeId,
856        }
857    }
858}
859
860/// Collects class names for the node with given id and all of it's child nodes.
861
862#[derive(Debug, Clone, Serialize, Deserialize, Default)]
863#[serde(rename_all = "camelCase")]
864pub struct CollectClassNamesFromSubtreeReturns<'a> {
865    /// Class name list.
866    classNames: Vec<Cow<'a, str>>,
867}
868
869impl<'a> CollectClassNamesFromSubtreeReturns<'a> {
870    pub fn builder(classNames: Vec<Cow<'a, str>>) -> CollectClassNamesFromSubtreeReturnsBuilder<'a> {
871        CollectClassNamesFromSubtreeReturnsBuilder {
872            classNames: classNames,
873        }
874    }
875    pub fn classNames(&self) -> &[Cow<'a, str>] { &self.classNames }
876}
877
878
879pub struct CollectClassNamesFromSubtreeReturnsBuilder<'a> {
880    classNames: Vec<Cow<'a, str>>,
881}
882
883impl<'a> CollectClassNamesFromSubtreeReturnsBuilder<'a> {
884    pub fn build(self) -> CollectClassNamesFromSubtreeReturns<'a> {
885        CollectClassNamesFromSubtreeReturns {
886            classNames: self.classNames,
887        }
888    }
889}
890
891impl CollectClassNamesFromSubtreeParams { pub const METHOD: &'static str = "DOM.collectClassNamesFromSubtree"; }
892
893impl<'a> crate::CdpCommand<'a> for CollectClassNamesFromSubtreeParams {
894    const METHOD: &'static str = "DOM.collectClassNamesFromSubtree";
895    type Response = CollectClassNamesFromSubtreeReturns<'a>;
896}
897
898/// Creates a deep copy of the specified node and places it into the target container before the
899/// given anchor.
900
901#[derive(Debug, Clone, Serialize, Deserialize, Default)]
902#[serde(rename_all = "camelCase")]
903pub struct CopyToParams {
904    /// Id of the node to copy.
905    nodeId: NodeId,
906    /// Id of the element to drop the copy into.
907    targetNodeId: NodeId,
908    /// Drop the copy before this node (if absent, the copy becomes the last child of
909    /// 'targetNodeId').
910    #[serde(skip_serializing_if = "Option::is_none")]
911    insertBeforeNodeId: Option<NodeId>,
912}
913
914impl CopyToParams {
915    pub fn builder(nodeId: NodeId, targetNodeId: NodeId) -> CopyToParamsBuilder {
916        CopyToParamsBuilder {
917            nodeId: nodeId,
918            targetNodeId: targetNodeId,
919            insertBeforeNodeId: None,
920        }
921    }
922    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
923    pub fn targetNodeId(&self) -> &NodeId { &self.targetNodeId }
924    pub fn insertBeforeNodeId(&self) -> Option<&NodeId> { self.insertBeforeNodeId.as_ref() }
925}
926
927
928pub struct CopyToParamsBuilder {
929    nodeId: NodeId,
930    targetNodeId: NodeId,
931    insertBeforeNodeId: Option<NodeId>,
932}
933
934impl CopyToParamsBuilder {
935    /// Drop the copy before this node (if absent, the copy becomes the last child of
936    /// 'targetNodeId').
937    pub fn insertBeforeNodeId(mut self, insertBeforeNodeId: NodeId) -> Self { self.insertBeforeNodeId = Some(insertBeforeNodeId); self }
938    pub fn build(self) -> CopyToParams {
939        CopyToParams {
940            nodeId: self.nodeId,
941            targetNodeId: self.targetNodeId,
942            insertBeforeNodeId: self.insertBeforeNodeId,
943        }
944    }
945}
946
947/// Creates a deep copy of the specified node and places it into the target container before the
948/// given anchor.
949
950#[derive(Debug, Clone, Serialize, Deserialize, Default)]
951#[serde(rename_all = "camelCase")]
952pub struct CopyToReturns {
953    /// Id of the node clone.
954    nodeId: NodeId,
955}
956
957impl CopyToReturns {
958    pub fn builder(nodeId: NodeId) -> CopyToReturnsBuilder {
959        CopyToReturnsBuilder {
960            nodeId: nodeId,
961        }
962    }
963    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
964}
965
966
967pub struct CopyToReturnsBuilder {
968    nodeId: NodeId,
969}
970
971impl CopyToReturnsBuilder {
972    pub fn build(self) -> CopyToReturns {
973        CopyToReturns {
974            nodeId: self.nodeId,
975        }
976    }
977}
978
979impl CopyToParams { pub const METHOD: &'static str = "DOM.copyTo"; }
980
981impl<'a> crate::CdpCommand<'a> for CopyToParams {
982    const METHOD: &'static str = "DOM.copyTo";
983    type Response = CopyToReturns;
984}
985
986/// Describes node given its id, does not require domain to be enabled. Does not start tracking any
987/// objects, can be used for automation.
988
989#[derive(Debug, Clone, Serialize, Deserialize, Default)]
990#[serde(rename_all = "camelCase")]
991pub struct DescribeNodeParams<'a> {
992    /// Identifier of the node.
993    #[serde(skip_serializing_if = "Option::is_none")]
994    nodeId: Option<NodeId>,
995    /// Identifier of the backend node.
996    #[serde(skip_serializing_if = "Option::is_none")]
997    backendNodeId: Option<BackendNodeId>,
998    /// JavaScript object id of the node wrapper.
999    #[serde(skip_serializing_if = "Option::is_none")]
1000    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1001    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1002    /// entire subtree or provide an integer larger than 0.
1003    #[serde(skip_serializing_if = "Option::is_none")]
1004    depth: Option<i64>,
1005    /// Whether or not iframes and shadow roots should be traversed when returning the subtree
1006    /// (default is false).
1007    #[serde(skip_serializing_if = "Option::is_none")]
1008    pierce: Option<bool>,
1009}
1010
1011impl<'a> DescribeNodeParams<'a> {
1012    pub fn builder() -> DescribeNodeParamsBuilder<'a> {
1013        DescribeNodeParamsBuilder {
1014            nodeId: None,
1015            backendNodeId: None,
1016            objectId: None,
1017            depth: None,
1018            pierce: None,
1019        }
1020    }
1021    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1022    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
1023    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
1024    pub fn depth(&self) -> Option<i64> { self.depth }
1025    pub fn pierce(&self) -> Option<bool> { self.pierce }
1026}
1027
1028#[derive(Default)]
1029pub struct DescribeNodeParamsBuilder<'a> {
1030    nodeId: Option<NodeId>,
1031    backendNodeId: Option<BackendNodeId>,
1032    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1033    depth: Option<i64>,
1034    pierce: Option<bool>,
1035}
1036
1037impl<'a> DescribeNodeParamsBuilder<'a> {
1038    /// Identifier of the node.
1039    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1040    /// Identifier of the backend node.
1041    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
1042    /// JavaScript object id of the node wrapper.
1043    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
1044    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1045    /// entire subtree or provide an integer larger than 0.
1046    pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
1047    /// Whether or not iframes and shadow roots should be traversed when returning the subtree
1048    /// (default is false).
1049    pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1050    pub fn build(self) -> DescribeNodeParams<'a> {
1051        DescribeNodeParams {
1052            nodeId: self.nodeId,
1053            backendNodeId: self.backendNodeId,
1054            objectId: self.objectId,
1055            depth: self.depth,
1056            pierce: self.pierce,
1057        }
1058    }
1059}
1060
1061/// Describes node given its id, does not require domain to be enabled. Does not start tracking any
1062/// objects, can be used for automation.
1063
1064#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1065#[serde(rename_all = "camelCase")]
1066pub struct DescribeNodeReturns<'a> {
1067    /// Node description.
1068    node: Node<'a>,
1069}
1070
1071impl<'a> DescribeNodeReturns<'a> {
1072    pub fn builder(node: Node<'a>) -> DescribeNodeReturnsBuilder<'a> {
1073        DescribeNodeReturnsBuilder {
1074            node: node,
1075        }
1076    }
1077    pub fn node(&self) -> &Node<'a> { &self.node }
1078}
1079
1080
1081pub struct DescribeNodeReturnsBuilder<'a> {
1082    node: Node<'a>,
1083}
1084
1085impl<'a> DescribeNodeReturnsBuilder<'a> {
1086    pub fn build(self) -> DescribeNodeReturns<'a> {
1087        DescribeNodeReturns {
1088            node: self.node,
1089        }
1090    }
1091}
1092
1093impl<'a> DescribeNodeParams<'a> { pub const METHOD: &'static str = "DOM.describeNode"; }
1094
1095impl<'a> crate::CdpCommand<'a> for DescribeNodeParams<'a> {
1096    const METHOD: &'static str = "DOM.describeNode";
1097    type Response = DescribeNodeReturns<'a>;
1098}
1099
1100/// Scrolls the specified rect of the given node into view if not already visible.
1101/// Note: exactly one between nodeId, backendNodeId and objectId should be passed
1102/// to identify the node.
1103
1104#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1105#[serde(rename_all = "camelCase")]
1106pub struct ScrollIntoViewIfNeededParams<'a> {
1107    /// Identifier of the node.
1108    #[serde(skip_serializing_if = "Option::is_none")]
1109    nodeId: Option<NodeId>,
1110    /// Identifier of the backend node.
1111    #[serde(skip_serializing_if = "Option::is_none")]
1112    backendNodeId: Option<BackendNodeId>,
1113    /// JavaScript object id of the node wrapper.
1114    #[serde(skip_serializing_if = "Option::is_none")]
1115    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1116    /// The rect to be scrolled into view, relative to the node's border box, in CSS pixels.
1117    /// When omitted, center of the node will be used, similar to Element.scrollIntoView.
1118    #[serde(skip_serializing_if = "Option::is_none")]
1119    rect: Option<Rect>,
1120}
1121
1122impl<'a> ScrollIntoViewIfNeededParams<'a> {
1123    pub fn builder() -> ScrollIntoViewIfNeededParamsBuilder<'a> {
1124        ScrollIntoViewIfNeededParamsBuilder {
1125            nodeId: None,
1126            backendNodeId: None,
1127            objectId: None,
1128            rect: None,
1129        }
1130    }
1131    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1132    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
1133    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
1134    pub fn rect(&self) -> Option<&Rect> { self.rect.as_ref() }
1135}
1136
1137#[derive(Default)]
1138pub struct ScrollIntoViewIfNeededParamsBuilder<'a> {
1139    nodeId: Option<NodeId>,
1140    backendNodeId: Option<BackendNodeId>,
1141    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1142    rect: Option<Rect>,
1143}
1144
1145impl<'a> ScrollIntoViewIfNeededParamsBuilder<'a> {
1146    /// Identifier of the node.
1147    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1148    /// Identifier of the backend node.
1149    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
1150    /// JavaScript object id of the node wrapper.
1151    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
1152    /// The rect to be scrolled into view, relative to the node's border box, in CSS pixels.
1153    /// When omitted, center of the node will be used, similar to Element.scrollIntoView.
1154    pub fn rect(mut self, rect: Rect) -> Self { self.rect = Some(rect); self }
1155    pub fn build(self) -> ScrollIntoViewIfNeededParams<'a> {
1156        ScrollIntoViewIfNeededParams {
1157            nodeId: self.nodeId,
1158            backendNodeId: self.backendNodeId,
1159            objectId: self.objectId,
1160            rect: self.rect,
1161        }
1162    }
1163}
1164
1165impl<'a> ScrollIntoViewIfNeededParams<'a> { pub const METHOD: &'static str = "DOM.scrollIntoViewIfNeeded"; }
1166
1167impl<'a> crate::CdpCommand<'a> for ScrollIntoViewIfNeededParams<'a> {
1168    const METHOD: &'static str = "DOM.scrollIntoViewIfNeeded";
1169    type Response = crate::EmptyReturns;
1170}
1171
1172#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1173pub struct DisableParams {}
1174
1175impl DisableParams { pub const METHOD: &'static str = "DOM.disable"; }
1176
1177impl<'a> crate::CdpCommand<'a> for DisableParams {
1178    const METHOD: &'static str = "DOM.disable";
1179    type Response = crate::EmptyReturns;
1180}
1181
1182/// Discards search results from the session with the given id. 'getSearchResults' should no longer
1183/// be called for that search.
1184
1185#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1186#[serde(rename_all = "camelCase")]
1187pub struct DiscardSearchResultsParams<'a> {
1188    /// Unique search session identifier.
1189    searchId: Cow<'a, str>,
1190}
1191
1192impl<'a> DiscardSearchResultsParams<'a> {
1193    pub fn builder(searchId: impl Into<Cow<'a, str>>) -> DiscardSearchResultsParamsBuilder<'a> {
1194        DiscardSearchResultsParamsBuilder {
1195            searchId: searchId.into(),
1196        }
1197    }
1198    pub fn searchId(&self) -> &str { self.searchId.as_ref() }
1199}
1200
1201
1202pub struct DiscardSearchResultsParamsBuilder<'a> {
1203    searchId: Cow<'a, str>,
1204}
1205
1206impl<'a> DiscardSearchResultsParamsBuilder<'a> {
1207    pub fn build(self) -> DiscardSearchResultsParams<'a> {
1208        DiscardSearchResultsParams {
1209            searchId: self.searchId,
1210        }
1211    }
1212}
1213
1214impl<'a> DiscardSearchResultsParams<'a> { pub const METHOD: &'static str = "DOM.discardSearchResults"; }
1215
1216impl<'a> crate::CdpCommand<'a> for DiscardSearchResultsParams<'a> {
1217    const METHOD: &'static str = "DOM.discardSearchResults";
1218    type Response = crate::EmptyReturns;
1219}
1220
1221/// Enables DOM agent for the given page.
1222
1223#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1224#[serde(rename_all = "camelCase")]
1225pub struct EnableParams<'a> {
1226    /// Whether to include whitespaces in the children array of returned Nodes.
1227    #[serde(skip_serializing_if = "Option::is_none")]
1228    includeWhitespace: Option<Cow<'a, str>>,
1229}
1230
1231impl<'a> EnableParams<'a> {
1232    pub fn builder() -> EnableParamsBuilder<'a> {
1233        EnableParamsBuilder {
1234            includeWhitespace: None,
1235        }
1236    }
1237    pub fn includeWhitespace(&self) -> Option<&str> { self.includeWhitespace.as_deref() }
1238}
1239
1240#[derive(Default)]
1241pub struct EnableParamsBuilder<'a> {
1242    includeWhitespace: Option<Cow<'a, str>>,
1243}
1244
1245impl<'a> EnableParamsBuilder<'a> {
1246    /// Whether to include whitespaces in the children array of returned Nodes.
1247    pub fn includeWhitespace(mut self, includeWhitespace: impl Into<Cow<'a, str>>) -> Self { self.includeWhitespace = Some(includeWhitespace.into()); self }
1248    pub fn build(self) -> EnableParams<'a> {
1249        EnableParams {
1250            includeWhitespace: self.includeWhitespace,
1251        }
1252    }
1253}
1254
1255impl<'a> EnableParams<'a> { pub const METHOD: &'static str = "DOM.enable"; }
1256
1257impl<'a> crate::CdpCommand<'a> for EnableParams<'a> {
1258    const METHOD: &'static str = "DOM.enable";
1259    type Response = crate::EmptyReturns;
1260}
1261
1262/// Focuses the given element.
1263
1264#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1265#[serde(rename_all = "camelCase")]
1266pub struct FocusParams<'a> {
1267    /// Identifier of the node.
1268    #[serde(skip_serializing_if = "Option::is_none")]
1269    nodeId: Option<NodeId>,
1270    /// Identifier of the backend node.
1271    #[serde(skip_serializing_if = "Option::is_none")]
1272    backendNodeId: Option<BackendNodeId>,
1273    /// JavaScript object id of the node wrapper.
1274    #[serde(skip_serializing_if = "Option::is_none")]
1275    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1276}
1277
1278impl<'a> FocusParams<'a> {
1279    pub fn builder() -> FocusParamsBuilder<'a> {
1280        FocusParamsBuilder {
1281            nodeId: None,
1282            backendNodeId: None,
1283            objectId: None,
1284        }
1285    }
1286    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1287    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
1288    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
1289}
1290
1291#[derive(Default)]
1292pub struct FocusParamsBuilder<'a> {
1293    nodeId: Option<NodeId>,
1294    backendNodeId: Option<BackendNodeId>,
1295    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1296}
1297
1298impl<'a> FocusParamsBuilder<'a> {
1299    /// Identifier of the node.
1300    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1301    /// Identifier of the backend node.
1302    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
1303    /// JavaScript object id of the node wrapper.
1304    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
1305    pub fn build(self) -> FocusParams<'a> {
1306        FocusParams {
1307            nodeId: self.nodeId,
1308            backendNodeId: self.backendNodeId,
1309            objectId: self.objectId,
1310        }
1311    }
1312}
1313
1314impl<'a> FocusParams<'a> { pub const METHOD: &'static str = "DOM.focus"; }
1315
1316impl<'a> crate::CdpCommand<'a> for FocusParams<'a> {
1317    const METHOD: &'static str = "DOM.focus";
1318    type Response = crate::EmptyReturns;
1319}
1320
1321/// Returns attributes for the specified node.
1322
1323#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1324#[serde(rename_all = "camelCase")]
1325pub struct GetAttributesParams {
1326    /// Id of the node to retrieve attributes for.
1327    nodeId: NodeId,
1328}
1329
1330impl GetAttributesParams {
1331    pub fn builder(nodeId: NodeId) -> GetAttributesParamsBuilder {
1332        GetAttributesParamsBuilder {
1333            nodeId: nodeId,
1334        }
1335    }
1336    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
1337}
1338
1339
1340pub struct GetAttributesParamsBuilder {
1341    nodeId: NodeId,
1342}
1343
1344impl GetAttributesParamsBuilder {
1345    pub fn build(self) -> GetAttributesParams {
1346        GetAttributesParams {
1347            nodeId: self.nodeId,
1348        }
1349    }
1350}
1351
1352/// Returns attributes for the specified node.
1353
1354#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1355#[serde(rename_all = "camelCase")]
1356pub struct GetAttributesReturns<'a> {
1357    /// An interleaved array of node attribute names and values.
1358    attributes: Vec<Cow<'a, str>>,
1359}
1360
1361impl<'a> GetAttributesReturns<'a> {
1362    pub fn builder(attributes: Vec<Cow<'a, str>>) -> GetAttributesReturnsBuilder<'a> {
1363        GetAttributesReturnsBuilder {
1364            attributes: attributes,
1365        }
1366    }
1367    pub fn attributes(&self) -> &[Cow<'a, str>] { &self.attributes }
1368}
1369
1370
1371pub struct GetAttributesReturnsBuilder<'a> {
1372    attributes: Vec<Cow<'a, str>>,
1373}
1374
1375impl<'a> GetAttributesReturnsBuilder<'a> {
1376    pub fn build(self) -> GetAttributesReturns<'a> {
1377        GetAttributesReturns {
1378            attributes: self.attributes,
1379        }
1380    }
1381}
1382
1383impl GetAttributesParams { pub const METHOD: &'static str = "DOM.getAttributes"; }
1384
1385impl<'a> crate::CdpCommand<'a> for GetAttributesParams {
1386    const METHOD: &'static str = "DOM.getAttributes";
1387    type Response = GetAttributesReturns<'a>;
1388}
1389
1390/// Returns boxes for the given node.
1391
1392#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1393#[serde(rename_all = "camelCase")]
1394pub struct GetBoxModelParams<'a> {
1395    /// Identifier of the node.
1396    #[serde(skip_serializing_if = "Option::is_none")]
1397    nodeId: Option<NodeId>,
1398    /// Identifier of the backend node.
1399    #[serde(skip_serializing_if = "Option::is_none")]
1400    backendNodeId: Option<BackendNodeId>,
1401    /// JavaScript object id of the node wrapper.
1402    #[serde(skip_serializing_if = "Option::is_none")]
1403    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1404}
1405
1406impl<'a> GetBoxModelParams<'a> {
1407    pub fn builder() -> GetBoxModelParamsBuilder<'a> {
1408        GetBoxModelParamsBuilder {
1409            nodeId: None,
1410            backendNodeId: None,
1411            objectId: None,
1412        }
1413    }
1414    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1415    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
1416    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
1417}
1418
1419#[derive(Default)]
1420pub struct GetBoxModelParamsBuilder<'a> {
1421    nodeId: Option<NodeId>,
1422    backendNodeId: Option<BackendNodeId>,
1423    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1424}
1425
1426impl<'a> GetBoxModelParamsBuilder<'a> {
1427    /// Identifier of the node.
1428    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1429    /// Identifier of the backend node.
1430    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
1431    /// JavaScript object id of the node wrapper.
1432    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
1433    pub fn build(self) -> GetBoxModelParams<'a> {
1434        GetBoxModelParams {
1435            nodeId: self.nodeId,
1436            backendNodeId: self.backendNodeId,
1437            objectId: self.objectId,
1438        }
1439    }
1440}
1441
1442/// Returns boxes for the given node.
1443
1444#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1445#[serde(rename_all = "camelCase")]
1446pub struct GetBoxModelReturns {
1447    /// Box model for the node.
1448    model: BoxModel,
1449}
1450
1451impl GetBoxModelReturns {
1452    pub fn builder(model: BoxModel) -> GetBoxModelReturnsBuilder {
1453        GetBoxModelReturnsBuilder {
1454            model: model,
1455        }
1456    }
1457    pub fn model(&self) -> &BoxModel { &self.model }
1458}
1459
1460
1461pub struct GetBoxModelReturnsBuilder {
1462    model: BoxModel,
1463}
1464
1465impl GetBoxModelReturnsBuilder {
1466    pub fn build(self) -> GetBoxModelReturns {
1467        GetBoxModelReturns {
1468            model: self.model,
1469        }
1470    }
1471}
1472
1473impl<'a> GetBoxModelParams<'a> { pub const METHOD: &'static str = "DOM.getBoxModel"; }
1474
1475impl<'a> crate::CdpCommand<'a> for GetBoxModelParams<'a> {
1476    const METHOD: &'static str = "DOM.getBoxModel";
1477    type Response = GetBoxModelReturns;
1478}
1479
1480/// Returns quads that describe node position on the page. This method
1481/// might return multiple quads for inline nodes.
1482
1483#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1484#[serde(rename_all = "camelCase")]
1485pub struct GetContentQuadsParams<'a> {
1486    /// Identifier of the node.
1487    #[serde(skip_serializing_if = "Option::is_none")]
1488    nodeId: Option<NodeId>,
1489    /// Identifier of the backend node.
1490    #[serde(skip_serializing_if = "Option::is_none")]
1491    backendNodeId: Option<BackendNodeId>,
1492    /// JavaScript object id of the node wrapper.
1493    #[serde(skip_serializing_if = "Option::is_none")]
1494    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1495}
1496
1497impl<'a> GetContentQuadsParams<'a> {
1498    pub fn builder() -> GetContentQuadsParamsBuilder<'a> {
1499        GetContentQuadsParamsBuilder {
1500            nodeId: None,
1501            backendNodeId: None,
1502            objectId: None,
1503        }
1504    }
1505    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1506    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
1507    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
1508}
1509
1510#[derive(Default)]
1511pub struct GetContentQuadsParamsBuilder<'a> {
1512    nodeId: Option<NodeId>,
1513    backendNodeId: Option<BackendNodeId>,
1514    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1515}
1516
1517impl<'a> GetContentQuadsParamsBuilder<'a> {
1518    /// Identifier of the node.
1519    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1520    /// Identifier of the backend node.
1521    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
1522    /// JavaScript object id of the node wrapper.
1523    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
1524    pub fn build(self) -> GetContentQuadsParams<'a> {
1525        GetContentQuadsParams {
1526            nodeId: self.nodeId,
1527            backendNodeId: self.backendNodeId,
1528            objectId: self.objectId,
1529        }
1530    }
1531}
1532
1533/// Returns quads that describe node position on the page. This method
1534/// might return multiple quads for inline nodes.
1535
1536#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1537#[serde(rename_all = "camelCase")]
1538pub struct GetContentQuadsReturns {
1539    /// Quads that describe node layout relative to viewport.
1540    quads: Vec<Quad>,
1541}
1542
1543impl GetContentQuadsReturns {
1544    pub fn builder(quads: Vec<Quad>) -> GetContentQuadsReturnsBuilder {
1545        GetContentQuadsReturnsBuilder {
1546            quads: quads,
1547        }
1548    }
1549    pub fn quads(&self) -> &[Quad] { &self.quads }
1550}
1551
1552
1553pub struct GetContentQuadsReturnsBuilder {
1554    quads: Vec<Quad>,
1555}
1556
1557impl GetContentQuadsReturnsBuilder {
1558    pub fn build(self) -> GetContentQuadsReturns {
1559        GetContentQuadsReturns {
1560            quads: self.quads,
1561        }
1562    }
1563}
1564
1565impl<'a> GetContentQuadsParams<'a> { pub const METHOD: &'static str = "DOM.getContentQuads"; }
1566
1567impl<'a> crate::CdpCommand<'a> for GetContentQuadsParams<'a> {
1568    const METHOD: &'static str = "DOM.getContentQuads";
1569    type Response = GetContentQuadsReturns;
1570}
1571
1572/// Returns the root DOM node (and optionally the subtree) to the caller.
1573/// Implicitly enables the DOM domain events for the current target.
1574
1575#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1576#[serde(rename_all = "camelCase")]
1577pub struct GetDocumentParams {
1578    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1579    /// entire subtree or provide an integer larger than 0.
1580    #[serde(skip_serializing_if = "Option::is_none")]
1581    depth: Option<i64>,
1582    /// Whether or not iframes and shadow roots should be traversed when returning the subtree
1583    /// (default is false).
1584    #[serde(skip_serializing_if = "Option::is_none")]
1585    pierce: Option<bool>,
1586}
1587
1588impl GetDocumentParams {
1589    pub fn builder() -> GetDocumentParamsBuilder {
1590        GetDocumentParamsBuilder {
1591            depth: None,
1592            pierce: None,
1593        }
1594    }
1595    pub fn depth(&self) -> Option<i64> { self.depth }
1596    pub fn pierce(&self) -> Option<bool> { self.pierce }
1597}
1598
1599#[derive(Default)]
1600pub struct GetDocumentParamsBuilder {
1601    depth: Option<i64>,
1602    pierce: Option<bool>,
1603}
1604
1605impl GetDocumentParamsBuilder {
1606    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1607    /// entire subtree or provide an integer larger than 0.
1608    pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
1609    /// Whether or not iframes and shadow roots should be traversed when returning the subtree
1610    /// (default is false).
1611    pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1612    pub fn build(self) -> GetDocumentParams {
1613        GetDocumentParams {
1614            depth: self.depth,
1615            pierce: self.pierce,
1616        }
1617    }
1618}
1619
1620/// Returns the root DOM node (and optionally the subtree) to the caller.
1621/// Implicitly enables the DOM domain events for the current target.
1622
1623#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1624#[serde(rename_all = "camelCase")]
1625pub struct GetDocumentReturns<'a> {
1626    /// Resulting node.
1627    root: Node<'a>,
1628}
1629
1630impl<'a> GetDocumentReturns<'a> {
1631    pub fn builder(root: Node<'a>) -> GetDocumentReturnsBuilder<'a> {
1632        GetDocumentReturnsBuilder {
1633            root: root,
1634        }
1635    }
1636    pub fn root(&self) -> &Node<'a> { &self.root }
1637}
1638
1639
1640pub struct GetDocumentReturnsBuilder<'a> {
1641    root: Node<'a>,
1642}
1643
1644impl<'a> GetDocumentReturnsBuilder<'a> {
1645    pub fn build(self) -> GetDocumentReturns<'a> {
1646        GetDocumentReturns {
1647            root: self.root,
1648        }
1649    }
1650}
1651
1652impl GetDocumentParams { pub const METHOD: &'static str = "DOM.getDocument"; }
1653
1654impl<'a> crate::CdpCommand<'a> for GetDocumentParams {
1655    const METHOD: &'static str = "DOM.getDocument";
1656    type Response = GetDocumentReturns<'a>;
1657}
1658
1659/// Returns the root DOM node (and optionally the subtree) to the caller.
1660/// Deprecated, as it is not designed to work well with the rest of the DOM agent.
1661/// Use DOMSnapshot.captureSnapshot instead.
1662
1663#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1664#[serde(rename_all = "camelCase")]
1665pub struct GetFlattenedDocumentParams {
1666    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1667    /// entire subtree or provide an integer larger than 0.
1668    #[serde(skip_serializing_if = "Option::is_none")]
1669    depth: Option<i64>,
1670    /// Whether or not iframes and shadow roots should be traversed when returning the subtree
1671    /// (default is false).
1672    #[serde(skip_serializing_if = "Option::is_none")]
1673    pierce: Option<bool>,
1674}
1675
1676impl GetFlattenedDocumentParams {
1677    pub fn builder() -> GetFlattenedDocumentParamsBuilder {
1678        GetFlattenedDocumentParamsBuilder {
1679            depth: None,
1680            pierce: None,
1681        }
1682    }
1683    pub fn depth(&self) -> Option<i64> { self.depth }
1684    pub fn pierce(&self) -> Option<bool> { self.pierce }
1685}
1686
1687#[derive(Default)]
1688pub struct GetFlattenedDocumentParamsBuilder {
1689    depth: Option<i64>,
1690    pierce: Option<bool>,
1691}
1692
1693impl GetFlattenedDocumentParamsBuilder {
1694    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1695    /// entire subtree or provide an integer larger than 0.
1696    pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
1697    /// Whether or not iframes and shadow roots should be traversed when returning the subtree
1698    /// (default is false).
1699    pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1700    pub fn build(self) -> GetFlattenedDocumentParams {
1701        GetFlattenedDocumentParams {
1702            depth: self.depth,
1703            pierce: self.pierce,
1704        }
1705    }
1706}
1707
1708/// Returns the root DOM node (and optionally the subtree) to the caller.
1709/// Deprecated, as it is not designed to work well with the rest of the DOM agent.
1710/// Use DOMSnapshot.captureSnapshot instead.
1711
1712#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1713#[serde(rename_all = "camelCase")]
1714pub struct GetFlattenedDocumentReturns<'a> {
1715    /// Resulting node.
1716    nodes: Vec<Node<'a>>,
1717}
1718
1719impl<'a> GetFlattenedDocumentReturns<'a> {
1720    pub fn builder(nodes: Vec<Node<'a>>) -> GetFlattenedDocumentReturnsBuilder<'a> {
1721        GetFlattenedDocumentReturnsBuilder {
1722            nodes: nodes,
1723        }
1724    }
1725    pub fn nodes(&self) -> &[Node<'a>] { &self.nodes }
1726}
1727
1728
1729pub struct GetFlattenedDocumentReturnsBuilder<'a> {
1730    nodes: Vec<Node<'a>>,
1731}
1732
1733impl<'a> GetFlattenedDocumentReturnsBuilder<'a> {
1734    pub fn build(self) -> GetFlattenedDocumentReturns<'a> {
1735        GetFlattenedDocumentReturns {
1736            nodes: self.nodes,
1737        }
1738    }
1739}
1740
1741impl GetFlattenedDocumentParams { pub const METHOD: &'static str = "DOM.getFlattenedDocument"; }
1742
1743impl<'a> crate::CdpCommand<'a> for GetFlattenedDocumentParams {
1744    const METHOD: &'static str = "DOM.getFlattenedDocument";
1745    type Response = GetFlattenedDocumentReturns<'a>;
1746}
1747
1748/// Finds nodes with a given computed style in a subtree.
1749
1750#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1751#[serde(rename_all = "camelCase")]
1752pub struct GetNodesForSubtreeByStyleParams<'a> {
1753    /// Node ID pointing to the root of a subtree.
1754    nodeId: NodeId,
1755    /// The style to filter nodes by (includes nodes if any of properties matches).
1756    computedStyles: Vec<CSSComputedStyleProperty<'a>>,
1757    /// Whether or not iframes and shadow roots in the same target should be traversed when returning the
1758    /// results (default is false).
1759    #[serde(skip_serializing_if = "Option::is_none")]
1760    pierce: Option<bool>,
1761}
1762
1763impl<'a> GetNodesForSubtreeByStyleParams<'a> {
1764    pub fn builder(nodeId: NodeId, computedStyles: Vec<CSSComputedStyleProperty<'a>>) -> GetNodesForSubtreeByStyleParamsBuilder<'a> {
1765        GetNodesForSubtreeByStyleParamsBuilder {
1766            nodeId: nodeId,
1767            computedStyles: computedStyles,
1768            pierce: None,
1769        }
1770    }
1771    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
1772    pub fn computedStyles(&self) -> &[CSSComputedStyleProperty<'a>] { &self.computedStyles }
1773    pub fn pierce(&self) -> Option<bool> { self.pierce }
1774}
1775
1776
1777pub struct GetNodesForSubtreeByStyleParamsBuilder<'a> {
1778    nodeId: NodeId,
1779    computedStyles: Vec<CSSComputedStyleProperty<'a>>,
1780    pierce: Option<bool>,
1781}
1782
1783impl<'a> GetNodesForSubtreeByStyleParamsBuilder<'a> {
1784    /// Whether or not iframes and shadow roots in the same target should be traversed when returning the
1785    /// results (default is false).
1786    pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
1787    pub fn build(self) -> GetNodesForSubtreeByStyleParams<'a> {
1788        GetNodesForSubtreeByStyleParams {
1789            nodeId: self.nodeId,
1790            computedStyles: self.computedStyles,
1791            pierce: self.pierce,
1792        }
1793    }
1794}
1795
1796/// Finds nodes with a given computed style in a subtree.
1797
1798#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1799#[serde(rename_all = "camelCase")]
1800pub struct GetNodesForSubtreeByStyleReturns {
1801    /// Resulting nodes.
1802    nodeIds: Vec<NodeId>,
1803}
1804
1805impl GetNodesForSubtreeByStyleReturns {
1806    pub fn builder(nodeIds: Vec<NodeId>) -> GetNodesForSubtreeByStyleReturnsBuilder {
1807        GetNodesForSubtreeByStyleReturnsBuilder {
1808            nodeIds: nodeIds,
1809        }
1810    }
1811    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
1812}
1813
1814
1815pub struct GetNodesForSubtreeByStyleReturnsBuilder {
1816    nodeIds: Vec<NodeId>,
1817}
1818
1819impl GetNodesForSubtreeByStyleReturnsBuilder {
1820    pub fn build(self) -> GetNodesForSubtreeByStyleReturns {
1821        GetNodesForSubtreeByStyleReturns {
1822            nodeIds: self.nodeIds,
1823        }
1824    }
1825}
1826
1827impl<'a> GetNodesForSubtreeByStyleParams<'a> { pub const METHOD: &'static str = "DOM.getNodesForSubtreeByStyle"; }
1828
1829impl<'a> crate::CdpCommand<'a> for GetNodesForSubtreeByStyleParams<'a> {
1830    const METHOD: &'static str = "DOM.getNodesForSubtreeByStyle";
1831    type Response = GetNodesForSubtreeByStyleReturns;
1832}
1833
1834/// Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
1835/// either returned or not.
1836
1837#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1838#[serde(rename_all = "camelCase")]
1839pub struct GetNodeForLocationParams {
1840    /// X coordinate.
1841    x: i32,
1842    /// Y coordinate.
1843    y: i32,
1844    /// False to skip to the nearest non-UA shadow root ancestor (default: false).
1845    #[serde(skip_serializing_if = "Option::is_none")]
1846    includeUserAgentShadowDOM: Option<bool>,
1847    /// Whether to ignore pointer-events: none on elements and hit test them.
1848    #[serde(skip_serializing_if = "Option::is_none")]
1849    ignorePointerEventsNone: Option<bool>,
1850}
1851
1852impl GetNodeForLocationParams {
1853    pub fn builder(x: i32, y: i32) -> GetNodeForLocationParamsBuilder {
1854        GetNodeForLocationParamsBuilder {
1855            x: x,
1856            y: y,
1857            includeUserAgentShadowDOM: None,
1858            ignorePointerEventsNone: None,
1859        }
1860    }
1861    pub fn x(&self) -> i32 { self.x }
1862    pub fn y(&self) -> i32 { self.y }
1863    pub fn includeUserAgentShadowDOM(&self) -> Option<bool> { self.includeUserAgentShadowDOM }
1864    pub fn ignorePointerEventsNone(&self) -> Option<bool> { self.ignorePointerEventsNone }
1865}
1866
1867
1868pub struct GetNodeForLocationParamsBuilder {
1869    x: i32,
1870    y: i32,
1871    includeUserAgentShadowDOM: Option<bool>,
1872    ignorePointerEventsNone: Option<bool>,
1873}
1874
1875impl GetNodeForLocationParamsBuilder {
1876    /// False to skip to the nearest non-UA shadow root ancestor (default: false).
1877    pub fn includeUserAgentShadowDOM(mut self, includeUserAgentShadowDOM: bool) -> Self { self.includeUserAgentShadowDOM = Some(includeUserAgentShadowDOM); self }
1878    /// Whether to ignore pointer-events: none on elements and hit test them.
1879    pub fn ignorePointerEventsNone(mut self, ignorePointerEventsNone: bool) -> Self { self.ignorePointerEventsNone = Some(ignorePointerEventsNone); self }
1880    pub fn build(self) -> GetNodeForLocationParams {
1881        GetNodeForLocationParams {
1882            x: self.x,
1883            y: self.y,
1884            includeUserAgentShadowDOM: self.includeUserAgentShadowDOM,
1885            ignorePointerEventsNone: self.ignorePointerEventsNone,
1886        }
1887    }
1888}
1889
1890/// Returns node id at given location. Depending on whether DOM domain is enabled, nodeId is
1891/// either returned or not.
1892
1893#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1894#[serde(rename_all = "camelCase")]
1895pub struct GetNodeForLocationReturns<'a> {
1896    /// Resulting node.
1897    backendNodeId: BackendNodeId,
1898    /// Frame this node belongs to.
1899    frameId: crate::page::FrameId<'a>,
1900    /// Id of the node at given coordinates, only when enabled and requested document.
1901    #[serde(skip_serializing_if = "Option::is_none")]
1902    nodeId: Option<NodeId>,
1903}
1904
1905impl<'a> GetNodeForLocationReturns<'a> {
1906    pub fn builder(backendNodeId: BackendNodeId, frameId: crate::page::FrameId<'a>) -> GetNodeForLocationReturnsBuilder<'a> {
1907        GetNodeForLocationReturnsBuilder {
1908            backendNodeId: backendNodeId,
1909            frameId: frameId,
1910            nodeId: None,
1911        }
1912    }
1913    pub fn backendNodeId(&self) -> &BackendNodeId { &self.backendNodeId }
1914    pub fn frameId(&self) -> &crate::page::FrameId<'a> { &self.frameId }
1915    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1916}
1917
1918
1919pub struct GetNodeForLocationReturnsBuilder<'a> {
1920    backendNodeId: BackendNodeId,
1921    frameId: crate::page::FrameId<'a>,
1922    nodeId: Option<NodeId>,
1923}
1924
1925impl<'a> GetNodeForLocationReturnsBuilder<'a> {
1926    /// Id of the node at given coordinates, only when enabled and requested document.
1927    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1928    pub fn build(self) -> GetNodeForLocationReturns<'a> {
1929        GetNodeForLocationReturns {
1930            backendNodeId: self.backendNodeId,
1931            frameId: self.frameId,
1932            nodeId: self.nodeId,
1933        }
1934    }
1935}
1936
1937impl GetNodeForLocationParams { pub const METHOD: &'static str = "DOM.getNodeForLocation"; }
1938
1939impl<'a> crate::CdpCommand<'a> for GetNodeForLocationParams {
1940    const METHOD: &'static str = "DOM.getNodeForLocation";
1941    type Response = GetNodeForLocationReturns<'a>;
1942}
1943
1944/// Returns node's HTML markup.
1945
1946#[derive(Debug, Clone, Serialize, Deserialize, Default)]
1947#[serde(rename_all = "camelCase")]
1948pub struct GetOuterHTMLParams<'a> {
1949    /// Identifier of the node.
1950    #[serde(skip_serializing_if = "Option::is_none")]
1951    nodeId: Option<NodeId>,
1952    /// Identifier of the backend node.
1953    #[serde(skip_serializing_if = "Option::is_none")]
1954    backendNodeId: Option<BackendNodeId>,
1955    /// JavaScript object id of the node wrapper.
1956    #[serde(skip_serializing_if = "Option::is_none")]
1957    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1958    /// Include all shadow roots. Equals to false if not specified.
1959    #[serde(skip_serializing_if = "Option::is_none")]
1960    includeShadowDOM: Option<bool>,
1961}
1962
1963impl<'a> GetOuterHTMLParams<'a> {
1964    pub fn builder() -> GetOuterHTMLParamsBuilder<'a> {
1965        GetOuterHTMLParamsBuilder {
1966            nodeId: None,
1967            backendNodeId: None,
1968            objectId: None,
1969            includeShadowDOM: None,
1970        }
1971    }
1972    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
1973    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
1974    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
1975    pub fn includeShadowDOM(&self) -> Option<bool> { self.includeShadowDOM }
1976}
1977
1978#[derive(Default)]
1979pub struct GetOuterHTMLParamsBuilder<'a> {
1980    nodeId: Option<NodeId>,
1981    backendNodeId: Option<BackendNodeId>,
1982    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
1983    includeShadowDOM: Option<bool>,
1984}
1985
1986impl<'a> GetOuterHTMLParamsBuilder<'a> {
1987    /// Identifier of the node.
1988    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
1989    /// Identifier of the backend node.
1990    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
1991    /// JavaScript object id of the node wrapper.
1992    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
1993    /// Include all shadow roots. Equals to false if not specified.
1994    pub fn includeShadowDOM(mut self, includeShadowDOM: bool) -> Self { self.includeShadowDOM = Some(includeShadowDOM); self }
1995    pub fn build(self) -> GetOuterHTMLParams<'a> {
1996        GetOuterHTMLParams {
1997            nodeId: self.nodeId,
1998            backendNodeId: self.backendNodeId,
1999            objectId: self.objectId,
2000            includeShadowDOM: self.includeShadowDOM,
2001        }
2002    }
2003}
2004
2005/// Returns node's HTML markup.
2006
2007#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2008#[serde(rename_all = "camelCase")]
2009pub struct GetOuterHTMLReturns<'a> {
2010    /// Outer HTML markup.
2011    outerHTML: Cow<'a, str>,
2012}
2013
2014impl<'a> GetOuterHTMLReturns<'a> {
2015    pub fn builder(outerHTML: impl Into<Cow<'a, str>>) -> GetOuterHTMLReturnsBuilder<'a> {
2016        GetOuterHTMLReturnsBuilder {
2017            outerHTML: outerHTML.into(),
2018        }
2019    }
2020    pub fn outerHTML(&self) -> &str { self.outerHTML.as_ref() }
2021}
2022
2023
2024pub struct GetOuterHTMLReturnsBuilder<'a> {
2025    outerHTML: Cow<'a, str>,
2026}
2027
2028impl<'a> GetOuterHTMLReturnsBuilder<'a> {
2029    pub fn build(self) -> GetOuterHTMLReturns<'a> {
2030        GetOuterHTMLReturns {
2031            outerHTML: self.outerHTML,
2032        }
2033    }
2034}
2035
2036impl<'a> GetOuterHTMLParams<'a> { pub const METHOD: &'static str = "DOM.getOuterHTML"; }
2037
2038impl<'a> crate::CdpCommand<'a> for GetOuterHTMLParams<'a> {
2039    const METHOD: &'static str = "DOM.getOuterHTML";
2040    type Response = GetOuterHTMLReturns<'a>;
2041}
2042
2043/// Returns the id of the nearest ancestor that is a relayout boundary.
2044
2045#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2046#[serde(rename_all = "camelCase")]
2047pub struct GetRelayoutBoundaryParams {
2048    /// Id of the node.
2049    nodeId: NodeId,
2050}
2051
2052impl GetRelayoutBoundaryParams {
2053    pub fn builder(nodeId: NodeId) -> GetRelayoutBoundaryParamsBuilder {
2054        GetRelayoutBoundaryParamsBuilder {
2055            nodeId: nodeId,
2056        }
2057    }
2058    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2059}
2060
2061
2062pub struct GetRelayoutBoundaryParamsBuilder {
2063    nodeId: NodeId,
2064}
2065
2066impl GetRelayoutBoundaryParamsBuilder {
2067    pub fn build(self) -> GetRelayoutBoundaryParams {
2068        GetRelayoutBoundaryParams {
2069            nodeId: self.nodeId,
2070        }
2071    }
2072}
2073
2074/// Returns the id of the nearest ancestor that is a relayout boundary.
2075
2076#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2077#[serde(rename_all = "camelCase")]
2078pub struct GetRelayoutBoundaryReturns {
2079    /// Relayout boundary node id for the given node.
2080    nodeId: NodeId,
2081}
2082
2083impl GetRelayoutBoundaryReturns {
2084    pub fn builder(nodeId: NodeId) -> GetRelayoutBoundaryReturnsBuilder {
2085        GetRelayoutBoundaryReturnsBuilder {
2086            nodeId: nodeId,
2087        }
2088    }
2089    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2090}
2091
2092
2093pub struct GetRelayoutBoundaryReturnsBuilder {
2094    nodeId: NodeId,
2095}
2096
2097impl GetRelayoutBoundaryReturnsBuilder {
2098    pub fn build(self) -> GetRelayoutBoundaryReturns {
2099        GetRelayoutBoundaryReturns {
2100            nodeId: self.nodeId,
2101        }
2102    }
2103}
2104
2105impl GetRelayoutBoundaryParams { pub const METHOD: &'static str = "DOM.getRelayoutBoundary"; }
2106
2107impl<'a> crate::CdpCommand<'a> for GetRelayoutBoundaryParams {
2108    const METHOD: &'static str = "DOM.getRelayoutBoundary";
2109    type Response = GetRelayoutBoundaryReturns;
2110}
2111
2112/// Returns search results from given 'fromIndex' to given 'toIndex' from the search with the given
2113/// identifier.
2114
2115#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2116#[serde(rename_all = "camelCase")]
2117pub struct GetSearchResultsParams<'a> {
2118    /// Unique search session identifier.
2119    searchId: Cow<'a, str>,
2120    /// Start index of the search result to be returned.
2121    fromIndex: u64,
2122    /// End index of the search result to be returned.
2123    toIndex: u64,
2124}
2125
2126impl<'a> GetSearchResultsParams<'a> {
2127    pub fn builder(searchId: impl Into<Cow<'a, str>>, fromIndex: u64, toIndex: u64) -> GetSearchResultsParamsBuilder<'a> {
2128        GetSearchResultsParamsBuilder {
2129            searchId: searchId.into(),
2130            fromIndex: fromIndex,
2131            toIndex: toIndex,
2132        }
2133    }
2134    pub fn searchId(&self) -> &str { self.searchId.as_ref() }
2135    pub fn fromIndex(&self) -> u64 { self.fromIndex }
2136    pub fn toIndex(&self) -> u64 { self.toIndex }
2137}
2138
2139
2140pub struct GetSearchResultsParamsBuilder<'a> {
2141    searchId: Cow<'a, str>,
2142    fromIndex: u64,
2143    toIndex: u64,
2144}
2145
2146impl<'a> GetSearchResultsParamsBuilder<'a> {
2147    pub fn build(self) -> GetSearchResultsParams<'a> {
2148        GetSearchResultsParams {
2149            searchId: self.searchId,
2150            fromIndex: self.fromIndex,
2151            toIndex: self.toIndex,
2152        }
2153    }
2154}
2155
2156/// Returns search results from given 'fromIndex' to given 'toIndex' from the search with the given
2157/// identifier.
2158
2159#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2160#[serde(rename_all = "camelCase")]
2161pub struct GetSearchResultsReturns {
2162    /// Ids of the search result nodes.
2163    nodeIds: Vec<NodeId>,
2164}
2165
2166impl GetSearchResultsReturns {
2167    pub fn builder(nodeIds: Vec<NodeId>) -> GetSearchResultsReturnsBuilder {
2168        GetSearchResultsReturnsBuilder {
2169            nodeIds: nodeIds,
2170        }
2171    }
2172    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
2173}
2174
2175
2176pub struct GetSearchResultsReturnsBuilder {
2177    nodeIds: Vec<NodeId>,
2178}
2179
2180impl GetSearchResultsReturnsBuilder {
2181    pub fn build(self) -> GetSearchResultsReturns {
2182        GetSearchResultsReturns {
2183            nodeIds: self.nodeIds,
2184        }
2185    }
2186}
2187
2188impl<'a> GetSearchResultsParams<'a> { pub const METHOD: &'static str = "DOM.getSearchResults"; }
2189
2190impl<'a> crate::CdpCommand<'a> for GetSearchResultsParams<'a> {
2191    const METHOD: &'static str = "DOM.getSearchResults";
2192    type Response = GetSearchResultsReturns;
2193}
2194
2195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2196pub struct HideHighlightParams {}
2197
2198impl HideHighlightParams { pub const METHOD: &'static str = "DOM.hideHighlight"; }
2199
2200impl<'a> crate::CdpCommand<'a> for HideHighlightParams {
2201    const METHOD: &'static str = "DOM.hideHighlight";
2202    type Response = crate::EmptyReturns;
2203}
2204
2205#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2206pub struct HighlightNodeParams {}
2207
2208impl HighlightNodeParams { pub const METHOD: &'static str = "DOM.highlightNode"; }
2209
2210impl<'a> crate::CdpCommand<'a> for HighlightNodeParams {
2211    const METHOD: &'static str = "DOM.highlightNode";
2212    type Response = crate::EmptyReturns;
2213}
2214
2215#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2216pub struct HighlightRectParams {}
2217
2218impl HighlightRectParams { pub const METHOD: &'static str = "DOM.highlightRect"; }
2219
2220impl<'a> crate::CdpCommand<'a> for HighlightRectParams {
2221    const METHOD: &'static str = "DOM.highlightRect";
2222    type Response = crate::EmptyReturns;
2223}
2224
2225#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2226pub struct MarkUndoableStateParams {}
2227
2228impl MarkUndoableStateParams { pub const METHOD: &'static str = "DOM.markUndoableState"; }
2229
2230impl<'a> crate::CdpCommand<'a> for MarkUndoableStateParams {
2231    const METHOD: &'static str = "DOM.markUndoableState";
2232    type Response = crate::EmptyReturns;
2233}
2234
2235/// Moves node into the new container, places it before the given anchor.
2236
2237#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2238#[serde(rename_all = "camelCase")]
2239pub struct MoveToParams {
2240    /// Id of the node to move.
2241    nodeId: NodeId,
2242    /// Id of the element to drop the moved node into.
2243    targetNodeId: NodeId,
2244    /// Drop node before this one (if absent, the moved node becomes the last child of
2245    /// 'targetNodeId').
2246    #[serde(skip_serializing_if = "Option::is_none")]
2247    insertBeforeNodeId: Option<NodeId>,
2248}
2249
2250impl MoveToParams {
2251    pub fn builder(nodeId: NodeId, targetNodeId: NodeId) -> MoveToParamsBuilder {
2252        MoveToParamsBuilder {
2253            nodeId: nodeId,
2254            targetNodeId: targetNodeId,
2255            insertBeforeNodeId: None,
2256        }
2257    }
2258    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2259    pub fn targetNodeId(&self) -> &NodeId { &self.targetNodeId }
2260    pub fn insertBeforeNodeId(&self) -> Option<&NodeId> { self.insertBeforeNodeId.as_ref() }
2261}
2262
2263
2264pub struct MoveToParamsBuilder {
2265    nodeId: NodeId,
2266    targetNodeId: NodeId,
2267    insertBeforeNodeId: Option<NodeId>,
2268}
2269
2270impl MoveToParamsBuilder {
2271    /// Drop node before this one (if absent, the moved node becomes the last child of
2272    /// 'targetNodeId').
2273    pub fn insertBeforeNodeId(mut self, insertBeforeNodeId: NodeId) -> Self { self.insertBeforeNodeId = Some(insertBeforeNodeId); self }
2274    pub fn build(self) -> MoveToParams {
2275        MoveToParams {
2276            nodeId: self.nodeId,
2277            targetNodeId: self.targetNodeId,
2278            insertBeforeNodeId: self.insertBeforeNodeId,
2279        }
2280    }
2281}
2282
2283/// Moves node into the new container, places it before the given anchor.
2284
2285#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2286#[serde(rename_all = "camelCase")]
2287pub struct MoveToReturns {
2288    /// New id of the moved node.
2289    nodeId: NodeId,
2290}
2291
2292impl MoveToReturns {
2293    pub fn builder(nodeId: NodeId) -> MoveToReturnsBuilder {
2294        MoveToReturnsBuilder {
2295            nodeId: nodeId,
2296        }
2297    }
2298    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2299}
2300
2301
2302pub struct MoveToReturnsBuilder {
2303    nodeId: NodeId,
2304}
2305
2306impl MoveToReturnsBuilder {
2307    pub fn build(self) -> MoveToReturns {
2308        MoveToReturns {
2309            nodeId: self.nodeId,
2310        }
2311    }
2312}
2313
2314impl MoveToParams { pub const METHOD: &'static str = "DOM.moveTo"; }
2315
2316impl<'a> crate::CdpCommand<'a> for MoveToParams {
2317    const METHOD: &'static str = "DOM.moveTo";
2318    type Response = MoveToReturns;
2319}
2320
2321/// Searches for a given string in the DOM tree. Use 'getSearchResults' to access search results or
2322/// 'cancelSearch' to end this search session.
2323
2324#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2325#[serde(rename_all = "camelCase")]
2326pub struct PerformSearchParams<'a> {
2327    /// Plain text or query selector or XPath search query.
2328    query: Cow<'a, str>,
2329    /// True to search in user agent shadow DOM.
2330    #[serde(skip_serializing_if = "Option::is_none")]
2331    includeUserAgentShadowDOM: Option<bool>,
2332}
2333
2334impl<'a> PerformSearchParams<'a> {
2335    pub fn builder(query: impl Into<Cow<'a, str>>) -> PerformSearchParamsBuilder<'a> {
2336        PerformSearchParamsBuilder {
2337            query: query.into(),
2338            includeUserAgentShadowDOM: None,
2339        }
2340    }
2341    pub fn query(&self) -> &str { self.query.as_ref() }
2342    pub fn includeUserAgentShadowDOM(&self) -> Option<bool> { self.includeUserAgentShadowDOM }
2343}
2344
2345
2346pub struct PerformSearchParamsBuilder<'a> {
2347    query: Cow<'a, str>,
2348    includeUserAgentShadowDOM: Option<bool>,
2349}
2350
2351impl<'a> PerformSearchParamsBuilder<'a> {
2352    /// True to search in user agent shadow DOM.
2353    pub fn includeUserAgentShadowDOM(mut self, includeUserAgentShadowDOM: bool) -> Self { self.includeUserAgentShadowDOM = Some(includeUserAgentShadowDOM); self }
2354    pub fn build(self) -> PerformSearchParams<'a> {
2355        PerformSearchParams {
2356            query: self.query,
2357            includeUserAgentShadowDOM: self.includeUserAgentShadowDOM,
2358        }
2359    }
2360}
2361
2362/// Searches for a given string in the DOM tree. Use 'getSearchResults' to access search results or
2363/// 'cancelSearch' to end this search session.
2364
2365#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2366#[serde(rename_all = "camelCase")]
2367pub struct PerformSearchReturns<'a> {
2368    /// Unique search session identifier.
2369    searchId: Cow<'a, str>,
2370    /// Number of search results.
2371    resultCount: u64,
2372}
2373
2374impl<'a> PerformSearchReturns<'a> {
2375    pub fn builder(searchId: impl Into<Cow<'a, str>>, resultCount: u64) -> PerformSearchReturnsBuilder<'a> {
2376        PerformSearchReturnsBuilder {
2377            searchId: searchId.into(),
2378            resultCount: resultCount,
2379        }
2380    }
2381    pub fn searchId(&self) -> &str { self.searchId.as_ref() }
2382    pub fn resultCount(&self) -> u64 { self.resultCount }
2383}
2384
2385
2386pub struct PerformSearchReturnsBuilder<'a> {
2387    searchId: Cow<'a, str>,
2388    resultCount: u64,
2389}
2390
2391impl<'a> PerformSearchReturnsBuilder<'a> {
2392    pub fn build(self) -> PerformSearchReturns<'a> {
2393        PerformSearchReturns {
2394            searchId: self.searchId,
2395            resultCount: self.resultCount,
2396        }
2397    }
2398}
2399
2400impl<'a> PerformSearchParams<'a> { pub const METHOD: &'static str = "DOM.performSearch"; }
2401
2402impl<'a> crate::CdpCommand<'a> for PerformSearchParams<'a> {
2403    const METHOD: &'static str = "DOM.performSearch";
2404    type Response = PerformSearchReturns<'a>;
2405}
2406
2407/// Requests that the node is sent to the caller given its path. // FIXME, use XPath
2408
2409#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2410#[serde(rename_all = "camelCase")]
2411pub struct PushNodeByPathToFrontendParams<'a> {
2412    /// Path to node in the proprietary format.
2413    path: Cow<'a, str>,
2414}
2415
2416impl<'a> PushNodeByPathToFrontendParams<'a> {
2417    pub fn builder(path: impl Into<Cow<'a, str>>) -> PushNodeByPathToFrontendParamsBuilder<'a> {
2418        PushNodeByPathToFrontendParamsBuilder {
2419            path: path.into(),
2420        }
2421    }
2422    pub fn path(&self) -> &str { self.path.as_ref() }
2423}
2424
2425
2426pub struct PushNodeByPathToFrontendParamsBuilder<'a> {
2427    path: Cow<'a, str>,
2428}
2429
2430impl<'a> PushNodeByPathToFrontendParamsBuilder<'a> {
2431    pub fn build(self) -> PushNodeByPathToFrontendParams<'a> {
2432        PushNodeByPathToFrontendParams {
2433            path: self.path,
2434        }
2435    }
2436}
2437
2438/// Requests that the node is sent to the caller given its path. // FIXME, use XPath
2439
2440#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2441#[serde(rename_all = "camelCase")]
2442pub struct PushNodeByPathToFrontendReturns {
2443    /// Id of the node for given path.
2444    nodeId: NodeId,
2445}
2446
2447impl PushNodeByPathToFrontendReturns {
2448    pub fn builder(nodeId: NodeId) -> PushNodeByPathToFrontendReturnsBuilder {
2449        PushNodeByPathToFrontendReturnsBuilder {
2450            nodeId: nodeId,
2451        }
2452    }
2453    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2454}
2455
2456
2457pub struct PushNodeByPathToFrontendReturnsBuilder {
2458    nodeId: NodeId,
2459}
2460
2461impl PushNodeByPathToFrontendReturnsBuilder {
2462    pub fn build(self) -> PushNodeByPathToFrontendReturns {
2463        PushNodeByPathToFrontendReturns {
2464            nodeId: self.nodeId,
2465        }
2466    }
2467}
2468
2469impl<'a> PushNodeByPathToFrontendParams<'a> { pub const METHOD: &'static str = "DOM.pushNodeByPathToFrontend"; }
2470
2471impl<'a> crate::CdpCommand<'a> for PushNodeByPathToFrontendParams<'a> {
2472    const METHOD: &'static str = "DOM.pushNodeByPathToFrontend";
2473    type Response = PushNodeByPathToFrontendReturns;
2474}
2475
2476/// Requests that a batch of nodes is sent to the caller given their backend node ids.
2477
2478#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2479#[serde(rename_all = "camelCase")]
2480pub struct PushNodesByBackendIdsToFrontendParams {
2481    /// The array of backend node ids.
2482    backendNodeIds: Vec<BackendNodeId>,
2483}
2484
2485impl PushNodesByBackendIdsToFrontendParams {
2486    pub fn builder(backendNodeIds: Vec<BackendNodeId>) -> PushNodesByBackendIdsToFrontendParamsBuilder {
2487        PushNodesByBackendIdsToFrontendParamsBuilder {
2488            backendNodeIds: backendNodeIds,
2489        }
2490    }
2491    pub fn backendNodeIds(&self) -> &[BackendNodeId] { &self.backendNodeIds }
2492}
2493
2494
2495pub struct PushNodesByBackendIdsToFrontendParamsBuilder {
2496    backendNodeIds: Vec<BackendNodeId>,
2497}
2498
2499impl PushNodesByBackendIdsToFrontendParamsBuilder {
2500    pub fn build(self) -> PushNodesByBackendIdsToFrontendParams {
2501        PushNodesByBackendIdsToFrontendParams {
2502            backendNodeIds: self.backendNodeIds,
2503        }
2504    }
2505}
2506
2507/// Requests that a batch of nodes is sent to the caller given their backend node ids.
2508
2509#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2510#[serde(rename_all = "camelCase")]
2511pub struct PushNodesByBackendIdsToFrontendReturns {
2512    /// The array of ids of pushed nodes that correspond to the backend ids specified in
2513    /// backendNodeIds.
2514    nodeIds: Vec<NodeId>,
2515}
2516
2517impl PushNodesByBackendIdsToFrontendReturns {
2518    pub fn builder(nodeIds: Vec<NodeId>) -> PushNodesByBackendIdsToFrontendReturnsBuilder {
2519        PushNodesByBackendIdsToFrontendReturnsBuilder {
2520            nodeIds: nodeIds,
2521        }
2522    }
2523    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
2524}
2525
2526
2527pub struct PushNodesByBackendIdsToFrontendReturnsBuilder {
2528    nodeIds: Vec<NodeId>,
2529}
2530
2531impl PushNodesByBackendIdsToFrontendReturnsBuilder {
2532    pub fn build(self) -> PushNodesByBackendIdsToFrontendReturns {
2533        PushNodesByBackendIdsToFrontendReturns {
2534            nodeIds: self.nodeIds,
2535        }
2536    }
2537}
2538
2539impl PushNodesByBackendIdsToFrontendParams { pub const METHOD: &'static str = "DOM.pushNodesByBackendIdsToFrontend"; }
2540
2541impl<'a> crate::CdpCommand<'a> for PushNodesByBackendIdsToFrontendParams {
2542    const METHOD: &'static str = "DOM.pushNodesByBackendIdsToFrontend";
2543    type Response = PushNodesByBackendIdsToFrontendReturns;
2544}
2545
2546/// Executes 'querySelector' on a given node.
2547
2548#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2549#[serde(rename_all = "camelCase")]
2550pub struct QuerySelectorParams<'a> {
2551    /// Id of the node to query upon.
2552    nodeId: NodeId,
2553    /// Selector string.
2554    selector: Cow<'a, str>,
2555}
2556
2557impl<'a> QuerySelectorParams<'a> {
2558    pub fn builder(nodeId: NodeId, selector: impl Into<Cow<'a, str>>) -> QuerySelectorParamsBuilder<'a> {
2559        QuerySelectorParamsBuilder {
2560            nodeId: nodeId,
2561            selector: selector.into(),
2562        }
2563    }
2564    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2565    pub fn selector(&self) -> &str { self.selector.as_ref() }
2566}
2567
2568
2569pub struct QuerySelectorParamsBuilder<'a> {
2570    nodeId: NodeId,
2571    selector: Cow<'a, str>,
2572}
2573
2574impl<'a> QuerySelectorParamsBuilder<'a> {
2575    pub fn build(self) -> QuerySelectorParams<'a> {
2576        QuerySelectorParams {
2577            nodeId: self.nodeId,
2578            selector: self.selector,
2579        }
2580    }
2581}
2582
2583/// Executes 'querySelector' on a given node.
2584
2585#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2586#[serde(rename_all = "camelCase")]
2587pub struct QuerySelectorReturns {
2588    /// Query selector result.
2589    nodeId: NodeId,
2590}
2591
2592impl QuerySelectorReturns {
2593    pub fn builder(nodeId: NodeId) -> QuerySelectorReturnsBuilder {
2594        QuerySelectorReturnsBuilder {
2595            nodeId: nodeId,
2596        }
2597    }
2598    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2599}
2600
2601
2602pub struct QuerySelectorReturnsBuilder {
2603    nodeId: NodeId,
2604}
2605
2606impl QuerySelectorReturnsBuilder {
2607    pub fn build(self) -> QuerySelectorReturns {
2608        QuerySelectorReturns {
2609            nodeId: self.nodeId,
2610        }
2611    }
2612}
2613
2614impl<'a> QuerySelectorParams<'a> { pub const METHOD: &'static str = "DOM.querySelector"; }
2615
2616impl<'a> crate::CdpCommand<'a> for QuerySelectorParams<'a> {
2617    const METHOD: &'static str = "DOM.querySelector";
2618    type Response = QuerySelectorReturns;
2619}
2620
2621/// Executes 'querySelectorAll' on a given node.
2622
2623#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2624#[serde(rename_all = "camelCase")]
2625pub struct QuerySelectorAllParams<'a> {
2626    /// Id of the node to query upon.
2627    nodeId: NodeId,
2628    /// Selector string.
2629    selector: Cow<'a, str>,
2630}
2631
2632impl<'a> QuerySelectorAllParams<'a> {
2633    pub fn builder(nodeId: NodeId, selector: impl Into<Cow<'a, str>>) -> QuerySelectorAllParamsBuilder<'a> {
2634        QuerySelectorAllParamsBuilder {
2635            nodeId: nodeId,
2636            selector: selector.into(),
2637        }
2638    }
2639    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2640    pub fn selector(&self) -> &str { self.selector.as_ref() }
2641}
2642
2643
2644pub struct QuerySelectorAllParamsBuilder<'a> {
2645    nodeId: NodeId,
2646    selector: Cow<'a, str>,
2647}
2648
2649impl<'a> QuerySelectorAllParamsBuilder<'a> {
2650    pub fn build(self) -> QuerySelectorAllParams<'a> {
2651        QuerySelectorAllParams {
2652            nodeId: self.nodeId,
2653            selector: self.selector,
2654        }
2655    }
2656}
2657
2658/// Executes 'querySelectorAll' on a given node.
2659
2660#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2661#[serde(rename_all = "camelCase")]
2662pub struct QuerySelectorAllReturns {
2663    /// Query selector result.
2664    nodeIds: Vec<NodeId>,
2665}
2666
2667impl QuerySelectorAllReturns {
2668    pub fn builder(nodeIds: Vec<NodeId>) -> QuerySelectorAllReturnsBuilder {
2669        QuerySelectorAllReturnsBuilder {
2670            nodeIds: nodeIds,
2671        }
2672    }
2673    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
2674}
2675
2676
2677pub struct QuerySelectorAllReturnsBuilder {
2678    nodeIds: Vec<NodeId>,
2679}
2680
2681impl QuerySelectorAllReturnsBuilder {
2682    pub fn build(self) -> QuerySelectorAllReturns {
2683        QuerySelectorAllReturns {
2684            nodeIds: self.nodeIds,
2685        }
2686    }
2687}
2688
2689impl<'a> QuerySelectorAllParams<'a> { pub const METHOD: &'static str = "DOM.querySelectorAll"; }
2690
2691impl<'a> crate::CdpCommand<'a> for QuerySelectorAllParams<'a> {
2692    const METHOD: &'static str = "DOM.querySelectorAll";
2693    type Response = QuerySelectorAllReturns;
2694}
2695
2696/// Returns NodeIds of current top layer elements.
2697/// Top layer is rendered closest to the user within a viewport, therefore its elements always
2698/// appear on top of all other content.
2699
2700#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2701#[serde(rename_all = "camelCase")]
2702pub struct GetTopLayerElementsReturns {
2703    /// NodeIds of top layer elements
2704    nodeIds: Vec<NodeId>,
2705}
2706
2707impl GetTopLayerElementsReturns {
2708    pub fn builder(nodeIds: Vec<NodeId>) -> GetTopLayerElementsReturnsBuilder {
2709        GetTopLayerElementsReturnsBuilder {
2710            nodeIds: nodeIds,
2711        }
2712    }
2713    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
2714}
2715
2716
2717pub struct GetTopLayerElementsReturnsBuilder {
2718    nodeIds: Vec<NodeId>,
2719}
2720
2721impl GetTopLayerElementsReturnsBuilder {
2722    pub fn build(self) -> GetTopLayerElementsReturns {
2723        GetTopLayerElementsReturns {
2724            nodeIds: self.nodeIds,
2725        }
2726    }
2727}
2728
2729#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2730pub struct GetTopLayerElementsParams {}
2731
2732impl GetTopLayerElementsParams { pub const METHOD: &'static str = "DOM.getTopLayerElements"; }
2733
2734impl<'a> crate::CdpCommand<'a> for GetTopLayerElementsParams {
2735    const METHOD: &'static str = "DOM.getTopLayerElements";
2736    type Response = GetTopLayerElementsReturns;
2737}
2738
2739/// Returns the NodeId of the matched element according to certain relations.
2740
2741#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2742#[serde(rename_all = "camelCase")]
2743pub struct GetElementByRelationParams<'a> {
2744    /// Id of the node from which to query the relation.
2745    nodeId: NodeId,
2746    /// Type of relation to get.
2747    relation: Cow<'a, str>,
2748}
2749
2750impl<'a> GetElementByRelationParams<'a> {
2751    pub fn builder(nodeId: NodeId, relation: impl Into<Cow<'a, str>>) -> GetElementByRelationParamsBuilder<'a> {
2752        GetElementByRelationParamsBuilder {
2753            nodeId: nodeId,
2754            relation: relation.into(),
2755        }
2756    }
2757    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2758    pub fn relation(&self) -> &str { self.relation.as_ref() }
2759}
2760
2761
2762pub struct GetElementByRelationParamsBuilder<'a> {
2763    nodeId: NodeId,
2764    relation: Cow<'a, str>,
2765}
2766
2767impl<'a> GetElementByRelationParamsBuilder<'a> {
2768    pub fn build(self) -> GetElementByRelationParams<'a> {
2769        GetElementByRelationParams {
2770            nodeId: self.nodeId,
2771            relation: self.relation,
2772        }
2773    }
2774}
2775
2776/// Returns the NodeId of the matched element according to certain relations.
2777
2778#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2779#[serde(rename_all = "camelCase")]
2780pub struct GetElementByRelationReturns {
2781    /// NodeId of the element matching the queried relation.
2782    nodeId: NodeId,
2783}
2784
2785impl GetElementByRelationReturns {
2786    pub fn builder(nodeId: NodeId) -> GetElementByRelationReturnsBuilder {
2787        GetElementByRelationReturnsBuilder {
2788            nodeId: nodeId,
2789        }
2790    }
2791    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2792}
2793
2794
2795pub struct GetElementByRelationReturnsBuilder {
2796    nodeId: NodeId,
2797}
2798
2799impl GetElementByRelationReturnsBuilder {
2800    pub fn build(self) -> GetElementByRelationReturns {
2801        GetElementByRelationReturns {
2802            nodeId: self.nodeId,
2803        }
2804    }
2805}
2806
2807impl<'a> GetElementByRelationParams<'a> { pub const METHOD: &'static str = "DOM.getElementByRelation"; }
2808
2809impl<'a> crate::CdpCommand<'a> for GetElementByRelationParams<'a> {
2810    const METHOD: &'static str = "DOM.getElementByRelation";
2811    type Response = GetElementByRelationReturns;
2812}
2813
2814#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2815pub struct RedoParams {}
2816
2817impl RedoParams { pub const METHOD: &'static str = "DOM.redo"; }
2818
2819impl<'a> crate::CdpCommand<'a> for RedoParams {
2820    const METHOD: &'static str = "DOM.redo";
2821    type Response = crate::EmptyReturns;
2822}
2823
2824/// Removes attribute with given name from an element with given id.
2825
2826#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2827#[serde(rename_all = "camelCase")]
2828pub struct RemoveAttributeParams<'a> {
2829    /// Id of the element to remove attribute from.
2830    nodeId: NodeId,
2831    /// Name of the attribute to remove.
2832    name: Cow<'a, str>,
2833}
2834
2835impl<'a> RemoveAttributeParams<'a> {
2836    pub fn builder(nodeId: NodeId, name: impl Into<Cow<'a, str>>) -> RemoveAttributeParamsBuilder<'a> {
2837        RemoveAttributeParamsBuilder {
2838            nodeId: nodeId,
2839            name: name.into(),
2840        }
2841    }
2842    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2843    pub fn name(&self) -> &str { self.name.as_ref() }
2844}
2845
2846
2847pub struct RemoveAttributeParamsBuilder<'a> {
2848    nodeId: NodeId,
2849    name: Cow<'a, str>,
2850}
2851
2852impl<'a> RemoveAttributeParamsBuilder<'a> {
2853    pub fn build(self) -> RemoveAttributeParams<'a> {
2854        RemoveAttributeParams {
2855            nodeId: self.nodeId,
2856            name: self.name,
2857        }
2858    }
2859}
2860
2861impl<'a> RemoveAttributeParams<'a> { pub const METHOD: &'static str = "DOM.removeAttribute"; }
2862
2863impl<'a> crate::CdpCommand<'a> for RemoveAttributeParams<'a> {
2864    const METHOD: &'static str = "DOM.removeAttribute";
2865    type Response = crate::EmptyReturns;
2866}
2867
2868/// Removes node with given id.
2869
2870#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2871#[serde(rename_all = "camelCase")]
2872pub struct RemoveNodeParams {
2873    /// Id of the node to remove.
2874    nodeId: NodeId,
2875}
2876
2877impl RemoveNodeParams {
2878    pub fn builder(nodeId: NodeId) -> RemoveNodeParamsBuilder {
2879        RemoveNodeParamsBuilder {
2880            nodeId: nodeId,
2881        }
2882    }
2883    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2884}
2885
2886
2887pub struct RemoveNodeParamsBuilder {
2888    nodeId: NodeId,
2889}
2890
2891impl RemoveNodeParamsBuilder {
2892    pub fn build(self) -> RemoveNodeParams {
2893        RemoveNodeParams {
2894            nodeId: self.nodeId,
2895        }
2896    }
2897}
2898
2899impl RemoveNodeParams { pub const METHOD: &'static str = "DOM.removeNode"; }
2900
2901impl<'a> crate::CdpCommand<'a> for RemoveNodeParams {
2902    const METHOD: &'static str = "DOM.removeNode";
2903    type Response = crate::EmptyReturns;
2904}
2905
2906/// Requests that children of the node with given id are returned to the caller in form of
2907/// 'setChildNodes' events where not only immediate children are retrieved, but all children down to
2908/// the specified depth.
2909
2910#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2911#[serde(rename_all = "camelCase")]
2912pub struct RequestChildNodesParams {
2913    /// Id of the node to get children for.
2914    nodeId: NodeId,
2915    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
2916    /// entire subtree or provide an integer larger than 0.
2917    #[serde(skip_serializing_if = "Option::is_none")]
2918    depth: Option<i64>,
2919    /// Whether or not iframes and shadow roots should be traversed when returning the sub-tree
2920    /// (default is false).
2921    #[serde(skip_serializing_if = "Option::is_none")]
2922    pierce: Option<bool>,
2923}
2924
2925impl RequestChildNodesParams {
2926    pub fn builder(nodeId: NodeId) -> RequestChildNodesParamsBuilder {
2927        RequestChildNodesParamsBuilder {
2928            nodeId: nodeId,
2929            depth: None,
2930            pierce: None,
2931        }
2932    }
2933    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
2934    pub fn depth(&self) -> Option<i64> { self.depth }
2935    pub fn pierce(&self) -> Option<bool> { self.pierce }
2936}
2937
2938
2939pub struct RequestChildNodesParamsBuilder {
2940    nodeId: NodeId,
2941    depth: Option<i64>,
2942    pierce: Option<bool>,
2943}
2944
2945impl RequestChildNodesParamsBuilder {
2946    /// The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
2947    /// entire subtree or provide an integer larger than 0.
2948    pub fn depth(mut self, depth: i64) -> Self { self.depth = Some(depth); self }
2949    /// Whether or not iframes and shadow roots should be traversed when returning the sub-tree
2950    /// (default is false).
2951    pub fn pierce(mut self, pierce: bool) -> Self { self.pierce = Some(pierce); self }
2952    pub fn build(self) -> RequestChildNodesParams {
2953        RequestChildNodesParams {
2954            nodeId: self.nodeId,
2955            depth: self.depth,
2956            pierce: self.pierce,
2957        }
2958    }
2959}
2960
2961impl RequestChildNodesParams { pub const METHOD: &'static str = "DOM.requestChildNodes"; }
2962
2963impl<'a> crate::CdpCommand<'a> for RequestChildNodesParams {
2964    const METHOD: &'static str = "DOM.requestChildNodes";
2965    type Response = crate::EmptyReturns;
2966}
2967
2968/// Requests that the node is sent to the caller given the JavaScript node object reference. All
2969/// nodes that form the path from the node to the root are also sent to the client as a series of
2970/// 'setChildNodes' notifications.
2971
2972#[derive(Debug, Clone, Serialize, Deserialize, Default)]
2973#[serde(rename_all = "camelCase")]
2974pub struct RequestNodeParams<'a> {
2975    /// JavaScript object id to convert into node.
2976    objectId: crate::runtime::RemoteObjectId<'a>,
2977}
2978
2979impl<'a> RequestNodeParams<'a> {
2980    pub fn builder(objectId: crate::runtime::RemoteObjectId<'a>) -> RequestNodeParamsBuilder<'a> {
2981        RequestNodeParamsBuilder {
2982            objectId: objectId,
2983        }
2984    }
2985    pub fn objectId(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.objectId }
2986}
2987
2988
2989pub struct RequestNodeParamsBuilder<'a> {
2990    objectId: crate::runtime::RemoteObjectId<'a>,
2991}
2992
2993impl<'a> RequestNodeParamsBuilder<'a> {
2994    pub fn build(self) -> RequestNodeParams<'a> {
2995        RequestNodeParams {
2996            objectId: self.objectId,
2997        }
2998    }
2999}
3000
3001/// Requests that the node is sent to the caller given the JavaScript node object reference. All
3002/// nodes that form the path from the node to the root are also sent to the client as a series of
3003/// 'setChildNodes' notifications.
3004
3005#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3006#[serde(rename_all = "camelCase")]
3007pub struct RequestNodeReturns {
3008    /// Node id for given object.
3009    nodeId: NodeId,
3010}
3011
3012impl RequestNodeReturns {
3013    pub fn builder(nodeId: NodeId) -> RequestNodeReturnsBuilder {
3014        RequestNodeReturnsBuilder {
3015            nodeId: nodeId,
3016        }
3017    }
3018    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3019}
3020
3021
3022pub struct RequestNodeReturnsBuilder {
3023    nodeId: NodeId,
3024}
3025
3026impl RequestNodeReturnsBuilder {
3027    pub fn build(self) -> RequestNodeReturns {
3028        RequestNodeReturns {
3029            nodeId: self.nodeId,
3030        }
3031    }
3032}
3033
3034impl<'a> RequestNodeParams<'a> { pub const METHOD: &'static str = "DOM.requestNode"; }
3035
3036impl<'a> crate::CdpCommand<'a> for RequestNodeParams<'a> {
3037    const METHOD: &'static str = "DOM.requestNode";
3038    type Response = RequestNodeReturns;
3039}
3040
3041/// Resolves the JavaScript node object for a given NodeId or BackendNodeId.
3042
3043#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3044#[serde(rename_all = "camelCase")]
3045pub struct ResolveNodeParams<'a> {
3046    /// Id of the node to resolve.
3047    #[serde(skip_serializing_if = "Option::is_none")]
3048    nodeId: Option<NodeId>,
3049    /// Backend identifier of the node to resolve.
3050    #[serde(skip_serializing_if = "Option::is_none")]
3051    backendNodeId: Option<crate::dom::BackendNodeId>,
3052    /// Symbolic group name that can be used to release multiple objects.
3053    #[serde(skip_serializing_if = "Option::is_none")]
3054    objectGroup: Option<Cow<'a, str>>,
3055    /// Execution context in which to resolve the node.
3056    #[serde(skip_serializing_if = "Option::is_none")]
3057    executionContextId: Option<crate::runtime::ExecutionContextId>,
3058}
3059
3060impl<'a> ResolveNodeParams<'a> {
3061    pub fn builder() -> ResolveNodeParamsBuilder<'a> {
3062        ResolveNodeParamsBuilder {
3063            nodeId: None,
3064            backendNodeId: None,
3065            objectGroup: None,
3066            executionContextId: None,
3067        }
3068    }
3069    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
3070    pub fn backendNodeId(&self) -> Option<&crate::dom::BackendNodeId> { self.backendNodeId.as_ref() }
3071    pub fn objectGroup(&self) -> Option<&str> { self.objectGroup.as_deref() }
3072    pub fn executionContextId(&self) -> Option<&crate::runtime::ExecutionContextId> { self.executionContextId.as_ref() }
3073}
3074
3075#[derive(Default)]
3076pub struct ResolveNodeParamsBuilder<'a> {
3077    nodeId: Option<NodeId>,
3078    backendNodeId: Option<crate::dom::BackendNodeId>,
3079    objectGroup: Option<Cow<'a, str>>,
3080    executionContextId: Option<crate::runtime::ExecutionContextId>,
3081}
3082
3083impl<'a> ResolveNodeParamsBuilder<'a> {
3084    /// Id of the node to resolve.
3085    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
3086    /// Backend identifier of the node to resolve.
3087    pub fn backendNodeId(mut self, backendNodeId: crate::dom::BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
3088    /// Symbolic group name that can be used to release multiple objects.
3089    pub fn objectGroup(mut self, objectGroup: impl Into<Cow<'a, str>>) -> Self { self.objectGroup = Some(objectGroup.into()); self }
3090    /// Execution context in which to resolve the node.
3091    pub fn executionContextId(mut self, executionContextId: crate::runtime::ExecutionContextId) -> Self { self.executionContextId = Some(executionContextId); self }
3092    pub fn build(self) -> ResolveNodeParams<'a> {
3093        ResolveNodeParams {
3094            nodeId: self.nodeId,
3095            backendNodeId: self.backendNodeId,
3096            objectGroup: self.objectGroup,
3097            executionContextId: self.executionContextId,
3098        }
3099    }
3100}
3101
3102/// Resolves the JavaScript node object for a given NodeId or BackendNodeId.
3103
3104#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3105#[serde(rename_all = "camelCase")]
3106pub struct ResolveNodeReturns {
3107    /// JavaScript object wrapper for given node.
3108    object: crate::runtime::RemoteObject,
3109}
3110
3111impl ResolveNodeReturns {
3112    pub fn builder(object: crate::runtime::RemoteObject) -> ResolveNodeReturnsBuilder {
3113        ResolveNodeReturnsBuilder {
3114            object: object,
3115        }
3116    }
3117    pub fn object(&self) -> &crate::runtime::RemoteObject { &self.object }
3118}
3119
3120
3121pub struct ResolveNodeReturnsBuilder {
3122    object: crate::runtime::RemoteObject,
3123}
3124
3125impl ResolveNodeReturnsBuilder {
3126    pub fn build(self) -> ResolveNodeReturns {
3127        ResolveNodeReturns {
3128            object: self.object,
3129        }
3130    }
3131}
3132
3133impl<'a> ResolveNodeParams<'a> { pub const METHOD: &'static str = "DOM.resolveNode"; }
3134
3135impl<'a> crate::CdpCommand<'a> for ResolveNodeParams<'a> {
3136    const METHOD: &'static str = "DOM.resolveNode";
3137    type Response = ResolveNodeReturns;
3138}
3139
3140/// Sets attribute for an element with given id.
3141
3142#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3143#[serde(rename_all = "camelCase")]
3144pub struct SetAttributeValueParams<'a> {
3145    /// Id of the element to set attribute for.
3146    nodeId: NodeId,
3147    /// Attribute name.
3148    name: Cow<'a, str>,
3149    /// Attribute value.
3150    value: Cow<'a, str>,
3151}
3152
3153impl<'a> SetAttributeValueParams<'a> {
3154    pub fn builder(nodeId: NodeId, name: impl Into<Cow<'a, str>>, value: impl Into<Cow<'a, str>>) -> SetAttributeValueParamsBuilder<'a> {
3155        SetAttributeValueParamsBuilder {
3156            nodeId: nodeId,
3157            name: name.into(),
3158            value: value.into(),
3159        }
3160    }
3161    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3162    pub fn name(&self) -> &str { self.name.as_ref() }
3163    pub fn value(&self) -> &str { self.value.as_ref() }
3164}
3165
3166
3167pub struct SetAttributeValueParamsBuilder<'a> {
3168    nodeId: NodeId,
3169    name: Cow<'a, str>,
3170    value: Cow<'a, str>,
3171}
3172
3173impl<'a> SetAttributeValueParamsBuilder<'a> {
3174    pub fn build(self) -> SetAttributeValueParams<'a> {
3175        SetAttributeValueParams {
3176            nodeId: self.nodeId,
3177            name: self.name,
3178            value: self.value,
3179        }
3180    }
3181}
3182
3183impl<'a> SetAttributeValueParams<'a> { pub const METHOD: &'static str = "DOM.setAttributeValue"; }
3184
3185impl<'a> crate::CdpCommand<'a> for SetAttributeValueParams<'a> {
3186    const METHOD: &'static str = "DOM.setAttributeValue";
3187    type Response = crate::EmptyReturns;
3188}
3189
3190/// Sets attributes on element with given id. This method is useful when user edits some existing
3191/// attribute value and types in several attribute name/value pairs.
3192
3193#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3194#[serde(rename_all = "camelCase")]
3195pub struct SetAttributesAsTextParams<'a> {
3196    /// Id of the element to set attributes for.
3197    nodeId: NodeId,
3198    /// Text with a number of attributes. Will parse this text using HTML parser.
3199    text: Cow<'a, str>,
3200    /// Attribute name to replace with new attributes derived from text in case text parsed
3201    /// successfully.
3202    #[serde(skip_serializing_if = "Option::is_none")]
3203    name: Option<Cow<'a, str>>,
3204}
3205
3206impl<'a> SetAttributesAsTextParams<'a> {
3207    pub fn builder(nodeId: NodeId, text: impl Into<Cow<'a, str>>) -> SetAttributesAsTextParamsBuilder<'a> {
3208        SetAttributesAsTextParamsBuilder {
3209            nodeId: nodeId,
3210            text: text.into(),
3211            name: None,
3212        }
3213    }
3214    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3215    pub fn text(&self) -> &str { self.text.as_ref() }
3216    pub fn name(&self) -> Option<&str> { self.name.as_deref() }
3217}
3218
3219
3220pub struct SetAttributesAsTextParamsBuilder<'a> {
3221    nodeId: NodeId,
3222    text: Cow<'a, str>,
3223    name: Option<Cow<'a, str>>,
3224}
3225
3226impl<'a> SetAttributesAsTextParamsBuilder<'a> {
3227    /// Attribute name to replace with new attributes derived from text in case text parsed
3228    /// successfully.
3229    pub fn name(mut self, name: impl Into<Cow<'a, str>>) -> Self { self.name = Some(name.into()); self }
3230    pub fn build(self) -> SetAttributesAsTextParams<'a> {
3231        SetAttributesAsTextParams {
3232            nodeId: self.nodeId,
3233            text: self.text,
3234            name: self.name,
3235        }
3236    }
3237}
3238
3239impl<'a> SetAttributesAsTextParams<'a> { pub const METHOD: &'static str = "DOM.setAttributesAsText"; }
3240
3241impl<'a> crate::CdpCommand<'a> for SetAttributesAsTextParams<'a> {
3242    const METHOD: &'static str = "DOM.setAttributesAsText";
3243    type Response = crate::EmptyReturns;
3244}
3245
3246/// Sets files for the given file input element.
3247
3248#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3249#[serde(rename_all = "camelCase")]
3250pub struct SetFileInputFilesParams<'a> {
3251    /// Array of file paths to set.
3252    files: Vec<Cow<'a, str>>,
3253    /// Identifier of the node.
3254    #[serde(skip_serializing_if = "Option::is_none")]
3255    nodeId: Option<NodeId>,
3256    /// Identifier of the backend node.
3257    #[serde(skip_serializing_if = "Option::is_none")]
3258    backendNodeId: Option<BackendNodeId>,
3259    /// JavaScript object id of the node wrapper.
3260    #[serde(skip_serializing_if = "Option::is_none")]
3261    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
3262}
3263
3264impl<'a> SetFileInputFilesParams<'a> {
3265    pub fn builder(files: Vec<Cow<'a, str>>) -> SetFileInputFilesParamsBuilder<'a> {
3266        SetFileInputFilesParamsBuilder {
3267            files: files,
3268            nodeId: None,
3269            backendNodeId: None,
3270            objectId: None,
3271        }
3272    }
3273    pub fn files(&self) -> &[Cow<'a, str>] { &self.files }
3274    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
3275    pub fn backendNodeId(&self) -> Option<&BackendNodeId> { self.backendNodeId.as_ref() }
3276    pub fn objectId(&self) -> Option<&crate::runtime::RemoteObjectId<'a>> { self.objectId.as_ref() }
3277}
3278
3279
3280pub struct SetFileInputFilesParamsBuilder<'a> {
3281    files: Vec<Cow<'a, str>>,
3282    nodeId: Option<NodeId>,
3283    backendNodeId: Option<BackendNodeId>,
3284    objectId: Option<crate::runtime::RemoteObjectId<'a>>,
3285}
3286
3287impl<'a> SetFileInputFilesParamsBuilder<'a> {
3288    /// Identifier of the node.
3289    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
3290    /// Identifier of the backend node.
3291    pub fn backendNodeId(mut self, backendNodeId: BackendNodeId) -> Self { self.backendNodeId = Some(backendNodeId); self }
3292    /// JavaScript object id of the node wrapper.
3293    pub fn objectId(mut self, objectId: crate::runtime::RemoteObjectId<'a>) -> Self { self.objectId = Some(objectId); self }
3294    pub fn build(self) -> SetFileInputFilesParams<'a> {
3295        SetFileInputFilesParams {
3296            files: self.files,
3297            nodeId: self.nodeId,
3298            backendNodeId: self.backendNodeId,
3299            objectId: self.objectId,
3300        }
3301    }
3302}
3303
3304impl<'a> SetFileInputFilesParams<'a> { pub const METHOD: &'static str = "DOM.setFileInputFiles"; }
3305
3306impl<'a> crate::CdpCommand<'a> for SetFileInputFilesParams<'a> {
3307    const METHOD: &'static str = "DOM.setFileInputFiles";
3308    type Response = crate::EmptyReturns;
3309}
3310
3311/// Sets if stack traces should be captured for Nodes. See 'Node.getNodeStackTraces'. Default is disabled.
3312
3313#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3314#[serde(rename_all = "camelCase")]
3315pub struct SetNodeStackTracesEnabledParams {
3316    /// Enable or disable.
3317    enable: bool,
3318}
3319
3320impl SetNodeStackTracesEnabledParams {
3321    pub fn builder(enable: bool) -> SetNodeStackTracesEnabledParamsBuilder {
3322        SetNodeStackTracesEnabledParamsBuilder {
3323            enable: enable,
3324        }
3325    }
3326    pub fn enable(&self) -> bool { self.enable }
3327}
3328
3329
3330pub struct SetNodeStackTracesEnabledParamsBuilder {
3331    enable: bool,
3332}
3333
3334impl SetNodeStackTracesEnabledParamsBuilder {
3335    pub fn build(self) -> SetNodeStackTracesEnabledParams {
3336        SetNodeStackTracesEnabledParams {
3337            enable: self.enable,
3338        }
3339    }
3340}
3341
3342impl SetNodeStackTracesEnabledParams { pub const METHOD: &'static str = "DOM.setNodeStackTracesEnabled"; }
3343
3344impl<'a> crate::CdpCommand<'a> for SetNodeStackTracesEnabledParams {
3345    const METHOD: &'static str = "DOM.setNodeStackTracesEnabled";
3346    type Response = crate::EmptyReturns;
3347}
3348
3349/// Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
3350
3351#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3352#[serde(rename_all = "camelCase")]
3353pub struct GetNodeStackTracesParams {
3354    /// Id of the node to get stack traces for.
3355    nodeId: NodeId,
3356}
3357
3358impl GetNodeStackTracesParams {
3359    pub fn builder(nodeId: NodeId) -> GetNodeStackTracesParamsBuilder {
3360        GetNodeStackTracesParamsBuilder {
3361            nodeId: nodeId,
3362        }
3363    }
3364    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3365}
3366
3367
3368pub struct GetNodeStackTracesParamsBuilder {
3369    nodeId: NodeId,
3370}
3371
3372impl GetNodeStackTracesParamsBuilder {
3373    pub fn build(self) -> GetNodeStackTracesParams {
3374        GetNodeStackTracesParams {
3375            nodeId: self.nodeId,
3376        }
3377    }
3378}
3379
3380/// Gets stack traces associated with a Node. As of now, only provides stack trace for Node creation.
3381
3382#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3383#[serde(rename_all = "camelCase")]
3384pub struct GetNodeStackTracesReturns {
3385    /// Creation stack trace, if available.
3386    #[serde(skip_serializing_if = "Option::is_none")]
3387    creation: Option<crate::runtime::StackTrace>,
3388}
3389
3390impl GetNodeStackTracesReturns {
3391    pub fn builder() -> GetNodeStackTracesReturnsBuilder {
3392        GetNodeStackTracesReturnsBuilder {
3393            creation: None,
3394        }
3395    }
3396    pub fn creation(&self) -> Option<&crate::runtime::StackTrace> { self.creation.as_ref() }
3397}
3398
3399#[derive(Default)]
3400pub struct GetNodeStackTracesReturnsBuilder {
3401    creation: Option<crate::runtime::StackTrace>,
3402}
3403
3404impl GetNodeStackTracesReturnsBuilder {
3405    /// Creation stack trace, if available.
3406    pub fn creation(mut self, creation: crate::runtime::StackTrace) -> Self { self.creation = Some(creation); self }
3407    pub fn build(self) -> GetNodeStackTracesReturns {
3408        GetNodeStackTracesReturns {
3409            creation: self.creation,
3410        }
3411    }
3412}
3413
3414impl GetNodeStackTracesParams { pub const METHOD: &'static str = "DOM.getNodeStackTraces"; }
3415
3416impl<'a> crate::CdpCommand<'a> for GetNodeStackTracesParams {
3417    const METHOD: &'static str = "DOM.getNodeStackTraces";
3418    type Response = GetNodeStackTracesReturns;
3419}
3420
3421/// Returns file information for the given
3422/// File wrapper.
3423
3424#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3425#[serde(rename_all = "camelCase")]
3426pub struct GetFileInfoParams<'a> {
3427    /// JavaScript object id of the node wrapper.
3428    objectId: crate::runtime::RemoteObjectId<'a>,
3429}
3430
3431impl<'a> GetFileInfoParams<'a> {
3432    pub fn builder(objectId: crate::runtime::RemoteObjectId<'a>) -> GetFileInfoParamsBuilder<'a> {
3433        GetFileInfoParamsBuilder {
3434            objectId: objectId,
3435        }
3436    }
3437    pub fn objectId(&self) -> &crate::runtime::RemoteObjectId<'a> { &self.objectId }
3438}
3439
3440
3441pub struct GetFileInfoParamsBuilder<'a> {
3442    objectId: crate::runtime::RemoteObjectId<'a>,
3443}
3444
3445impl<'a> GetFileInfoParamsBuilder<'a> {
3446    pub fn build(self) -> GetFileInfoParams<'a> {
3447        GetFileInfoParams {
3448            objectId: self.objectId,
3449        }
3450    }
3451}
3452
3453/// Returns file information for the given
3454/// File wrapper.
3455
3456#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3457#[serde(rename_all = "camelCase")]
3458pub struct GetFileInfoReturns<'a> {
3459    path: Cow<'a, str>,
3460}
3461
3462impl<'a> GetFileInfoReturns<'a> {
3463    pub fn builder(path: impl Into<Cow<'a, str>>) -> GetFileInfoReturnsBuilder<'a> {
3464        GetFileInfoReturnsBuilder {
3465            path: path.into(),
3466        }
3467    }
3468    pub fn path(&self) -> &str { self.path.as_ref() }
3469}
3470
3471
3472pub struct GetFileInfoReturnsBuilder<'a> {
3473    path: Cow<'a, str>,
3474}
3475
3476impl<'a> GetFileInfoReturnsBuilder<'a> {
3477    pub fn build(self) -> GetFileInfoReturns<'a> {
3478        GetFileInfoReturns {
3479            path: self.path,
3480        }
3481    }
3482}
3483
3484impl<'a> GetFileInfoParams<'a> { pub const METHOD: &'static str = "DOM.getFileInfo"; }
3485
3486impl<'a> crate::CdpCommand<'a> for GetFileInfoParams<'a> {
3487    const METHOD: &'static str = "DOM.getFileInfo";
3488    type Response = GetFileInfoReturns<'a>;
3489}
3490
3491/// Returns list of detached nodes
3492
3493#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3494#[serde(rename_all = "camelCase")]
3495pub struct GetDetachedDomNodesReturns<'a> {
3496    /// The list of detached nodes
3497    detachedNodes: Vec<DetachedElementInfo<'a>>,
3498}
3499
3500impl<'a> GetDetachedDomNodesReturns<'a> {
3501    pub fn builder(detachedNodes: Vec<DetachedElementInfo<'a>>) -> GetDetachedDomNodesReturnsBuilder<'a> {
3502        GetDetachedDomNodesReturnsBuilder {
3503            detachedNodes: detachedNodes,
3504        }
3505    }
3506    pub fn detachedNodes(&self) -> &[DetachedElementInfo<'a>] { &self.detachedNodes }
3507}
3508
3509
3510pub struct GetDetachedDomNodesReturnsBuilder<'a> {
3511    detachedNodes: Vec<DetachedElementInfo<'a>>,
3512}
3513
3514impl<'a> GetDetachedDomNodesReturnsBuilder<'a> {
3515    pub fn build(self) -> GetDetachedDomNodesReturns<'a> {
3516        GetDetachedDomNodesReturns {
3517            detachedNodes: self.detachedNodes,
3518        }
3519    }
3520}
3521
3522#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3523pub struct GetDetachedDomNodesParams {}
3524
3525impl GetDetachedDomNodesParams { pub const METHOD: &'static str = "DOM.getDetachedDomNodes"; }
3526
3527impl<'a> crate::CdpCommand<'a> for GetDetachedDomNodesParams {
3528    const METHOD: &'static str = "DOM.getDetachedDomNodes";
3529    type Response = GetDetachedDomNodesReturns<'a>;
3530}
3531
3532/// Enables console to refer to the node with given id via $x (see Command Line API for more details
3533/// $x functions).
3534
3535#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3536#[serde(rename_all = "camelCase")]
3537pub struct SetInspectedNodeParams {
3538    /// DOM node id to be accessible by means of $x command line API.
3539    nodeId: NodeId,
3540}
3541
3542impl SetInspectedNodeParams {
3543    pub fn builder(nodeId: NodeId) -> SetInspectedNodeParamsBuilder {
3544        SetInspectedNodeParamsBuilder {
3545            nodeId: nodeId,
3546        }
3547    }
3548    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3549}
3550
3551
3552pub struct SetInspectedNodeParamsBuilder {
3553    nodeId: NodeId,
3554}
3555
3556impl SetInspectedNodeParamsBuilder {
3557    pub fn build(self) -> SetInspectedNodeParams {
3558        SetInspectedNodeParams {
3559            nodeId: self.nodeId,
3560        }
3561    }
3562}
3563
3564impl SetInspectedNodeParams { pub const METHOD: &'static str = "DOM.setInspectedNode"; }
3565
3566impl<'a> crate::CdpCommand<'a> for SetInspectedNodeParams {
3567    const METHOD: &'static str = "DOM.setInspectedNode";
3568    type Response = crate::EmptyReturns;
3569}
3570
3571/// Sets node name for a node with given id.
3572
3573#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3574#[serde(rename_all = "camelCase")]
3575pub struct SetNodeNameParams<'a> {
3576    /// Id of the node to set name for.
3577    nodeId: NodeId,
3578    /// New node's name.
3579    name: Cow<'a, str>,
3580}
3581
3582impl<'a> SetNodeNameParams<'a> {
3583    pub fn builder(nodeId: NodeId, name: impl Into<Cow<'a, str>>) -> SetNodeNameParamsBuilder<'a> {
3584        SetNodeNameParamsBuilder {
3585            nodeId: nodeId,
3586            name: name.into(),
3587        }
3588    }
3589    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3590    pub fn name(&self) -> &str { self.name.as_ref() }
3591}
3592
3593
3594pub struct SetNodeNameParamsBuilder<'a> {
3595    nodeId: NodeId,
3596    name: Cow<'a, str>,
3597}
3598
3599impl<'a> SetNodeNameParamsBuilder<'a> {
3600    pub fn build(self) -> SetNodeNameParams<'a> {
3601        SetNodeNameParams {
3602            nodeId: self.nodeId,
3603            name: self.name,
3604        }
3605    }
3606}
3607
3608/// Sets node name for a node with given id.
3609
3610#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3611#[serde(rename_all = "camelCase")]
3612pub struct SetNodeNameReturns {
3613    /// New node's id.
3614    nodeId: NodeId,
3615}
3616
3617impl SetNodeNameReturns {
3618    pub fn builder(nodeId: NodeId) -> SetNodeNameReturnsBuilder {
3619        SetNodeNameReturnsBuilder {
3620            nodeId: nodeId,
3621        }
3622    }
3623    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3624}
3625
3626
3627pub struct SetNodeNameReturnsBuilder {
3628    nodeId: NodeId,
3629}
3630
3631impl SetNodeNameReturnsBuilder {
3632    pub fn build(self) -> SetNodeNameReturns {
3633        SetNodeNameReturns {
3634            nodeId: self.nodeId,
3635        }
3636    }
3637}
3638
3639impl<'a> SetNodeNameParams<'a> { pub const METHOD: &'static str = "DOM.setNodeName"; }
3640
3641impl<'a> crate::CdpCommand<'a> for SetNodeNameParams<'a> {
3642    const METHOD: &'static str = "DOM.setNodeName";
3643    type Response = SetNodeNameReturns;
3644}
3645
3646/// Sets node value for a node with given id.
3647
3648#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3649#[serde(rename_all = "camelCase")]
3650pub struct SetNodeValueParams<'a> {
3651    /// Id of the node to set value for.
3652    nodeId: NodeId,
3653    /// New node's value.
3654    value: Cow<'a, str>,
3655}
3656
3657impl<'a> SetNodeValueParams<'a> {
3658    pub fn builder(nodeId: NodeId, value: impl Into<Cow<'a, str>>) -> SetNodeValueParamsBuilder<'a> {
3659        SetNodeValueParamsBuilder {
3660            nodeId: nodeId,
3661            value: value.into(),
3662        }
3663    }
3664    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3665    pub fn value(&self) -> &str { self.value.as_ref() }
3666}
3667
3668
3669pub struct SetNodeValueParamsBuilder<'a> {
3670    nodeId: NodeId,
3671    value: Cow<'a, str>,
3672}
3673
3674impl<'a> SetNodeValueParamsBuilder<'a> {
3675    pub fn build(self) -> SetNodeValueParams<'a> {
3676        SetNodeValueParams {
3677            nodeId: self.nodeId,
3678            value: self.value,
3679        }
3680    }
3681}
3682
3683impl<'a> SetNodeValueParams<'a> { pub const METHOD: &'static str = "DOM.setNodeValue"; }
3684
3685impl<'a> crate::CdpCommand<'a> for SetNodeValueParams<'a> {
3686    const METHOD: &'static str = "DOM.setNodeValue";
3687    type Response = crate::EmptyReturns;
3688}
3689
3690/// Sets node HTML markup, returns new node id.
3691
3692#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3693#[serde(rename_all = "camelCase")]
3694pub struct SetOuterHTMLParams<'a> {
3695    /// Id of the node to set markup for.
3696    nodeId: NodeId,
3697    /// Outer HTML markup to set.
3698    outerHTML: Cow<'a, str>,
3699}
3700
3701impl<'a> SetOuterHTMLParams<'a> {
3702    pub fn builder(nodeId: NodeId, outerHTML: impl Into<Cow<'a, str>>) -> SetOuterHTMLParamsBuilder<'a> {
3703        SetOuterHTMLParamsBuilder {
3704            nodeId: nodeId,
3705            outerHTML: outerHTML.into(),
3706        }
3707    }
3708    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3709    pub fn outerHTML(&self) -> &str { self.outerHTML.as_ref() }
3710}
3711
3712
3713pub struct SetOuterHTMLParamsBuilder<'a> {
3714    nodeId: NodeId,
3715    outerHTML: Cow<'a, str>,
3716}
3717
3718impl<'a> SetOuterHTMLParamsBuilder<'a> {
3719    pub fn build(self) -> SetOuterHTMLParams<'a> {
3720        SetOuterHTMLParams {
3721            nodeId: self.nodeId,
3722            outerHTML: self.outerHTML,
3723        }
3724    }
3725}
3726
3727impl<'a> SetOuterHTMLParams<'a> { pub const METHOD: &'static str = "DOM.setOuterHTML"; }
3728
3729impl<'a> crate::CdpCommand<'a> for SetOuterHTMLParams<'a> {
3730    const METHOD: &'static str = "DOM.setOuterHTML";
3731    type Response = crate::EmptyReturns;
3732}
3733
3734#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3735pub struct UndoParams {}
3736
3737impl UndoParams { pub const METHOD: &'static str = "DOM.undo"; }
3738
3739impl<'a> crate::CdpCommand<'a> for UndoParams {
3740    const METHOD: &'static str = "DOM.undo";
3741    type Response = crate::EmptyReturns;
3742}
3743
3744/// Returns iframe node that owns iframe with the given domain.
3745
3746#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3747#[serde(rename_all = "camelCase")]
3748pub struct GetFrameOwnerParams<'a> {
3749    frameId: crate::page::FrameId<'a>,
3750}
3751
3752impl<'a> GetFrameOwnerParams<'a> {
3753    pub fn builder(frameId: crate::page::FrameId<'a>) -> GetFrameOwnerParamsBuilder<'a> {
3754        GetFrameOwnerParamsBuilder {
3755            frameId: frameId,
3756        }
3757    }
3758    pub fn frameId(&self) -> &crate::page::FrameId<'a> { &self.frameId }
3759}
3760
3761
3762pub struct GetFrameOwnerParamsBuilder<'a> {
3763    frameId: crate::page::FrameId<'a>,
3764}
3765
3766impl<'a> GetFrameOwnerParamsBuilder<'a> {
3767    pub fn build(self) -> GetFrameOwnerParams<'a> {
3768        GetFrameOwnerParams {
3769            frameId: self.frameId,
3770        }
3771    }
3772}
3773
3774/// Returns iframe node that owns iframe with the given domain.
3775
3776#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3777#[serde(rename_all = "camelCase")]
3778pub struct GetFrameOwnerReturns {
3779    /// Resulting node.
3780    backendNodeId: BackendNodeId,
3781    /// Id of the node at given coordinates, only when enabled and requested document.
3782    #[serde(skip_serializing_if = "Option::is_none")]
3783    nodeId: Option<NodeId>,
3784}
3785
3786impl GetFrameOwnerReturns {
3787    pub fn builder(backendNodeId: BackendNodeId) -> GetFrameOwnerReturnsBuilder {
3788        GetFrameOwnerReturnsBuilder {
3789            backendNodeId: backendNodeId,
3790            nodeId: None,
3791        }
3792    }
3793    pub fn backendNodeId(&self) -> &BackendNodeId { &self.backendNodeId }
3794    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
3795}
3796
3797
3798pub struct GetFrameOwnerReturnsBuilder {
3799    backendNodeId: BackendNodeId,
3800    nodeId: Option<NodeId>,
3801}
3802
3803impl GetFrameOwnerReturnsBuilder {
3804    /// Id of the node at given coordinates, only when enabled and requested document.
3805    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
3806    pub fn build(self) -> GetFrameOwnerReturns {
3807        GetFrameOwnerReturns {
3808            backendNodeId: self.backendNodeId,
3809            nodeId: self.nodeId,
3810        }
3811    }
3812}
3813
3814impl<'a> GetFrameOwnerParams<'a> { pub const METHOD: &'static str = "DOM.getFrameOwner"; }
3815
3816impl<'a> crate::CdpCommand<'a> for GetFrameOwnerParams<'a> {
3817    const METHOD: &'static str = "DOM.getFrameOwner";
3818    type Response = GetFrameOwnerReturns;
3819}
3820
3821/// Returns the query container of the given node based on container query
3822/// conditions: containerName, physical and logical axes, and whether it queries
3823/// scroll-state or anchored elements. If no axes are provided and
3824/// queriesScrollState is false, the style container is returned, which is the
3825/// direct parent or the closest element with a matching container-name.
3826
3827#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3828#[serde(rename_all = "camelCase")]
3829pub struct GetContainerForNodeParams<'a> {
3830    nodeId: NodeId,
3831    #[serde(skip_serializing_if = "Option::is_none")]
3832    containerName: Option<Cow<'a, str>>,
3833    #[serde(skip_serializing_if = "Option::is_none")]
3834    physicalAxes: Option<PhysicalAxes>,
3835    #[serde(skip_serializing_if = "Option::is_none")]
3836    logicalAxes: Option<LogicalAxes>,
3837    #[serde(skip_serializing_if = "Option::is_none")]
3838    queriesScrollState: Option<bool>,
3839    #[serde(skip_serializing_if = "Option::is_none")]
3840    queriesAnchored: Option<bool>,
3841}
3842
3843impl<'a> GetContainerForNodeParams<'a> {
3844    pub fn builder(nodeId: NodeId) -> GetContainerForNodeParamsBuilder<'a> {
3845        GetContainerForNodeParamsBuilder {
3846            nodeId: nodeId,
3847            containerName: None,
3848            physicalAxes: None,
3849            logicalAxes: None,
3850            queriesScrollState: None,
3851            queriesAnchored: None,
3852        }
3853    }
3854    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3855    pub fn containerName(&self) -> Option<&str> { self.containerName.as_deref() }
3856    pub fn physicalAxes(&self) -> Option<&PhysicalAxes> { self.physicalAxes.as_ref() }
3857    pub fn logicalAxes(&self) -> Option<&LogicalAxes> { self.logicalAxes.as_ref() }
3858    pub fn queriesScrollState(&self) -> Option<bool> { self.queriesScrollState }
3859    pub fn queriesAnchored(&self) -> Option<bool> { self.queriesAnchored }
3860}
3861
3862
3863pub struct GetContainerForNodeParamsBuilder<'a> {
3864    nodeId: NodeId,
3865    containerName: Option<Cow<'a, str>>,
3866    physicalAxes: Option<PhysicalAxes>,
3867    logicalAxes: Option<LogicalAxes>,
3868    queriesScrollState: Option<bool>,
3869    queriesAnchored: Option<bool>,
3870}
3871
3872impl<'a> GetContainerForNodeParamsBuilder<'a> {
3873    pub fn containerName(mut self, containerName: impl Into<Cow<'a, str>>) -> Self { self.containerName = Some(containerName.into()); self }
3874    pub fn physicalAxes(mut self, physicalAxes: PhysicalAxes) -> Self { self.physicalAxes = Some(physicalAxes); self }
3875    pub fn logicalAxes(mut self, logicalAxes: LogicalAxes) -> Self { self.logicalAxes = Some(logicalAxes); self }
3876    pub fn queriesScrollState(mut self, queriesScrollState: bool) -> Self { self.queriesScrollState = Some(queriesScrollState); self }
3877    pub fn queriesAnchored(mut self, queriesAnchored: bool) -> Self { self.queriesAnchored = Some(queriesAnchored); self }
3878    pub fn build(self) -> GetContainerForNodeParams<'a> {
3879        GetContainerForNodeParams {
3880            nodeId: self.nodeId,
3881            containerName: self.containerName,
3882            physicalAxes: self.physicalAxes,
3883            logicalAxes: self.logicalAxes,
3884            queriesScrollState: self.queriesScrollState,
3885            queriesAnchored: self.queriesAnchored,
3886        }
3887    }
3888}
3889
3890/// Returns the query container of the given node based on container query
3891/// conditions: containerName, physical and logical axes, and whether it queries
3892/// scroll-state or anchored elements. If no axes are provided and
3893/// queriesScrollState is false, the style container is returned, which is the
3894/// direct parent or the closest element with a matching container-name.
3895
3896#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3897#[serde(rename_all = "camelCase")]
3898pub struct GetContainerForNodeReturns {
3899    /// The container node for the given node, or null if not found.
3900    #[serde(skip_serializing_if = "Option::is_none")]
3901    nodeId: Option<NodeId>,
3902}
3903
3904impl GetContainerForNodeReturns {
3905    pub fn builder() -> GetContainerForNodeReturnsBuilder {
3906        GetContainerForNodeReturnsBuilder {
3907            nodeId: None,
3908        }
3909    }
3910    pub fn nodeId(&self) -> Option<&NodeId> { self.nodeId.as_ref() }
3911}
3912
3913#[derive(Default)]
3914pub struct GetContainerForNodeReturnsBuilder {
3915    nodeId: Option<NodeId>,
3916}
3917
3918impl GetContainerForNodeReturnsBuilder {
3919    /// The container node for the given node, or null if not found.
3920    pub fn nodeId(mut self, nodeId: NodeId) -> Self { self.nodeId = Some(nodeId); self }
3921    pub fn build(self) -> GetContainerForNodeReturns {
3922        GetContainerForNodeReturns {
3923            nodeId: self.nodeId,
3924        }
3925    }
3926}
3927
3928impl<'a> GetContainerForNodeParams<'a> { pub const METHOD: &'static str = "DOM.getContainerForNode"; }
3929
3930impl<'a> crate::CdpCommand<'a> for GetContainerForNodeParams<'a> {
3931    const METHOD: &'static str = "DOM.getContainerForNode";
3932    type Response = GetContainerForNodeReturns;
3933}
3934
3935/// Returns the descendants of a container query container that have
3936/// container queries against this container.
3937
3938#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3939#[serde(rename_all = "camelCase")]
3940pub struct GetQueryingDescendantsForContainerParams {
3941    /// Id of the container node to find querying descendants from.
3942    nodeId: NodeId,
3943}
3944
3945impl GetQueryingDescendantsForContainerParams {
3946    pub fn builder(nodeId: NodeId) -> GetQueryingDescendantsForContainerParamsBuilder {
3947        GetQueryingDescendantsForContainerParamsBuilder {
3948            nodeId: nodeId,
3949        }
3950    }
3951    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
3952}
3953
3954
3955pub struct GetQueryingDescendantsForContainerParamsBuilder {
3956    nodeId: NodeId,
3957}
3958
3959impl GetQueryingDescendantsForContainerParamsBuilder {
3960    pub fn build(self) -> GetQueryingDescendantsForContainerParams {
3961        GetQueryingDescendantsForContainerParams {
3962            nodeId: self.nodeId,
3963        }
3964    }
3965}
3966
3967/// Returns the descendants of a container query container that have
3968/// container queries against this container.
3969
3970#[derive(Debug, Clone, Serialize, Deserialize, Default)]
3971#[serde(rename_all = "camelCase")]
3972pub struct GetQueryingDescendantsForContainerReturns {
3973    /// Descendant nodes with container queries against the given container.
3974    nodeIds: Vec<NodeId>,
3975}
3976
3977impl GetQueryingDescendantsForContainerReturns {
3978    pub fn builder(nodeIds: Vec<NodeId>) -> GetQueryingDescendantsForContainerReturnsBuilder {
3979        GetQueryingDescendantsForContainerReturnsBuilder {
3980            nodeIds: nodeIds,
3981        }
3982    }
3983    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
3984}
3985
3986
3987pub struct GetQueryingDescendantsForContainerReturnsBuilder {
3988    nodeIds: Vec<NodeId>,
3989}
3990
3991impl GetQueryingDescendantsForContainerReturnsBuilder {
3992    pub fn build(self) -> GetQueryingDescendantsForContainerReturns {
3993        GetQueryingDescendantsForContainerReturns {
3994            nodeIds: self.nodeIds,
3995        }
3996    }
3997}
3998
3999impl GetQueryingDescendantsForContainerParams { pub const METHOD: &'static str = "DOM.getQueryingDescendantsForContainer"; }
4000
4001impl<'a> crate::CdpCommand<'a> for GetQueryingDescendantsForContainerParams {
4002    const METHOD: &'static str = "DOM.getQueryingDescendantsForContainer";
4003    type Response = GetQueryingDescendantsForContainerReturns;
4004}
4005
4006/// Returns the target anchor element of the given anchor query according to
4007/// https://www.w3.org/TR/css-anchor-position-1/#target.
4008
4009#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4010#[serde(rename_all = "camelCase")]
4011pub struct GetAnchorElementParams<'a> {
4012    /// Id of the positioned element from which to find the anchor.
4013    nodeId: NodeId,
4014    /// An optional anchor specifier, as defined in
4015    /// https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier.
4016    /// If not provided, it will return the implicit anchor element for
4017    /// the given positioned element.
4018    #[serde(skip_serializing_if = "Option::is_none")]
4019    anchorSpecifier: Option<Cow<'a, str>>,
4020}
4021
4022impl<'a> GetAnchorElementParams<'a> {
4023    pub fn builder(nodeId: NodeId) -> GetAnchorElementParamsBuilder<'a> {
4024        GetAnchorElementParamsBuilder {
4025            nodeId: nodeId,
4026            anchorSpecifier: None,
4027        }
4028    }
4029    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
4030    pub fn anchorSpecifier(&self) -> Option<&str> { self.anchorSpecifier.as_deref() }
4031}
4032
4033
4034pub struct GetAnchorElementParamsBuilder<'a> {
4035    nodeId: NodeId,
4036    anchorSpecifier: Option<Cow<'a, str>>,
4037}
4038
4039impl<'a> GetAnchorElementParamsBuilder<'a> {
4040    /// An optional anchor specifier, as defined in
4041    /// https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier.
4042    /// If not provided, it will return the implicit anchor element for
4043    /// the given positioned element.
4044    pub fn anchorSpecifier(mut self, anchorSpecifier: impl Into<Cow<'a, str>>) -> Self { self.anchorSpecifier = Some(anchorSpecifier.into()); self }
4045    pub fn build(self) -> GetAnchorElementParams<'a> {
4046        GetAnchorElementParams {
4047            nodeId: self.nodeId,
4048            anchorSpecifier: self.anchorSpecifier,
4049        }
4050    }
4051}
4052
4053/// Returns the target anchor element of the given anchor query according to
4054/// https://www.w3.org/TR/css-anchor-position-1/#target.
4055
4056#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4057#[serde(rename_all = "camelCase")]
4058pub struct GetAnchorElementReturns {
4059    /// The anchor element of the given anchor query.
4060    nodeId: NodeId,
4061}
4062
4063impl GetAnchorElementReturns {
4064    pub fn builder(nodeId: NodeId) -> GetAnchorElementReturnsBuilder {
4065        GetAnchorElementReturnsBuilder {
4066            nodeId: nodeId,
4067        }
4068    }
4069    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
4070}
4071
4072
4073pub struct GetAnchorElementReturnsBuilder {
4074    nodeId: NodeId,
4075}
4076
4077impl GetAnchorElementReturnsBuilder {
4078    pub fn build(self) -> GetAnchorElementReturns {
4079        GetAnchorElementReturns {
4080            nodeId: self.nodeId,
4081        }
4082    }
4083}
4084
4085impl<'a> GetAnchorElementParams<'a> { pub const METHOD: &'static str = "DOM.getAnchorElement"; }
4086
4087impl<'a> crate::CdpCommand<'a> for GetAnchorElementParams<'a> {
4088    const METHOD: &'static str = "DOM.getAnchorElement";
4089    type Response = GetAnchorElementReturns;
4090}
4091
4092/// When enabling, this API force-opens the popover identified by nodeId
4093/// and keeps it open until disabled.
4094
4095#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4096#[serde(rename_all = "camelCase")]
4097pub struct ForceShowPopoverParams {
4098    /// Id of the popover HTMLElement
4099    nodeId: NodeId,
4100    /// If true, opens the popover and keeps it open. If false, closes the
4101    /// popover if it was previously force-opened.
4102    enable: bool,
4103}
4104
4105impl ForceShowPopoverParams {
4106    pub fn builder(nodeId: NodeId, enable: bool) -> ForceShowPopoverParamsBuilder {
4107        ForceShowPopoverParamsBuilder {
4108            nodeId: nodeId,
4109            enable: enable,
4110        }
4111    }
4112    pub fn nodeId(&self) -> &NodeId { &self.nodeId }
4113    pub fn enable(&self) -> bool { self.enable }
4114}
4115
4116
4117pub struct ForceShowPopoverParamsBuilder {
4118    nodeId: NodeId,
4119    enable: bool,
4120}
4121
4122impl ForceShowPopoverParamsBuilder {
4123    pub fn build(self) -> ForceShowPopoverParams {
4124        ForceShowPopoverParams {
4125            nodeId: self.nodeId,
4126            enable: self.enable,
4127        }
4128    }
4129}
4130
4131/// When enabling, this API force-opens the popover identified by nodeId
4132/// and keeps it open until disabled.
4133
4134#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4135#[serde(rename_all = "camelCase")]
4136pub struct ForceShowPopoverReturns {
4137    /// List of popovers that were closed in order to respect popover stacking order.
4138    nodeIds: Vec<NodeId>,
4139}
4140
4141impl ForceShowPopoverReturns {
4142    pub fn builder(nodeIds: Vec<NodeId>) -> ForceShowPopoverReturnsBuilder {
4143        ForceShowPopoverReturnsBuilder {
4144            nodeIds: nodeIds,
4145        }
4146    }
4147    pub fn nodeIds(&self) -> &[NodeId] { &self.nodeIds }
4148}
4149
4150
4151pub struct ForceShowPopoverReturnsBuilder {
4152    nodeIds: Vec<NodeId>,
4153}
4154
4155impl ForceShowPopoverReturnsBuilder {
4156    pub fn build(self) -> ForceShowPopoverReturns {
4157        ForceShowPopoverReturns {
4158            nodeIds: self.nodeIds,
4159        }
4160    }
4161}
4162
4163impl ForceShowPopoverParams { pub const METHOD: &'static str = "DOM.forceShowPopover"; }
4164
4165impl<'a> crate::CdpCommand<'a> for ForceShowPopoverParams {
4166    const METHOD: &'static str = "DOM.forceShowPopover";
4167    type Response = ForceShowPopoverReturns;
4168}