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 CaptureStatusOutput extends DataObject
15: {
16: /**
17: * @var bool
18: */
19: public $isRetriable = null;
20:
21: /**
22: * @var KeyValuePair[]
23: */
24: public $providerRawOutput = null;
25:
26: /**
27: * @var int
28: */
29: public $statusCode = null;
30:
31: /**
32: * @return object
33: */
34: public function toObject()
35: {
36: $object = parent::toObject();
37: if (!is_null($this->isRetriable)) {
38: $object->isRetriable = $this->isRetriable;
39: }
40: if (!is_null($this->providerRawOutput)) {
41: $object->providerRawOutput = [];
42: foreach ($this->providerRawOutput as $element) {
43: if (!is_null($element)) {
44: $object->providerRawOutput[] = $element->toObject();
45: }
46: }
47: }
48: if (!is_null($this->statusCode)) {
49: $object->statusCode = $this->statusCode;
50: }
51: return $object;
52: }
53:
54: /**
55: * @param object $object
56: * @return $this
57: * @throws UnexpectedValueException
58: */
59: public function fromObject($object)
60: {
61: parent::fromObject($object);
62: if (property_exists($object, 'isRetriable')) {
63: $this->isRetriable = $object->isRetriable;
64: }
65: if (property_exists($object, 'providerRawOutput')) {
66: if (!is_array($object->providerRawOutput) && !is_object($object->providerRawOutput)) {
67: throw new UnexpectedValueException('value \'' . print_r($object->providerRawOutput, true) . '\' is not an array or object');
68: }
69: $this->providerRawOutput = [];
70: foreach ($object->providerRawOutput as $element) {
71: $value = new KeyValuePair();
72: $this->providerRawOutput[] = $value->fromObject($element);
73: }
74: }
75: if (property_exists($object, 'statusCode')) {
76: $this->statusCode = $object->statusCode;
77: }
78: return $this;
79: }
80: }
81: