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 CustomerAccount extends DataObject
15: {
16: /**
17: * @var CustomerAccountAuthentication|null
18: */
19: public ?CustomerAccountAuthentication $authentication = null;
20:
21: /**
22: * @var string|null
23: */
24: public ?string $changeDate = null;
25:
26: /**
27: * @var bool|null
28: */
29: public ?bool $changedDuringCheckout = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $createDate = null;
35:
36: /**
37: * @var bool|null
38: */
39: public ?bool $hadSuspiciousActivity = null;
40:
41: /**
42: * @var bool|null
43: */
44: public ?bool $hasForgottenPassword = null;
45:
46: /**
47: * @var bool|null
48: */
49: public ?bool $hasPassword = null;
50:
51: /**
52: * @var string|null
53: */
54: public ?string $passwordChangeDate = null;
55:
56: /**
57: * @var bool|null
58: */
59: public ?bool $passwordChangedDuringCheckout = null;
60:
61: /**
62: * @var PaymentAccountOnFile|null
63: */
64: public ?PaymentAccountOnFile $paymentAccountOnFile = null;
65:
66: /**
67: * @var string|null
68: */
69: public ?string $paymentAccountOnFileType = null;
70:
71: /**
72: * @var CustomerPaymentActivity|null
73: */
74: public ?CustomerPaymentActivity $paymentActivity = null;
75:
76: /**
77: * @return object
78: */
79: public function toObject(): object
80: {
81: $object = parent::toObject();
82: if (!is_null($this->authentication)) {
83: $object->authentication = $this->authentication->toObject();
84: }
85: if (!is_null($this->changeDate)) {
86: $object->changeDate = $this->changeDate;
87: }
88: if (!is_null($this->changedDuringCheckout)) {
89: $object->changedDuringCheckout = $this->changedDuringCheckout;
90: }
91: if (!is_null($this->createDate)) {
92: $object->createDate = $this->createDate;
93: }
94: if (!is_null($this->hadSuspiciousActivity)) {
95: $object->hadSuspiciousActivity = $this->hadSuspiciousActivity;
96: }
97: if (!is_null($this->hasForgottenPassword)) {
98: $object->hasForgottenPassword = $this->hasForgottenPassword;
99: }
100: if (!is_null($this->hasPassword)) {
101: $object->hasPassword = $this->hasPassword;
102: }
103: if (!is_null($this->passwordChangeDate)) {
104: $object->passwordChangeDate = $this->passwordChangeDate;
105: }
106: if (!is_null($this->passwordChangedDuringCheckout)) {
107: $object->passwordChangedDuringCheckout = $this->passwordChangedDuringCheckout;
108: }
109: if (!is_null($this->paymentAccountOnFile)) {
110: $object->paymentAccountOnFile = $this->paymentAccountOnFile->toObject();
111: }
112: if (!is_null($this->paymentAccountOnFileType)) {
113: $object->paymentAccountOnFileType = $this->paymentAccountOnFileType;
114: }
115: if (!is_null($this->paymentActivity)) {
116: $object->paymentActivity = $this->paymentActivity->toObject();
117: }
118: return $object;
119: }
120:
121: /**
122: * @param object $object
123: *
124: * @return $this
125: * @throws UnexpectedValueException
126: */
127: public function fromObject(object $object): CustomerAccount
128: {
129: parent::fromObject($object);
130: if (property_exists($object, 'authentication')) {
131: if (!is_object($object->authentication)) {
132: throw new UnexpectedValueException('value \'' . print_r($object->authentication, true) . '\' is not an object');
133: }
134: $value = new CustomerAccountAuthentication();
135: $this->authentication = $value->fromObject($object->authentication);
136: }
137: if (property_exists($object, 'changeDate')) {
138: $this->changeDate = $object->changeDate;
139: }
140: if (property_exists($object, 'changedDuringCheckout')) {
141: $this->changedDuringCheckout = $object->changedDuringCheckout;
142: }
143: if (property_exists($object, 'createDate')) {
144: $this->createDate = $object->createDate;
145: }
146: if (property_exists($object, 'hadSuspiciousActivity')) {
147: $this->hadSuspiciousActivity = $object->hadSuspiciousActivity;
148: }
149: if (property_exists($object, 'hasForgottenPassword')) {
150: $this->hasForgottenPassword = $object->hasForgottenPassword;
151: }
152: if (property_exists($object, 'hasPassword')) {
153: $this->hasPassword = $object->hasPassword;
154: }
155: if (property_exists($object, 'passwordChangeDate')) {
156: $this->passwordChangeDate = $object->passwordChangeDate;
157: }
158: if (property_exists($object, 'passwordChangedDuringCheckout')) {
159: $this->passwordChangedDuringCheckout = $object->passwordChangedDuringCheckout;
160: }
161: if (property_exists($object, 'paymentAccountOnFile')) {
162: if (!is_object($object->paymentAccountOnFile)) {
163: throw new UnexpectedValueException('value \'' . print_r($object->paymentAccountOnFile, true) . '\' is not an object');
164: }
165: $value = new PaymentAccountOnFile();
166: $this->paymentAccountOnFile = $value->fromObject($object->paymentAccountOnFile);
167: }
168: if (property_exists($object, 'paymentAccountOnFileType')) {
169: $this->paymentAccountOnFileType = $object->paymentAccountOnFileType;
170: }
171: if (property_exists($object, 'paymentActivity')) {
172: if (!is_object($object->paymentActivity)) {
173: throw new UnexpectedValueException('value \'' . print_r($object->paymentActivity, true) . '\' is not an object');
174: }
175: $value = new CustomerPaymentActivity();
176: $this->paymentActivity = $value->fromObject($object->paymentActivity);
177: }
178: return $this;
179: }
180: }
181: