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 Dispute extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $captureId = null;
20:
21: /**
22: * @var DisputeOutput|null
23: */
24: public ?DisputeOutput $disputeOutput = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $id = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $paymentId = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $status = null;
40:
41: /**
42: * @var DisputeStatusOutput|null
43: */
44: public ?DisputeStatusOutput $statusOutput = null;
45:
46: /**
47: * @return object
48: */
49: public function toObject(): object
50: {
51: $object = parent::toObject();
52: if (!is_null($this->captureId)) {
53: $object->captureId = $this->captureId;
54: }
55: if (!is_null($this->disputeOutput)) {
56: $object->disputeOutput = $this->disputeOutput->toObject();
57: }
58: if (!is_null($this->id)) {
59: $object->id = $this->id;
60: }
61: if (!is_null($this->paymentId)) {
62: $object->paymentId = $this->paymentId;
63: }
64: if (!is_null($this->status)) {
65: $object->status = $this->status;
66: }
67: if (!is_null($this->statusOutput)) {
68: $object->statusOutput = $this->statusOutput->toObject();
69: }
70: return $object;
71: }
72:
73: /**
74: * @param object $object
75: *
76: * @return $this
77: * @throws UnexpectedValueException
78: */
79: public function fromObject(object $object): Dispute
80: {
81: parent::fromObject($object);
82: if (property_exists($object, 'captureId')) {
83: $this->captureId = $object->captureId;
84: }
85: if (property_exists($object, 'disputeOutput')) {
86: if (!is_object($object->disputeOutput)) {
87: throw new UnexpectedValueException('value \'' . print_r($object->disputeOutput, true) . '\' is not an object');
88: }
89: $value = new DisputeOutput();
90: $this->disputeOutput = $value->fromObject($object->disputeOutput);
91: }
92: if (property_exists($object, 'id')) {
93: $this->id = $object->id;
94: }
95: if (property_exists($object, 'paymentId')) {
96: $this->paymentId = $object->paymentId;
97: }
98: if (property_exists($object, 'status')) {
99: $this->status = $object->status;
100: }
101: if (property_exists($object, 'statusOutput')) {
102: if (!is_object($object->statusOutput)) {
103: throw new UnexpectedValueException('value \'' . print_r($object->statusOutput, true) . '\' is not an object');
104: }
105: $value = new DisputeStatusOutput();
106: $this->statusOutput = $value->fromObject($object->statusOutput);
107: }
108: return $this;
109: }
110: }
111: