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