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 DisputeResponse extends DataObject
14: {
15: /**
16: * @var DisputeCaseWithEntries|null
17: */
18: public ?DisputeCaseWithEntries $dispute = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $requestId = null;
24:
25: /**
26: * @return object
27: */
28: public function toObject(): object
29: {
30: $object = parent::toObject();
31: if (!is_null($this->dispute)) {
32: $object->dispute = $this->dispute->toObject();
33: }
34: if (!is_null($this->requestId)) {
35: $object->requestId = $this->requestId;
36: }
37: return $object;
38: }
39:
40: /**
41: * @param object $object
42: *
43: * @return $this
44: * @throws UnexpectedValueException
45: */
46: public function fromObject(object $object): DisputeResponse
47: {
48: parent::fromObject($object);
49: if (property_exists($object, 'dispute')) {
50: if (!is_object($object->dispute)) {
51: throw new UnexpectedValueException('value \'' . print_r($object->dispute, true) . '\' is not an object');
52: }
53: $value = new DisputeCaseWithEntries();
54: $this->dispute = $value->fromObject($object->dispute);
55: }
56: if (property_exists($object, 'requestId')) {
57: $this->requestId = $object->requestId;
58: }
59: return $this;
60: }
61: }
62: