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 ApiBalanceInquiryResponse extends DataObject
14: {
15: /**
16: * @var AdditionalResponseData|null
17: */
18: public ?AdditionalResponseData $additionalResponseData = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $authorizationCode = null;
24:
25: /**
26: * @var AmountData|null
27: */
28: public ?AmountData $availableAmount = null;
29:
30: /**
31: * @var CardPaymentDataForResponse|null
32: */
33: public ?CardPaymentDataForResponse $cardPaymentData = null;
34:
35: /**
36: * @var string|null
37: */
38: public ?string $operationId = null;
39:
40: /**
41: * @var ApiReferencesForResponses|null
42: */
43: public ?ApiReferencesForResponses $references = null;
44:
45: /**
46: * @var string|null
47: */
48: public ?string $responder = null;
49:
50: /**
51: * @var string|null
52: */
53: public ?string $responseCode = null;
54:
55: /**
56: * @var string|null
57: */
58: public ?string $responseCodeCategory = null;
59:
60: /**
61: * @var string|null
62: */
63: public ?string $responseCodeDescription = null;
64:
65: /**
66: * @return object
67: */
68: public function toObject(): object
69: {
70: $object = parent::toObject();
71: if (!is_null($this->additionalResponseData)) {
72: $object->additionalResponseData = $this->additionalResponseData->toObject();
73: }
74: if (!is_null($this->authorizationCode)) {
75: $object->authorizationCode = $this->authorizationCode;
76: }
77: if (!is_null($this->availableAmount)) {
78: $object->availableAmount = $this->availableAmount->toObject();
79: }
80: if (!is_null($this->cardPaymentData)) {
81: $object->cardPaymentData = $this->cardPaymentData->toObject();
82: }
83: if (!is_null($this->operationId)) {
84: $object->operationId = $this->operationId;
85: }
86: if (!is_null($this->references)) {
87: $object->references = $this->references->toObject();
88: }
89: if (!is_null($this->responder)) {
90: $object->responder = $this->responder;
91: }
92: if (!is_null($this->responseCode)) {
93: $object->responseCode = $this->responseCode;
94: }
95: if (!is_null($this->responseCodeCategory)) {
96: $object->responseCodeCategory = $this->responseCodeCategory;
97: }
98: if (!is_null($this->responseCodeDescription)) {
99: $object->responseCodeDescription = $this->responseCodeDescription;
100: }
101: return $object;
102: }
103:
104: /**
105: * @param object $object
106: *
107: * @return $this
108: * @throws UnexpectedValueException
109: */
110: public function fromObject(object $object): ApiBalanceInquiryResponse
111: {
112: parent::fromObject($object);
113: if (property_exists($object, 'additionalResponseData')) {
114: if (!is_object($object->additionalResponseData)) {
115: throw new UnexpectedValueException('value \'' . print_r($object->additionalResponseData, true) . '\' is not an object');
116: }
117: $value = new AdditionalResponseData();
118: $this->additionalResponseData = $value->fromObject($object->additionalResponseData);
119: }
120: if (property_exists($object, 'authorizationCode')) {
121: $this->authorizationCode = $object->authorizationCode;
122: }
123: if (property_exists($object, 'availableAmount')) {
124: if (!is_object($object->availableAmount)) {
125: throw new UnexpectedValueException('value \'' . print_r($object->availableAmount, true) . '\' is not an object');
126: }
127: $value = new AmountData();
128: $this->availableAmount = $value->fromObject($object->availableAmount);
129: }
130: if (property_exists($object, 'cardPaymentData')) {
131: if (!is_object($object->cardPaymentData)) {
132: throw new UnexpectedValueException('value \'' . print_r($object->cardPaymentData, true) . '\' is not an object');
133: }
134: $value = new CardPaymentDataForResponse();
135: $this->cardPaymentData = $value->fromObject($object->cardPaymentData);
136: }
137: if (property_exists($object, 'operationId')) {
138: $this->operationId = $object->operationId;
139: }
140: if (property_exists($object, 'references')) {
141: if (!is_object($object->references)) {
142: throw new UnexpectedValueException('value \'' . print_r($object->references, true) . '\' is not an object');
143: }
144: $value = new ApiReferencesForResponses();
145: $this->references = $value->fromObject($object->references);
146: }
147: if (property_exists($object, 'responder')) {
148: $this->responder = $object->responder;
149: }
150: if (property_exists($object, 'responseCode')) {
151: $this->responseCode = $object->responseCode;
152: }
153: if (property_exists($object, 'responseCodeCategory')) {
154: $this->responseCodeCategory = $object->responseCodeCategory;
155: }
156: if (property_exists($object, 'responseCodeDescription')) {
157: $this->responseCodeDescription = $object->responseCodeDescription;
158: }
159: return $this;
160: }
161: }
162: