rustenium-bidi-definitions 0.1.1

Generated WebDriver BiDi protocol type definitions for Rustenium
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct CapabilitiesRequest {
    #[serde(rename = "alwaysMatch")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub always_match: Option<CapabilityRequest>,
    #[serde(rename = "firstMatch")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub first_match: Option<Vec<CapabilityRequest>>,
}
impl CapabilitiesRequest {
    pub const IDENTIFIER: &'static str = "session.CapabilitiesRequest";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CapabilityRequest {
    #[serde(rename = "acceptInsecureCerts")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub accept_insecure_certs: Option<bool>,
    #[serde(rename = "browserName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_name: Option<String>,
    #[serde(rename = "browserVersion")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub browser_version: Option<String>,
    #[serde(rename = "platformName")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub platform_name: Option<String>,
    #[serde(rename = "proxy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub proxy: Option<ProxyConfiguration>,
    #[serde(rename = "unhandledPromptBehavior")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub unhandled_prompt_behavior: Option<UnhandledPromptBehavior>,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
impl CapabilityRequest {
    pub fn new(
        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
    ) -> Self {
        Self {
            extensible: extensible.into(),
            accept_insecure_certs: None,
            browser_name: None,
            browser_version: None,
            platform_name: None,
            proxy: None,
            unhandled_prompt_behavior: None,
        }
    }
}
impl CapabilityRequest {
    pub const IDENTIFIER: &'static str = "session.CapabilityRequest";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProxyConfiguration {
    AutodetectProxyConfiguration(AutodetectProxyConfiguration),
    DirectProxyConfiguration(DirectProxyConfiguration),
    ManualProxyConfiguration(ManualProxyConfiguration),
    PacProxyConfiguration(PacProxyConfiguration),
    SystemProxyConfiguration(SystemProxyConfiguration),
    SocksProxyConfiguration(SocksProxyConfiguration),
    EmptyProxyConfiguration {},
}
impl From<AutodetectProxyConfiguration> for ProxyConfiguration {
    fn from(v: AutodetectProxyConfiguration) -> Self {
        ProxyConfiguration::AutodetectProxyConfiguration(v)
    }
}
impl TryFrom<ProxyConfiguration> for AutodetectProxyConfiguration {
    type Error = ProxyConfiguration;
    fn try_from(e: ProxyConfiguration) -> Result<Self, Self::Error> {
        match e {
            ProxyConfiguration::AutodetectProxyConfiguration(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<DirectProxyConfiguration> for ProxyConfiguration {
    fn from(v: DirectProxyConfiguration) -> Self {
        ProxyConfiguration::DirectProxyConfiguration(v)
    }
}
impl TryFrom<ProxyConfiguration> for DirectProxyConfiguration {
    type Error = ProxyConfiguration;
    fn try_from(e: ProxyConfiguration) -> Result<Self, Self::Error> {
        match e {
            ProxyConfiguration::DirectProxyConfiguration(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<ManualProxyConfiguration> for ProxyConfiguration {
    fn from(v: ManualProxyConfiguration) -> Self {
        ProxyConfiguration::ManualProxyConfiguration(v)
    }
}
impl TryFrom<ProxyConfiguration> for ManualProxyConfiguration {
    type Error = ProxyConfiguration;
    fn try_from(e: ProxyConfiguration) -> Result<Self, Self::Error> {
        match e {
            ProxyConfiguration::ManualProxyConfiguration(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<PacProxyConfiguration> for ProxyConfiguration {
    fn from(v: PacProxyConfiguration) -> Self {
        ProxyConfiguration::PacProxyConfiguration(v)
    }
}
impl TryFrom<ProxyConfiguration> for PacProxyConfiguration {
    type Error = ProxyConfiguration;
    fn try_from(e: ProxyConfiguration) -> Result<Self, Self::Error> {
        match e {
            ProxyConfiguration::PacProxyConfiguration(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<SystemProxyConfiguration> for ProxyConfiguration {
    fn from(v: SystemProxyConfiguration) -> Self {
        ProxyConfiguration::SystemProxyConfiguration(v)
    }
}
impl TryFrom<ProxyConfiguration> for SystemProxyConfiguration {
    type Error = ProxyConfiguration;
    fn try_from(e: ProxyConfiguration) -> Result<Self, Self::Error> {
        match e {
            ProxyConfiguration::SystemProxyConfiguration(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<SocksProxyConfiguration> for ProxyConfiguration {
    fn from(v: SocksProxyConfiguration) -> Self {
        ProxyConfiguration::SocksProxyConfiguration(v)
    }
}
impl TryFrom<ProxyConfiguration> for SocksProxyConfiguration {
    type Error = ProxyConfiguration;
    fn try_from(e: ProxyConfiguration) -> Result<Self, Self::Error> {
        match e {
            ProxyConfiguration::SocksProxyConfiguration(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AutodetectProxyConfiguration {
    #[serde(rename = "proxyType")]
    pub proxy_type: AutodetectProxyConfigurationProxyType,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum AutodetectProxyConfigurationProxyType {
    #[serde(rename = "autodetect")]
    Autodetect,
}
impl AutodetectProxyConfiguration {
    pub fn new(
        proxy_type: impl Into<AutodetectProxyConfigurationProxyType>,
        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
    ) -> Self {
        Self {
            proxy_type: proxy_type.into(),
            extensible: extensible.into(),
        }
    }
}
impl AutodetectProxyConfiguration {
    pub const IDENTIFIER: &'static str = "session.AutodetectProxyConfiguration";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DirectProxyConfiguration {
    #[serde(rename = "proxyType")]
    pub proxy_type: DirectProxyConfigurationProxyType,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum DirectProxyConfigurationProxyType {
    #[serde(rename = "direct")]
    Direct,
}
impl DirectProxyConfiguration {
    pub fn new(
        proxy_type: impl Into<DirectProxyConfigurationProxyType>,
        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
    ) -> Self {
        Self {
            proxy_type: proxy_type.into(),
            extensible: extensible.into(),
        }
    }
}
impl DirectProxyConfiguration {
    pub const IDENTIFIER: &'static str = "session.DirectProxyConfiguration";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ManualProxyConfiguration {
    #[serde(rename = "proxyType")]
    pub proxy_type: ManualProxyConfigurationProxyType,
    #[serde(rename = "httpProxy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub http_proxy: Option<String>,
    #[serde(rename = "sslProxy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub ssl_proxy: Option<String>,
    #[serde(rename = "noProxy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub no_proxy: Option<Vec<String>>,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ManualProxyConfigurationProxyType {
    #[serde(rename = "manual")]
    Manual,
}
impl ManualProxyConfiguration {
    pub fn new(
        proxy_type: impl Into<ManualProxyConfigurationProxyType>,
        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
    ) -> Self {
        Self {
            proxy_type: proxy_type.into(),
            extensible: extensible.into(),
            http_proxy: None,
            ssl_proxy: None,
            no_proxy: None,
        }
    }
}
impl ManualProxyConfiguration {
    pub const IDENTIFIER: &'static str = "session.ManualProxyConfiguration";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SocksProxyConfiguration {
    #[serde(rename = "socksProxy")]
    pub socks_proxy: String,
    #[serde(rename = "socksVersion")]
    pub socks_version: u64,
}
impl SocksProxyConfiguration {
    pub fn new(socks_proxy: impl Into<String>, socks_version: impl Into<u64>) -> Self {
        Self {
            socks_proxy: socks_proxy.into(),
            socks_version: socks_version.into(),
        }
    }
}
impl SocksProxyConfiguration {
    pub const IDENTIFIER: &'static str = "session.SocksProxyConfiguration";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PacProxyConfiguration {
    #[serde(rename = "proxyType")]
    pub proxy_type: PacProxyConfigurationProxyType,
    #[serde(rename = "proxyAutoconfigUrl")]
    pub proxy_autoconfig_url: String,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PacProxyConfigurationProxyType {
    #[serde(rename = "pac")]
    Pac,
}
impl PacProxyConfiguration {
    pub fn new(
        proxy_type: impl Into<PacProxyConfigurationProxyType>,
        proxy_autoconfig_url: impl Into<String>,
        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
    ) -> Self {
        Self {
            proxy_type: proxy_type.into(),
            proxy_autoconfig_url: proxy_autoconfig_url.into(),
            extensible: extensible.into(),
        }
    }
}
impl PacProxyConfiguration {
    pub const IDENTIFIER: &'static str = "session.PacProxyConfiguration";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SystemProxyConfiguration {
    #[serde(rename = "proxyType")]
    pub proxy_type: SystemProxyConfigurationProxyType,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum SystemProxyConfigurationProxyType {
    #[serde(rename = "system")]
    System,
}
impl SystemProxyConfiguration {
    pub fn new(
        proxy_type: impl Into<SystemProxyConfigurationProxyType>,
        extensible: impl Into<std::collections::HashMap<String, serde_json::Value>>,
    ) -> Self {
        Self {
            proxy_type: proxy_type.into(),
            extensible: extensible.into(),
        }
    }
}
impl SystemProxyConfiguration {
    pub const IDENTIFIER: &'static str = "session.SystemProxyConfiguration";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct UserPromptHandler {
    #[serde(rename = "alert")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub alert: Option<UserPromptHandlerType>,
    #[serde(rename = "beforeUnload")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub before_unload: Option<UserPromptHandlerType>,
    #[serde(rename = "confirm")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub confirm: Option<UserPromptHandlerType>,
    #[serde(rename = "default")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub r#default: Option<UserPromptHandlerType>,
    #[serde(rename = "file")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub file: Option<UserPromptHandlerType>,
    #[serde(rename = "prompt")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub prompt: Option<UserPromptHandlerType>,
}
impl UserPromptHandler {
    pub const IDENTIFIER: &'static str = "session.UserPromptHandler";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum UserPromptHandlerType {
    #[serde(rename = "accept")]
    Accept,
    #[serde(rename = "dismiss")]
    Dismiss,
    #[serde(rename = "ignore")]
    Ignore,
    #[serde(rename = "dismiss and notify")]
    DismissAndNotify,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize, Eq, Hash)]
pub struct Subscription(String);
impl Subscription {
    pub fn new(val: impl Into<String>) -> Self {
        Subscription(val.into())
    }
    pub fn inner(&self) -> &String {
        &self.0
    }
}
impl AsRef<str> for Subscription {
    fn as_ref(&self) -> &str {
        self.0.as_str()
    }
}
impl From<Subscription> for String {
    fn from(el: Subscription) -> String {
        el.0
    }
}
impl From<String> for Subscription {
    fn from(expr: String) -> Self {
        Subscription(expr)
    }
}
impl Subscription {
    pub const IDENTIFIER: &'static str = "session.Subscription";
    pub const DOMAIN_DIRECTION: &'static str = "all";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UnsubscribeByIdRequest {
    #[serde(rename = "subscriptions")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub subscriptions: Vec<Subscription>,
}
impl UnsubscribeByIdRequest {
    pub fn new(subscriptions: Vec<Subscription>) -> Self {
        Self { subscriptions }
    }
}
impl UnsubscribeByIdRequest {
    pub const IDENTIFIER: &'static str = "session.UnsubscribeByIDRequest";
    pub const DOMAIN_DIRECTION: &'static str = "remote";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UnsubscribeByAttributesRequest {
    #[serde(rename = "events")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub events: Vec<String>,
}
impl UnsubscribeByAttributesRequest {
    pub fn new(events: Vec<String>) -> Self {
        Self { events }
    }
}
impl UnsubscribeByAttributesRequest {
    pub const IDENTIFIER: &'static str = "session.UnsubscribeByAttributesRequest";
    pub const DOMAIN_DIRECTION: &'static str = "remote";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UnsubscribeParameters {
    UnsubscribeByAttributesRequest(UnsubscribeByAttributesRequest),
    UnsubscribeByIdRequest(UnsubscribeByIdRequest),
}
impl From<UnsubscribeByAttributesRequest> for UnsubscribeParameters {
    fn from(v: UnsubscribeByAttributesRequest) -> Self {
        UnsubscribeParameters::UnsubscribeByAttributesRequest(v)
    }
}
impl TryFrom<UnsubscribeParameters> for UnsubscribeByAttributesRequest {
    type Error = UnsubscribeParameters;
    fn try_from(e: UnsubscribeParameters) -> Result<Self, Self::Error> {
        match e {
            UnsubscribeParameters::UnsubscribeByAttributesRequest(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<UnsubscribeByIdRequest> for UnsubscribeParameters {
    fn from(v: UnsubscribeByIdRequest) -> Self {
        UnsubscribeParameters::UnsubscribeByIdRequest(v)
    }
}
impl TryFrom<UnsubscribeParameters> for UnsubscribeByIdRequest {
    type Error = UnsubscribeParameters;
    fn try_from(e: UnsubscribeParameters) -> Result<Self, Self::Error> {
        match e {
            UnsubscribeParameters::UnsubscribeByIdRequest(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NewResultCapabilities {
    #[serde(rename = "acceptInsecureCerts")]
    pub accept_insecure_certs: bool,
    #[serde(rename = "browserName")]
    pub browser_name: String,
    #[serde(rename = "browserVersion")]
    pub browser_version: String,
    #[serde(rename = "platformName")]
    pub platform_name: String,
    #[serde(rename = "setWindowRect")]
    pub set_window_rect: bool,
    #[serde(rename = "userAgent")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub user_agent: Option<String>,
    #[serde(rename = "proxy")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub proxy: Option<ProxyConfiguration>,
    #[serde(rename = "unhandledPromptBehavior")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub unhandled_prompt_behavior: Option<UnhandledPromptBehavior>,
    #[serde(rename = "webSocketUrl")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub web_socket_url: Option<String>,
    #[serde(flatten)]
    #[serde(default)]
    pub extensible: std::collections::HashMap<String, serde_json::Value>,
}
impl NewResultCapabilities {
    pub const IDENTIFIER: &'static str = "";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UnhandledPromptBehavior {
    UserPromptHandler(UserPromptHandler),
    UserPromptHandlerType(UserPromptHandlerType),
}
impl From<UserPromptHandler> for UnhandledPromptBehavior {
    fn from(v: UserPromptHandler) -> Self {
        UnhandledPromptBehavior::UserPromptHandler(v)
    }
}
impl TryFrom<UnhandledPromptBehavior> for UserPromptHandler {
    type Error = UnhandledPromptBehavior;
    fn try_from(e: UnhandledPromptBehavior) -> Result<Self, Self::Error> {
        match e {
            UnhandledPromptBehavior::UserPromptHandler(inner) => Ok(inner),
            other => Err(other),
        }
    }
}
impl From<UserPromptHandlerType> for UnhandledPromptBehavior {
    fn from(v: UserPromptHandlerType) -> Self {
        UnhandledPromptBehavior::UserPromptHandlerType(v)
    }
}
impl TryFrom<UnhandledPromptBehavior> for UserPromptHandlerType {
    type Error = UnhandledPromptBehavior;
    fn try_from(e: UnhandledPromptBehavior) -> Result<Self, Self::Error> {
        match e {
            UnhandledPromptBehavior::UserPromptHandlerType(inner) => Ok(inner),
            other => Err(other),
        }
    }
}