-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathCorsIssueDetails.php
More file actions
93 lines (80 loc) · 2.48 KB
/
CorsIssueDetails.php
File metadata and controls
93 lines (80 loc) · 2.48 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
<?php
namespace ChromeDevtoolsProtocol\Model\Audits;
use ChromeDevtoolsProtocol\Model\Network\ClientSecurityState;
use ChromeDevtoolsProtocol\Model\Network\CorsErrorStatus;
/**
* Details for a CORS related issue, e.g. a warning or error related to CORS RFC1918 enforcement.
*
* @generated This file has been auto-generated, do not edit.
*
* @author Jakub Kulhan <jakub.kulhan@gmail.com>
*/
final class CorsIssueDetails implements \JsonSerializable
{
/** @var CorsErrorStatus */
public $corsErrorStatus;
/** @var bool */
public $isWarning;
/** @var AffectedRequest */
public $request;
/** @var SourceCodeLocation|null */
public $location;
/** @var string|null */
public $initiatorOrigin;
/** @var string */
public $resourceIPAddressSpace;
/** @var ClientSecurityState|null */
public $clientSecurityState;
public static function fromJson($data)
{
$instance = new static();
if (isset($data->corsErrorStatus)) {
$instance->corsErrorStatus = CorsErrorStatus::fromJson($data->corsErrorStatus);
}
if (isset($data->isWarning)) {
$instance->isWarning = (bool)$data->isWarning;
}
if (isset($data->request)) {
$instance->request = AffectedRequest::fromJson($data->request);
}
if (isset($data->location)) {
$instance->location = SourceCodeLocation::fromJson($data->location);
}
if (isset($data->initiatorOrigin)) {
$instance->initiatorOrigin = (string)$data->initiatorOrigin;
}
if (isset($data->resourceIPAddressSpace)) {
$instance->resourceIPAddressSpace = (string)$data->resourceIPAddressSpace;
}
if (isset($data->clientSecurityState)) {
$instance->clientSecurityState = ClientSecurityState::fromJson($data->clientSecurityState);
}
return $instance;
}
public function jsonSerialize(): mixed
{
$data = new \stdClass();
if ($this->corsErrorStatus !== null) {
$data->corsErrorStatus = $this->corsErrorStatus->jsonSerialize();
}
if ($this->isWarning !== null) {
$data->isWarning = $this->isWarning;
}
if ($this->request !== null) {
$data->request = $this->request->jsonSerialize();
}
if ($this->location !== null) {
$data->location = $this->location->jsonSerialize();
}
if ($this->initiatorOrigin !== null) {
$data->initiatorOrigin = $this->initiatorOrigin;
}
if ($this->resourceIPAddressSpace !== null) {
$data->resourceIPAddressSpace = $this->resourceIPAddressSpace;
}
if ($this->clientSecurityState !== null) {
$data->clientSecurityState = $this->clientSecurityState->jsonSerialize();
}
return $data;
}
}