1: <?php
2: /*
3: * This class was auto-generated from the API references found at
4: * https://apireference.connect.worldline-solutions.com/
5: */
6: namespace Worldline\Connect\Sdk\V1\Domain;
7:
8: use UnexpectedValueException;
9: use Worldline\Connect\Sdk\Domain\DataObject;
10:
11: /**
12: * @package Worldline\Connect\Sdk\V1\Domain
13: */
14: class APIError extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $category = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $code = null;
25:
26: /**
27: * @var int|null
28: */
29: public ?int $httpStatusCode = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $id = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $message = null;
40:
41: /**
42: * @var string|null
43: */
44: public ?string $propertyName = null;
45:
46: /**
47: * @var string|null
48: */
49: public ?string $requestId = null;
50:
51: /**
52: * @return object
53: */
54: public function toObject(): object
55: {
56: $object = parent::toObject();
57: if (!is_null($this->category)) {
58: $object->category = $this->category;
59: }
60: if (!is_null($this->code)) {
61: $object->code = $this->code;
62: }
63: if (!is_null($this->httpStatusCode)) {
64: $object->httpStatusCode = $this->httpStatusCode;
65: }
66: if (!is_null($this->id)) {
67: $object->id = $this->id;
68: }
69: if (!is_null($this->message)) {
70: $object->message = $this->message;
71: }
72: if (!is_null($this->propertyName)) {
73: $object->propertyName = $this->propertyName;
74: }
75: if (!is_null($this->requestId)) {
76: $object->requestId = $this->requestId;
77: }
78: return $object;
79: }
80:
81: /**
82: * @param object $object
83: *
84: * @return $this
85: * @throws UnexpectedValueException
86: */
87: public function fromObject(object $object): APIError
88: {
89: parent::fromObject($object);
90: if (property_exists($object, 'category')) {
91: $this->category = $object->category;
92: }
93: if (property_exists($object, 'code')) {
94: $this->code = $object->code;
95: }
96: if (property_exists($object, 'httpStatusCode')) {
97: $this->httpStatusCode = $object->httpStatusCode;
98: }
99: if (property_exists($object, 'id')) {
100: $this->id = $object->id;
101: }
102: if (property_exists($object, 'message')) {
103: $this->message = $object->message;
104: }
105: if (property_exists($object, 'propertyName')) {
106: $this->propertyName = $object->propertyName;
107: }
108: if (property_exists($object, 'requestId')) {
109: $this->requestId = $object->requestId;
110: }
111: return $this;
112: }
113: }
114: