rustenium-cdp-definitions 0.1.1

Generated Chrome DevTools 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
582
583
584
585
586
587
588
589
use serde::{Deserialize, Serialize};
#[doc = "Enable the BluetoothEmulation domain.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-enable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {
    #[doc = "State of the simulated central."]
    #[serde(rename = "state")]
    pub state: super::types::CentralState,
    #[doc = "If the simulated central supports low-energy."]
    #[serde(rename = "leSupported")]
    pub le_supported: bool,
}
impl EnableParams {
    pub fn new(
        state: impl Into<super::types::CentralState>,
        le_supported: impl Into<bool>,
    ) -> Self {
        Self {
            state: state.into(),
            le_supported: le_supported.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum EnableMethod {
    #[serde(rename = "BluetoothEmulation.enable")]
    Enable,
}
#[doc = "Enable the BluetoothEmulation domain.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-enable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Enable {
    pub method: EnableMethod,
    pub params: EnableParams,
}
impl Enable {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.enable";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for Enable {
    type Result = super::results::EnableResult;
}
#[doc = "Set the state of the simulated central.\n[setSimulatedCentralState](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-setSimulatedCentralState)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSimulatedCentralStateParams {
    #[doc = "State of the simulated central."]
    #[serde(rename = "state")]
    pub state: super::types::CentralState,
}
impl SetSimulatedCentralStateParams {
    pub fn new(state: impl Into<super::types::CentralState>) -> Self {
        Self {
            state: state.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SetSimulatedCentralStateMethod {
    #[serde(rename = "BluetoothEmulation.setSimulatedCentralState")]
    SetSimulatedCentralState,
}
#[doc = "Set the state of the simulated central.\n[setSimulatedCentralState](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-setSimulatedCentralState)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SetSimulatedCentralState {
    pub method: SetSimulatedCentralStateMethod,
    pub params: SetSimulatedCentralStateParams,
}
impl SetSimulatedCentralState {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.setSimulatedCentralState";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SetSimulatedCentralState {
    type Result = super::results::SetSimulatedCentralStateResult;
}
#[doc = "Disable the BluetoothEmulation domain.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-disable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum DisableMethod {
    #[serde(rename = "BluetoothEmulation.disable")]
    Disable,
}
#[doc = "Disable the BluetoothEmulation domain.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-disable)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Disable {
    pub method: DisableMethod,
    pub params: DisableParams,
}
impl Disable {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.disable";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for Disable {
    type Result = super::results::DisableResult;
}
#[doc = "Simulates a peripheral with |address|, |name| and |knownServiceUuids|\nthat has already been connected to the system.\n[simulatePreconnectedPeripheral](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulatePreconnectedPeripheral)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulatePreconnectedPeripheralParams {
    #[serde(rename = "address")]
    pub address: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "manufacturerData")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub manufacturer_data: Vec<super::types::ManufacturerData>,
    #[serde(rename = "knownServiceUuids")]
    #[serde(skip_serializing_if = "Vec::is_empty")]
    pub known_service_uuids: Vec<String>,
}
impl SimulatePreconnectedPeripheralParams {
    pub fn new(
        address: impl Into<String>,
        name: impl Into<String>,
        manufacturer_data: Vec<super::types::ManufacturerData>,
        known_service_uuids: Vec<String>,
    ) -> Self {
        Self {
            address: address.into(),
            name: name.into(),
            manufacturer_data,
            known_service_uuids,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SimulatePreconnectedPeripheralMethod {
    #[serde(rename = "BluetoothEmulation.simulatePreconnectedPeripheral")]
    SimulatePreconnectedPeripheral,
}
#[doc = "Simulates a peripheral with |address|, |name| and |knownServiceUuids|\nthat has already been connected to the system.\n[simulatePreconnectedPeripheral](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulatePreconnectedPeripheral)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulatePreconnectedPeripheral {
    pub method: SimulatePreconnectedPeripheralMethod,
    pub params: SimulatePreconnectedPeripheralParams,
}
impl SimulatePreconnectedPeripheral {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.simulatePreconnectedPeripheral";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SimulatePreconnectedPeripheral {
    type Result = super::results::SimulatePreconnectedPeripheralResult;
}
#[doc = "Simulates an advertisement packet described in |entry| being received by\nthe central.\n[simulateAdvertisement](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateAdvertisement)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateAdvertisementParams {
    #[serde(rename = "entry")]
    pub entry: super::types::ScanEntry,
}
impl SimulateAdvertisementParams {
    pub fn new(entry: impl Into<super::types::ScanEntry>) -> Self {
        Self {
            entry: entry.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SimulateAdvertisementMethod {
    #[serde(rename = "BluetoothEmulation.simulateAdvertisement")]
    SimulateAdvertisement,
}
#[doc = "Simulates an advertisement packet described in |entry| being received by\nthe central.\n[simulateAdvertisement](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateAdvertisement)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateAdvertisement {
    pub method: SimulateAdvertisementMethod,
    pub params: SimulateAdvertisementParams,
}
impl SimulateAdvertisement {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.simulateAdvertisement";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SimulateAdvertisement {
    type Result = super::results::SimulateAdvertisementResult;
}
#[doc = "Simulates the response code from the peripheral with |address| for a\nGATT operation of |type|. The |code| value follows the HCI Error Codes from\nBluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes.\n[simulateGATTOperationResponse](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateGATTOperationResponse)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateGattOperationResponseParams {
    #[serde(rename = "address")]
    pub address: String,
    #[serde(rename = "type")]
    pub r#type: super::types::GattOperationType,
    #[serde(rename = "code")]
    pub code: i64,
}
impl SimulateGattOperationResponseParams {
    pub fn new(
        address: impl Into<String>,
        r#type: impl Into<super::types::GattOperationType>,
        code: impl Into<i64>,
    ) -> Self {
        Self {
            address: address.into(),
            r#type: r#type.into(),
            code: code.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SimulateGattOperationResponseMethod {
    #[serde(rename = "BluetoothEmulation.simulateGATTOperationResponse")]
    SimulateGattOperationResponse,
}
#[doc = "Simulates the response code from the peripheral with |address| for a\nGATT operation of |type|. The |code| value follows the HCI Error Codes from\nBluetooth Core Specification Vol 2 Part D 1.3 List Of Error Codes.\n[simulateGATTOperationResponse](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateGATTOperationResponse)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateGattOperationResponse {
    pub method: SimulateGattOperationResponseMethod,
    pub params: SimulateGattOperationResponseParams,
}
impl SimulateGattOperationResponse {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.simulateGATTOperationResponse";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SimulateGattOperationResponse {
    type Result = super::results::SimulateGattOperationResponseResult;
}
#[doc = "Simulates the response from the characteristic with |characteristicId| for a\ncharacteristic operation of |type|. The |code| value follows the Error\nCodes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.\nThe |data| is expected to exist when simulating a successful read operation\nresponse.\n[simulateCharacteristicOperationResponse](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateCharacteristicOperationResponse)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateCharacteristicOperationResponseParams {
    #[serde(rename = "characteristicId")]
    pub characteristic_id: String,
    #[serde(rename = "type")]
    pub r#type: super::types::CharacteristicOperationType,
    #[serde(rename = "code")]
    pub code: i64,
    #[serde(rename = "data")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub data: Option<crate::Binary>,
}
impl SimulateCharacteristicOperationResponseParams {
    pub fn new(
        characteristic_id: impl Into<String>,
        r#type: impl Into<super::types::CharacteristicOperationType>,
        code: impl Into<i64>,
    ) -> Self {
        Self {
            characteristic_id: characteristic_id.into(),
            r#type: r#type.into(),
            code: code.into(),
            data: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SimulateCharacteristicOperationResponseMethod {
    #[serde(rename = "BluetoothEmulation.simulateCharacteristicOperationResponse")]
    SimulateCharacteristicOperationResponse,
}
#[doc = "Simulates the response from the characteristic with |characteristicId| for a\ncharacteristic operation of |type|. The |code| value follows the Error\nCodes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.\nThe |data| is expected to exist when simulating a successful read operation\nresponse.\n[simulateCharacteristicOperationResponse](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateCharacteristicOperationResponse)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateCharacteristicOperationResponse {
    pub method: SimulateCharacteristicOperationResponseMethod,
    pub params: SimulateCharacteristicOperationResponseParams,
}
impl SimulateCharacteristicOperationResponse {
    pub const IDENTIFIER: &'static str =
        "BluetoothEmulation.simulateCharacteristicOperationResponse";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SimulateCharacteristicOperationResponse {
    type Result = super::results::SimulateCharacteristicOperationResponseResult;
}
#[doc = "Simulates the response from the descriptor with |descriptorId| for a\ndescriptor operation of |type|. The |code| value follows the Error\nCodes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.\nThe |data| is expected to exist when simulating a successful read operation\nresponse.\n[simulateDescriptorOperationResponse](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateDescriptorOperationResponse)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateDescriptorOperationResponseParams {
    #[serde(rename = "descriptorId")]
    pub descriptor_id: String,
    #[serde(rename = "type")]
    pub r#type: super::types::DescriptorOperationType,
    #[serde(rename = "code")]
    pub code: i64,
    #[serde(rename = "data")]
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(default)]
    pub data: Option<crate::Binary>,
}
impl SimulateDescriptorOperationResponseParams {
    pub fn new(
        descriptor_id: impl Into<String>,
        r#type: impl Into<super::types::DescriptorOperationType>,
        code: impl Into<i64>,
    ) -> Self {
        Self {
            descriptor_id: descriptor_id.into(),
            r#type: r#type.into(),
            code: code.into(),
            data: None,
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SimulateDescriptorOperationResponseMethod {
    #[serde(rename = "BluetoothEmulation.simulateDescriptorOperationResponse")]
    SimulateDescriptorOperationResponse,
}
#[doc = "Simulates the response from the descriptor with |descriptorId| for a\ndescriptor operation of |type|. The |code| value follows the Error\nCodes from Bluetooth Core Specification Vol 3 Part F 3.4.1.1 Error Response.\nThe |data| is expected to exist when simulating a successful read operation\nresponse.\n[simulateDescriptorOperationResponse](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateDescriptorOperationResponse)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateDescriptorOperationResponse {
    pub method: SimulateDescriptorOperationResponseMethod,
    pub params: SimulateDescriptorOperationResponseParams,
}
impl SimulateDescriptorOperationResponse {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.simulateDescriptorOperationResponse";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SimulateDescriptorOperationResponse {
    type Result = super::results::SimulateDescriptorOperationResponseResult;
}
#[doc = "Adds a service with |serviceUuid| to the peripheral with |address|.\n[addService](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-addService)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddServiceParams {
    #[serde(rename = "address")]
    pub address: String,
    #[serde(rename = "serviceUuid")]
    pub service_uuid: String,
}
impl AddServiceParams {
    pub fn new(address: impl Into<String>, service_uuid: impl Into<String>) -> Self {
        Self {
            address: address.into(),
            service_uuid: service_uuid.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AddServiceMethod {
    #[serde(rename = "BluetoothEmulation.addService")]
    AddService,
}
#[doc = "Adds a service with |serviceUuid| to the peripheral with |address|.\n[addService](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-addService)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddService {
    pub method: AddServiceMethod,
    pub params: AddServiceParams,
}
impl AddService {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.addService";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for AddService {
    type Result = super::results::AddServiceResult;
}
#[doc = "Removes the service respresented by |serviceId| from the simulated central.\n[removeService](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-removeService)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveServiceParams {
    #[serde(rename = "serviceId")]
    pub service_id: String,
}
impl RemoveServiceParams {
    pub fn new(service_id: impl Into<String>) -> Self {
        Self {
            service_id: service_id.into(),
        }
    }
}
impl<T: Into<String>> From<T> for RemoveServiceParams {
    fn from(url: T) -> Self {
        RemoveServiceParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum RemoveServiceMethod {
    #[serde(rename = "BluetoothEmulation.removeService")]
    RemoveService,
}
#[doc = "Removes the service respresented by |serviceId| from the simulated central.\n[removeService](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-removeService)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveService {
    pub method: RemoveServiceMethod,
    pub params: RemoveServiceParams,
}
impl RemoveService {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.removeService";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for RemoveService {
    type Result = super::results::RemoveServiceResult;
}
#[doc = "Adds a characteristic with |characteristicUuid| and |properties| to the\nservice represented by |serviceId|.\n[addCharacteristic](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-addCharacteristic)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddCharacteristicParams {
    #[serde(rename = "serviceId")]
    pub service_id: String,
    #[serde(rename = "characteristicUuid")]
    pub characteristic_uuid: String,
    #[serde(rename = "properties")]
    pub properties: super::types::CharacteristicProperties,
}
impl AddCharacteristicParams {
    pub fn new(
        service_id: impl Into<String>,
        characteristic_uuid: impl Into<String>,
        properties: impl Into<super::types::CharacteristicProperties>,
    ) -> Self {
        Self {
            service_id: service_id.into(),
            characteristic_uuid: characteristic_uuid.into(),
            properties: properties.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AddCharacteristicMethod {
    #[serde(rename = "BluetoothEmulation.addCharacteristic")]
    AddCharacteristic,
}
#[doc = "Adds a characteristic with |characteristicUuid| and |properties| to the\nservice represented by |serviceId|.\n[addCharacteristic](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-addCharacteristic)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddCharacteristic {
    pub method: AddCharacteristicMethod,
    pub params: AddCharacteristicParams,
}
impl AddCharacteristic {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.addCharacteristic";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for AddCharacteristic {
    type Result = super::results::AddCharacteristicResult;
}
#[doc = "Removes the characteristic respresented by |characteristicId| from the\nsimulated central.\n[removeCharacteristic](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-removeCharacteristic)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveCharacteristicParams {
    #[serde(rename = "characteristicId")]
    pub characteristic_id: String,
}
impl RemoveCharacteristicParams {
    pub fn new(characteristic_id: impl Into<String>) -> Self {
        Self {
            characteristic_id: characteristic_id.into(),
        }
    }
}
impl<T: Into<String>> From<T> for RemoveCharacteristicParams {
    fn from(url: T) -> Self {
        RemoveCharacteristicParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum RemoveCharacteristicMethod {
    #[serde(rename = "BluetoothEmulation.removeCharacteristic")]
    RemoveCharacteristic,
}
#[doc = "Removes the characteristic respresented by |characteristicId| from the\nsimulated central.\n[removeCharacteristic](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-removeCharacteristic)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveCharacteristic {
    pub method: RemoveCharacteristicMethod,
    pub params: RemoveCharacteristicParams,
}
impl RemoveCharacteristic {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.removeCharacteristic";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for RemoveCharacteristic {
    type Result = super::results::RemoveCharacteristicResult;
}
#[doc = "Adds a descriptor with |descriptorUuid| to the characteristic respresented\nby |characteristicId|.\n[addDescriptor](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-addDescriptor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddDescriptorParams {
    #[serde(rename = "characteristicId")]
    pub characteristic_id: String,
    #[serde(rename = "descriptorUuid")]
    pub descriptor_uuid: String,
}
impl AddDescriptorParams {
    pub fn new(characteristic_id: impl Into<String>, descriptor_uuid: impl Into<String>) -> Self {
        Self {
            characteristic_id: characteristic_id.into(),
            descriptor_uuid: descriptor_uuid.into(),
        }
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AddDescriptorMethod {
    #[serde(rename = "BluetoothEmulation.addDescriptor")]
    AddDescriptor,
}
#[doc = "Adds a descriptor with |descriptorUuid| to the characteristic respresented\nby |characteristicId|.\n[addDescriptor](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-addDescriptor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AddDescriptor {
    pub method: AddDescriptorMethod,
    pub params: AddDescriptorParams,
}
impl AddDescriptor {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.addDescriptor";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for AddDescriptor {
    type Result = super::results::AddDescriptorResult;
}
#[doc = "Removes the descriptor with |descriptorId| from the simulated central.\n[removeDescriptor](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-removeDescriptor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveDescriptorParams {
    #[serde(rename = "descriptorId")]
    pub descriptor_id: String,
}
impl RemoveDescriptorParams {
    pub fn new(descriptor_id: impl Into<String>) -> Self {
        Self {
            descriptor_id: descriptor_id.into(),
        }
    }
}
impl<T: Into<String>> From<T> for RemoveDescriptorParams {
    fn from(url: T) -> Self {
        RemoveDescriptorParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum RemoveDescriptorMethod {
    #[serde(rename = "BluetoothEmulation.removeDescriptor")]
    RemoveDescriptor,
}
#[doc = "Removes the descriptor with |descriptorId| from the simulated central.\n[removeDescriptor](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-removeDescriptor)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RemoveDescriptor {
    pub method: RemoveDescriptorMethod,
    pub params: RemoveDescriptorParams,
}
impl RemoveDescriptor {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.removeDescriptor";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for RemoveDescriptor {
    type Result = super::results::RemoveDescriptorResult;
}
#[doc = "Simulates a GATT disconnection from the peripheral with |address|.\n[simulateGATTDisconnection](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateGATTDisconnection)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateGattDisconnectionParams {
    #[serde(rename = "address")]
    pub address: String,
}
impl SimulateGattDisconnectionParams {
    pub fn new(address: impl Into<String>) -> Self {
        Self {
            address: address.into(),
        }
    }
}
impl<T: Into<String>> From<T> for SimulateGattDisconnectionParams {
    fn from(url: T) -> Self {
        SimulateGattDisconnectionParams::new(url)
    }
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SimulateGattDisconnectionMethod {
    #[serde(rename = "BluetoothEmulation.simulateGATTDisconnection")]
    SimulateGattDisconnection,
}
#[doc = "Simulates a GATT disconnection from the peripheral with |address|.\n[simulateGATTDisconnection](https://chromedevtools.github.io/devtools-protocol/tot/BluetoothEmulation/#method-simulateGATTDisconnection)"]
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SimulateGattDisconnection {
    pub method: SimulateGattDisconnectionMethod,
    pub params: SimulateGattDisconnectionParams,
}
impl SimulateGattDisconnection {
    pub const IDENTIFIER: &'static str = "BluetoothEmulation.simulateGATTDisconnection";
    pub fn identifier(&self) -> &'static str {
        Self::IDENTIFIER
    }
}
impl crate::CommandResult for SimulateGattDisconnection {
    type Result = super::results::SimulateGattDisconnectionResult;
}
group_enum ! (BluetoothEmulationCommands { Enable (Enable) , SetSimulatedCentralState (SetSimulatedCentralState) , Disable (Disable) , SimulatePreconnectedPeripheral (SimulatePreconnectedPeripheral) , SimulateAdvertisement (SimulateAdvertisement) , SimulateGattOperationResponse (SimulateGattOperationResponse) , SimulateCharacteristicOperationResponse (SimulateCharacteristicOperationResponse) , SimulateDescriptorOperationResponse (SimulateDescriptorOperationResponse) , AddService (AddService) , RemoveService (RemoveService) , AddCharacteristic (AddCharacteristic) , RemoveCharacteristic (RemoveCharacteristic) , AddDescriptor (AddDescriptor) , RemoveDescriptor (RemoveDescriptor) , SimulateGattDisconnection (SimulateGattDisconnection) } + identifiable);