cdp-protocol 0.3.1

A Rust implementation of the Chrome DevTools Protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
// Auto-generated from Chrome at version 146.0.7680.165 domain: DOMSnapshot
#![allow(dead_code)]
use super::dom;
use super::dom_debugger;
use super::page;
#[allow(unused_imports)]
use super::types::*;
#[allow(unused_imports)]
use derive_builder::Builder;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[allow(unused_imports)]
use serde_json::Value as Json;
pub type StringIndex = JsUInt;
pub type ArrayOfStrings = Vec<StringIndex>;
pub type Rectangle = Vec<JsFloat>;
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "A Node in the DOM tree."]
pub struct DomNode {
    #[serde(default)]
    #[doc = "`Node`'s nodeType."]
    pub node_type: JsUInt,
    #[serde(default)]
    #[doc = "`Node`'s nodeName."]
    pub node_name: String,
    #[serde(default)]
    #[doc = "`Node`'s nodeValue."]
    pub node_value: String,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Only set for textarea elements, contains the text value."]
    pub text_value: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Only set for input elements, contains the input's associated text value."]
    pub input_value: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Only set for radio and checkbox input elements, indicates if the element has been checked"]
    pub input_checked: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Only set for option elements, indicates if the element has been selected"]
    pub option_selected: Option<bool>,
    #[doc = "`Node`'s id, corresponds to DOM.Node.backendNodeId."]
    pub backend_node_id: dom::BackendNodeId,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The indexes of the node's child nodes in the `domNodes` array returned by `getSnapshot`, if\n any."]
    pub child_node_indexes: Option<Vec<JsUInt>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Attributes of an `Element` node."]
    pub attributes: Option<Vec<NameValue>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Indexes of pseudo elements associated with this node in the `domNodes` array returned by\n `getSnapshot`, if any."]
    pub pseudo_element_indexes: Option<Vec<JsUInt>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The index of the node's related layout tree node in the `layoutTreeNodes` array returned by\n `getSnapshot`, if any."]
    pub layout_node_index: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Document URL that `Document` or `FrameOwner` node points to."]
    #[serde(rename = "documentURL")]
    pub document_url: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Base URL that `Document` or `FrameOwner` node uses for URL completion."]
    #[serde(rename = "baseURL")]
    pub base_url: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Only set for documents, contains the document's content language."]
    pub content_language: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Only set for documents, contains the document's character set encoding."]
    pub document_encoding: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "`DocumentType` node's publicId."]
    pub public_id: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "`DocumentType` node's systemId."]
    pub system_id: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Frame ID for frame owner elements and also for the document node."]
    pub frame_id: Option<page::FrameId>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The index of a frame owner element's content document in the `domNodes` array returned by\n `getSnapshot`, if any."]
    pub content_document_index: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Type of a pseudo element node."]
    pub pseudo_type: Option<dom::PseudoType>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Shadow root type."]
    pub shadow_root_type: Option<dom::ShadowRootType>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether this DOM node responds to mouse clicks. This includes nodes that have had click\n event listeners attached via JavaScript as well as anchor tags that naturally navigate when\n clicked."]
    pub is_clickable: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Details of the node's event listeners, if any."]
    pub event_listeners: Option<Vec<dom_debugger::EventListener>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The selected url for nodes with a srcset attribute."]
    #[serde(rename = "currentSourceURL")]
    pub current_source_url: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The url of the script (if any) that generates this node."]
    #[serde(rename = "originURL")]
    pub origin_url: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Scroll offsets, set when this node is a Document."]
    pub scroll_offset_x: Option<JsFloat>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub scroll_offset_y: Option<JsFloat>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Details of post layout rendered text positions. The exact layout should not be regarded as\n stable and may change between versions."]
pub struct InlineTextBox {
    #[doc = "The bounding box in document coordinates. Note that scroll offset of the document is ignored."]
    pub bounding_box: dom::Rect,
    #[serde(default)]
    #[doc = "The starting index in characters, for this post layout textbox substring. Characters that\n would be represented as a surrogate pair in UTF-16 have length 2."]
    pub start_character_index: JsUInt,
    #[serde(default)]
    #[doc = "The number of characters in this post layout textbox substring. Characters that would be\n represented as a surrogate pair in UTF-16 have length 2."]
    pub num_characters: JsUInt,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Details of an element in the DOM tree with a LayoutObject."]
pub struct LayoutTreeNode {
    #[serde(default)]
    #[doc = "The index of the related DOM node in the `domNodes` array returned by `getSnapshot`."]
    pub dom_node_index: JsUInt,
    #[doc = "The bounding box in document coordinates. Note that scroll offset of the document is ignored."]
    pub bounding_box: dom::Rect,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Contents of the LayoutText, if any."]
    pub layout_text: Option<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The post-layout inline text nodes, if any."]
    pub inline_text_nodes: Option<Vec<InlineTextBox>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Index into the `computedStyles` array returned by `getSnapshot`."]
    pub style_index: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Global paint order index, which is determined by the stacking order of the nodes. Nodes\n that are painted together will have the same index. Only provided if includePaintOrder in\n getSnapshot was true."]
    pub paint_order: Option<JsUInt>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Set to true to indicate the element begins a new stacking context."]
    pub is_stacking_context: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "A subset of the full ComputedStyle as defined by the request whitelist."]
pub struct ComputedStyle {
    #[doc = "Name/value pairs of computed style properties."]
    pub properties: Vec<NameValue>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "A name/value pair."]
pub struct NameValue {
    #[serde(default)]
    #[doc = "Attribute/property name."]
    pub name: String,
    #[serde(default)]
    #[doc = "Attribute/property value."]
    pub value: String,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Data that is only present on rare nodes."]
pub struct RareStringData {
    #[serde(default)]
    pub index: Vec<JsUInt>,
    pub value: Vec<StringIndex>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
pub struct RareBooleanData {
    #[serde(default)]
    pub index: Vec<JsUInt>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
pub struct RareIntegerData {
    #[serde(default)]
    pub index: Vec<JsUInt>,
    #[serde(default)]
    pub value: Vec<JsUInt>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Document snapshot."]
pub struct DocumentSnapshot {
    #[doc = "Document URL that `Document` or `FrameOwner` node points to."]
    #[serde(rename = "documentURL")]
    pub document_url: StringIndex,
    #[doc = "Document title."]
    pub title: StringIndex,
    #[doc = "Base URL that `Document` or `FrameOwner` node uses for URL completion."]
    #[serde(rename = "baseURL")]
    pub base_url: StringIndex,
    #[doc = "Contains the document's content language."]
    pub content_language: StringIndex,
    #[doc = "Contains the document's character set encoding."]
    pub encoding_name: StringIndex,
    #[doc = "`DocumentType` node's publicId."]
    pub public_id: StringIndex,
    #[doc = "`DocumentType` node's systemId."]
    pub system_id: StringIndex,
    #[doc = "Frame ID for frame owner elements and also for the document node."]
    pub frame_id: StringIndex,
    #[doc = "A table with dom nodes."]
    pub nodes: NodeTreeSnapshot,
    #[doc = "The nodes in the layout tree."]
    pub layout: LayoutTreeSnapshot,
    #[doc = "The post-layout inline text nodes."]
    pub text_boxes: TextBoxSnapshot,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Horizontal scroll offset."]
    pub scroll_offset_x: Option<JsFloat>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Vertical scroll offset."]
    pub scroll_offset_y: Option<JsFloat>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Document content width."]
    pub content_width: Option<JsFloat>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Document content height."]
    pub content_height: Option<JsFloat>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Table containing nodes."]
pub struct NodeTreeSnapshot {
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Parent node index."]
    pub parent_index: Option<Vec<JsUInt>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "`Node`'s nodeType."]
    pub node_type: Option<Vec<JsUInt>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Type of the shadow root the `Node` is in. String values are equal to the `ShadowRootType` enum."]
    pub shadow_root_type: Option<RareStringData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "`Node`'s nodeName."]
    pub node_name: Option<Vec<StringIndex>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "`Node`'s nodeValue."]
    pub node_value: Option<Vec<StringIndex>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "`Node`'s id, corresponds to DOM.Node.backendNodeId."]
    pub backend_node_id: Option<Vec<dom::BackendNodeId>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Attributes of an `Element` node. Flatten name, value pairs."]
    pub attributes: Option<Vec<ArrayOfStrings>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Only set for textarea elements, contains the text value."]
    pub text_value: Option<RareStringData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Only set for input elements, contains the input's associated text value."]
    pub input_value: Option<RareStringData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Only set for radio and checkbox input elements, indicates if the element has been checked"]
    pub input_checked: Option<RareBooleanData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Only set for option elements, indicates if the element has been selected"]
    pub option_selected: Option<RareBooleanData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The index of the document in the list of the snapshot documents."]
    pub content_document_index: Option<RareIntegerData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Type of a pseudo element node."]
    pub pseudo_type: Option<RareStringData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Pseudo element identifier for this node. Only present if there is a\n valid pseudoType."]
    pub pseudo_identifier: Option<RareStringData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "Whether this DOM node responds to mouse clicks. This includes nodes that have had click\n event listeners attached via JavaScript as well as anchor tags that naturally navigate when\n clicked."]
    pub is_clickable: Option<RareBooleanData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The selected url for nodes with a srcset attribute."]
    #[serde(rename = "currentSourceURL")]
    pub current_source_url: Option<RareStringData>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The url of the script (if any) that generates this node."]
    #[serde(rename = "originURL")]
    pub origin_url: Option<RareStringData>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Table of details of an element in the DOM tree with a LayoutObject."]
pub struct LayoutTreeSnapshot {
    #[serde(default)]
    #[doc = "Index of the corresponding node in the `NodeTreeSnapshot` array returned by `captureSnapshot`."]
    pub node_index: Vec<JsUInt>,
    #[doc = "Array of indexes specifying computed style strings, filtered according to the `computedStyles` parameter passed to `captureSnapshot`."]
    pub styles: Vec<ArrayOfStrings>,
    #[doc = "The absolute position bounding box."]
    pub bounds: Vec<Rectangle>,
    #[doc = "Contents of the LayoutText, if any."]
    pub text: Vec<StringIndex>,
    #[doc = "Stacking context information."]
    pub stacking_contexts: RareBooleanData,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Global paint order index, which is determined by the stacking order of the nodes. Nodes\n that are painted together will have the same index. Only provided if includePaintOrder in\n captureSnapshot was true."]
    pub paint_orders: Option<Vec<JsUInt>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The offset rect of nodes. Only available when includeDOMRects is set to true"]
    pub offset_rects: Option<Vec<Rectangle>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The scroll rect of nodes. Only available when includeDOMRects is set to true"]
    pub scroll_rects: Option<Vec<Rectangle>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The client rect of nodes. Only available when includeDOMRects is set to true"]
    pub client_rects: Option<Vec<Rectangle>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[doc = "The list of background colors that are blended with colors of overlapping elements."]
    pub blended_background_colors: Option<Vec<StringIndex>>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "The list of computed text opacities."]
    pub text_color_opacities: Option<Vec<JsFloat>>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Table of details of the post layout rendered text positions. The exact layout should not be regarded as\n stable and may change between versions."]
pub struct TextBoxSnapshot {
    #[serde(default)]
    #[doc = "Index of the layout tree node that owns this box collection."]
    pub layout_index: Vec<JsUInt>,
    #[doc = "The absolute position bounding box."]
    pub bounds: Vec<Rectangle>,
    #[serde(default)]
    #[doc = "The starting index in characters, for this post layout textbox substring. Characters that\n would be represented as a surrogate pair in UTF-16 have length 2."]
    pub start: Vec<JsUInt>,
    #[serde(default)]
    #[doc = "The number of characters in this post layout textbox substring. Characters that would be\n represented as a surrogate pair in UTF-16 have length 2."]
    pub length: Vec<JsUInt>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct Disable(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
pub struct Enable(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
#[deprecated]
pub struct GetSnapshot {
    #[serde(default)]
    #[doc = "Whitelist of computed styles to return."]
    pub computed_style_whitelist: Vec<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether or not to retrieve details of DOM listeners (default false)."]
    pub include_event_listeners: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to determine and include the paint order index of LayoutTreeNodes (default false)."]
    pub include_paint_order: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to include UA shadow tree in the snapshot (default false)."]
    pub include_user_agent_shadow_tree: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[builder(setter(into, strip_option))]
#[serde(rename_all = "camelCase")]
#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
pub struct CaptureSnapshot {
    #[serde(default)]
    #[doc = "Whitelist of computed styles to return."]
    pub computed_styles: Vec<String>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to include layout object paint orders into the snapshot."]
    pub include_paint_order: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to include DOM rectangles (offsetRects, clientRects, scrollRects) into the snapshot"]
    #[serde(rename = "includeDOMRects")]
    pub include_dom_rects: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to include blended background colors in the snapshot (default: false).\n Blended background color is achieved by blending background colors of all elements\n that overlap with the current element."]
    pub include_blended_background_colors: Option<bool>,
    #[builder(default)]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    #[doc = "Whether to include text color opacity in the snapshot (default: false).\n An element might have the opacity property set that affects the text color of the element.\n The final text color opacity is computed based on the opacity of all overlapping elements."]
    pub include_text_color_opacities: Option<bool>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Disables DOM snapshot agent for the given page."]
pub struct DisableReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
#[doc = "Enables DOM snapshot agent for the given page."]
pub struct EnableReturnObject(pub Option<Json>);
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
#[deprecated]
pub struct GetSnapshotReturnObject {
    #[doc = "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document."]
    pub dom_nodes: Vec<DomNode>,
    #[doc = "The nodes in the layout tree."]
    pub layout_tree_nodes: Vec<LayoutTreeNode>,
    #[doc = "Whitelisted ComputedStyle properties for each node in the layout tree."]
    pub computed_styles: Vec<ComputedStyle>,
}
#[allow(deprecated)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
#[serde(rename_all = "camelCase")]
#[doc = "Returns a document snapshot, including the full DOM tree of the root node (including iframes,\n template contents, and imported documents) in a flattened array, as well as layout and\n white-listed computed style information for the nodes. Shadow DOM in the returned DOM tree is\n flattened."]
pub struct CaptureSnapshotReturnObject {
    #[doc = "The nodes in the DOM tree. The DOMNode at index 0 corresponds to the root document."]
    pub documents: Vec<DocumentSnapshot>,
    #[doc = "Shared string table that all string properties refer to with indexes."]
    pub strings: Vec<String>,
}
#[allow(deprecated)]
impl Method for Disable {
    const NAME: &'static str = "DOMSnapshot.disable";
    type ReturnObject = DisableReturnObject;
}
#[allow(deprecated)]
impl Method for Enable {
    const NAME: &'static str = "DOMSnapshot.enable";
    type ReturnObject = EnableReturnObject;
}
#[allow(deprecated)]
impl Method for GetSnapshot {
    const NAME: &'static str = "DOMSnapshot.getSnapshot";
    type ReturnObject = GetSnapshotReturnObject;
}
#[allow(deprecated)]
impl Method for CaptureSnapshot {
    const NAME: &'static str = "DOMSnapshot.captureSnapshot";
    type ReturnObject = CaptureSnapshotReturnObject;
}
#[allow(dead_code)]
pub mod events {
    #[allow(unused_imports)]
    use super::super::types::*;
    #[allow(unused_imports)]
    use derive_builder::Builder;
    #[allow(unused_imports)]
    use serde::{Deserialize, Serialize};
    #[allow(unused_imports)]
    use serde_json::Value as Json;
}