Skip to main content

rustenium_bidi_definitions/script/
types.rs

1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
3pub struct Channel(String);
4impl Channel {
5    pub fn new(val: impl Into<String>) -> Self {
6        Channel(val.into())
7    }
8    pub fn inner(&self) -> &String {
9        &self.0
10    }
11}
12impl AsRef<str> for Channel {
13    fn as_ref(&self) -> &str {
14        self.0.as_str()
15    }
16}
17impl From<Channel> for String {
18    fn from(el: Channel) -> String {
19        el.0
20    }
21}
22impl From<String> for Channel {
23    fn from(expr: String) -> Self {
24        Channel(expr)
25    }
26}
27impl Channel {
28    pub const IDENTIFIER: &'static str = "script.Channel";
29    pub const DOMAIN_DIRECTION: &'static str = "all";
30    pub fn identifier(&self) -> &'static str {
31        Self::IDENTIFIER
32    }
33}
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct ChannelValue {
36    #[serde(rename = "type")]
37    pub r#type: ChannelValueType,
38    #[serde(rename = "value")]
39    pub value: ChannelProperties,
40}
41#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
42pub enum ChannelValueType {
43    #[serde(rename = "channel")]
44    Channel,
45}
46impl ChannelValue {
47    pub fn new(r#type: impl Into<ChannelValueType>, value: impl Into<ChannelProperties>) -> Self {
48        Self {
49            r#type: r#type.into(),
50            value: value.into(),
51        }
52    }
53}
54impl ChannelValue {
55    pub const IDENTIFIER: &'static str = "script.ChannelValue";
56    pub const DOMAIN_DIRECTION: &'static str = "all";
57    pub fn identifier(&self) -> &'static str {
58        Self::IDENTIFIER
59    }
60}
61#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
62pub struct ChannelProperties {
63    #[serde(rename = "channel")]
64    pub channel: Channel,
65    #[serde(rename = "serializationOptions")]
66    #[serde(skip_serializing_if = "Option::is_none")]
67    #[serde(default)]
68    pub serialization_options: Option<SerializationOptions>,
69    #[serde(rename = "ownership")]
70    #[serde(skip_serializing_if = "Option::is_none")]
71    #[serde(default)]
72    pub ownership: Option<ResultOwnership>,
73}
74impl ChannelProperties {
75    pub fn new(channel: impl Into<Channel>) -> Self {
76        Self {
77            channel: channel.into(),
78            serialization_options: None,
79            ownership: None,
80        }
81    }
82}
83impl ChannelProperties {
84    pub const IDENTIFIER: &'static str = "script.ChannelProperties";
85    pub const DOMAIN_DIRECTION: &'static str = "all";
86    pub fn identifier(&self) -> &'static str {
87        Self::IDENTIFIER
88    }
89}
90#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
91pub struct EvaluateResultSuccess {
92    #[serde(rename = "type")]
93    pub r#type: EvaluateResultSuccessType,
94    #[serde(rename = "result")]
95    pub result: RemoteValue,
96    #[serde(rename = "realm")]
97    pub realm: Realm,
98}
99#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
100pub enum EvaluateResultSuccessType {
101    #[serde(rename = "success")]
102    Success,
103}
104impl EvaluateResultSuccess {
105    pub fn new(
106        r#type: impl Into<EvaluateResultSuccessType>,
107        result: impl Into<RemoteValue>,
108        realm: impl Into<Realm>,
109    ) -> Self {
110        Self {
111            r#type: r#type.into(),
112            result: result.into(),
113            realm: realm.into(),
114        }
115    }
116}
117impl EvaluateResultSuccess {
118    pub const IDENTIFIER: &'static str = "script.EvaluateResultSuccess";
119    pub const DOMAIN_DIRECTION: &'static str = "all";
120    pub fn identifier(&self) -> &'static str {
121        Self::IDENTIFIER
122    }
123}
124#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
125pub struct EvaluateResultException {
126    #[serde(rename = "type")]
127    pub r#type: EvaluateResultExceptionType,
128    #[serde(rename = "exceptionDetails")]
129    pub exception_details: ExceptionDetails,
130    #[serde(rename = "realm")]
131    pub realm: Realm,
132}
133#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
134pub enum EvaluateResultExceptionType {
135    #[serde(rename = "exception")]
136    Exception,
137}
138impl EvaluateResultException {
139    pub fn new(
140        r#type: impl Into<EvaluateResultExceptionType>,
141        exception_details: impl Into<ExceptionDetails>,
142        realm: impl Into<Realm>,
143    ) -> Self {
144        Self {
145            r#type: r#type.into(),
146            exception_details: exception_details.into(),
147            realm: realm.into(),
148        }
149    }
150}
151impl EvaluateResultException {
152    pub const IDENTIFIER: &'static str = "script.EvaluateResultException";
153    pub const DOMAIN_DIRECTION: &'static str = "all";
154    pub fn identifier(&self) -> &'static str {
155        Self::IDENTIFIER
156    }
157}
158#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
159pub struct ExceptionDetails {
160    #[serde(rename = "columnNumber")]
161    pub column_number: u64,
162    #[serde(rename = "exception")]
163    pub exception: RemoteValue,
164    #[serde(rename = "lineNumber")]
165    pub line_number: u64,
166    #[serde(rename = "stackTrace")]
167    pub stack_trace: StackTrace,
168    #[serde(rename = "text")]
169    pub text: String,
170}
171impl ExceptionDetails {
172    pub const IDENTIFIER: &'static str = "script.ExceptionDetails";
173    pub const DOMAIN_DIRECTION: &'static str = "all";
174    pub fn identifier(&self) -> &'static str {
175        Self::IDENTIFIER
176    }
177}
178#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
179pub struct Handle(String);
180impl Handle {
181    pub fn new(val: impl Into<String>) -> Self {
182        Handle(val.into())
183    }
184    pub fn inner(&self) -> &String {
185        &self.0
186    }
187}
188impl AsRef<str> for Handle {
189    fn as_ref(&self) -> &str {
190        self.0.as_str()
191    }
192}
193impl From<Handle> for String {
194    fn from(el: Handle) -> String {
195        el.0
196    }
197}
198impl From<String> for Handle {
199    fn from(expr: String) -> Self {
200        Handle(expr)
201    }
202}
203impl Handle {
204    pub const IDENTIFIER: &'static str = "script.Handle";
205    pub const DOMAIN_DIRECTION: &'static str = "all";
206    pub fn identifier(&self) -> &'static str {
207        Self::IDENTIFIER
208    }
209}
210#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
211pub struct InternalId(String);
212impl InternalId {
213    pub fn new(val: impl Into<String>) -> Self {
214        InternalId(val.into())
215    }
216    pub fn inner(&self) -> &String {
217        &self.0
218    }
219}
220impl AsRef<str> for InternalId {
221    fn as_ref(&self) -> &str {
222        self.0.as_str()
223    }
224}
225impl From<InternalId> for String {
226    fn from(el: InternalId) -> String {
227        el.0
228    }
229}
230impl From<String> for InternalId {
231    fn from(expr: String) -> Self {
232        InternalId(expr)
233    }
234}
235impl std::borrow::Borrow<str> for InternalId {
236    fn borrow(&self) -> &str {
237        &self.0
238    }
239}
240impl InternalId {
241    pub const IDENTIFIER: &'static str = "script.InternalId";
242    pub const DOMAIN_DIRECTION: &'static str = "all";
243    pub fn identifier(&self) -> &'static str {
244        Self::IDENTIFIER
245    }
246}
247#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
248#[serde(untagged)]
249pub enum LocalValue {
250    RemoteReference(RemoteReference),
251    PrimitiveProtocolValue(PrimitiveProtocolValue),
252    ChannelValue(ChannelValue),
253    ArrayLocalValue(ArrayLocalValue),
254    DateLocalValue(DateLocalValue),
255    MapLocalValue(MapLocalValue),
256    ObjectLocalValue(ObjectLocalValue),
257    RegExpLocalValue(RegExpLocalValue),
258    SetLocalValue(SetLocalValue),
259}
260impl From<RemoteReference> for LocalValue {
261    fn from(v: RemoteReference) -> Self {
262        LocalValue::RemoteReference(v)
263    }
264}
265impl TryFrom<LocalValue> for RemoteReference {
266    type Error = LocalValue;
267    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
268        match e {
269            LocalValue::RemoteReference(inner) => Ok(inner),
270            other => Err(other),
271        }
272    }
273}
274impl From<PrimitiveProtocolValue> for LocalValue {
275    fn from(v: PrimitiveProtocolValue) -> Self {
276        LocalValue::PrimitiveProtocolValue(v)
277    }
278}
279impl TryFrom<LocalValue> for PrimitiveProtocolValue {
280    type Error = LocalValue;
281    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
282        match e {
283            LocalValue::PrimitiveProtocolValue(inner) => Ok(inner),
284            other => Err(other),
285        }
286    }
287}
288impl From<ChannelValue> for LocalValue {
289    fn from(v: ChannelValue) -> Self {
290        LocalValue::ChannelValue(v)
291    }
292}
293impl TryFrom<LocalValue> for ChannelValue {
294    type Error = LocalValue;
295    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
296        match e {
297            LocalValue::ChannelValue(inner) => Ok(inner),
298            other => Err(other),
299        }
300    }
301}
302impl From<ArrayLocalValue> for LocalValue {
303    fn from(v: ArrayLocalValue) -> Self {
304        LocalValue::ArrayLocalValue(v)
305    }
306}
307impl TryFrom<LocalValue> for ArrayLocalValue {
308    type Error = LocalValue;
309    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
310        match e {
311            LocalValue::ArrayLocalValue(inner) => Ok(inner),
312            other => Err(other),
313        }
314    }
315}
316impl From<DateLocalValue> for LocalValue {
317    fn from(v: DateLocalValue) -> Self {
318        LocalValue::DateLocalValue(v)
319    }
320}
321impl TryFrom<LocalValue> for DateLocalValue {
322    type Error = LocalValue;
323    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
324        match e {
325            LocalValue::DateLocalValue(inner) => Ok(inner),
326            other => Err(other),
327        }
328    }
329}
330impl From<MapLocalValue> for LocalValue {
331    fn from(v: MapLocalValue) -> Self {
332        LocalValue::MapLocalValue(v)
333    }
334}
335impl TryFrom<LocalValue> for MapLocalValue {
336    type Error = LocalValue;
337    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
338        match e {
339            LocalValue::MapLocalValue(inner) => Ok(inner),
340            other => Err(other),
341        }
342    }
343}
344impl From<ObjectLocalValue> for LocalValue {
345    fn from(v: ObjectLocalValue) -> Self {
346        LocalValue::ObjectLocalValue(v)
347    }
348}
349impl TryFrom<LocalValue> for ObjectLocalValue {
350    type Error = LocalValue;
351    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
352        match e {
353            LocalValue::ObjectLocalValue(inner) => Ok(inner),
354            other => Err(other),
355        }
356    }
357}
358impl From<RegExpLocalValue> for LocalValue {
359    fn from(v: RegExpLocalValue) -> Self {
360        LocalValue::RegExpLocalValue(v)
361    }
362}
363impl TryFrom<LocalValue> for RegExpLocalValue {
364    type Error = LocalValue;
365    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
366        match e {
367            LocalValue::RegExpLocalValue(inner) => Ok(inner),
368            other => Err(other),
369        }
370    }
371}
372impl From<SetLocalValue> for LocalValue {
373    fn from(v: SetLocalValue) -> Self {
374        LocalValue::SetLocalValue(v)
375    }
376}
377impl TryFrom<LocalValue> for SetLocalValue {
378    type Error = LocalValue;
379    fn try_from(e: LocalValue) -> Result<Self, Self::Error> {
380        match e {
381            LocalValue::SetLocalValue(inner) => Ok(inner),
382            other => Err(other),
383        }
384    }
385}
386#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
387pub struct ListLocalValue(Vec<LocalValue>);
388impl ListLocalValue {
389    pub fn new(val: impl Into<Vec<LocalValue>>) -> Self {
390        ListLocalValue(val.into())
391    }
392    pub fn inner(&self) -> &Vec<LocalValue> {
393        &self.0
394    }
395}
396impl ListLocalValue {
397    pub const IDENTIFIER: &'static str = "script.ListLocalValue";
398    pub const DOMAIN_DIRECTION: &'static str = "all";
399    pub fn identifier(&self) -> &'static str {
400        Self::IDENTIFIER
401    }
402}
403#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
404pub struct ArrayLocalValue {
405    #[serde(rename = "type")]
406    pub r#type: ArrayLocalValueType,
407    #[serde(rename = "value")]
408    pub value: ListLocalValue,
409}
410#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
411pub enum ArrayLocalValueType {
412    #[serde(rename = "array")]
413    Array,
414}
415impl ArrayLocalValue {
416    pub fn new(r#type: impl Into<ArrayLocalValueType>, value: impl Into<ListLocalValue>) -> Self {
417        Self {
418            r#type: r#type.into(),
419            value: value.into(),
420        }
421    }
422}
423impl ArrayLocalValue {
424    pub const IDENTIFIER: &'static str = "script.ArrayLocalValue";
425    pub const DOMAIN_DIRECTION: &'static str = "all";
426    pub fn identifier(&self) -> &'static str {
427        Self::IDENTIFIER
428    }
429}
430#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
431pub struct DateLocalValue {
432    #[serde(rename = "type")]
433    pub r#type: DateLocalValueType,
434    #[serde(rename = "value")]
435    pub value: String,
436}
437#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
438pub enum DateLocalValueType {
439    #[serde(rename = "date")]
440    Date,
441}
442impl DateLocalValue {
443    pub fn new(r#type: impl Into<DateLocalValueType>, value: impl Into<String>) -> Self {
444        Self {
445            r#type: r#type.into(),
446            value: value.into(),
447        }
448    }
449}
450impl DateLocalValue {
451    pub const IDENTIFIER: &'static str = "script.DateLocalValue";
452    pub const DOMAIN_DIRECTION: &'static str = "all";
453    pub fn identifier(&self) -> &'static str {
454        Self::IDENTIFIER
455    }
456}
457#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
458pub struct MappingLocalValue(Vec<Vec<serde_json::Value>>);
459impl MappingLocalValue {
460    pub fn new(val: impl Into<Vec<Vec<serde_json::Value>>>) -> Self {
461        MappingLocalValue(val.into())
462    }
463    pub fn inner(&self) -> &Vec<Vec<serde_json::Value>> {
464        &self.0
465    }
466}
467impl MappingLocalValue {
468    pub const IDENTIFIER: &'static str = "script.MappingLocalValue";
469    pub const DOMAIN_DIRECTION: &'static str = "all";
470    pub fn identifier(&self) -> &'static str {
471        Self::IDENTIFIER
472    }
473}
474#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
475pub struct MapLocalValue {
476    #[serde(rename = "type")]
477    pub r#type: MapLocalValueType,
478    #[serde(rename = "value")]
479    pub value: MappingLocalValue,
480}
481#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
482pub enum MapLocalValueType {
483    #[serde(rename = "map")]
484    Map,
485}
486impl MapLocalValue {
487    pub fn new(r#type: impl Into<MapLocalValueType>, value: impl Into<MappingLocalValue>) -> Self {
488        Self {
489            r#type: r#type.into(),
490            value: value.into(),
491        }
492    }
493}
494impl MapLocalValue {
495    pub const IDENTIFIER: &'static str = "script.MapLocalValue";
496    pub const DOMAIN_DIRECTION: &'static str = "all";
497    pub fn identifier(&self) -> &'static str {
498        Self::IDENTIFIER
499    }
500}
501#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
502pub struct ObjectLocalValue {
503    #[serde(rename = "type")]
504    pub r#type: ObjectLocalValueType,
505    #[serde(rename = "value")]
506    pub value: MappingLocalValue,
507}
508#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
509pub enum ObjectLocalValueType {
510    #[serde(rename = "object")]
511    Object,
512}
513impl ObjectLocalValue {
514    pub fn new(
515        r#type: impl Into<ObjectLocalValueType>,
516        value: impl Into<MappingLocalValue>,
517    ) -> Self {
518        Self {
519            r#type: r#type.into(),
520            value: value.into(),
521        }
522    }
523}
524impl ObjectLocalValue {
525    pub const IDENTIFIER: &'static str = "script.ObjectLocalValue";
526    pub const DOMAIN_DIRECTION: &'static str = "all";
527    pub fn identifier(&self) -> &'static str {
528        Self::IDENTIFIER
529    }
530}
531#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
532pub struct RegExpValue {
533    #[serde(rename = "pattern")]
534    pub pattern: String,
535    #[serde(rename = "flags")]
536    #[serde(skip_serializing_if = "Option::is_none")]
537    #[serde(default)]
538    pub flags: Option<String>,
539}
540impl RegExpValue {
541    pub fn new(pattern: impl Into<String>) -> Self {
542        Self {
543            pattern: pattern.into(),
544            flags: None,
545        }
546    }
547}
548impl<T: Into<String>> From<T> for RegExpValue {
549    fn from(url: T) -> Self {
550        RegExpValue::new(url)
551    }
552}
553impl RegExpValue {
554    pub const IDENTIFIER: &'static str = "script.RegExpValue";
555    pub const DOMAIN_DIRECTION: &'static str = "all";
556    pub fn identifier(&self) -> &'static str {
557        Self::IDENTIFIER
558    }
559}
560#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
561pub struct RegExpLocalValue {
562    #[serde(rename = "type")]
563    pub r#type: RegExpLocalValueType,
564    #[serde(rename = "value")]
565    pub value: RegExpValue,
566}
567#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
568pub enum RegExpLocalValueType {
569    #[serde(rename = "regexp")]
570    Regexp,
571}
572impl RegExpLocalValue {
573    pub fn new(r#type: impl Into<RegExpLocalValueType>, value: impl Into<RegExpValue>) -> Self {
574        Self {
575            r#type: r#type.into(),
576            value: value.into(),
577        }
578    }
579}
580impl RegExpLocalValue {
581    pub const IDENTIFIER: &'static str = "script.RegExpLocalValue";
582    pub const DOMAIN_DIRECTION: &'static str = "all";
583    pub fn identifier(&self) -> &'static str {
584        Self::IDENTIFIER
585    }
586}
587#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
588pub struct SetLocalValue {
589    #[serde(rename = "type")]
590    pub r#type: SetLocalValueType,
591    #[serde(rename = "value")]
592    pub value: ListLocalValue,
593}
594#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
595pub enum SetLocalValueType {
596    #[serde(rename = "set")]
597    Set,
598}
599impl SetLocalValue {
600    pub fn new(r#type: impl Into<SetLocalValueType>, value: impl Into<ListLocalValue>) -> Self {
601        Self {
602            r#type: r#type.into(),
603            value: value.into(),
604        }
605    }
606}
607impl SetLocalValue {
608    pub const IDENTIFIER: &'static str = "script.SetLocalValue";
609    pub const DOMAIN_DIRECTION: &'static str = "all";
610    pub fn identifier(&self) -> &'static str {
611        Self::IDENTIFIER
612    }
613}
614#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
615pub struct PreloadScript(String);
616impl PreloadScript {
617    pub fn new(val: impl Into<String>) -> Self {
618        PreloadScript(val.into())
619    }
620    pub fn inner(&self) -> &String {
621        &self.0
622    }
623}
624impl AsRef<str> for PreloadScript {
625    fn as_ref(&self) -> &str {
626        self.0.as_str()
627    }
628}
629impl From<PreloadScript> for String {
630    fn from(el: PreloadScript) -> String {
631        el.0
632    }
633}
634impl From<String> for PreloadScript {
635    fn from(expr: String) -> Self {
636        PreloadScript(expr)
637    }
638}
639impl PreloadScript {
640    pub const IDENTIFIER: &'static str = "script.PreloadScript";
641    pub const DOMAIN_DIRECTION: &'static str = "all";
642    pub fn identifier(&self) -> &'static str {
643        Self::IDENTIFIER
644    }
645}
646#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
647pub struct Realm(String);
648impl Realm {
649    pub fn new(val: impl Into<String>) -> Self {
650        Realm(val.into())
651    }
652    pub fn inner(&self) -> &String {
653        &self.0
654    }
655}
656impl AsRef<str> for Realm {
657    fn as_ref(&self) -> &str {
658        self.0.as_str()
659    }
660}
661impl From<Realm> for String {
662    fn from(el: Realm) -> String {
663        el.0
664    }
665}
666impl From<String> for Realm {
667    fn from(expr: String) -> Self {
668        Realm(expr)
669    }
670}
671impl Realm {
672    pub const IDENTIFIER: &'static str = "script.Realm";
673    pub const DOMAIN_DIRECTION: &'static str = "all";
674    pub fn identifier(&self) -> &'static str {
675        Self::IDENTIFIER
676    }
677}
678#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
679#[serde(untagged)]
680pub enum PrimitiveProtocolValue {
681    UndefinedValue(UndefinedValue),
682    NullValue(NullValue),
683    StringValue(StringValue),
684    NumberValue(NumberValue),
685    BooleanValue(BooleanValue),
686    BigIntValue(BigIntValue),
687}
688impl From<UndefinedValue> for PrimitiveProtocolValue {
689    fn from(v: UndefinedValue) -> Self {
690        PrimitiveProtocolValue::UndefinedValue(v)
691    }
692}
693impl TryFrom<PrimitiveProtocolValue> for UndefinedValue {
694    type Error = PrimitiveProtocolValue;
695    fn try_from(e: PrimitiveProtocolValue) -> Result<Self, Self::Error> {
696        match e {
697            PrimitiveProtocolValue::UndefinedValue(inner) => Ok(inner),
698            other => Err(other),
699        }
700    }
701}
702impl From<NullValue> for PrimitiveProtocolValue {
703    fn from(v: NullValue) -> Self {
704        PrimitiveProtocolValue::NullValue(v)
705    }
706}
707impl TryFrom<PrimitiveProtocolValue> for NullValue {
708    type Error = PrimitiveProtocolValue;
709    fn try_from(e: PrimitiveProtocolValue) -> Result<Self, Self::Error> {
710        match e {
711            PrimitiveProtocolValue::NullValue(inner) => Ok(inner),
712            other => Err(other),
713        }
714    }
715}
716impl From<StringValue> for PrimitiveProtocolValue {
717    fn from(v: StringValue) -> Self {
718        PrimitiveProtocolValue::StringValue(v)
719    }
720}
721impl TryFrom<PrimitiveProtocolValue> for StringValue {
722    type Error = PrimitiveProtocolValue;
723    fn try_from(e: PrimitiveProtocolValue) -> Result<Self, Self::Error> {
724        match e {
725            PrimitiveProtocolValue::StringValue(inner) => Ok(inner),
726            other => Err(other),
727        }
728    }
729}
730impl From<NumberValue> for PrimitiveProtocolValue {
731    fn from(v: NumberValue) -> Self {
732        PrimitiveProtocolValue::NumberValue(v)
733    }
734}
735impl TryFrom<PrimitiveProtocolValue> for NumberValue {
736    type Error = PrimitiveProtocolValue;
737    fn try_from(e: PrimitiveProtocolValue) -> Result<Self, Self::Error> {
738        match e {
739            PrimitiveProtocolValue::NumberValue(inner) => Ok(inner),
740            other => Err(other),
741        }
742    }
743}
744impl From<BooleanValue> for PrimitiveProtocolValue {
745    fn from(v: BooleanValue) -> Self {
746        PrimitiveProtocolValue::BooleanValue(v)
747    }
748}
749impl TryFrom<PrimitiveProtocolValue> for BooleanValue {
750    type Error = PrimitiveProtocolValue;
751    fn try_from(e: PrimitiveProtocolValue) -> Result<Self, Self::Error> {
752        match e {
753            PrimitiveProtocolValue::BooleanValue(inner) => Ok(inner),
754            other => Err(other),
755        }
756    }
757}
758impl From<BigIntValue> for PrimitiveProtocolValue {
759    fn from(v: BigIntValue) -> Self {
760        PrimitiveProtocolValue::BigIntValue(v)
761    }
762}
763impl TryFrom<PrimitiveProtocolValue> for BigIntValue {
764    type Error = PrimitiveProtocolValue;
765    fn try_from(e: PrimitiveProtocolValue) -> Result<Self, Self::Error> {
766        match e {
767            PrimitiveProtocolValue::BigIntValue(inner) => Ok(inner),
768            other => Err(other),
769        }
770    }
771}
772#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
773pub struct UndefinedValue {
774    #[serde(rename = "type")]
775    pub r#type: UndefinedValueType,
776}
777#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
778pub enum UndefinedValueType {
779    #[serde(rename = "undefined")]
780    Undefined,
781}
782impl UndefinedValue {
783    pub fn new(r#type: impl Into<UndefinedValueType>) -> Self {
784        Self {
785            r#type: r#type.into(),
786        }
787    }
788}
789impl UndefinedValue {
790    pub const IDENTIFIER: &'static str = "script.UndefinedValue";
791    pub const DOMAIN_DIRECTION: &'static str = "all";
792    pub fn identifier(&self) -> &'static str {
793        Self::IDENTIFIER
794    }
795}
796#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
797pub struct NullValue {
798    #[serde(rename = "type")]
799    pub r#type: NullValueType,
800}
801#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
802pub enum NullValueType {
803    #[serde(rename = "null")]
804    Null,
805}
806impl NullValue {
807    pub fn new(r#type: impl Into<NullValueType>) -> Self {
808        Self {
809            r#type: r#type.into(),
810        }
811    }
812}
813impl NullValue {
814    pub const IDENTIFIER: &'static str = "script.NullValue";
815    pub const DOMAIN_DIRECTION: &'static str = "all";
816    pub fn identifier(&self) -> &'static str {
817        Self::IDENTIFIER
818    }
819}
820#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
821pub struct StringValue {
822    #[serde(rename = "type")]
823    pub r#type: StringValueType,
824    #[serde(rename = "value")]
825    pub value: String,
826}
827#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
828pub enum StringValueType {
829    #[serde(rename = "string")]
830    String,
831}
832impl StringValue {
833    pub fn new(r#type: impl Into<StringValueType>, value: impl Into<String>) -> Self {
834        Self {
835            r#type: r#type.into(),
836            value: value.into(),
837        }
838    }
839}
840impl StringValue {
841    pub const IDENTIFIER: &'static str = "script.StringValue";
842    pub const DOMAIN_DIRECTION: &'static str = "all";
843    pub fn identifier(&self) -> &'static str {
844        Self::IDENTIFIER
845    }
846}
847#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
848pub struct SpecialNumber(String);
849impl SpecialNumber {
850    pub fn new(val: impl Into<String>) -> Self {
851        SpecialNumber(val.into())
852    }
853    pub fn inner(&self) -> &String {
854        &self.0
855    }
856}
857impl AsRef<str> for SpecialNumber {
858    fn as_ref(&self) -> &str {
859        self.0.as_str()
860    }
861}
862impl From<SpecialNumber> for String {
863    fn from(el: SpecialNumber) -> String {
864        el.0
865    }
866}
867impl From<String> for SpecialNumber {
868    fn from(expr: String) -> Self {
869        SpecialNumber(expr)
870    }
871}
872impl SpecialNumber {
873    pub const IDENTIFIER: &'static str = "script.SpecialNumber";
874    pub const DOMAIN_DIRECTION: &'static str = "all";
875    pub fn identifier(&self) -> &'static str {
876        Self::IDENTIFIER
877    }
878}
879#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
880pub struct NumberValue {
881    #[serde(rename = "type")]
882    pub r#type: NumberValueType,
883    #[serde(rename = "value")]
884    pub value: serde_json::Value,
885}
886#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
887pub enum NumberValueType {
888    #[serde(rename = "number")]
889    Number,
890}
891impl NumberValue {
892    pub fn new(r#type: impl Into<NumberValueType>, value: impl Into<serde_json::Value>) -> Self {
893        Self {
894            r#type: r#type.into(),
895            value: value.into(),
896        }
897    }
898}
899impl NumberValue {
900    pub const IDENTIFIER: &'static str = "script.NumberValue";
901    pub const DOMAIN_DIRECTION: &'static str = "all";
902    pub fn identifier(&self) -> &'static str {
903        Self::IDENTIFIER
904    }
905}
906#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
907pub struct BooleanValue {
908    #[serde(rename = "type")]
909    pub r#type: BooleanValueType,
910    #[serde(rename = "value")]
911    pub value: bool,
912}
913#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
914pub enum BooleanValueType {
915    #[serde(rename = "boolean")]
916    Boolean,
917}
918impl BooleanValue {
919    pub fn new(r#type: impl Into<BooleanValueType>, value: impl Into<bool>) -> Self {
920        Self {
921            r#type: r#type.into(),
922            value: value.into(),
923        }
924    }
925}
926impl BooleanValue {
927    pub const IDENTIFIER: &'static str = "script.BooleanValue";
928    pub const DOMAIN_DIRECTION: &'static str = "all";
929    pub fn identifier(&self) -> &'static str {
930        Self::IDENTIFIER
931    }
932}
933#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
934pub struct BigIntValue {
935    #[serde(rename = "type")]
936    pub r#type: BigIntValueType,
937    #[serde(rename = "value")]
938    pub value: String,
939}
940#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
941pub enum BigIntValueType {
942    #[serde(rename = "bigint")]
943    Bigint,
944}
945impl BigIntValue {
946    pub fn new(r#type: impl Into<BigIntValueType>, value: impl Into<String>) -> Self {
947        Self {
948            r#type: r#type.into(),
949            value: value.into(),
950        }
951    }
952}
953impl BigIntValue {
954    pub const IDENTIFIER: &'static str = "script.BigIntValue";
955    pub const DOMAIN_DIRECTION: &'static str = "all";
956    pub fn identifier(&self) -> &'static str {
957        Self::IDENTIFIER
958    }
959}
960#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
961pub enum RealmType {
962    #[serde(rename = "window")]
963    Window,
964    #[serde(rename = "dedicated-worker")]
965    DedicatedWorker,
966    #[serde(rename = "shared-worker")]
967    SharedWorker,
968    #[serde(rename = "service-worker")]
969    ServiceWorker,
970    #[serde(rename = "worker")]
971    Worker,
972    #[serde(rename = "paint-worklet")]
973    PaintWorklet,
974    #[serde(rename = "audio-worklet")]
975    AudioWorklet,
976    #[serde(rename = "worklet")]
977    Worklet,
978}
979#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
980#[serde(untagged)]
981pub enum RemoteReference {
982    SharedReference(SharedReference),
983    RemoteObjectReference(RemoteObjectReference),
984}
985impl From<SharedReference> for RemoteReference {
986    fn from(v: SharedReference) -> Self {
987        RemoteReference::SharedReference(v)
988    }
989}
990impl TryFrom<RemoteReference> for SharedReference {
991    type Error = RemoteReference;
992    fn try_from(e: RemoteReference) -> Result<Self, Self::Error> {
993        match e {
994            RemoteReference::SharedReference(inner) => Ok(inner),
995            other => Err(other),
996        }
997    }
998}
999impl From<RemoteObjectReference> for RemoteReference {
1000    fn from(v: RemoteObjectReference) -> Self {
1001        RemoteReference::RemoteObjectReference(v)
1002    }
1003}
1004impl TryFrom<RemoteReference> for RemoteObjectReference {
1005    type Error = RemoteReference;
1006    fn try_from(e: RemoteReference) -> Result<Self, Self::Error> {
1007        match e {
1008            RemoteReference::RemoteObjectReference(inner) => Ok(inner),
1009            other => Err(other),
1010        }
1011    }
1012}
1013#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1014pub struct SharedReference {
1015    #[serde(rename = "sharedId")]
1016    pub shared_id: SharedId,
1017    #[serde(rename = "handle")]
1018    #[serde(skip_serializing_if = "Option::is_none")]
1019    #[serde(default)]
1020    pub handle: Option<Handle>,
1021    #[serde(flatten)]
1022    #[serde(default)]
1023    pub extensible: std::collections::HashMap<String, serde_json::Value>,
1024}
1025impl SharedReference {
1026    pub fn new(
1027        shared_id: impl Into<SharedId>,
1028        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
1029    ) -> Self {
1030        Self {
1031            shared_id: shared_id.into(),
1032            extensible: extensible.into(),
1033            handle: None,
1034        }
1035    }
1036}
1037impl SharedReference {
1038    pub const IDENTIFIER: &'static str = "script.SharedReference";
1039    pub const DOMAIN_DIRECTION: &'static str = "all";
1040    pub fn identifier(&self) -> &'static str {
1041        Self::IDENTIFIER
1042    }
1043}
1044#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1045pub struct RemoteObjectReference {
1046    #[serde(rename = "handle")]
1047    pub handle: Handle,
1048    #[serde(rename = "sharedId")]
1049    #[serde(skip_serializing_if = "Option::is_none")]
1050    #[serde(default)]
1051    pub shared_id: Option<SharedId>,
1052    #[serde(flatten)]
1053    #[serde(default)]
1054    pub extensible: std::collections::HashMap<String, serde_json::Value>,
1055}
1056impl RemoteObjectReference {
1057    pub fn new(
1058        handle: impl Into<Handle>,
1059        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
1060    ) -> Self {
1061        Self {
1062            handle: handle.into(),
1063            extensible: extensible.into(),
1064            shared_id: None,
1065        }
1066    }
1067}
1068impl RemoteObjectReference {
1069    pub const IDENTIFIER: &'static str = "script.RemoteObjectReference";
1070    pub const DOMAIN_DIRECTION: &'static str = "all";
1071    pub fn identifier(&self) -> &'static str {
1072        Self::IDENTIFIER
1073    }
1074}
1075#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1076#[serde(untagged)]
1077pub enum RemoteValue {
1078    PrimitiveProtocolValue(PrimitiveProtocolValue),
1079    SymbolRemoteValue(SymbolRemoteValue),
1080    ArrayRemoteValue(ArrayRemoteValue),
1081    ObjectRemoteValue(ObjectRemoteValue),
1082    FunctionRemoteValue(FunctionRemoteValue),
1083    RegExpRemoteValue(RegExpRemoteValue),
1084    DateRemoteValue(DateRemoteValue),
1085    MapRemoteValue(MapRemoteValue),
1086    SetRemoteValue(SetRemoteValue),
1087    WeakMapRemoteValue(WeakMapRemoteValue),
1088    WeakSetRemoteValue(WeakSetRemoteValue),
1089    GeneratorRemoteValue(GeneratorRemoteValue),
1090    ErrorRemoteValue(ErrorRemoteValue),
1091    ProxyRemoteValue(ProxyRemoteValue),
1092    PromiseRemoteValue(PromiseRemoteValue),
1093    TypedArrayRemoteValue(TypedArrayRemoteValue),
1094    ArrayBufferRemoteValue(ArrayBufferRemoteValue),
1095    NodeListRemoteValue(NodeListRemoteValue),
1096    HtmlCollectionRemoteValue(HtmlCollectionRemoteValue),
1097    NodeRemoteValue(NodeRemoteValue),
1098    WindowProxyRemoteValue(WindowProxyRemoteValue),
1099}
1100impl From<PrimitiveProtocolValue> for RemoteValue {
1101    fn from(v: PrimitiveProtocolValue) -> Self {
1102        RemoteValue::PrimitiveProtocolValue(v)
1103    }
1104}
1105impl TryFrom<RemoteValue> for PrimitiveProtocolValue {
1106    type Error = RemoteValue;
1107    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1108        match e {
1109            RemoteValue::PrimitiveProtocolValue(inner) => Ok(inner),
1110            other => Err(other),
1111        }
1112    }
1113}
1114impl From<SymbolRemoteValue> for RemoteValue {
1115    fn from(v: SymbolRemoteValue) -> Self {
1116        RemoteValue::SymbolRemoteValue(v)
1117    }
1118}
1119impl TryFrom<RemoteValue> for SymbolRemoteValue {
1120    type Error = RemoteValue;
1121    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1122        match e {
1123            RemoteValue::SymbolRemoteValue(inner) => Ok(inner),
1124            other => Err(other),
1125        }
1126    }
1127}
1128impl From<ArrayRemoteValue> for RemoteValue {
1129    fn from(v: ArrayRemoteValue) -> Self {
1130        RemoteValue::ArrayRemoteValue(v)
1131    }
1132}
1133impl TryFrom<RemoteValue> for ArrayRemoteValue {
1134    type Error = RemoteValue;
1135    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1136        match e {
1137            RemoteValue::ArrayRemoteValue(inner) => Ok(inner),
1138            other => Err(other),
1139        }
1140    }
1141}
1142impl From<ObjectRemoteValue> for RemoteValue {
1143    fn from(v: ObjectRemoteValue) -> Self {
1144        RemoteValue::ObjectRemoteValue(v)
1145    }
1146}
1147impl TryFrom<RemoteValue> for ObjectRemoteValue {
1148    type Error = RemoteValue;
1149    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1150        match e {
1151            RemoteValue::ObjectRemoteValue(inner) => Ok(inner),
1152            other => Err(other),
1153        }
1154    }
1155}
1156impl From<FunctionRemoteValue> for RemoteValue {
1157    fn from(v: FunctionRemoteValue) -> Self {
1158        RemoteValue::FunctionRemoteValue(v)
1159    }
1160}
1161impl TryFrom<RemoteValue> for FunctionRemoteValue {
1162    type Error = RemoteValue;
1163    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1164        match e {
1165            RemoteValue::FunctionRemoteValue(inner) => Ok(inner),
1166            other => Err(other),
1167        }
1168    }
1169}
1170impl From<RegExpRemoteValue> for RemoteValue {
1171    fn from(v: RegExpRemoteValue) -> Self {
1172        RemoteValue::RegExpRemoteValue(v)
1173    }
1174}
1175impl TryFrom<RemoteValue> for RegExpRemoteValue {
1176    type Error = RemoteValue;
1177    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1178        match e {
1179            RemoteValue::RegExpRemoteValue(inner) => Ok(inner),
1180            other => Err(other),
1181        }
1182    }
1183}
1184impl From<DateRemoteValue> for RemoteValue {
1185    fn from(v: DateRemoteValue) -> Self {
1186        RemoteValue::DateRemoteValue(v)
1187    }
1188}
1189impl TryFrom<RemoteValue> for DateRemoteValue {
1190    type Error = RemoteValue;
1191    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1192        match e {
1193            RemoteValue::DateRemoteValue(inner) => Ok(inner),
1194            other => Err(other),
1195        }
1196    }
1197}
1198impl From<MapRemoteValue> for RemoteValue {
1199    fn from(v: MapRemoteValue) -> Self {
1200        RemoteValue::MapRemoteValue(v)
1201    }
1202}
1203impl TryFrom<RemoteValue> for MapRemoteValue {
1204    type Error = RemoteValue;
1205    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1206        match e {
1207            RemoteValue::MapRemoteValue(inner) => Ok(inner),
1208            other => Err(other),
1209        }
1210    }
1211}
1212impl From<SetRemoteValue> for RemoteValue {
1213    fn from(v: SetRemoteValue) -> Self {
1214        RemoteValue::SetRemoteValue(v)
1215    }
1216}
1217impl TryFrom<RemoteValue> for SetRemoteValue {
1218    type Error = RemoteValue;
1219    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1220        match e {
1221            RemoteValue::SetRemoteValue(inner) => Ok(inner),
1222            other => Err(other),
1223        }
1224    }
1225}
1226impl From<WeakMapRemoteValue> for RemoteValue {
1227    fn from(v: WeakMapRemoteValue) -> Self {
1228        RemoteValue::WeakMapRemoteValue(v)
1229    }
1230}
1231impl TryFrom<RemoteValue> for WeakMapRemoteValue {
1232    type Error = RemoteValue;
1233    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1234        match e {
1235            RemoteValue::WeakMapRemoteValue(inner) => Ok(inner),
1236            other => Err(other),
1237        }
1238    }
1239}
1240impl From<WeakSetRemoteValue> for RemoteValue {
1241    fn from(v: WeakSetRemoteValue) -> Self {
1242        RemoteValue::WeakSetRemoteValue(v)
1243    }
1244}
1245impl TryFrom<RemoteValue> for WeakSetRemoteValue {
1246    type Error = RemoteValue;
1247    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1248        match e {
1249            RemoteValue::WeakSetRemoteValue(inner) => Ok(inner),
1250            other => Err(other),
1251        }
1252    }
1253}
1254impl From<GeneratorRemoteValue> for RemoteValue {
1255    fn from(v: GeneratorRemoteValue) -> Self {
1256        RemoteValue::GeneratorRemoteValue(v)
1257    }
1258}
1259impl TryFrom<RemoteValue> for GeneratorRemoteValue {
1260    type Error = RemoteValue;
1261    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1262        match e {
1263            RemoteValue::GeneratorRemoteValue(inner) => Ok(inner),
1264            other => Err(other),
1265        }
1266    }
1267}
1268impl From<ErrorRemoteValue> for RemoteValue {
1269    fn from(v: ErrorRemoteValue) -> Self {
1270        RemoteValue::ErrorRemoteValue(v)
1271    }
1272}
1273impl TryFrom<RemoteValue> for ErrorRemoteValue {
1274    type Error = RemoteValue;
1275    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1276        match e {
1277            RemoteValue::ErrorRemoteValue(inner) => Ok(inner),
1278            other => Err(other),
1279        }
1280    }
1281}
1282impl From<ProxyRemoteValue> for RemoteValue {
1283    fn from(v: ProxyRemoteValue) -> Self {
1284        RemoteValue::ProxyRemoteValue(v)
1285    }
1286}
1287impl TryFrom<RemoteValue> for ProxyRemoteValue {
1288    type Error = RemoteValue;
1289    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1290        match e {
1291            RemoteValue::ProxyRemoteValue(inner) => Ok(inner),
1292            other => Err(other),
1293        }
1294    }
1295}
1296impl From<PromiseRemoteValue> for RemoteValue {
1297    fn from(v: PromiseRemoteValue) -> Self {
1298        RemoteValue::PromiseRemoteValue(v)
1299    }
1300}
1301impl TryFrom<RemoteValue> for PromiseRemoteValue {
1302    type Error = RemoteValue;
1303    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1304        match e {
1305            RemoteValue::PromiseRemoteValue(inner) => Ok(inner),
1306            other => Err(other),
1307        }
1308    }
1309}
1310impl From<TypedArrayRemoteValue> for RemoteValue {
1311    fn from(v: TypedArrayRemoteValue) -> Self {
1312        RemoteValue::TypedArrayRemoteValue(v)
1313    }
1314}
1315impl TryFrom<RemoteValue> for TypedArrayRemoteValue {
1316    type Error = RemoteValue;
1317    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1318        match e {
1319            RemoteValue::TypedArrayRemoteValue(inner) => Ok(inner),
1320            other => Err(other),
1321        }
1322    }
1323}
1324impl From<ArrayBufferRemoteValue> for RemoteValue {
1325    fn from(v: ArrayBufferRemoteValue) -> Self {
1326        RemoteValue::ArrayBufferRemoteValue(v)
1327    }
1328}
1329impl TryFrom<RemoteValue> for ArrayBufferRemoteValue {
1330    type Error = RemoteValue;
1331    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1332        match e {
1333            RemoteValue::ArrayBufferRemoteValue(inner) => Ok(inner),
1334            other => Err(other),
1335        }
1336    }
1337}
1338impl From<NodeListRemoteValue> for RemoteValue {
1339    fn from(v: NodeListRemoteValue) -> Self {
1340        RemoteValue::NodeListRemoteValue(v)
1341    }
1342}
1343impl TryFrom<RemoteValue> for NodeListRemoteValue {
1344    type Error = RemoteValue;
1345    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1346        match e {
1347            RemoteValue::NodeListRemoteValue(inner) => Ok(inner),
1348            other => Err(other),
1349        }
1350    }
1351}
1352impl From<HtmlCollectionRemoteValue> for RemoteValue {
1353    fn from(v: HtmlCollectionRemoteValue) -> Self {
1354        RemoteValue::HtmlCollectionRemoteValue(v)
1355    }
1356}
1357impl TryFrom<RemoteValue> for HtmlCollectionRemoteValue {
1358    type Error = RemoteValue;
1359    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1360        match e {
1361            RemoteValue::HtmlCollectionRemoteValue(inner) => Ok(inner),
1362            other => Err(other),
1363        }
1364    }
1365}
1366impl From<NodeRemoteValue> for RemoteValue {
1367    fn from(v: NodeRemoteValue) -> Self {
1368        RemoteValue::NodeRemoteValue(v)
1369    }
1370}
1371impl TryFrom<RemoteValue> for NodeRemoteValue {
1372    type Error = RemoteValue;
1373    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1374        match e {
1375            RemoteValue::NodeRemoteValue(inner) => Ok(inner),
1376            other => Err(other),
1377        }
1378    }
1379}
1380impl From<WindowProxyRemoteValue> for RemoteValue {
1381    fn from(v: WindowProxyRemoteValue) -> Self {
1382        RemoteValue::WindowProxyRemoteValue(v)
1383    }
1384}
1385impl TryFrom<RemoteValue> for WindowProxyRemoteValue {
1386    type Error = RemoteValue;
1387    fn try_from(e: RemoteValue) -> Result<Self, Self::Error> {
1388        match e {
1389            RemoteValue::WindowProxyRemoteValue(inner) => Ok(inner),
1390            other => Err(other),
1391        }
1392    }
1393}
1394#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1395pub struct ListRemoteValue(Vec<RemoteValue>);
1396impl ListRemoteValue {
1397    pub fn new(val: impl Into<Vec<RemoteValue>>) -> Self {
1398        ListRemoteValue(val.into())
1399    }
1400    pub fn inner(&self) -> &Vec<RemoteValue> {
1401        &self.0
1402    }
1403}
1404impl ListRemoteValue {
1405    pub const IDENTIFIER: &'static str = "script.ListRemoteValue";
1406    pub const DOMAIN_DIRECTION: &'static str = "all";
1407    pub fn identifier(&self) -> &'static str {
1408        Self::IDENTIFIER
1409    }
1410}
1411#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1412pub struct MappingRemoteValue(Vec<Vec<serde_json::Value>>);
1413impl MappingRemoteValue {
1414    pub fn new(val: impl Into<Vec<Vec<serde_json::Value>>>) -> Self {
1415        MappingRemoteValue(val.into())
1416    }
1417    pub fn inner(&self) -> &Vec<Vec<serde_json::Value>> {
1418        &self.0
1419    }
1420}
1421impl MappingRemoteValue {
1422    pub const IDENTIFIER: &'static str = "script.MappingRemoteValue";
1423    pub const DOMAIN_DIRECTION: &'static str = "all";
1424    pub fn identifier(&self) -> &'static str {
1425        Self::IDENTIFIER
1426    }
1427}
1428#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1429pub struct SymbolRemoteValue {
1430    #[serde(rename = "type")]
1431    pub r#type: SymbolRemoteValueType,
1432    #[serde(rename = "handle")]
1433    #[serde(skip_serializing_if = "Option::is_none")]
1434    #[serde(default)]
1435    pub handle: Option<Handle>,
1436    #[serde(rename = "internalId")]
1437    #[serde(skip_serializing_if = "Option::is_none")]
1438    #[serde(default)]
1439    pub internal_id: Option<InternalId>,
1440}
1441#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1442pub enum SymbolRemoteValueType {
1443    #[serde(rename = "symbol")]
1444    Symbol,
1445}
1446impl SymbolRemoteValue {
1447    pub fn new(r#type: impl Into<SymbolRemoteValueType>) -> Self {
1448        Self {
1449            r#type: r#type.into(),
1450            handle: None,
1451            internal_id: None,
1452        }
1453    }
1454}
1455impl SymbolRemoteValue {
1456    pub const IDENTIFIER: &'static str = "script.SymbolRemoteValue";
1457    pub const DOMAIN_DIRECTION: &'static str = "all";
1458    pub fn identifier(&self) -> &'static str {
1459        Self::IDENTIFIER
1460    }
1461}
1462#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1463pub struct ArrayRemoteValue {
1464    #[serde(rename = "type")]
1465    pub r#type: ArrayRemoteValueType,
1466    #[serde(rename = "handle")]
1467    #[serde(skip_serializing_if = "Option::is_none")]
1468    #[serde(default)]
1469    pub handle: Option<Handle>,
1470    #[serde(rename = "internalId")]
1471    #[serde(skip_serializing_if = "Option::is_none")]
1472    #[serde(default)]
1473    pub internal_id: Option<InternalId>,
1474    #[serde(rename = "value")]
1475    #[serde(skip_serializing_if = "Option::is_none")]
1476    #[serde(default)]
1477    pub value: Option<ListRemoteValue>,
1478}
1479#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1480pub enum ArrayRemoteValueType {
1481    #[serde(rename = "array")]
1482    Array,
1483}
1484impl ArrayRemoteValue {
1485    pub fn new(r#type: impl Into<ArrayRemoteValueType>) -> Self {
1486        Self {
1487            r#type: r#type.into(),
1488            handle: None,
1489            internal_id: None,
1490            value: None,
1491        }
1492    }
1493}
1494impl ArrayRemoteValue {
1495    pub const IDENTIFIER: &'static str = "script.ArrayRemoteValue";
1496    pub const DOMAIN_DIRECTION: &'static str = "all";
1497    pub fn identifier(&self) -> &'static str {
1498        Self::IDENTIFIER
1499    }
1500}
1501#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1502pub struct ObjectRemoteValue {
1503    #[serde(rename = "type")]
1504    pub r#type: ObjectRemoteValueType,
1505    #[serde(rename = "handle")]
1506    #[serde(skip_serializing_if = "Option::is_none")]
1507    #[serde(default)]
1508    pub handle: Option<Handle>,
1509    #[serde(rename = "internalId")]
1510    #[serde(skip_serializing_if = "Option::is_none")]
1511    #[serde(default)]
1512    pub internal_id: Option<InternalId>,
1513    #[serde(rename = "value")]
1514    #[serde(skip_serializing_if = "Option::is_none")]
1515    #[serde(default)]
1516    pub value: Option<MappingRemoteValue>,
1517}
1518#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1519pub enum ObjectRemoteValueType {
1520    #[serde(rename = "object")]
1521    Object,
1522}
1523impl ObjectRemoteValue {
1524    pub fn new(r#type: impl Into<ObjectRemoteValueType>) -> Self {
1525        Self {
1526            r#type: r#type.into(),
1527            handle: None,
1528            internal_id: None,
1529            value: None,
1530        }
1531    }
1532}
1533impl ObjectRemoteValue {
1534    pub const IDENTIFIER: &'static str = "script.ObjectRemoteValue";
1535    pub const DOMAIN_DIRECTION: &'static str = "all";
1536    pub fn identifier(&self) -> &'static str {
1537        Self::IDENTIFIER
1538    }
1539}
1540#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1541pub struct FunctionRemoteValue {
1542    #[serde(rename = "type")]
1543    pub r#type: FunctionRemoteValueType,
1544    #[serde(rename = "handle")]
1545    #[serde(skip_serializing_if = "Option::is_none")]
1546    #[serde(default)]
1547    pub handle: Option<Handle>,
1548    #[serde(rename = "internalId")]
1549    #[serde(skip_serializing_if = "Option::is_none")]
1550    #[serde(default)]
1551    pub internal_id: Option<InternalId>,
1552}
1553#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1554pub enum FunctionRemoteValueType {
1555    #[serde(rename = "function")]
1556    Function,
1557}
1558impl FunctionRemoteValue {
1559    pub fn new(r#type: impl Into<FunctionRemoteValueType>) -> Self {
1560        Self {
1561            r#type: r#type.into(),
1562            handle: None,
1563            internal_id: None,
1564        }
1565    }
1566}
1567impl FunctionRemoteValue {
1568    pub const IDENTIFIER: &'static str = "script.FunctionRemoteValue";
1569    pub const DOMAIN_DIRECTION: &'static str = "all";
1570    pub fn identifier(&self) -> &'static str {
1571        Self::IDENTIFIER
1572    }
1573}
1574#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1575pub struct RegExpRemoteValue {
1576    #[serde(flatten)]
1577    #[serde(default)]
1578    pub reg_exp_local_value: RegExpLocalValue,
1579    #[serde(rename = "handle")]
1580    #[serde(skip_serializing_if = "Option::is_none")]
1581    #[serde(default)]
1582    pub handle: Option<Handle>,
1583    #[serde(rename = "internalId")]
1584    #[serde(skip_serializing_if = "Option::is_none")]
1585    #[serde(default)]
1586    pub internal_id: Option<InternalId>,
1587}
1588impl RegExpRemoteValue {
1589    pub fn new(reg_exp_local_value: impl Into<RegExpLocalValue>) -> Self {
1590        Self {
1591            reg_exp_local_value: reg_exp_local_value.into(),
1592            handle: None,
1593            internal_id: None,
1594        }
1595    }
1596}
1597impl RegExpRemoteValue {
1598    pub const IDENTIFIER: &'static str = "script.RegExpRemoteValue";
1599    pub const DOMAIN_DIRECTION: &'static str = "all";
1600    pub fn identifier(&self) -> &'static str {
1601        Self::IDENTIFIER
1602    }
1603}
1604#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1605pub struct DateRemoteValue {
1606    #[serde(flatten)]
1607    #[serde(default)]
1608    pub date_local_value: DateLocalValue,
1609    #[serde(rename = "handle")]
1610    #[serde(skip_serializing_if = "Option::is_none")]
1611    #[serde(default)]
1612    pub handle: Option<Handle>,
1613    #[serde(rename = "internalId")]
1614    #[serde(skip_serializing_if = "Option::is_none")]
1615    #[serde(default)]
1616    pub internal_id: Option<InternalId>,
1617}
1618impl DateRemoteValue {
1619    pub fn new(date_local_value: impl Into<DateLocalValue>) -> Self {
1620        Self {
1621            date_local_value: date_local_value.into(),
1622            handle: None,
1623            internal_id: None,
1624        }
1625    }
1626}
1627impl DateRemoteValue {
1628    pub const IDENTIFIER: &'static str = "script.DateRemoteValue";
1629    pub const DOMAIN_DIRECTION: &'static str = "all";
1630    pub fn identifier(&self) -> &'static str {
1631        Self::IDENTIFIER
1632    }
1633}
1634#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1635pub struct MapRemoteValue {
1636    #[serde(rename = "type")]
1637    pub r#type: MapRemoteValueType,
1638    #[serde(rename = "handle")]
1639    #[serde(skip_serializing_if = "Option::is_none")]
1640    #[serde(default)]
1641    pub handle: Option<Handle>,
1642    #[serde(rename = "internalId")]
1643    #[serde(skip_serializing_if = "Option::is_none")]
1644    #[serde(default)]
1645    pub internal_id: Option<InternalId>,
1646    #[serde(rename = "value")]
1647    #[serde(skip_serializing_if = "Option::is_none")]
1648    #[serde(default)]
1649    pub value: Option<MappingRemoteValue>,
1650}
1651#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1652pub enum MapRemoteValueType {
1653    #[serde(rename = "map")]
1654    Map,
1655}
1656impl MapRemoteValue {
1657    pub fn new(r#type: impl Into<MapRemoteValueType>) -> Self {
1658        Self {
1659            r#type: r#type.into(),
1660            handle: None,
1661            internal_id: None,
1662            value: None,
1663        }
1664    }
1665}
1666impl MapRemoteValue {
1667    pub const IDENTIFIER: &'static str = "script.MapRemoteValue";
1668    pub const DOMAIN_DIRECTION: &'static str = "all";
1669    pub fn identifier(&self) -> &'static str {
1670        Self::IDENTIFIER
1671    }
1672}
1673#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1674pub struct SetRemoteValue {
1675    #[serde(rename = "type")]
1676    pub r#type: SetRemoteValueType,
1677    #[serde(rename = "handle")]
1678    #[serde(skip_serializing_if = "Option::is_none")]
1679    #[serde(default)]
1680    pub handle: Option<Handle>,
1681    #[serde(rename = "internalId")]
1682    #[serde(skip_serializing_if = "Option::is_none")]
1683    #[serde(default)]
1684    pub internal_id: Option<InternalId>,
1685    #[serde(rename = "value")]
1686    #[serde(skip_serializing_if = "Option::is_none")]
1687    #[serde(default)]
1688    pub value: Option<ListRemoteValue>,
1689}
1690#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1691pub enum SetRemoteValueType {
1692    #[serde(rename = "set")]
1693    Set,
1694}
1695impl SetRemoteValue {
1696    pub fn new(r#type: impl Into<SetRemoteValueType>) -> Self {
1697        Self {
1698            r#type: r#type.into(),
1699            handle: None,
1700            internal_id: None,
1701            value: None,
1702        }
1703    }
1704}
1705impl SetRemoteValue {
1706    pub const IDENTIFIER: &'static str = "script.SetRemoteValue";
1707    pub const DOMAIN_DIRECTION: &'static str = "all";
1708    pub fn identifier(&self) -> &'static str {
1709        Self::IDENTIFIER
1710    }
1711}
1712#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1713pub struct WeakMapRemoteValue {
1714    #[serde(rename = "type")]
1715    pub r#type: WeakMapRemoteValueType,
1716    #[serde(rename = "handle")]
1717    #[serde(skip_serializing_if = "Option::is_none")]
1718    #[serde(default)]
1719    pub handle: Option<Handle>,
1720    #[serde(rename = "internalId")]
1721    #[serde(skip_serializing_if = "Option::is_none")]
1722    #[serde(default)]
1723    pub internal_id: Option<InternalId>,
1724}
1725#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1726pub enum WeakMapRemoteValueType {
1727    #[serde(rename = "weakmap")]
1728    Weakmap,
1729}
1730impl WeakMapRemoteValue {
1731    pub fn new(r#type: impl Into<WeakMapRemoteValueType>) -> Self {
1732        Self {
1733            r#type: r#type.into(),
1734            handle: None,
1735            internal_id: None,
1736        }
1737    }
1738}
1739impl WeakMapRemoteValue {
1740    pub const IDENTIFIER: &'static str = "script.WeakMapRemoteValue";
1741    pub const DOMAIN_DIRECTION: &'static str = "all";
1742    pub fn identifier(&self) -> &'static str {
1743        Self::IDENTIFIER
1744    }
1745}
1746#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1747pub struct WeakSetRemoteValue {
1748    #[serde(rename = "type")]
1749    pub r#type: WeakSetRemoteValueType,
1750    #[serde(rename = "handle")]
1751    #[serde(skip_serializing_if = "Option::is_none")]
1752    #[serde(default)]
1753    pub handle: Option<Handle>,
1754    #[serde(rename = "internalId")]
1755    #[serde(skip_serializing_if = "Option::is_none")]
1756    #[serde(default)]
1757    pub internal_id: Option<InternalId>,
1758}
1759#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1760pub enum WeakSetRemoteValueType {
1761    #[serde(rename = "weakset")]
1762    Weakset,
1763}
1764impl WeakSetRemoteValue {
1765    pub fn new(r#type: impl Into<WeakSetRemoteValueType>) -> Self {
1766        Self {
1767            r#type: r#type.into(),
1768            handle: None,
1769            internal_id: None,
1770        }
1771    }
1772}
1773impl WeakSetRemoteValue {
1774    pub const IDENTIFIER: &'static str = "script.WeakSetRemoteValue";
1775    pub const DOMAIN_DIRECTION: &'static str = "all";
1776    pub fn identifier(&self) -> &'static str {
1777        Self::IDENTIFIER
1778    }
1779}
1780#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1781pub struct GeneratorRemoteValue {
1782    #[serde(rename = "type")]
1783    pub r#type: GeneratorRemoteValueType,
1784    #[serde(rename = "handle")]
1785    #[serde(skip_serializing_if = "Option::is_none")]
1786    #[serde(default)]
1787    pub handle: Option<Handle>,
1788    #[serde(rename = "internalId")]
1789    #[serde(skip_serializing_if = "Option::is_none")]
1790    #[serde(default)]
1791    pub internal_id: Option<InternalId>,
1792}
1793#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1794pub enum GeneratorRemoteValueType {
1795    #[serde(rename = "generator")]
1796    Generator,
1797}
1798impl GeneratorRemoteValue {
1799    pub fn new(r#type: impl Into<GeneratorRemoteValueType>) -> Self {
1800        Self {
1801            r#type: r#type.into(),
1802            handle: None,
1803            internal_id: None,
1804        }
1805    }
1806}
1807impl GeneratorRemoteValue {
1808    pub const IDENTIFIER: &'static str = "script.GeneratorRemoteValue";
1809    pub const DOMAIN_DIRECTION: &'static str = "all";
1810    pub fn identifier(&self) -> &'static str {
1811        Self::IDENTIFIER
1812    }
1813}
1814#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1815pub struct ErrorRemoteValue {
1816    #[serde(rename = "type")]
1817    pub r#type: ErrorRemoteValueType,
1818    #[serde(rename = "handle")]
1819    #[serde(skip_serializing_if = "Option::is_none")]
1820    #[serde(default)]
1821    pub handle: Option<Handle>,
1822    #[serde(rename = "internalId")]
1823    #[serde(skip_serializing_if = "Option::is_none")]
1824    #[serde(default)]
1825    pub internal_id: Option<InternalId>,
1826}
1827#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1828pub enum ErrorRemoteValueType {
1829    #[serde(rename = "error")]
1830    Error,
1831}
1832impl ErrorRemoteValue {
1833    pub fn new(r#type: impl Into<ErrorRemoteValueType>) -> Self {
1834        Self {
1835            r#type: r#type.into(),
1836            handle: None,
1837            internal_id: None,
1838        }
1839    }
1840}
1841impl ErrorRemoteValue {
1842    pub const IDENTIFIER: &'static str = "script.ErrorRemoteValue";
1843    pub const DOMAIN_DIRECTION: &'static str = "all";
1844    pub fn identifier(&self) -> &'static str {
1845        Self::IDENTIFIER
1846    }
1847}
1848#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1849pub struct ProxyRemoteValue {
1850    #[serde(rename = "type")]
1851    pub r#type: ProxyRemoteValueType,
1852    #[serde(rename = "handle")]
1853    #[serde(skip_serializing_if = "Option::is_none")]
1854    #[serde(default)]
1855    pub handle: Option<Handle>,
1856    #[serde(rename = "internalId")]
1857    #[serde(skip_serializing_if = "Option::is_none")]
1858    #[serde(default)]
1859    pub internal_id: Option<InternalId>,
1860}
1861#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1862pub enum ProxyRemoteValueType {
1863    #[serde(rename = "proxy")]
1864    Proxy,
1865}
1866impl ProxyRemoteValue {
1867    pub fn new(r#type: impl Into<ProxyRemoteValueType>) -> Self {
1868        Self {
1869            r#type: r#type.into(),
1870            handle: None,
1871            internal_id: None,
1872        }
1873    }
1874}
1875impl ProxyRemoteValue {
1876    pub const IDENTIFIER: &'static str = "script.ProxyRemoteValue";
1877    pub const DOMAIN_DIRECTION: &'static str = "all";
1878    pub fn identifier(&self) -> &'static str {
1879        Self::IDENTIFIER
1880    }
1881}
1882#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1883pub struct PromiseRemoteValue {
1884    #[serde(rename = "type")]
1885    pub r#type: PromiseRemoteValueType,
1886    #[serde(rename = "handle")]
1887    #[serde(skip_serializing_if = "Option::is_none")]
1888    #[serde(default)]
1889    pub handle: Option<Handle>,
1890    #[serde(rename = "internalId")]
1891    #[serde(skip_serializing_if = "Option::is_none")]
1892    #[serde(default)]
1893    pub internal_id: Option<InternalId>,
1894}
1895#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1896pub enum PromiseRemoteValueType {
1897    #[serde(rename = "promise")]
1898    Promise,
1899}
1900impl PromiseRemoteValue {
1901    pub fn new(r#type: impl Into<PromiseRemoteValueType>) -> Self {
1902        Self {
1903            r#type: r#type.into(),
1904            handle: None,
1905            internal_id: None,
1906        }
1907    }
1908}
1909impl PromiseRemoteValue {
1910    pub const IDENTIFIER: &'static str = "script.PromiseRemoteValue";
1911    pub const DOMAIN_DIRECTION: &'static str = "all";
1912    pub fn identifier(&self) -> &'static str {
1913        Self::IDENTIFIER
1914    }
1915}
1916#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1917pub struct TypedArrayRemoteValue {
1918    #[serde(rename = "type")]
1919    pub r#type: TypedArrayRemoteValueType,
1920    #[serde(rename = "handle")]
1921    #[serde(skip_serializing_if = "Option::is_none")]
1922    #[serde(default)]
1923    pub handle: Option<Handle>,
1924    #[serde(rename = "internalId")]
1925    #[serde(skip_serializing_if = "Option::is_none")]
1926    #[serde(default)]
1927    pub internal_id: Option<InternalId>,
1928}
1929#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1930pub enum TypedArrayRemoteValueType {
1931    #[serde(rename = "typedarray")]
1932    Typedarray,
1933}
1934impl TypedArrayRemoteValue {
1935    pub fn new(r#type: impl Into<TypedArrayRemoteValueType>) -> Self {
1936        Self {
1937            r#type: r#type.into(),
1938            handle: None,
1939            internal_id: None,
1940        }
1941    }
1942}
1943impl TypedArrayRemoteValue {
1944    pub const IDENTIFIER: &'static str = "script.TypedArrayRemoteValue";
1945    pub const DOMAIN_DIRECTION: &'static str = "all";
1946    pub fn identifier(&self) -> &'static str {
1947        Self::IDENTIFIER
1948    }
1949}
1950#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1951pub struct ArrayBufferRemoteValue {
1952    #[serde(rename = "type")]
1953    pub r#type: ArrayBufferRemoteValueType,
1954    #[serde(rename = "handle")]
1955    #[serde(skip_serializing_if = "Option::is_none")]
1956    #[serde(default)]
1957    pub handle: Option<Handle>,
1958    #[serde(rename = "internalId")]
1959    #[serde(skip_serializing_if = "Option::is_none")]
1960    #[serde(default)]
1961    pub internal_id: Option<InternalId>,
1962}
1963#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
1964pub enum ArrayBufferRemoteValueType {
1965    #[serde(rename = "arraybuffer")]
1966    Arraybuffer,
1967}
1968impl ArrayBufferRemoteValue {
1969    pub fn new(r#type: impl Into<ArrayBufferRemoteValueType>) -> Self {
1970        Self {
1971            r#type: r#type.into(),
1972            handle: None,
1973            internal_id: None,
1974        }
1975    }
1976}
1977impl ArrayBufferRemoteValue {
1978    pub const IDENTIFIER: &'static str = "script.ArrayBufferRemoteValue";
1979    pub const DOMAIN_DIRECTION: &'static str = "all";
1980    pub fn identifier(&self) -> &'static str {
1981        Self::IDENTIFIER
1982    }
1983}
1984#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1985pub struct NodeListRemoteValue {
1986    #[serde(rename = "type")]
1987    pub r#type: NodeListRemoteValueType,
1988    #[serde(rename = "handle")]
1989    #[serde(skip_serializing_if = "Option::is_none")]
1990    #[serde(default)]
1991    pub handle: Option<Handle>,
1992    #[serde(rename = "internalId")]
1993    #[serde(skip_serializing_if = "Option::is_none")]
1994    #[serde(default)]
1995    pub internal_id: Option<InternalId>,
1996    #[serde(rename = "value")]
1997    #[serde(skip_serializing_if = "Option::is_none")]
1998    #[serde(default)]
1999    pub value: Option<ListRemoteValue>,
2000}
2001#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2002pub enum NodeListRemoteValueType {
2003    #[serde(rename = "nodelist")]
2004    Nodelist,
2005}
2006impl NodeListRemoteValue {
2007    pub fn new(r#type: impl Into<NodeListRemoteValueType>) -> Self {
2008        Self {
2009            r#type: r#type.into(),
2010            handle: None,
2011            internal_id: None,
2012            value: None,
2013        }
2014    }
2015}
2016impl NodeListRemoteValue {
2017    pub const IDENTIFIER: &'static str = "script.NodeListRemoteValue";
2018    pub const DOMAIN_DIRECTION: &'static str = "all";
2019    pub fn identifier(&self) -> &'static str {
2020        Self::IDENTIFIER
2021    }
2022}
2023#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2024pub struct HtmlCollectionRemoteValue {
2025    #[serde(rename = "type")]
2026    pub r#type: HtmlCollectionRemoteValueType,
2027    #[serde(rename = "handle")]
2028    #[serde(skip_serializing_if = "Option::is_none")]
2029    #[serde(default)]
2030    pub handle: Option<Handle>,
2031    #[serde(rename = "internalId")]
2032    #[serde(skip_serializing_if = "Option::is_none")]
2033    #[serde(default)]
2034    pub internal_id: Option<InternalId>,
2035    #[serde(rename = "value")]
2036    #[serde(skip_serializing_if = "Option::is_none")]
2037    #[serde(default)]
2038    pub value: Option<ListRemoteValue>,
2039}
2040#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2041pub enum HtmlCollectionRemoteValueType {
2042    #[serde(rename = "htmlcollection")]
2043    Htmlcollection,
2044}
2045impl HtmlCollectionRemoteValue {
2046    pub fn new(r#type: impl Into<HtmlCollectionRemoteValueType>) -> Self {
2047        Self {
2048            r#type: r#type.into(),
2049            handle: None,
2050            internal_id: None,
2051            value: None,
2052        }
2053    }
2054}
2055impl HtmlCollectionRemoteValue {
2056    pub const IDENTIFIER: &'static str = "script.HTMLCollectionRemoteValue";
2057    pub const DOMAIN_DIRECTION: &'static str = "all";
2058    pub fn identifier(&self) -> &'static str {
2059        Self::IDENTIFIER
2060    }
2061}
2062#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2063pub struct NodeRemoteValue {
2064    #[serde(rename = "type")]
2065    pub r#type: NodeRemoteValueType,
2066    #[serde(rename = "sharedId")]
2067    #[serde(skip_serializing_if = "Option::is_none")]
2068    #[serde(default)]
2069    pub shared_id: Option<SharedId>,
2070    #[serde(rename = "handle")]
2071    #[serde(skip_serializing_if = "Option::is_none")]
2072    #[serde(default)]
2073    pub handle: Option<Handle>,
2074    #[serde(rename = "internalId")]
2075    #[serde(skip_serializing_if = "Option::is_none")]
2076    #[serde(default)]
2077    pub internal_id: Option<InternalId>,
2078    #[serde(rename = "value")]
2079    #[serde(skip_serializing_if = "Option::is_none")]
2080    #[serde(default)]
2081    pub value: Option<Box<NodeProperties>>,
2082}
2083#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2084pub enum NodeRemoteValueType {
2085    #[serde(rename = "node")]
2086    Node,
2087}
2088impl NodeRemoteValue {
2089    pub fn new(r#type: impl Into<NodeRemoteValueType>) -> Self {
2090        Self {
2091            r#type: r#type.into(),
2092            shared_id: None,
2093            handle: None,
2094            internal_id: None,
2095            value: None,
2096        }
2097    }
2098}
2099impl NodeRemoteValue {
2100    pub const IDENTIFIER: &'static str = "script.NodeRemoteValue";
2101    pub const DOMAIN_DIRECTION: &'static str = "all";
2102    pub fn identifier(&self) -> &'static str {
2103        Self::IDENTIFIER
2104    }
2105}
2106#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2107pub struct NodeProperties {
2108    #[serde(rename = "nodeType")]
2109    pub node_type: u64,
2110    #[serde(rename = "childNodeCount")]
2111    pub child_node_count: u64,
2112    #[serde(rename = "attributes")]
2113    #[serde(default)]
2114    pub attributes: Option<std::collections::HashMap<String, serde_json::Value>>,
2115    #[serde(rename = "children")]
2116    #[serde(skip_serializing_if = "Option::is_none")]
2117    #[serde(default)]
2118    pub children: Option<Vec<NodeRemoteValue>>,
2119    #[serde(rename = "localName")]
2120    #[serde(skip_serializing_if = "Option::is_none")]
2121    #[serde(default)]
2122    pub local_name: Option<String>,
2123    #[serde(rename = "mode")]
2124    #[serde(skip_serializing_if = "Option::is_none")]
2125    #[serde(default)]
2126    pub mode: Option<NodePropertiesMode>,
2127    #[serde(rename = "namespaceURI")]
2128    #[serde(skip_serializing_if = "Option::is_none")]
2129    #[serde(default)]
2130    pub namespace_uri: Option<String>,
2131    #[serde(rename = "nodeValue")]
2132    #[serde(skip_serializing_if = "Option::is_none")]
2133    #[serde(default)]
2134    pub node_value: Option<String>,
2135    #[serde(rename = "shadowRoot")]
2136    #[serde(skip_serializing_if = "Option::is_none")]
2137    #[serde(default)]
2138    pub shadow_root: Option<Box<NodeRemoteValue>>,
2139}
2140#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2141pub enum NodePropertiesMode {
2142    #[serde(rename = "open")]
2143    Open,
2144    #[serde(rename = "closed")]
2145    Closed,
2146}
2147impl NodeProperties {
2148    pub fn new(node_type: impl Into<u64>, child_node_count: impl Into<u64>) -> Self {
2149        Self {
2150            node_type: node_type.into(),
2151            child_node_count: child_node_count.into(),
2152            attributes: None,
2153            children: None,
2154            local_name: None,
2155            mode: None,
2156            namespace_uri: None,
2157            node_value: None,
2158            shadow_root: None,
2159        }
2160    }
2161}
2162impl NodeProperties {
2163    pub const IDENTIFIER: &'static str = "script.NodeProperties";
2164    pub const DOMAIN_DIRECTION: &'static str = "all";
2165    pub fn identifier(&self) -> &'static str {
2166        Self::IDENTIFIER
2167    }
2168}
2169#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2170pub struct WindowProxyRemoteValue {
2171    #[serde(rename = "type")]
2172    pub r#type: WindowProxyRemoteValueType,
2173    #[serde(rename = "value")]
2174    pub value: WindowProxyProperties,
2175    #[serde(rename = "handle")]
2176    #[serde(skip_serializing_if = "Option::is_none")]
2177    #[serde(default)]
2178    pub handle: Option<Handle>,
2179    #[serde(rename = "internalId")]
2180    #[serde(skip_serializing_if = "Option::is_none")]
2181    #[serde(default)]
2182    pub internal_id: Option<InternalId>,
2183}
2184#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2185pub enum WindowProxyRemoteValueType {
2186    #[serde(rename = "window")]
2187    Window,
2188}
2189impl WindowProxyRemoteValue {
2190    pub fn new(
2191        r#type: impl Into<WindowProxyRemoteValueType>,
2192        value: impl Into<WindowProxyProperties>,
2193    ) -> Self {
2194        Self {
2195            r#type: r#type.into(),
2196            value: value.into(),
2197            handle: None,
2198            internal_id: None,
2199        }
2200    }
2201}
2202impl WindowProxyRemoteValue {
2203    pub const IDENTIFIER: &'static str = "script.WindowProxyRemoteValue";
2204    pub const DOMAIN_DIRECTION: &'static str = "all";
2205    pub fn identifier(&self) -> &'static str {
2206        Self::IDENTIFIER
2207    }
2208}
2209#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2210pub struct WindowProxyProperties {
2211    #[serde(rename = "context")]
2212    pub context: crate::browsing_context::types::BrowsingContext,
2213}
2214impl WindowProxyProperties {
2215    pub fn new(context: impl Into<crate::browsing_context::types::BrowsingContext>) -> Self {
2216        Self {
2217            context: context.into(),
2218        }
2219    }
2220}
2221impl WindowProxyProperties {
2222    pub const IDENTIFIER: &'static str = "script.WindowProxyProperties";
2223    pub const DOMAIN_DIRECTION: &'static str = "all";
2224    pub fn identifier(&self) -> &'static str {
2225        Self::IDENTIFIER
2226    }
2227}
2228#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2229pub enum ResultOwnership {
2230    #[serde(rename = "root")]
2231    Root,
2232    #[serde(rename = "none")]
2233    None,
2234}
2235#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
2236pub struct SerializationOptions {
2237    #[serde(rename = "maxDomDepth")]
2238    #[serde(skip_serializing_if = "Option::is_none")]
2239    #[serde(default = "default_serialization_options_max_dom_depth")]
2240    pub max_dom_depth: Option<u64>,
2241    #[serde(rename = "maxObjectDepth")]
2242    #[serde(skip_serializing_if = "Option::is_none")]
2243    #[serde(default)]
2244    pub max_object_depth: Option<u64>,
2245    #[serde(rename = "includeShadowTree")]
2246    #[serde(skip_serializing_if = "Option::is_none")]
2247    #[serde(default)]
2248    pub include_shadow_tree: Option<SerializationOptionsIncludeShadowTree>,
2249}
2250fn default_serialization_options_max_dom_depth() -> Option<u64> {
2251    Some(0u64)
2252}
2253#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2254pub enum SerializationOptionsIncludeShadowTree {
2255    #[serde(rename = "none")]
2256    None,
2257    #[serde(rename = "open")]
2258    Open,
2259    #[serde(rename = "all")]
2260    All,
2261}
2262impl SerializationOptions {
2263    pub const IDENTIFIER: &'static str = "script.SerializationOptions";
2264    pub const DOMAIN_DIRECTION: &'static str = "all";
2265    pub fn identifier(&self) -> &'static str {
2266        Self::IDENTIFIER
2267    }
2268}
2269#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
2270pub struct SharedId(String);
2271impl SharedId {
2272    pub fn new(val: impl Into<String>) -> Self {
2273        SharedId(val.into())
2274    }
2275    pub fn inner(&self) -> &String {
2276        &self.0
2277    }
2278}
2279impl AsRef<str> for SharedId {
2280    fn as_ref(&self) -> &str {
2281        self.0.as_str()
2282    }
2283}
2284impl From<SharedId> for String {
2285    fn from(el: SharedId) -> String {
2286        el.0
2287    }
2288}
2289impl From<String> for SharedId {
2290    fn from(expr: String) -> Self {
2291        SharedId(expr)
2292    }
2293}
2294impl std::borrow::Borrow<str> for SharedId {
2295    fn borrow(&self) -> &str {
2296        &self.0
2297    }
2298}
2299impl SharedId {
2300    pub const IDENTIFIER: &'static str = "script.SharedId";
2301    pub const DOMAIN_DIRECTION: &'static str = "all";
2302    pub fn identifier(&self) -> &'static str {
2303        Self::IDENTIFIER
2304    }
2305}
2306#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2307pub struct StackFrame {
2308    #[serde(rename = "columnNumber")]
2309    pub column_number: u64,
2310    #[serde(rename = "functionName")]
2311    pub function_name: String,
2312    #[serde(rename = "lineNumber")]
2313    pub line_number: u64,
2314    #[serde(rename = "url")]
2315    pub url: String,
2316}
2317impl StackFrame {
2318    pub fn new(
2319        column_number: impl Into<u64>,
2320        function_name: impl Into<String>,
2321        line_number: impl Into<u64>,
2322        url: impl Into<String>,
2323    ) -> Self {
2324        Self {
2325            column_number: column_number.into(),
2326            function_name: function_name.into(),
2327            line_number: line_number.into(),
2328            url: url.into(),
2329        }
2330    }
2331}
2332impl StackFrame {
2333    pub const IDENTIFIER: &'static str = "script.StackFrame";
2334    pub const DOMAIN_DIRECTION: &'static str = "all";
2335    pub fn identifier(&self) -> &'static str {
2336        Self::IDENTIFIER
2337    }
2338}
2339#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2340pub struct StackTrace {
2341    #[serde(rename = "callFrames")]
2342    #[serde(skip_serializing_if = "Vec::is_empty")]
2343    pub call_frames: Vec<StackFrame>,
2344}
2345impl StackTrace {
2346    pub fn new(call_frames: Vec<StackFrame>) -> Self {
2347        Self { call_frames }
2348    }
2349}
2350impl StackTrace {
2351    pub const IDENTIFIER: &'static str = "script.StackTrace";
2352    pub const DOMAIN_DIRECTION: &'static str = "all";
2353    pub fn identifier(&self) -> &'static str {
2354        Self::IDENTIFIER
2355    }
2356}
2357#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2358pub struct RealmTarget {
2359    #[serde(rename = "realm")]
2360    pub realm: Realm,
2361}
2362impl RealmTarget {
2363    pub fn new(realm: impl Into<Realm>) -> Self {
2364        Self {
2365            realm: realm.into(),
2366        }
2367    }
2368}
2369impl RealmTarget {
2370    pub const IDENTIFIER: &'static str = "script.RealmTarget";
2371    pub const DOMAIN_DIRECTION: &'static str = "remote";
2372    pub fn identifier(&self) -> &'static str {
2373        Self::IDENTIFIER
2374    }
2375}
2376#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2377pub struct ContextTarget {
2378    #[serde(rename = "context")]
2379    pub context: crate::browsing_context::types::BrowsingContext,
2380    #[serde(rename = "sandbox")]
2381    #[serde(skip_serializing_if = "Option::is_none")]
2382    #[serde(default)]
2383    pub sandbox: Option<String>,
2384}
2385impl ContextTarget {
2386    pub fn new(context: impl Into<crate::browsing_context::types::BrowsingContext>) -> Self {
2387        Self {
2388            context: context.into(),
2389            sandbox: None,
2390        }
2391    }
2392}
2393impl ContextTarget {
2394    pub const IDENTIFIER: &'static str = "script.ContextTarget";
2395    pub const DOMAIN_DIRECTION: &'static str = "remote";
2396    pub fn identifier(&self) -> &'static str {
2397        Self::IDENTIFIER
2398    }
2399}
2400#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2401#[serde(untagged)]
2402pub enum Target {
2403    ContextTarget(ContextTarget),
2404    RealmTarget(RealmTarget),
2405}
2406impl From<ContextTarget> for Target {
2407    fn from(v: ContextTarget) -> Self {
2408        Target::ContextTarget(v)
2409    }
2410}
2411impl TryFrom<Target> for ContextTarget {
2412    type Error = Target;
2413    fn try_from(e: Target) -> Result<Self, Self::Error> {
2414        match e {
2415            Target::ContextTarget(inner) => Ok(inner),
2416            other => Err(other),
2417        }
2418    }
2419}
2420impl From<RealmTarget> for Target {
2421    fn from(v: RealmTarget) -> Self {
2422        Target::RealmTarget(v)
2423    }
2424}
2425impl TryFrom<Target> for RealmTarget {
2426    type Error = Target;
2427    fn try_from(e: Target) -> Result<Self, Self::Error> {
2428        match e {
2429            Target::RealmTarget(inner) => Ok(inner),
2430            other => Err(other),
2431        }
2432    }
2433}
2434#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2435#[serde(untagged)]
2436pub enum RealmInfo {
2437    WindowRealmInfo(WindowRealmInfo),
2438    DedicatedWorkerRealmInfo(DedicatedWorkerRealmInfo),
2439    SharedWorkerRealmInfo(SharedWorkerRealmInfo),
2440    ServiceWorkerRealmInfo(ServiceWorkerRealmInfo),
2441    WorkerRealmInfo(WorkerRealmInfo),
2442    PaintWorkletRealmInfo(PaintWorkletRealmInfo),
2443    AudioWorkletRealmInfo(AudioWorkletRealmInfo),
2444    WorkletRealmInfo(WorkletRealmInfo),
2445}
2446impl From<WindowRealmInfo> for RealmInfo {
2447    fn from(v: WindowRealmInfo) -> Self {
2448        RealmInfo::WindowRealmInfo(v)
2449    }
2450}
2451impl TryFrom<RealmInfo> for WindowRealmInfo {
2452    type Error = RealmInfo;
2453    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2454        match e {
2455            RealmInfo::WindowRealmInfo(inner) => Ok(inner),
2456            other => Err(other),
2457        }
2458    }
2459}
2460impl From<DedicatedWorkerRealmInfo> for RealmInfo {
2461    fn from(v: DedicatedWorkerRealmInfo) -> Self {
2462        RealmInfo::DedicatedWorkerRealmInfo(v)
2463    }
2464}
2465impl TryFrom<RealmInfo> for DedicatedWorkerRealmInfo {
2466    type Error = RealmInfo;
2467    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2468        match e {
2469            RealmInfo::DedicatedWorkerRealmInfo(inner) => Ok(inner),
2470            other => Err(other),
2471        }
2472    }
2473}
2474impl From<SharedWorkerRealmInfo> for RealmInfo {
2475    fn from(v: SharedWorkerRealmInfo) -> Self {
2476        RealmInfo::SharedWorkerRealmInfo(v)
2477    }
2478}
2479impl TryFrom<RealmInfo> for SharedWorkerRealmInfo {
2480    type Error = RealmInfo;
2481    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2482        match e {
2483            RealmInfo::SharedWorkerRealmInfo(inner) => Ok(inner),
2484            other => Err(other),
2485        }
2486    }
2487}
2488impl From<ServiceWorkerRealmInfo> for RealmInfo {
2489    fn from(v: ServiceWorkerRealmInfo) -> Self {
2490        RealmInfo::ServiceWorkerRealmInfo(v)
2491    }
2492}
2493impl TryFrom<RealmInfo> for ServiceWorkerRealmInfo {
2494    type Error = RealmInfo;
2495    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2496        match e {
2497            RealmInfo::ServiceWorkerRealmInfo(inner) => Ok(inner),
2498            other => Err(other),
2499        }
2500    }
2501}
2502impl From<WorkerRealmInfo> for RealmInfo {
2503    fn from(v: WorkerRealmInfo) -> Self {
2504        RealmInfo::WorkerRealmInfo(v)
2505    }
2506}
2507impl TryFrom<RealmInfo> for WorkerRealmInfo {
2508    type Error = RealmInfo;
2509    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2510        match e {
2511            RealmInfo::WorkerRealmInfo(inner) => Ok(inner),
2512            other => Err(other),
2513        }
2514    }
2515}
2516impl From<PaintWorkletRealmInfo> for RealmInfo {
2517    fn from(v: PaintWorkletRealmInfo) -> Self {
2518        RealmInfo::PaintWorkletRealmInfo(v)
2519    }
2520}
2521impl TryFrom<RealmInfo> for PaintWorkletRealmInfo {
2522    type Error = RealmInfo;
2523    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2524        match e {
2525            RealmInfo::PaintWorkletRealmInfo(inner) => Ok(inner),
2526            other => Err(other),
2527        }
2528    }
2529}
2530impl From<AudioWorkletRealmInfo> for RealmInfo {
2531    fn from(v: AudioWorkletRealmInfo) -> Self {
2532        RealmInfo::AudioWorkletRealmInfo(v)
2533    }
2534}
2535impl TryFrom<RealmInfo> for AudioWorkletRealmInfo {
2536    type Error = RealmInfo;
2537    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2538        match e {
2539            RealmInfo::AudioWorkletRealmInfo(inner) => Ok(inner),
2540            other => Err(other),
2541        }
2542    }
2543}
2544impl From<WorkletRealmInfo> for RealmInfo {
2545    fn from(v: WorkletRealmInfo) -> Self {
2546        RealmInfo::WorkletRealmInfo(v)
2547    }
2548}
2549impl TryFrom<RealmInfo> for WorkletRealmInfo {
2550    type Error = RealmInfo;
2551    fn try_from(e: RealmInfo) -> Result<Self, Self::Error> {
2552        match e {
2553            RealmInfo::WorkletRealmInfo(inner) => Ok(inner),
2554            other => Err(other),
2555        }
2556    }
2557}
2558#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2559pub struct BaseRealmInfo {
2560    #[serde(rename = "realm")]
2561    pub realm: Realm,
2562    #[serde(rename = "origin")]
2563    pub origin: String,
2564}
2565impl BaseRealmInfo {
2566    pub fn new(realm: impl Into<Realm>, origin: impl Into<String>) -> Self {
2567        Self {
2568            realm: realm.into(),
2569            origin: origin.into(),
2570        }
2571    }
2572}
2573impl BaseRealmInfo {
2574    pub const IDENTIFIER: &'static str = "script.BaseRealmInfo";
2575    pub const DOMAIN_DIRECTION: &'static str = "local";
2576    pub fn identifier(&self) -> &'static str {
2577        Self::IDENTIFIER
2578    }
2579}
2580#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2581pub struct WindowRealmInfo {
2582    #[serde(flatten)]
2583    #[serde(default)]
2584    pub base_realm_info: BaseRealmInfo,
2585    #[serde(rename = "type")]
2586    pub r#type: WindowRealmInfoType,
2587    #[serde(rename = "context")]
2588    pub context: crate::browsing_context::types::BrowsingContext,
2589    #[serde(rename = "sandbox")]
2590    #[serde(skip_serializing_if = "Option::is_none")]
2591    #[serde(default)]
2592    pub sandbox: Option<String>,
2593}
2594#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2595pub enum WindowRealmInfoType {
2596    #[serde(rename = "window")]
2597    Window,
2598}
2599impl WindowRealmInfo {
2600    pub fn new(
2601        base_realm_info: impl Into<BaseRealmInfo>,
2602        r#type: impl Into<WindowRealmInfoType>,
2603        context: impl Into<crate::browsing_context::types::BrowsingContext>,
2604    ) -> Self {
2605        Self {
2606            base_realm_info: base_realm_info.into(),
2607            r#type: r#type.into(),
2608            context: context.into(),
2609            sandbox: None,
2610        }
2611    }
2612}
2613impl WindowRealmInfo {
2614    pub const IDENTIFIER: &'static str = "script.WindowRealmInfo";
2615    pub const DOMAIN_DIRECTION: &'static str = "local";
2616    pub fn identifier(&self) -> &'static str {
2617        Self::IDENTIFIER
2618    }
2619}
2620#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2621pub struct DedicatedWorkerRealmInfo {
2622    #[serde(flatten)]
2623    #[serde(default)]
2624    pub base_realm_info: BaseRealmInfo,
2625    #[serde(rename = "type")]
2626    pub r#type: DedicatedWorkerRealmInfoType,
2627    #[serde(rename = "owners")]
2628    #[serde(skip_serializing_if = "Vec::is_empty")]
2629    pub owners: Vec<Realm>,
2630}
2631#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2632pub enum DedicatedWorkerRealmInfoType {
2633    #[serde(rename = "dedicated-worker")]
2634    DedicatedWorker,
2635}
2636impl DedicatedWorkerRealmInfo {
2637    pub fn new(
2638        base_realm_info: impl Into<BaseRealmInfo>,
2639        r#type: impl Into<DedicatedWorkerRealmInfoType>,
2640        owners: Vec<Realm>,
2641    ) -> Self {
2642        Self {
2643            base_realm_info: base_realm_info.into(),
2644            r#type: r#type.into(),
2645            owners,
2646        }
2647    }
2648}
2649impl DedicatedWorkerRealmInfo {
2650    pub const IDENTIFIER: &'static str = "script.DedicatedWorkerRealmInfo";
2651    pub const DOMAIN_DIRECTION: &'static str = "local";
2652    pub fn identifier(&self) -> &'static str {
2653        Self::IDENTIFIER
2654    }
2655}
2656#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2657pub struct SharedWorkerRealmInfo {
2658    #[serde(flatten)]
2659    #[serde(default)]
2660    pub base_realm_info: BaseRealmInfo,
2661    #[serde(rename = "type")]
2662    pub r#type: SharedWorkerRealmInfoType,
2663}
2664#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2665pub enum SharedWorkerRealmInfoType {
2666    #[serde(rename = "shared-worker")]
2667    SharedWorker,
2668}
2669impl SharedWorkerRealmInfo {
2670    pub fn new(
2671        base_realm_info: impl Into<BaseRealmInfo>,
2672        r#type: impl Into<SharedWorkerRealmInfoType>,
2673    ) -> Self {
2674        Self {
2675            base_realm_info: base_realm_info.into(),
2676            r#type: r#type.into(),
2677        }
2678    }
2679}
2680impl SharedWorkerRealmInfo {
2681    pub const IDENTIFIER: &'static str = "script.SharedWorkerRealmInfo";
2682    pub const DOMAIN_DIRECTION: &'static str = "local";
2683    pub fn identifier(&self) -> &'static str {
2684        Self::IDENTIFIER
2685    }
2686}
2687#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2688pub struct ServiceWorkerRealmInfo {
2689    #[serde(flatten)]
2690    #[serde(default)]
2691    pub base_realm_info: BaseRealmInfo,
2692    #[serde(rename = "type")]
2693    pub r#type: ServiceWorkerRealmInfoType,
2694}
2695#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2696pub enum ServiceWorkerRealmInfoType {
2697    #[serde(rename = "service-worker")]
2698    ServiceWorker,
2699}
2700impl ServiceWorkerRealmInfo {
2701    pub fn new(
2702        base_realm_info: impl Into<BaseRealmInfo>,
2703        r#type: impl Into<ServiceWorkerRealmInfoType>,
2704    ) -> Self {
2705        Self {
2706            base_realm_info: base_realm_info.into(),
2707            r#type: r#type.into(),
2708        }
2709    }
2710}
2711impl ServiceWorkerRealmInfo {
2712    pub const IDENTIFIER: &'static str = "script.ServiceWorkerRealmInfo";
2713    pub const DOMAIN_DIRECTION: &'static str = "local";
2714    pub fn identifier(&self) -> &'static str {
2715        Self::IDENTIFIER
2716    }
2717}
2718#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2719pub struct WorkerRealmInfo {
2720    #[serde(flatten)]
2721    #[serde(default)]
2722    pub base_realm_info: BaseRealmInfo,
2723    #[serde(rename = "type")]
2724    pub r#type: WorkerRealmInfoType,
2725}
2726#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2727pub enum WorkerRealmInfoType {
2728    #[serde(rename = "worker")]
2729    Worker,
2730}
2731impl WorkerRealmInfo {
2732    pub fn new(
2733        base_realm_info: impl Into<BaseRealmInfo>,
2734        r#type: impl Into<WorkerRealmInfoType>,
2735    ) -> Self {
2736        Self {
2737            base_realm_info: base_realm_info.into(),
2738            r#type: r#type.into(),
2739        }
2740    }
2741}
2742impl WorkerRealmInfo {
2743    pub const IDENTIFIER: &'static str = "script.WorkerRealmInfo";
2744    pub const DOMAIN_DIRECTION: &'static str = "local";
2745    pub fn identifier(&self) -> &'static str {
2746        Self::IDENTIFIER
2747    }
2748}
2749#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2750pub struct PaintWorkletRealmInfo {
2751    #[serde(flatten)]
2752    #[serde(default)]
2753    pub base_realm_info: BaseRealmInfo,
2754    #[serde(rename = "type")]
2755    pub r#type: PaintWorkletRealmInfoType,
2756}
2757#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2758pub enum PaintWorkletRealmInfoType {
2759    #[serde(rename = "paint-worklet")]
2760    PaintWorklet,
2761}
2762impl PaintWorkletRealmInfo {
2763    pub fn new(
2764        base_realm_info: impl Into<BaseRealmInfo>,
2765        r#type: impl Into<PaintWorkletRealmInfoType>,
2766    ) -> Self {
2767        Self {
2768            base_realm_info: base_realm_info.into(),
2769            r#type: r#type.into(),
2770        }
2771    }
2772}
2773impl PaintWorkletRealmInfo {
2774    pub const IDENTIFIER: &'static str = "script.PaintWorkletRealmInfo";
2775    pub const DOMAIN_DIRECTION: &'static str = "local";
2776    pub fn identifier(&self) -> &'static str {
2777        Self::IDENTIFIER
2778    }
2779}
2780#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2781pub struct AudioWorkletRealmInfo {
2782    #[serde(flatten)]
2783    #[serde(default)]
2784    pub base_realm_info: BaseRealmInfo,
2785    #[serde(rename = "type")]
2786    pub r#type: AudioWorkletRealmInfoType,
2787}
2788#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2789pub enum AudioWorkletRealmInfoType {
2790    #[serde(rename = "audio-worklet")]
2791    AudioWorklet,
2792}
2793impl AudioWorkletRealmInfo {
2794    pub fn new(
2795        base_realm_info: impl Into<BaseRealmInfo>,
2796        r#type: impl Into<AudioWorkletRealmInfoType>,
2797    ) -> Self {
2798        Self {
2799            base_realm_info: base_realm_info.into(),
2800            r#type: r#type.into(),
2801        }
2802    }
2803}
2804impl AudioWorkletRealmInfo {
2805    pub const IDENTIFIER: &'static str = "script.AudioWorkletRealmInfo";
2806    pub const DOMAIN_DIRECTION: &'static str = "local";
2807    pub fn identifier(&self) -> &'static str {
2808        Self::IDENTIFIER
2809    }
2810}
2811#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2812pub struct WorkletRealmInfo {
2813    #[serde(flatten)]
2814    #[serde(default)]
2815    pub base_realm_info: BaseRealmInfo,
2816    #[serde(rename = "type")]
2817    pub r#type: WorkletRealmInfoType,
2818}
2819#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
2820pub enum WorkletRealmInfoType {
2821    #[serde(rename = "worklet")]
2822    Worklet,
2823}
2824impl WorkletRealmInfo {
2825    pub fn new(
2826        base_realm_info: impl Into<BaseRealmInfo>,
2827        r#type: impl Into<WorkletRealmInfoType>,
2828    ) -> Self {
2829        Self {
2830            base_realm_info: base_realm_info.into(),
2831            r#type: r#type.into(),
2832        }
2833    }
2834}
2835impl WorkletRealmInfo {
2836    pub const IDENTIFIER: &'static str = "script.WorkletRealmInfo";
2837    pub const DOMAIN_DIRECTION: &'static str = "local";
2838    pub fn identifier(&self) -> &'static str {
2839        Self::IDENTIFIER
2840    }
2841}
2842#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
2843pub struct Source {
2844    #[serde(rename = "realm")]
2845    pub realm: Realm,
2846    #[serde(rename = "context")]
2847    #[serde(skip_serializing_if = "Option::is_none")]
2848    #[serde(default)]
2849    pub context: Option<crate::browsing_context::types::BrowsingContext>,
2850}
2851impl Source {
2852    pub fn new(realm: impl Into<Realm>) -> Self {
2853        Self {
2854            realm: realm.into(),
2855            context: None,
2856        }
2857    }
2858}
2859impl Source {
2860    pub const IDENTIFIER: &'static str = "script.Source";
2861    pub const DOMAIN_DIRECTION: &'static str = "local";
2862    pub fn identifier(&self) -> &'static str {
2863        Self::IDENTIFIER
2864    }
2865}