1#![allow(dead_code)]
3#[allow(unused_imports)]
4use super::types::*;
5#[allow(unused_imports)]
6use derive_builder::Builder;
7#[allow(unused_imports)]
8use serde::{Deserialize, Serialize};
9#[allow(unused_imports)]
10use serde_json::Value as Json;
11pub type ScriptId = String;
12pub type RemoteObjectId = String;
13pub type UnserializableValue = String;
14pub type ExecutionContextId = JsUInt;
15pub type Timestamp = JsFloat;
16pub type TimeDelta = JsFloat;
17pub type UniqueDebuggerId = String;
18#[allow(deprecated)]
19#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
20pub enum SerializationOptionsSerialization {
21 #[serde(rename = "deep")]
22 Deep,
23 #[serde(rename = "json")]
24 Json,
25 #[serde(rename = "idOnly")]
26 IdOnly,
27}
28#[allow(deprecated)]
29#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
30pub enum DeepSerializedValueType {
31 #[serde(rename = "undefined")]
32 Undefined,
33 #[serde(rename = "null")]
34 Null,
35 #[serde(rename = "string")]
36 String,
37 #[serde(rename = "number")]
38 Number,
39 #[serde(rename = "boolean")]
40 Boolean,
41 #[serde(rename = "bigint")]
42 Bigint,
43 #[serde(rename = "regexp")]
44 Regexp,
45 #[serde(rename = "date")]
46 Date,
47 #[serde(rename = "symbol")]
48 Symbol,
49 #[serde(rename = "array")]
50 Array,
51 #[serde(rename = "object")]
52 Object,
53 #[serde(rename = "function")]
54 Function,
55 #[serde(rename = "map")]
56 Map,
57 #[serde(rename = "set")]
58 Set,
59 #[serde(rename = "weakmap")]
60 Weakmap,
61 #[serde(rename = "weakset")]
62 Weakset,
63 #[serde(rename = "error")]
64 Error,
65 #[serde(rename = "proxy")]
66 Proxy,
67 #[serde(rename = "promise")]
68 Promise,
69 #[serde(rename = "typedarray")]
70 Typedarray,
71 #[serde(rename = "arraybuffer")]
72 Arraybuffer,
73 #[serde(rename = "node")]
74 Node,
75 #[serde(rename = "window")]
76 Window,
77 #[serde(rename = "generator")]
78 Generator,
79}
80#[allow(deprecated)]
81#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
82pub enum RemoteObjectType {
83 #[serde(rename = "object")]
84 Object,
85 #[serde(rename = "function")]
86 Function,
87 #[serde(rename = "undefined")]
88 Undefined,
89 #[serde(rename = "string")]
90 String,
91 #[serde(rename = "number")]
92 Number,
93 #[serde(rename = "boolean")]
94 Boolean,
95 #[serde(rename = "symbol")]
96 Symbol,
97 #[serde(rename = "bigint")]
98 Bigint,
99}
100#[allow(deprecated)]
101#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
102pub enum RemoteObjectSubtype {
103 #[serde(rename = "array")]
104 Array,
105 #[serde(rename = "null")]
106 Null,
107 #[serde(rename = "node")]
108 Node,
109 #[serde(rename = "regexp")]
110 Regexp,
111 #[serde(rename = "date")]
112 Date,
113 #[serde(rename = "map")]
114 Map,
115 #[serde(rename = "set")]
116 Set,
117 #[serde(rename = "weakmap")]
118 Weakmap,
119 #[serde(rename = "weakset")]
120 Weakset,
121 #[serde(rename = "iterator")]
122 Iterator,
123 #[serde(rename = "generator")]
124 Generator,
125 #[serde(rename = "error")]
126 Error,
127 #[serde(rename = "proxy")]
128 Proxy,
129 #[serde(rename = "promise")]
130 Promise,
131 #[serde(rename = "typedarray")]
132 Typedarray,
133 #[serde(rename = "arraybuffer")]
134 Arraybuffer,
135 #[serde(rename = "dataview")]
136 Dataview,
137 #[serde(rename = "webassemblymemory")]
138 Webassemblymemory,
139 #[serde(rename = "wasmvalue")]
140 Wasmvalue,
141 #[serde(rename = "trustedtype")]
142 Trustedtype,
143}
144#[allow(deprecated)]
145#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
146pub enum ObjectPreviewType {
147 #[serde(rename = "object")]
148 Object,
149 #[serde(rename = "function")]
150 Function,
151 #[serde(rename = "undefined")]
152 Undefined,
153 #[serde(rename = "string")]
154 String,
155 #[serde(rename = "number")]
156 Number,
157 #[serde(rename = "boolean")]
158 Boolean,
159 #[serde(rename = "symbol")]
160 Symbol,
161 #[serde(rename = "bigint")]
162 Bigint,
163}
164#[allow(deprecated)]
165#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
166pub enum ObjectPreviewSubtype {
167 #[serde(rename = "array")]
168 Array,
169 #[serde(rename = "null")]
170 Null,
171 #[serde(rename = "node")]
172 Node,
173 #[serde(rename = "regexp")]
174 Regexp,
175 #[serde(rename = "date")]
176 Date,
177 #[serde(rename = "map")]
178 Map,
179 #[serde(rename = "set")]
180 Set,
181 #[serde(rename = "weakmap")]
182 Weakmap,
183 #[serde(rename = "weakset")]
184 Weakset,
185 #[serde(rename = "iterator")]
186 Iterator,
187 #[serde(rename = "generator")]
188 Generator,
189 #[serde(rename = "error")]
190 Error,
191 #[serde(rename = "proxy")]
192 Proxy,
193 #[serde(rename = "promise")]
194 Promise,
195 #[serde(rename = "typedarray")]
196 Typedarray,
197 #[serde(rename = "arraybuffer")]
198 Arraybuffer,
199 #[serde(rename = "dataview")]
200 Dataview,
201 #[serde(rename = "webassemblymemory")]
202 Webassemblymemory,
203 #[serde(rename = "wasmvalue")]
204 Wasmvalue,
205 #[serde(rename = "trustedtype")]
206 Trustedtype,
207}
208#[allow(deprecated)]
209#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
210pub enum PropertyPreviewType {
211 #[serde(rename = "object")]
212 Object,
213 #[serde(rename = "function")]
214 Function,
215 #[serde(rename = "undefined")]
216 Undefined,
217 #[serde(rename = "string")]
218 String,
219 #[serde(rename = "number")]
220 Number,
221 #[serde(rename = "boolean")]
222 Boolean,
223 #[serde(rename = "symbol")]
224 Symbol,
225 #[serde(rename = "accessor")]
226 Accessor,
227 #[serde(rename = "bigint")]
228 Bigint,
229}
230#[allow(deprecated)]
231#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
232pub enum PropertyPreviewSubtype {
233 #[serde(rename = "array")]
234 Array,
235 #[serde(rename = "null")]
236 Null,
237 #[serde(rename = "node")]
238 Node,
239 #[serde(rename = "regexp")]
240 Regexp,
241 #[serde(rename = "date")]
242 Date,
243 #[serde(rename = "map")]
244 Map,
245 #[serde(rename = "set")]
246 Set,
247 #[serde(rename = "weakmap")]
248 Weakmap,
249 #[serde(rename = "weakset")]
250 Weakset,
251 #[serde(rename = "iterator")]
252 Iterator,
253 #[serde(rename = "generator")]
254 Generator,
255 #[serde(rename = "error")]
256 Error,
257 #[serde(rename = "proxy")]
258 Proxy,
259 #[serde(rename = "promise")]
260 Promise,
261 #[serde(rename = "typedarray")]
262 Typedarray,
263 #[serde(rename = "arraybuffer")]
264 Arraybuffer,
265 #[serde(rename = "dataview")]
266 Dataview,
267 #[serde(rename = "webassemblymemory")]
268 Webassemblymemory,
269 #[serde(rename = "wasmvalue")]
270 Wasmvalue,
271 #[serde(rename = "trustedtype")]
272 Trustedtype,
273}
274#[allow(deprecated)]
275#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
276pub enum ConsoleApiCalledTypeOption {
277 #[serde(rename = "log")]
278 Log,
279 #[serde(rename = "debug")]
280 Debug,
281 #[serde(rename = "info")]
282 Info,
283 #[serde(rename = "error")]
284 Error,
285 #[serde(rename = "warning")]
286 Warning,
287 #[serde(rename = "dir")]
288 Dir,
289 #[serde(rename = "dirxml")]
290 Dirxml,
291 #[serde(rename = "table")]
292 Table,
293 #[serde(rename = "trace")]
294 Trace,
295 #[serde(rename = "clear")]
296 Clear,
297 #[serde(rename = "startGroup")]
298 StartGroup,
299 #[serde(rename = "startGroupCollapsed")]
300 StartGroupCollapsed,
301 #[serde(rename = "endGroup")]
302 EndGroup,
303 #[serde(rename = "assert")]
304 Assert,
305 #[serde(rename = "profile")]
306 Profile,
307 #[serde(rename = "profileEnd")]
308 ProfileEnd,
309 #[serde(rename = "count")]
310 Count,
311 #[serde(rename = "timeEnd")]
312 TimeEnd,
313}
314#[allow(deprecated)]
315#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
316#[builder(setter(into, strip_option))]
317#[serde(rename_all = "camelCase")]
318#[doc = "Represents options for serialization. Overrides `generatePreview` and `returnByValue`."]
319pub struct SerializationOptions {
320 pub serialization: SerializationOptionsSerialization,
321 #[builder(default)]
322 #[serde(skip_serializing_if = "Option::is_none")]
323 #[serde(default)]
324 #[doc = "Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode."]
325 pub max_depth: Option<JsUInt>,
326 #[builder(default)]
327 #[serde(skip_serializing_if = "Option::is_none")]
328 #[serde(default)]
329 #[doc = "Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM\n serialization via `maxNodeDepth: integer` and `includeShadowTree: \"none\" | \"open\" | \"all\"`.\n Values can be only of type string or integer."]
330 pub additional_parameters: Option<Json>,
331}
332#[allow(deprecated)]
333#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
334#[builder(setter(into, strip_option))]
335#[serde(rename_all = "camelCase")]
336#[doc = "Represents deep serialized value."]
337pub struct DeepSerializedValue {
338 pub r#type: DeepSerializedValueType,
339 #[builder(default)]
340 #[serde(skip_serializing_if = "Option::is_none")]
341 #[serde(default)]
342 pub value: Option<Json>,
343 #[builder(default)]
344 #[serde(skip_serializing_if = "Option::is_none")]
345 #[serde(default)]
346 pub object_id: Option<String>,
347 #[builder(default)]
348 #[serde(skip_serializing_if = "Option::is_none")]
349 #[serde(default)]
350 #[doc = "Set if value reference met more then once during serialization. In such\n case, value is provided only to one of the serialized values. Unique\n per value in the scope of one CDP call."]
351 pub weak_local_object_reference: Option<JsUInt>,
352}
353#[allow(deprecated)]
354#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
355#[builder(setter(into, strip_option))]
356#[serde(rename_all = "camelCase")]
357#[doc = "Mirror object referencing original JavaScript object."]
358pub struct RemoteObject {
359 #[doc = "Object type."]
360 pub r#type: RemoteObjectType,
361 #[builder(default)]
362 #[serde(skip_serializing_if = "Option::is_none")]
363 #[doc = "Object subtype hint. Specified for `object` type values only.\n NOTE: If you change anything here, make sure to also update\n `subtype` in `ObjectPreview` and `PropertyPreview` below."]
364 pub subtype: Option<RemoteObjectSubtype>,
365 #[builder(default)]
366 #[serde(skip_serializing_if = "Option::is_none")]
367 #[serde(default)]
368 #[doc = "Object class (constructor) name. Specified for `object` type values only."]
369 pub class_name: Option<String>,
370 #[builder(default)]
371 #[serde(skip_serializing_if = "Option::is_none")]
372 #[serde(default)]
373 #[doc = "Remote object value in case of primitive values or JSON values (if it was requested)."]
374 pub value: Option<Json>,
375 #[builder(default)]
376 #[serde(skip_serializing_if = "Option::is_none")]
377 #[doc = "Primitive value which can not be JSON-stringified does not have `value`, but gets this\n property."]
378 pub unserializable_value: Option<UnserializableValue>,
379 #[builder(default)]
380 #[serde(skip_serializing_if = "Option::is_none")]
381 #[serde(default)]
382 #[doc = "String representation of the object."]
383 pub description: Option<String>,
384 #[builder(default)]
385 #[serde(skip_serializing_if = "Option::is_none")]
386 #[doc = "Deep serialized value."]
387 pub deep_serialized_value: Option<DeepSerializedValue>,
388 #[builder(default)]
389 #[serde(skip_serializing_if = "Option::is_none")]
390 #[doc = "Unique object identifier (for non-primitive values)."]
391 pub object_id: Option<RemoteObjectId>,
392 #[builder(default)]
393 #[serde(skip_serializing_if = "Option::is_none")]
394 #[doc = "Preview containing abbreviated property values. Specified for `object` type values only."]
395 pub preview: Option<ObjectPreview>,
396 #[builder(default)]
397 #[serde(skip_serializing_if = "Option::is_none")]
398 pub custom_preview: Option<CustomPreview>,
399}
400#[allow(deprecated)]
401#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
402#[builder(setter(into, strip_option))]
403#[serde(rename_all = "camelCase")]
404pub struct CustomPreview {
405 #[serde(default)]
406 #[doc = "The JSON-stringified result of formatter.header(object, config) call.\n It contains json ML array that represents RemoteObject."]
407 pub header: String,
408 #[builder(default)]
409 #[serde(skip_serializing_if = "Option::is_none")]
410 #[doc = "If formatter returns true as a result of formatter.hasBody call then bodyGetterId will\n contain RemoteObjectId for the function that returns result of formatter.body(object, config) call.\n The result value is json ML array."]
411 pub body_getter_id: Option<RemoteObjectId>,
412}
413#[allow(deprecated)]
414#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
415#[builder(setter(into, strip_option))]
416#[serde(rename_all = "camelCase")]
417#[doc = "Object containing abbreviated remote object value."]
418pub struct ObjectPreview {
419 #[doc = "Object type."]
420 pub r#type: ObjectPreviewType,
421 #[builder(default)]
422 #[serde(skip_serializing_if = "Option::is_none")]
423 #[doc = "Object subtype hint. Specified for `object` type values only."]
424 pub subtype: Option<ObjectPreviewSubtype>,
425 #[builder(default)]
426 #[serde(skip_serializing_if = "Option::is_none")]
427 #[serde(default)]
428 #[doc = "String representation of the object."]
429 pub description: Option<String>,
430 #[serde(default)]
431 #[doc = "True iff some of the properties or entries of the original object did not fit."]
432 pub overflow: bool,
433 #[doc = "List of the properties."]
434 pub properties: Vec<PropertyPreview>,
435 #[builder(default)]
436 #[serde(skip_serializing_if = "Option::is_none")]
437 #[doc = "List of the entries. Specified for `map` and `set` subtype values only."]
438 pub entries: Option<Vec<EntryPreview>>,
439}
440#[allow(deprecated)]
441#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
442#[builder(setter(into, strip_option))]
443#[serde(rename_all = "camelCase")]
444pub struct PropertyPreview {
445 #[serde(default)]
446 #[doc = "Property name."]
447 pub name: String,
448 #[doc = "Object type. Accessor means that the property itself is an accessor property."]
449 pub r#type: PropertyPreviewType,
450 #[builder(default)]
451 #[serde(skip_serializing_if = "Option::is_none")]
452 #[serde(default)]
453 #[doc = "User-friendly property value string."]
454 pub value: Option<String>,
455 #[builder(default)]
456 #[serde(skip_serializing_if = "Option::is_none")]
457 #[doc = "Nested value preview."]
458 pub value_preview: Option<ObjectPreview>,
459 #[builder(default)]
460 #[serde(skip_serializing_if = "Option::is_none")]
461 #[doc = "Object subtype hint. Specified for `object` type values only."]
462 pub subtype: Option<PropertyPreviewSubtype>,
463}
464#[allow(deprecated)]
465#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
466#[builder(setter(into, strip_option))]
467#[serde(rename_all = "camelCase")]
468pub struct EntryPreview {
469 #[builder(default)]
470 #[serde(skip_serializing_if = "Option::is_none")]
471 #[doc = "Preview of the key. Specified for map-like collection entries."]
472 pub key: Option<ObjectPreview>,
473 #[doc = "Preview of the value."]
474 pub value: ObjectPreview,
475}
476#[allow(deprecated)]
477#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
478#[builder(setter(into, strip_option))]
479#[serde(rename_all = "camelCase")]
480#[doc = "Object property descriptor."]
481pub struct PropertyDescriptor {
482 #[serde(default)]
483 #[doc = "Property name or symbol description."]
484 pub name: String,
485 #[builder(default)]
486 #[serde(skip_serializing_if = "Option::is_none")]
487 #[doc = "The value associated with the property."]
488 pub value: Option<RemoteObject>,
489 #[builder(default)]
490 #[serde(skip_serializing_if = "Option::is_none")]
491 #[serde(default)]
492 #[doc = "True if the value associated with the property may be changed (data descriptors only)."]
493 pub writable: Option<bool>,
494 #[builder(default)]
495 #[serde(skip_serializing_if = "Option::is_none")]
496 #[doc = "A function which serves as a getter for the property, or `undefined` if there is no getter\n (accessor descriptors only)."]
497 pub get: Option<RemoteObject>,
498 #[builder(default)]
499 #[serde(skip_serializing_if = "Option::is_none")]
500 #[doc = "A function which serves as a setter for the property, or `undefined` if there is no setter\n (accessor descriptors only)."]
501 pub set: Option<RemoteObject>,
502 #[serde(default)]
503 #[doc = "True if the type of this property descriptor may be changed and if the property may be\n deleted from the corresponding object."]
504 pub configurable: bool,
505 #[serde(default)]
506 #[doc = "True if this property shows up during enumeration of the properties on the corresponding\n object."]
507 pub enumerable: bool,
508 #[builder(default)]
509 #[serde(skip_serializing_if = "Option::is_none")]
510 #[serde(default)]
511 #[doc = "True if the result was thrown during the evaluation."]
512 pub was_thrown: Option<bool>,
513 #[builder(default)]
514 #[serde(skip_serializing_if = "Option::is_none")]
515 #[serde(default)]
516 #[doc = "True if the property is owned for the object."]
517 pub is_own: Option<bool>,
518 #[builder(default)]
519 #[serde(skip_serializing_if = "Option::is_none")]
520 #[doc = "Property symbol object, if the property is of the `symbol` type."]
521 pub symbol: Option<RemoteObject>,
522}
523#[allow(deprecated)]
524#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
525#[builder(setter(into, strip_option))]
526#[serde(rename_all = "camelCase")]
527#[doc = "Object internal property descriptor. This property isn't normally visible in JavaScript code."]
528pub struct InternalPropertyDescriptor {
529 #[serde(default)]
530 #[doc = "Conventional property name."]
531 pub name: String,
532 #[builder(default)]
533 #[serde(skip_serializing_if = "Option::is_none")]
534 #[doc = "The value associated with the property."]
535 pub value: Option<RemoteObject>,
536}
537#[allow(deprecated)]
538#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
539#[builder(setter(into, strip_option))]
540#[serde(rename_all = "camelCase")]
541#[doc = "Object private field descriptor."]
542pub struct PrivatePropertyDescriptor {
543 #[serde(default)]
544 #[doc = "Private property name."]
545 pub name: String,
546 #[builder(default)]
547 #[serde(skip_serializing_if = "Option::is_none")]
548 #[doc = "The value associated with the private property."]
549 pub value: Option<RemoteObject>,
550 #[builder(default)]
551 #[serde(skip_serializing_if = "Option::is_none")]
552 #[doc = "A function which serves as a getter for the private property,\n or `undefined` if there is no getter (accessor descriptors only)."]
553 pub get: Option<RemoteObject>,
554 #[builder(default)]
555 #[serde(skip_serializing_if = "Option::is_none")]
556 #[doc = "A function which serves as a setter for the private property,\n or `undefined` if there is no setter (accessor descriptors only)."]
557 pub set: Option<RemoteObject>,
558}
559#[allow(deprecated)]
560#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
561#[builder(setter(into, strip_option))]
562#[serde(rename_all = "camelCase")]
563#[doc = "Represents function call argument. Either remote object id `objectId`, primitive `value`,\n unserializable primitive value or neither of (for undefined) them should be specified."]
564pub struct CallArgument {
565 #[builder(default)]
566 #[serde(skip_serializing_if = "Option::is_none")]
567 #[serde(default)]
568 #[doc = "Primitive value or serializable javascript object."]
569 pub value: Option<Json>,
570 #[builder(default)]
571 #[serde(skip_serializing_if = "Option::is_none")]
572 #[doc = "Primitive value which can not be JSON-stringified."]
573 pub unserializable_value: Option<UnserializableValue>,
574 #[builder(default)]
575 #[serde(skip_serializing_if = "Option::is_none")]
576 #[doc = "Remote object handle."]
577 pub object_id: Option<RemoteObjectId>,
578}
579#[allow(deprecated)]
580#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
581#[builder(setter(into, strip_option))]
582#[serde(rename_all = "camelCase")]
583#[doc = "Description of an isolated world."]
584pub struct ExecutionContextDescription {
585 #[doc = "Unique id of the execution context. It can be used to specify in which execution context\n script evaluation should be performed."]
586 pub id: ExecutionContextId,
587 #[serde(default)]
588 #[doc = "Execution context origin."]
589 pub origin: String,
590 #[serde(default)]
591 #[doc = "Human readable name describing given context."]
592 pub name: String,
593 #[serde(default)]
594 #[doc = "A system-unique execution context identifier. Unlike the id, this is unique across\n multiple processes, so can be reliably used to identify specific context while backend\n performs a cross-process navigation."]
595 pub unique_id: String,
596 #[builder(default)]
597 #[serde(skip_serializing_if = "Option::is_none")]
598 #[serde(default)]
599 #[doc = "Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'|'isolated'|'worker', frameId: string}"]
600 pub aux_data: Option<Json>,
601}
602#[allow(deprecated)]
603#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
604#[builder(setter(into, strip_option))]
605#[serde(rename_all = "camelCase")]
606#[doc = "Detailed information about exception (or error) that was thrown during script compilation or\n execution."]
607pub struct ExceptionDetails {
608 #[serde(default)]
609 #[doc = "Exception id."]
610 pub exception_id: JsUInt,
611 #[serde(default)]
612 #[doc = "Exception text, which should be used together with exception object when available."]
613 pub text: String,
614 #[serde(default)]
615 #[doc = "Line number of the exception location (0-based)."]
616 pub line_number: JsUInt,
617 #[serde(default)]
618 #[doc = "Column number of the exception location (0-based)."]
619 pub column_number: JsUInt,
620 #[builder(default)]
621 #[serde(skip_serializing_if = "Option::is_none")]
622 #[doc = "Script ID of the exception location."]
623 pub script_id: Option<ScriptId>,
624 #[builder(default)]
625 #[serde(skip_serializing_if = "Option::is_none")]
626 #[serde(default)]
627 #[doc = "URL of the exception location, to be used when the script was not reported."]
628 pub url: Option<String>,
629 #[builder(default)]
630 #[serde(skip_serializing_if = "Option::is_none")]
631 #[doc = "JavaScript stack trace if available."]
632 pub stack_trace: Option<StackTrace>,
633 #[builder(default)]
634 #[serde(skip_serializing_if = "Option::is_none")]
635 #[doc = "Exception object if available."]
636 pub exception: Option<RemoteObject>,
637 #[builder(default)]
638 #[serde(skip_serializing_if = "Option::is_none")]
639 #[doc = "Identifier of the context where exception happened."]
640 pub execution_context_id: Option<ExecutionContextId>,
641 #[builder(default)]
642 #[serde(skip_serializing_if = "Option::is_none")]
643 #[serde(default)]
644 #[doc = "Dictionary with entries of meta data that the client associated\n with this exception, such as information about associated network\n requests, etc."]
645 pub exception_meta_data: Option<Json>,
646}
647#[allow(deprecated)]
648#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
649#[builder(setter(into, strip_option))]
650#[serde(rename_all = "camelCase")]
651#[doc = "Stack entry for runtime errors and assertions."]
652pub struct CallFrame {
653 #[serde(default)]
654 #[doc = "JavaScript function name."]
655 pub function_name: String,
656 #[doc = "JavaScript script id."]
657 pub script_id: ScriptId,
658 #[serde(default)]
659 #[doc = "JavaScript script name or url."]
660 pub url: String,
661 #[serde(default)]
662 #[doc = "JavaScript script line number (0-based)."]
663 pub line_number: JsUInt,
664 #[serde(default)]
665 #[doc = "JavaScript script column number (0-based)."]
666 pub column_number: JsUInt,
667}
668#[allow(deprecated)]
669#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
670#[builder(setter(into, strip_option))]
671#[serde(rename_all = "camelCase")]
672#[doc = "Call frames for assertions or error messages."]
673pub struct StackTrace {
674 #[builder(default)]
675 #[serde(skip_serializing_if = "Option::is_none")]
676 #[serde(default)]
677 #[doc = "String label of this stack trace. For async traces this may be a name of the function that\n initiated the async call."]
678 pub description: Option<String>,
679 #[doc = "JavaScript function name."]
680 pub call_frames: Vec<CallFrame>,
681 #[builder(default)]
682 #[serde(skip_serializing_if = "Option::is_none")]
683 #[doc = "Asynchronous JavaScript stack trace that preceded this stack, if available."]
684 pub parent: Option<Box<StackTrace>>,
685 #[builder(default)]
686 #[serde(skip_serializing_if = "Option::is_none")]
687 #[doc = "Asynchronous JavaScript stack trace that preceded this stack, if available."]
688 pub parent_id: Option<StackTraceId>,
689}
690#[allow(deprecated)]
691#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
692#[builder(setter(into, strip_option))]
693#[serde(rename_all = "camelCase")]
694#[doc = "If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This\n allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages."]
695pub struct StackTraceId {
696 #[serde(default)]
697 pub id: String,
698 #[builder(default)]
699 #[serde(skip_serializing_if = "Option::is_none")]
700 pub debugger_id: Option<UniqueDebuggerId>,
701}
702#[allow(deprecated)]
703#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
704#[builder(setter(into, strip_option))]
705#[serde(rename_all = "camelCase")]
706#[doc = "Add handler to promise with given promise object id."]
707pub struct AwaitPromise {
708 #[doc = "Identifier of the promise."]
709 pub promise_object_id: RemoteObjectId,
710 #[builder(default)]
711 #[serde(skip_serializing_if = "Option::is_none")]
712 #[serde(default)]
713 #[doc = "Whether the result is expected to be a JSON object that should be sent by value."]
714 pub return_by_value: Option<bool>,
715 #[builder(default)]
716 #[serde(skip_serializing_if = "Option::is_none")]
717 #[serde(default)]
718 #[doc = "Whether preview should be generated for the result."]
719 pub generate_preview: Option<bool>,
720}
721#[allow(deprecated)]
722#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
723#[builder(setter(into, strip_option))]
724#[serde(rename_all = "camelCase")]
725#[doc = "Calls function with given declaration on the given object. Object group of the result is\n inherited from the target object."]
726pub struct CallFunctionOn {
727 #[serde(default)]
728 #[doc = "Declaration of the function to call."]
729 pub function_declaration: String,
730 #[builder(default)]
731 #[serde(skip_serializing_if = "Option::is_none")]
732 #[doc = "Identifier of the object to call function on. Either objectId or executionContextId should\n be specified."]
733 pub object_id: Option<RemoteObjectId>,
734 #[builder(default)]
735 #[serde(skip_serializing_if = "Option::is_none")]
736 #[doc = "Call arguments. All call arguments must belong to the same JavaScript world as the target\n object."]
737 pub arguments: Option<Vec<CallArgument>>,
738 #[builder(default)]
739 #[serde(skip_serializing_if = "Option::is_none")]
740 #[serde(default)]
741 #[doc = "In silent mode exceptions thrown during evaluation are not reported and do not pause\n execution. Overrides `setPauseOnException` state."]
742 pub silent: Option<bool>,
743 #[builder(default)]
744 #[serde(skip_serializing_if = "Option::is_none")]
745 #[serde(default)]
746 #[doc = "Whether the result is expected to be a JSON object which should be sent by value.\n Can be overriden by `serializationOptions`."]
747 pub return_by_value: Option<bool>,
748 #[builder(default)]
749 #[serde(skip_serializing_if = "Option::is_none")]
750 #[serde(default)]
751 #[doc = "Whether preview should be generated for the result."]
752 pub generate_preview: Option<bool>,
753 #[builder(default)]
754 #[serde(skip_serializing_if = "Option::is_none")]
755 #[serde(default)]
756 #[doc = "Whether execution should be treated as initiated by user in the UI."]
757 pub user_gesture: Option<bool>,
758 #[builder(default)]
759 #[serde(skip_serializing_if = "Option::is_none")]
760 #[serde(default)]
761 #[doc = "Whether execution should `await` for resulting value and return once awaited promise is\n resolved."]
762 pub await_promise: Option<bool>,
763 #[builder(default)]
764 #[serde(skip_serializing_if = "Option::is_none")]
765 #[doc = "Specifies execution context which global object will be used to call function on. Either\n executionContextId or objectId should be specified."]
766 pub execution_context_id: Option<ExecutionContextId>,
767 #[builder(default)]
768 #[serde(skip_serializing_if = "Option::is_none")]
769 #[serde(default)]
770 #[doc = "Symbolic group name that can be used to release multiple objects. If objectGroup is not\n specified and objectId is, objectGroup will be inherited from object."]
771 pub object_group: Option<String>,
772 #[builder(default)]
773 #[serde(skip_serializing_if = "Option::is_none")]
774 #[serde(default)]
775 #[doc = "Whether to throw an exception if side effect cannot be ruled out during evaluation."]
776 pub throw_on_side_effect: Option<bool>,
777 #[builder(default)]
778 #[serde(skip_serializing_if = "Option::is_none")]
779 #[serde(default)]
780 #[doc = "An alternative way to specify the execution context to call function on.\n Compared to contextId that may be reused across processes, this is guaranteed to be\n system-unique, so it can be used to prevent accidental function call\n in context different than intended (e.g. as a result of navigation across process\n boundaries).\n This is mutually exclusive with `executionContextId`."]
781 pub unique_context_id: Option<String>,
782 #[builder(default)]
783 #[serde(skip_serializing_if = "Option::is_none")]
784 #[doc = "Specifies the result serialization. If provided, overrides\n `generatePreview` and `returnByValue`."]
785 pub serialization_options: Option<SerializationOptions>,
786}
787#[allow(deprecated)]
788#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
789#[builder(setter(into, strip_option))]
790#[serde(rename_all = "camelCase")]
791#[doc = "Compiles expression."]
792pub struct CompileScript {
793 #[serde(default)]
794 #[doc = "Expression to compile."]
795 pub expression: String,
796 #[serde(default)]
797 #[doc = "Source url to be set for the script."]
798 #[serde(rename = "sourceURL")]
799 pub source_url: String,
800 #[serde(default)]
801 #[doc = "Specifies whether the compiled script should be persisted."]
802 pub persist_script: bool,
803 #[builder(default)]
804 #[serde(skip_serializing_if = "Option::is_none")]
805 #[doc = "Specifies in which execution context to perform script run. If the parameter is omitted the\n evaluation will be performed in the context of the inspected page."]
806 pub execution_context_id: Option<ExecutionContextId>,
807}
808#[allow(deprecated)]
809#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
810pub struct Disable(pub Option<Json>);
811#[allow(deprecated)]
812#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
813pub struct DiscardConsoleEntries(pub Option<Json>);
814#[allow(deprecated)]
815#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
816pub struct Enable(pub Option<Json>);
817#[allow(deprecated)]
818#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
819#[builder(setter(into, strip_option))]
820#[serde(rename_all = "camelCase")]
821#[doc = "Evaluates expression on global object."]
822pub struct Evaluate {
823 #[serde(default)]
824 #[doc = "Expression to evaluate."]
825 pub expression: String,
826 #[builder(default)]
827 #[serde(skip_serializing_if = "Option::is_none")]
828 #[serde(default)]
829 #[doc = "Symbolic group name that can be used to release multiple objects."]
830 pub object_group: Option<String>,
831 #[builder(default)]
832 #[serde(skip_serializing_if = "Option::is_none")]
833 #[serde(default)]
834 #[doc = "Determines whether Command Line API should be available during the evaluation."]
835 #[serde(rename = "includeCommandLineAPI")]
836 pub include_command_line_api: Option<bool>,
837 #[builder(default)]
838 #[serde(skip_serializing_if = "Option::is_none")]
839 #[serde(default)]
840 #[doc = "In silent mode exceptions thrown during evaluation are not reported and do not pause\n execution. Overrides `setPauseOnException` state."]
841 pub silent: Option<bool>,
842 #[builder(default)]
843 #[serde(skip_serializing_if = "Option::is_none")]
844 #[doc = "Specifies in which execution context to perform evaluation. If the parameter is omitted the\n evaluation will be performed in the context of the inspected page.\n This is mutually exclusive with `uniqueContextId`, which offers an\n alternative way to identify the execution context that is more reliable\n in a multi-process environment."]
845 pub context_id: Option<ExecutionContextId>,
846 #[builder(default)]
847 #[serde(skip_serializing_if = "Option::is_none")]
848 #[serde(default)]
849 #[doc = "Whether the result is expected to be a JSON object that should be sent by value."]
850 pub return_by_value: Option<bool>,
851 #[builder(default)]
852 #[serde(skip_serializing_if = "Option::is_none")]
853 #[serde(default)]
854 #[doc = "Whether preview should be generated for the result."]
855 pub generate_preview: Option<bool>,
856 #[builder(default)]
857 #[serde(skip_serializing_if = "Option::is_none")]
858 #[serde(default)]
859 #[doc = "Whether execution should be treated as initiated by user in the UI."]
860 pub user_gesture: Option<bool>,
861 #[builder(default)]
862 #[serde(skip_serializing_if = "Option::is_none")]
863 #[serde(default)]
864 #[doc = "Whether execution should `await` for resulting value and return once awaited promise is\n resolved."]
865 pub await_promise: Option<bool>,
866 #[builder(default)]
867 #[serde(skip_serializing_if = "Option::is_none")]
868 #[serde(default)]
869 #[doc = "Whether to throw an exception if side effect cannot be ruled out during evaluation.\n This implies `disableBreaks` below."]
870 pub throw_on_side_effect: Option<bool>,
871 #[builder(default)]
872 #[serde(skip_serializing_if = "Option::is_none")]
873 #[doc = "Terminate execution after timing out (number of milliseconds)."]
874 pub timeout: Option<TimeDelta>,
875 #[builder(default)]
876 #[serde(skip_serializing_if = "Option::is_none")]
877 #[serde(default)]
878 #[doc = "Disable breakpoints during execution."]
879 pub disable_breaks: Option<bool>,
880 #[builder(default)]
881 #[serde(skip_serializing_if = "Option::is_none")]
882 #[serde(default)]
883 #[doc = "Setting this flag to true enables `let` re-declaration and top-level `await`.\n Note that `let` variables can only be re-declared if they originate from\n `replMode` themselves."]
884 pub repl_mode: Option<bool>,
885 #[builder(default)]
886 #[serde(skip_serializing_if = "Option::is_none")]
887 #[serde(default)]
888 #[doc = "The Content Security Policy (CSP) for the target might block 'unsafe-eval'\n which includes eval(), Function(), setTimeout() and setInterval()\n when called with non-callable arguments. This flag bypasses CSP for this\n evaluation and allows unsafe-eval. Defaults to true."]
889 #[serde(rename = "allowUnsafeEvalBlockedByCSP")]
890 pub allow_unsafe_eval_blocked_by_csp: Option<bool>,
891 #[builder(default)]
892 #[serde(skip_serializing_if = "Option::is_none")]
893 #[serde(default)]
894 #[doc = "An alternative way to specify the execution context to evaluate in.\n Compared to contextId that may be reused across processes, this is guaranteed to be\n system-unique, so it can be used to prevent accidental evaluation of the expression\n in context different than intended (e.g. as a result of navigation across process\n boundaries).\n This is mutually exclusive with `contextId`."]
895 pub unique_context_id: Option<String>,
896 #[builder(default)]
897 #[serde(skip_serializing_if = "Option::is_none")]
898 #[doc = "Specifies the result serialization. If provided, overrides\n `generatePreview` and `returnByValue`."]
899 pub serialization_options: Option<SerializationOptions>,
900}
901#[allow(deprecated)]
902#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
903pub struct GetIsolateId(pub Option<Json>);
904#[allow(deprecated)]
905#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
906pub struct GetHeapUsage(pub Option<Json>);
907#[allow(deprecated)]
908#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
909#[builder(setter(into, strip_option))]
910#[serde(rename_all = "camelCase")]
911#[doc = "Returns properties of a given object. Object group of the result is inherited from the target\n object."]
912pub struct GetProperties {
913 #[doc = "Identifier of the object to return properties for."]
914 pub object_id: RemoteObjectId,
915 #[builder(default)]
916 #[serde(skip_serializing_if = "Option::is_none")]
917 #[serde(default)]
918 #[doc = "If true, returns properties belonging only to the element itself, not to its prototype\n chain."]
919 pub own_properties: Option<bool>,
920 #[builder(default)]
921 #[serde(skip_serializing_if = "Option::is_none")]
922 #[serde(default)]
923 #[doc = "If true, returns accessor properties (with getter/setter) only; internal properties are not\n returned either."]
924 pub accessor_properties_only: Option<bool>,
925 #[builder(default)]
926 #[serde(skip_serializing_if = "Option::is_none")]
927 #[serde(default)]
928 #[doc = "Whether preview should be generated for the results."]
929 pub generate_preview: Option<bool>,
930 #[builder(default)]
931 #[serde(skip_serializing_if = "Option::is_none")]
932 #[serde(default)]
933 #[doc = "If true, returns non-indexed properties only."]
934 pub non_indexed_properties_only: Option<bool>,
935}
936#[allow(deprecated)]
937#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
938#[builder(setter(into, strip_option))]
939#[serde(rename_all = "camelCase")]
940#[doc = "Returns all let, const and class variables from global scope."]
941pub struct GlobalLexicalScopeNames {
942 #[builder(default)]
943 #[serde(skip_serializing_if = "Option::is_none")]
944 #[doc = "Specifies in which execution context to lookup global scope variables."]
945 pub execution_context_id: Option<ExecutionContextId>,
946}
947#[allow(deprecated)]
948#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
949#[builder(setter(into, strip_option))]
950#[serde(rename_all = "camelCase")]
951pub struct QueryObjects {
952 #[doc = "Identifier of the prototype to return objects for."]
953 pub prototype_object_id: RemoteObjectId,
954 #[builder(default)]
955 #[serde(skip_serializing_if = "Option::is_none")]
956 #[serde(default)]
957 #[doc = "Symbolic group name that can be used to release the results."]
958 pub object_group: Option<String>,
959}
960#[allow(deprecated)]
961#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
962#[builder(setter(into, strip_option))]
963#[serde(rename_all = "camelCase")]
964#[doc = "Releases remote object with given id."]
965pub struct ReleaseObject {
966 #[doc = "Identifier of the object to release."]
967 pub object_id: RemoteObjectId,
968}
969#[allow(deprecated)]
970#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
971#[builder(setter(into, strip_option))]
972#[serde(rename_all = "camelCase")]
973#[doc = "Releases all remote objects that belong to a given group."]
974pub struct ReleaseObjectGroup {
975 #[serde(default)]
976 #[doc = "Symbolic object group name."]
977 pub object_group: String,
978}
979#[allow(deprecated)]
980#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
981pub struct RunIfWaitingForDebugger(pub Option<Json>);
982#[allow(deprecated)]
983#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
984#[builder(setter(into, strip_option))]
985#[serde(rename_all = "camelCase")]
986#[doc = "Runs script with given id in a given context."]
987pub struct RunScript {
988 #[doc = "Id of the script to run."]
989 pub script_id: ScriptId,
990 #[builder(default)]
991 #[serde(skip_serializing_if = "Option::is_none")]
992 #[doc = "Specifies in which execution context to perform script run. If the parameter is omitted the\n evaluation will be performed in the context of the inspected page."]
993 pub execution_context_id: Option<ExecutionContextId>,
994 #[builder(default)]
995 #[serde(skip_serializing_if = "Option::is_none")]
996 #[serde(default)]
997 #[doc = "Symbolic group name that can be used to release multiple objects."]
998 pub object_group: Option<String>,
999 #[builder(default)]
1000 #[serde(skip_serializing_if = "Option::is_none")]
1001 #[serde(default)]
1002 #[doc = "In silent mode exceptions thrown during evaluation are not reported and do not pause\n execution. Overrides `setPauseOnException` state."]
1003 pub silent: Option<bool>,
1004 #[builder(default)]
1005 #[serde(skip_serializing_if = "Option::is_none")]
1006 #[serde(default)]
1007 #[doc = "Determines whether Command Line API should be available during the evaluation."]
1008 #[serde(rename = "includeCommandLineAPI")]
1009 pub include_command_line_api: Option<bool>,
1010 #[builder(default)]
1011 #[serde(skip_serializing_if = "Option::is_none")]
1012 #[serde(default)]
1013 #[doc = "Whether the result is expected to be a JSON object which should be sent by value."]
1014 pub return_by_value: Option<bool>,
1015 #[builder(default)]
1016 #[serde(skip_serializing_if = "Option::is_none")]
1017 #[serde(default)]
1018 #[doc = "Whether preview should be generated for the result."]
1019 pub generate_preview: Option<bool>,
1020 #[builder(default)]
1021 #[serde(skip_serializing_if = "Option::is_none")]
1022 #[serde(default)]
1023 #[doc = "Whether execution should `await` for resulting value and return once awaited promise is\n resolved."]
1024 pub await_promise: Option<bool>,
1025}
1026#[allow(deprecated)]
1027#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1028#[builder(setter(into, strip_option))]
1029#[serde(rename_all = "camelCase")]
1030#[doc = "Enables or disables async call stacks tracking."]
1031pub struct SetAsyncCallStackDepth {
1032 #[serde(default)]
1033 #[doc = "Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async\n call stacks (default)."]
1034 pub max_depth: JsUInt,
1035}
1036#[allow(deprecated)]
1037#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1038#[builder(setter(into, strip_option))]
1039#[serde(rename_all = "camelCase")]
1040pub struct SetCustomObjectFormatterEnabled {
1041 #[serde(default)]
1042 pub enabled: bool,
1043}
1044#[allow(deprecated)]
1045#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1046#[builder(setter(into, strip_option))]
1047#[serde(rename_all = "camelCase")]
1048pub struct SetMaxCallStackSizeToCapture {
1049 #[serde(default)]
1050 pub size: JsUInt,
1051}
1052#[allow(deprecated)]
1053#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1054pub struct TerminateExecution(pub Option<Json>);
1055#[allow(deprecated)]
1056#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1057#[builder(setter(into, strip_option))]
1058#[serde(rename_all = "camelCase")]
1059#[doc = "If executionContextId is empty, adds binding with the given name on the\n global objects of all inspected contexts, including those created later,\n bindings survive reloads.\n Binding function takes exactly one argument, this argument should be string,\n in case of any other input, function throws an exception.\n Each binding function call produces Runtime.bindingCalled notification."]
1060pub struct AddBinding {
1061 #[serde(default)]
1062 pub name: String,
1063 #[builder(default)]
1064 #[serde(skip_serializing_if = "Option::is_none")]
1065 #[doc = "If specified, the binding would only be exposed to the specified\n execution context. If omitted and `executionContextName` is not set,\n the binding is exposed to all execution contexts of the target.\n This parameter is mutually exclusive with `executionContextName`.\n Deprecated in favor of `executionContextName` due to an unclear use case\n and bugs in implementation (crbug.com/1169639). `executionContextId` will be\n removed in the future."]
1066 #[deprecated]
1067 pub execution_context_id: Option<ExecutionContextId>,
1068 #[builder(default)]
1069 #[serde(skip_serializing_if = "Option::is_none")]
1070 #[serde(default)]
1071 #[doc = "If specified, the binding is exposed to the executionContext with\n matching name, even for contexts created after the binding is added.\n See also `ExecutionContext.name` and `worldName` parameter to\n `Page.addScriptToEvaluateOnNewDocument`.\n This parameter is mutually exclusive with `executionContextId`."]
1072 pub execution_context_name: Option<String>,
1073}
1074#[allow(deprecated)]
1075#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1076#[builder(setter(into, strip_option))]
1077#[serde(rename_all = "camelCase")]
1078#[doc = "This method does not remove binding function from global object but\n unsubscribes current runtime agent from Runtime.bindingCalled notifications."]
1079pub struct RemoveBinding {
1080 #[serde(default)]
1081 pub name: String,
1082}
1083#[allow(deprecated)]
1084#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1085#[builder(setter(into, strip_option))]
1086#[serde(rename_all = "camelCase")]
1087#[doc = "This method tries to lookup and populate exception details for a\n JavaScript Error object.\n Note that the stackTrace portion of the resulting exceptionDetails will\n only be populated if the Runtime domain was enabled at the time when the\n Error was thrown."]
1088pub struct GetExceptionDetails {
1089 #[doc = "The error object for which to resolve the exception details."]
1090 pub error_object_id: RemoteObjectId,
1091}
1092#[allow(deprecated)]
1093#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1094#[serde(rename_all = "camelCase")]
1095#[doc = "Add handler to promise with given promise object id."]
1096pub struct AwaitPromiseReturnObject {
1097 #[doc = "Promise result. Will contain rejected value if promise was rejected."]
1098 pub result: RemoteObject,
1099 #[builder(default)]
1100 #[serde(skip_serializing_if = "Option::is_none")]
1101 #[doc = "Exception details if stack strace is available."]
1102 pub exception_details: Option<ExceptionDetails>,
1103}
1104#[allow(deprecated)]
1105#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1106#[serde(rename_all = "camelCase")]
1107#[doc = "Calls function with given declaration on the given object. Object group of the result is\n inherited from the target object."]
1108pub struct CallFunctionOnReturnObject {
1109 #[doc = "Call result."]
1110 pub result: RemoteObject,
1111 #[builder(default)]
1112 #[serde(skip_serializing_if = "Option::is_none")]
1113 #[doc = "Exception details."]
1114 pub exception_details: Option<ExceptionDetails>,
1115}
1116#[allow(deprecated)]
1117#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1118#[serde(rename_all = "camelCase")]
1119#[doc = "Compiles expression."]
1120pub struct CompileScriptReturnObject {
1121 #[builder(default)]
1122 #[serde(skip_serializing_if = "Option::is_none")]
1123 #[doc = "Id of the script."]
1124 pub script_id: Option<ScriptId>,
1125 #[builder(default)]
1126 #[serde(skip_serializing_if = "Option::is_none")]
1127 #[doc = "Exception details."]
1128 pub exception_details: Option<ExceptionDetails>,
1129}
1130#[allow(deprecated)]
1131#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1132#[doc = "Disables reporting of execution contexts creation."]
1133pub struct DisableReturnObject(pub Option<Json>);
1134#[allow(deprecated)]
1135#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1136#[doc = "Discards collected exceptions and console API calls."]
1137pub struct DiscardConsoleEntriesReturnObject(pub Option<Json>);
1138#[allow(deprecated)]
1139#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1140#[doc = "Enables reporting of execution contexts creation by means of `executionContextCreated` event.\n When the reporting gets enabled the event will be sent immediately for each existing execution\n context."]
1141pub struct EnableReturnObject(pub Option<Json>);
1142#[allow(deprecated)]
1143#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1144#[serde(rename_all = "camelCase")]
1145#[doc = "Evaluates expression on global object."]
1146pub struct EvaluateReturnObject {
1147 #[doc = "Evaluation result."]
1148 pub result: RemoteObject,
1149 #[builder(default)]
1150 #[serde(skip_serializing_if = "Option::is_none")]
1151 #[doc = "Exception details."]
1152 pub exception_details: Option<ExceptionDetails>,
1153}
1154#[allow(deprecated)]
1155#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1156#[serde(rename_all = "camelCase")]
1157#[doc = "Returns the isolate id."]
1158pub struct GetIsolateIdReturnObject {
1159 #[serde(default)]
1160 #[doc = "The isolate id."]
1161 pub id: String,
1162}
1163#[allow(deprecated)]
1164#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1165#[serde(rename_all = "camelCase")]
1166#[doc = "Returns the JavaScript heap usage.\n It is the total usage of the corresponding isolate not scoped to a particular Runtime."]
1167pub struct GetHeapUsageReturnObject {
1168 #[serde(default)]
1169 #[doc = "Used JavaScript heap size in bytes."]
1170 pub used_size: JsFloat,
1171 #[serde(default)]
1172 #[doc = "Allocated JavaScript heap size in bytes."]
1173 pub total_size: JsFloat,
1174 #[serde(default)]
1175 #[doc = "Used size in bytes in the embedder's garbage-collected heap."]
1176 pub embedder_heap_used_size: JsFloat,
1177 #[serde(default)]
1178 #[doc = "Size in bytes of backing storage for array buffers and external strings."]
1179 pub backing_storage_size: JsFloat,
1180}
1181#[allow(deprecated)]
1182#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1183#[serde(rename_all = "camelCase")]
1184#[doc = "Returns properties of a given object. Object group of the result is inherited from the target\n object."]
1185pub struct GetPropertiesReturnObject {
1186 #[doc = "Object properties."]
1187 pub result: Vec<PropertyDescriptor>,
1188 #[builder(default)]
1189 #[serde(skip_serializing_if = "Option::is_none")]
1190 #[doc = "Internal object properties (only of the element itself)."]
1191 pub internal_properties: Option<Vec<InternalPropertyDescriptor>>,
1192 #[builder(default)]
1193 #[serde(skip_serializing_if = "Option::is_none")]
1194 #[doc = "Object private properties."]
1195 pub private_properties: Option<Vec<PrivatePropertyDescriptor>>,
1196 #[builder(default)]
1197 #[serde(skip_serializing_if = "Option::is_none")]
1198 #[doc = "Exception details."]
1199 pub exception_details: Option<ExceptionDetails>,
1200}
1201#[allow(deprecated)]
1202#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1203#[serde(rename_all = "camelCase")]
1204#[doc = "Returns all let, const and class variables from global scope."]
1205pub struct GlobalLexicalScopeNamesReturnObject {
1206 pub names: Vec<String>,
1207}
1208#[allow(deprecated)]
1209#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1210#[serde(rename_all = "camelCase")]
1211pub struct QueryObjectsReturnObject {
1212 #[doc = "Array with objects."]
1213 pub objects: RemoteObject,
1214}
1215#[allow(deprecated)]
1216#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1217#[doc = "Releases remote object with given id."]
1218pub struct ReleaseObjectReturnObject(pub Option<Json>);
1219#[allow(deprecated)]
1220#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1221#[doc = "Releases all remote objects that belong to a given group."]
1222pub struct ReleaseObjectGroupReturnObject(pub Option<Json>);
1223#[allow(deprecated)]
1224#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1225#[doc = "Tells inspected instance to run if it was waiting for debugger to attach."]
1226pub struct RunIfWaitingForDebuggerReturnObject(pub Option<Json>);
1227#[allow(deprecated)]
1228#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1229#[serde(rename_all = "camelCase")]
1230#[doc = "Runs script with given id in a given context."]
1231pub struct RunScriptReturnObject {
1232 #[doc = "Run result."]
1233 pub result: RemoteObject,
1234 #[builder(default)]
1235 #[serde(skip_serializing_if = "Option::is_none")]
1236 #[doc = "Exception details."]
1237 pub exception_details: Option<ExceptionDetails>,
1238}
1239#[allow(deprecated)]
1240#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1241#[doc = "Enables or disables async call stacks tracking."]
1242pub struct SetAsyncCallStackDepthReturnObject(pub Option<Json>);
1243#[allow(deprecated)]
1244#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1245pub struct SetCustomObjectFormatterEnabledReturnObject(pub Option<Json>);
1246#[allow(deprecated)]
1247#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1248pub struct SetMaxCallStackSizeToCaptureReturnObject(pub Option<Json>);
1249#[allow(deprecated)]
1250#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1251#[doc = "Terminate current or next JavaScript execution.\n Will cancel the termination when the outer-most script execution ends."]
1252pub struct TerminateExecutionReturnObject(pub Option<Json>);
1253#[allow(deprecated)]
1254#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1255#[doc = "If executionContextId is empty, adds binding with the given name on the\n global objects of all inspected contexts, including those created later,\n bindings survive reloads.\n Binding function takes exactly one argument, this argument should be string,\n in case of any other input, function throws an exception.\n Each binding function call produces Runtime.bindingCalled notification."]
1256pub struct AddBindingReturnObject(pub Option<Json>);
1257#[allow(deprecated)]
1258#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1259#[doc = "This method does not remove binding function from global object but\n unsubscribes current runtime agent from Runtime.bindingCalled notifications."]
1260pub struct RemoveBindingReturnObject(pub Option<Json>);
1261#[allow(deprecated)]
1262#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1263#[serde(rename_all = "camelCase")]
1264#[doc = "This method tries to lookup and populate exception details for a\n JavaScript Error object.\n Note that the stackTrace portion of the resulting exceptionDetails will\n only be populated if the Runtime domain was enabled at the time when the\n Error was thrown."]
1265pub struct GetExceptionDetailsReturnObject {
1266 #[builder(default)]
1267 #[serde(skip_serializing_if = "Option::is_none")]
1268 pub exception_details: Option<ExceptionDetails>,
1269}
1270#[allow(deprecated)]
1271impl Method for AwaitPromise {
1272 const NAME: &'static str = "Runtime.awaitPromise";
1273 type ReturnObject = AwaitPromiseReturnObject;
1274}
1275#[allow(deprecated)]
1276impl Method for CallFunctionOn {
1277 const NAME: &'static str = "Runtime.callFunctionOn";
1278 type ReturnObject = CallFunctionOnReturnObject;
1279}
1280#[allow(deprecated)]
1281impl Method for CompileScript {
1282 const NAME: &'static str = "Runtime.compileScript";
1283 type ReturnObject = CompileScriptReturnObject;
1284}
1285#[allow(deprecated)]
1286impl Method for Disable {
1287 const NAME: &'static str = "Runtime.disable";
1288 type ReturnObject = DisableReturnObject;
1289}
1290#[allow(deprecated)]
1291impl Method for DiscardConsoleEntries {
1292 const NAME: &'static str = "Runtime.discardConsoleEntries";
1293 type ReturnObject = DiscardConsoleEntriesReturnObject;
1294}
1295#[allow(deprecated)]
1296impl Method for Enable {
1297 const NAME: &'static str = "Runtime.enable";
1298 type ReturnObject = EnableReturnObject;
1299}
1300#[allow(deprecated)]
1301impl Method for Evaluate {
1302 const NAME: &'static str = "Runtime.evaluate";
1303 type ReturnObject = EvaluateReturnObject;
1304}
1305#[allow(deprecated)]
1306impl Method for GetIsolateId {
1307 const NAME: &'static str = "Runtime.getIsolateId";
1308 type ReturnObject = GetIsolateIdReturnObject;
1309}
1310#[allow(deprecated)]
1311impl Method for GetHeapUsage {
1312 const NAME: &'static str = "Runtime.getHeapUsage";
1313 type ReturnObject = GetHeapUsageReturnObject;
1314}
1315#[allow(deprecated)]
1316impl Method for GetProperties {
1317 const NAME: &'static str = "Runtime.getProperties";
1318 type ReturnObject = GetPropertiesReturnObject;
1319}
1320#[allow(deprecated)]
1321impl Method for GlobalLexicalScopeNames {
1322 const NAME: &'static str = "Runtime.globalLexicalScopeNames";
1323 type ReturnObject = GlobalLexicalScopeNamesReturnObject;
1324}
1325#[allow(deprecated)]
1326impl Method for QueryObjects {
1327 const NAME: &'static str = "Runtime.queryObjects";
1328 type ReturnObject = QueryObjectsReturnObject;
1329}
1330#[allow(deprecated)]
1331impl Method for ReleaseObject {
1332 const NAME: &'static str = "Runtime.releaseObject";
1333 type ReturnObject = ReleaseObjectReturnObject;
1334}
1335#[allow(deprecated)]
1336impl Method for ReleaseObjectGroup {
1337 const NAME: &'static str = "Runtime.releaseObjectGroup";
1338 type ReturnObject = ReleaseObjectGroupReturnObject;
1339}
1340#[allow(deprecated)]
1341impl Method for RunIfWaitingForDebugger {
1342 const NAME: &'static str = "Runtime.runIfWaitingForDebugger";
1343 type ReturnObject = RunIfWaitingForDebuggerReturnObject;
1344}
1345#[allow(deprecated)]
1346impl Method for RunScript {
1347 const NAME: &'static str = "Runtime.runScript";
1348 type ReturnObject = RunScriptReturnObject;
1349}
1350#[allow(deprecated)]
1351impl Method for SetAsyncCallStackDepth {
1352 const NAME: &'static str = "Runtime.setAsyncCallStackDepth";
1353 type ReturnObject = SetAsyncCallStackDepthReturnObject;
1354}
1355#[allow(deprecated)]
1356impl Method for SetCustomObjectFormatterEnabled {
1357 const NAME: &'static str = "Runtime.setCustomObjectFormatterEnabled";
1358 type ReturnObject = SetCustomObjectFormatterEnabledReturnObject;
1359}
1360#[allow(deprecated)]
1361impl Method for SetMaxCallStackSizeToCapture {
1362 const NAME: &'static str = "Runtime.setMaxCallStackSizeToCapture";
1363 type ReturnObject = SetMaxCallStackSizeToCaptureReturnObject;
1364}
1365#[allow(deprecated)]
1366impl Method for TerminateExecution {
1367 const NAME: &'static str = "Runtime.terminateExecution";
1368 type ReturnObject = TerminateExecutionReturnObject;
1369}
1370#[allow(deprecated)]
1371impl Method for AddBinding {
1372 const NAME: &'static str = "Runtime.addBinding";
1373 type ReturnObject = AddBindingReturnObject;
1374}
1375#[allow(deprecated)]
1376impl Method for RemoveBinding {
1377 const NAME: &'static str = "Runtime.removeBinding";
1378 type ReturnObject = RemoveBindingReturnObject;
1379}
1380#[allow(deprecated)]
1381impl Method for GetExceptionDetails {
1382 const NAME: &'static str = "Runtime.getExceptionDetails";
1383 type ReturnObject = GetExceptionDetailsReturnObject;
1384}
1385#[allow(dead_code)]
1386pub mod events {
1387 #[allow(unused_imports)]
1388 use super::super::types::*;
1389 #[allow(unused_imports)]
1390 use derive_builder::Builder;
1391 #[allow(unused_imports)]
1392 use serde::{Deserialize, Serialize};
1393 #[allow(unused_imports)]
1394 use serde_json::Value as Json;
1395 #[allow(deprecated)]
1396 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1397 pub struct BindingCalledEvent {
1398 pub params: BindingCalledEventParams,
1399 }
1400 #[allow(deprecated)]
1401 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1402 #[serde(rename_all = "camelCase")]
1403 pub struct BindingCalledEventParams {
1404 #[serde(default)]
1405 pub name: String,
1406 #[serde(default)]
1407 pub payload: String,
1408 #[doc = "Identifier of the context where the call was made."]
1409 pub execution_context_id: super::ExecutionContextId,
1410 }
1411 #[allow(deprecated)]
1412 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1413 pub struct ConsoleAPICalledEvent {
1414 pub params: ConsoleAPICalledEventParams,
1415 }
1416 #[allow(deprecated)]
1417 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1418 #[serde(rename_all = "camelCase")]
1419 pub struct ConsoleAPICalledEventParams {
1420 #[doc = "Type of the call."]
1421 pub r#type: super::ConsoleApiCalledTypeOption,
1422 #[doc = "Call arguments."]
1423 pub args: Vec<super::RemoteObject>,
1424 #[doc = "Identifier of the context where the call was made."]
1425 pub execution_context_id: super::ExecutionContextId,
1426 #[doc = "Call timestamp."]
1427 pub timestamp: super::Timestamp,
1428 #[builder(default)]
1429 #[serde(skip_serializing_if = "Option::is_none")]
1430 #[doc = "Stack trace captured when the call was made. The async stack chain is automatically reported for\n the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call\n chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field."]
1431 pub stack_trace: Option<super::StackTrace>,
1432 #[builder(default)]
1433 #[serde(skip_serializing_if = "Option::is_none")]
1434 #[serde(default)]
1435 #[doc = "Console context descriptor for calls on non-default console context (not console.*):\n 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call\n on named context."]
1436 pub context: Option<String>,
1437 }
1438 #[allow(deprecated)]
1439 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1440 pub struct ExceptionRevokedEvent {
1441 pub params: ExceptionRevokedEventParams,
1442 }
1443 #[allow(deprecated)]
1444 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1445 #[serde(rename_all = "camelCase")]
1446 pub struct ExceptionRevokedEventParams {
1447 #[serde(default)]
1448 #[doc = "Reason describing why exception was revoked."]
1449 pub reason: String,
1450 #[serde(default)]
1451 #[doc = "The id of revoked exception, as reported in `exceptionThrown`."]
1452 pub exception_id: JsUInt,
1453 }
1454 #[allow(deprecated)]
1455 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1456 pub struct ExceptionThrownEvent {
1457 pub params: ExceptionThrownEventParams,
1458 }
1459 #[allow(deprecated)]
1460 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1461 #[serde(rename_all = "camelCase")]
1462 pub struct ExceptionThrownEventParams {
1463 #[doc = "Timestamp of the exception."]
1464 pub timestamp: super::Timestamp,
1465 pub exception_details: super::ExceptionDetails,
1466 }
1467 #[allow(deprecated)]
1468 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1469 pub struct ExecutionContextCreatedEvent {
1470 pub params: ExecutionContextCreatedEventParams,
1471 }
1472 #[allow(deprecated)]
1473 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1474 #[serde(rename_all = "camelCase")]
1475 pub struct ExecutionContextCreatedEventParams {
1476 #[doc = "A newly created execution context."]
1477 pub context: super::ExecutionContextDescription,
1478 }
1479 #[allow(deprecated)]
1480 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1481 pub struct ExecutionContextDestroyedEvent {
1482 pub params: ExecutionContextDestroyedEventParams,
1483 }
1484 #[allow(deprecated)]
1485 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1486 #[serde(rename_all = "camelCase")]
1487 pub struct ExecutionContextDestroyedEventParams {
1488 #[doc = "Id of the destroyed context"]
1489 #[deprecated]
1490 pub execution_context_id: super::ExecutionContextId,
1491 #[serde(default)]
1492 #[doc = "Unique Id of the destroyed context"]
1493 pub execution_context_unique_id: String,
1494 }
1495 #[allow(deprecated)]
1496 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1497 pub struct ExecutionContextsClearedEvent(pub Option<Json>);
1498 #[allow(deprecated)]
1499 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
1500 pub struct InspectRequestedEvent {
1501 pub params: InspectRequestedEventParams,
1502 }
1503 #[allow(deprecated)]
1504 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Builder)]
1505 #[serde(rename_all = "camelCase")]
1506 pub struct InspectRequestedEventParams {
1507 pub object: super::RemoteObject,
1508 #[serde(default)]
1509 pub hints: Json,
1510 #[builder(default)]
1511 #[serde(skip_serializing_if = "Option::is_none")]
1512 #[doc = "Identifier of the context where the call was made."]
1513 pub execution_context_id: Option<super::ExecutionContextId>,
1514 }
1515}