1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class ApiPaymentErrorResponse extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $detail = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $instance = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $requestId = null;
29:
30: /**
31: * @var int|null
32: */
33: public ?int $status = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $title = null;
39:
40: /**
41: * @var string|null
42: */
43: public ?string $type = null;
44:
45: /**
46: * @return object
47: */
48: public function toObject(): object
49: {
50: $object = parent::toObject();
51: if (!is_null($this->detail)) {
52: $object->detail = $this->detail;
53: }
54: if (!is_null($this->instance)) {
55: $object->instance = $this->instance;
56: }
57: if (!is_null($this->requestId)) {
58: $object->requestId = $this->requestId;
59: }
60: if (!is_null($this->status)) {
61: $object->status = $this->status;
62: }
63: if (!is_null($this->title)) {
64: $object->title = $this->title;
65: }
66: if (!is_null($this->type)) {
67: $object->type = $this->type;
68: }
69: return $object;
70: }
71:
72: /**
73: * @param object $object
74: *
75: * @return $this
76: * @throws UnexpectedValueException
77: */
78: public function fromObject(object $object): ApiPaymentErrorResponse
79: {
80: parent::fromObject($object);
81: if (property_exists($object, 'detail')) {
82: $this->detail = $object->detail;
83: }
84: if (property_exists($object, 'instance')) {
85: $this->instance = $object->instance;
86: }
87: if (property_exists($object, 'requestId')) {
88: $this->requestId = $object->requestId;
89: }
90: if (property_exists($object, 'status')) {
91: $this->status = $object->status;
92: }
93: if (property_exists($object, 'title')) {
94: $this->title = $object->title;
95: }
96: if (property_exists($object, 'type')) {
97: $this->type = $object->type;
98: }
99: return $this;
100: }
101: }
102: