1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8:
9: /**
10: * @package Worldline\Acquiring\Sdk\V1\Domain
11: */
12: class ApiReversalResponse extends ApiActionResponse
13: {
14: /**
15: * @var AmountData|null
16: */
17: public ?AmountData $totalAuthorizedAmount = null;
18:
19: /**
20: * @return object
21: */
22: public function toObject(): object
23: {
24: $object = parent::toObject();
25: if (!is_null($this->totalAuthorizedAmount)) {
26: $object->totalAuthorizedAmount = $this->totalAuthorizedAmount->toObject();
27: }
28: return $object;
29: }
30:
31: /**
32: * @param object $object
33: *
34: * @return $this
35: * @throws UnexpectedValueException
36: */
37: public function fromObject(object $object): ApiReversalResponse
38: {
39: parent::fromObject($object);
40: if (property_exists($object, 'totalAuthorizedAmount')) {
41: if (!is_object($object->totalAuthorizedAmount)) {
42: throw new UnexpectedValueException('value \'' . print_r($object->totalAuthorizedAmount, true) . '\' is not an object');
43: }
44: $value = new AmountData();
45: $this->totalAuthorizedAmount = $value->fromObject($object->totalAuthorizedAmount);
46: }
47: return $this;
48: }
49: }
50: