-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathQueryAXTreeRequest.php
More file actions
114 lines (100 loc) · 2.13 KB
/
QueryAXTreeRequest.php
File metadata and controls
114 lines (100 loc) · 2.13 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
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace ChromeDevtoolsProtocol\Model\Accessibility;
/**
* Request for Accessibility.queryAXTree command.
*
* @generated This file has been auto-generated, do not edit.
*
* @author Jakub Kulhan <jakub.kulhan@gmail.com>
*/
final class QueryAXTreeRequest implements \JsonSerializable
{
/**
* Identifier of the node for the root to query.
*
* @var int
*/
public $nodeId;
/**
* Identifier of the backend node for the root to query.
*
* @var int
*/
public $backendNodeId;
/**
* JavaScript object id of the node wrapper for the root to query.
*
* @var string
*/
public $objectId;
/**
* Find nodes with this computed name.
*
* @var string|null
*/
public $accessibleName;
/**
* Find nodes with this computed role.
*
* @var string|null
*/
public $role;
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->accessibleName)) {
$instance->accessibleName = (string)$data->accessibleName;
}
if (isset($data->role)) {
$instance->role = (string)$data->role;
}
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->accessibleName !== null) {
$data->accessibleName = $this->accessibleName;
}
if ($this->role !== null) {
$data->role = $this->role;
}
return $data;
}
/**
* Create new instance using builder.
*
* @return QueryAXTreeRequestBuilder
*/
public static function builder(): QueryAXTreeRequestBuilder
{
return new QueryAXTreeRequestBuilder();
}
/**
* Create new empty instance.
*
* @return self
*/
public static function make(): self
{
return static::builder()->build();
}
}