-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathGetPartialAXTreeRequest.php
More file actions
101 lines (88 loc) · 2.03 KB
/
GetPartialAXTreeRequest.php
File metadata and controls
101 lines (88 loc) · 2.03 KB
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
<?php
namespace ChromeDevtoolsProtocol\Model\Accessibility;
/**
* Request for Accessibility.getPartialAXTree command.
*
* @generated This file has been auto-generated, do not edit.
*
* @author Jakub Kulhan <jakub.kulhan@gmail.com>
*/
final class GetPartialAXTreeRequest implements \JsonSerializable
{
/**
* Identifier of the node to get the partial accessibility tree for.
*
* @var int
*/
public $nodeId;
/**
* Identifier of the backend node to get the partial accessibility tree for.
*
* @var int
*/
public $backendNodeId;
/**
* JavaScript object id of the node wrapper to get the partial accessibility tree for.
*
* @var string
*/
public $objectId;
/**
* Whether to fetch this nodes ancestors, siblings and children. Defaults to true.
*
* @var bool|null
*/
public $fetchRelatives;
public static function fromJson($data)
{
$instance = new static();
if (isset($data->nodeId)) {
$instance->nodeId = (int)$data->nodeId;
}
if (isset($data->backendNodeId)) {
$instance->backendNodeId = (int)$data->backendNodeId;
}
if (isset($data->objectId)) {
$instance->objectId = (string)$data->objectId;
}
if (isset($data->fetchRelatives)) {
$instance->fetchRelatives = (bool)$data->fetchRelatives;
}
return $instance;
}
public function jsonSerialize(): mixed
{
$data = new \stdClass();
if ($this->nodeId !== null) {
$data->nodeId = $this->nodeId;
}
if ($this->backendNodeId !== null) {
$data->backendNodeId = $this->backendNodeId;
}
if ($this->objectId !== null) {
$data->objectId = $this->objectId;
}
if ($this->fetchRelatives !== null) {
$data->fetchRelatives = $this->fetchRelatives;
}
return $data;
}
/**
* Create new instance using builder.
*
* @return GetPartialAXTreeRequestBuilder
*/
public static function builder(): GetPartialAXTreeRequestBuilder
{
return new GetPartialAXTreeRequestBuilder();
}
/**
* Create new empty instance.
*
* @return self
*/
public static function make(): self
{
return static::builder()->build();
}
}