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:
10: /**
11: * @package Worldline\Connect\Sdk\V1\Domain
12: */
13: class BankTransferPayoutMethodSpecificInput extends AbstractPayoutMethodSpecificInput
14: {
15: /**
16: * @var BankAccountBban|null
17: */
18: public ?BankAccountBban $bankAccountBban = null;
19:
20: /**
21: * @var BankAccountIban|null
22: */
23: public ?BankAccountIban $bankAccountIban = null;
24:
25: /**
26: * @var PayoutCustomer|null
27: *
28: * @deprecated Moved to PayoutDetails
29: */
30: public ?PayoutCustomer $customer = null;
31:
32: /**
33: * @var string|null
34: */
35: public ?string $payoutDate = null;
36:
37: /**
38: * @var string|null
39: */
40: public ?string $payoutText = null;
41:
42: /**
43: * @var string|null
44: */
45: public ?string $swiftCode = null;
46:
47: /**
48: * @return object
49: */
50: public function toObject(): object
51: {
52: $object = parent::toObject();
53: if (!is_null($this->bankAccountBban)) {
54: $object->bankAccountBban = $this->bankAccountBban->toObject();
55: }
56: if (!is_null($this->bankAccountIban)) {
57: $object->bankAccountIban = $this->bankAccountIban->toObject();
58: }
59: if (!is_null($this->customer)) {
60: $object->customer = $this->customer->toObject();
61: }
62: if (!is_null($this->payoutDate)) {
63: $object->payoutDate = $this->payoutDate;
64: }
65: if (!is_null($this->payoutText)) {
66: $object->payoutText = $this->payoutText;
67: }
68: if (!is_null($this->swiftCode)) {
69: $object->swiftCode = $this->swiftCode;
70: }
71: return $object;
72: }
73:
74: /**
75: * @param object $object
76: *
77: * @return $this
78: * @throws UnexpectedValueException
79: */
80: public function fromObject(object $object): BankTransferPayoutMethodSpecificInput
81: {
82: parent::fromObject($object);
83: if (property_exists($object, 'bankAccountBban')) {
84: if (!is_object($object->bankAccountBban)) {
85: throw new UnexpectedValueException('value \'' . print_r($object->bankAccountBban, true) . '\' is not an object');
86: }
87: $value = new BankAccountBban();
88: $this->bankAccountBban = $value->fromObject($object->bankAccountBban);
89: }
90: if (property_exists($object, 'bankAccountIban')) {
91: if (!is_object($object->bankAccountIban)) {
92: throw new UnexpectedValueException('value \'' . print_r($object->bankAccountIban, true) . '\' is not an object');
93: }
94: $value = new BankAccountIban();
95: $this->bankAccountIban = $value->fromObject($object->bankAccountIban);
96: }
97: if (property_exists($object, 'customer')) {
98: if (!is_object($object->customer)) {
99: throw new UnexpectedValueException('value \'' . print_r($object->customer, true) . '\' is not an object');
100: }
101: $value = new PayoutCustomer();
102: $this->customer = $value->fromObject($object->customer);
103: }
104: if (property_exists($object, 'payoutDate')) {
105: $this->payoutDate = $object->payoutDate;
106: }
107: if (property_exists($object, 'payoutText')) {
108: $this->payoutText = $object->payoutText;
109: }
110: if (property_exists($object, 'swiftCode')) {
111: $this->swiftCode = $object->swiftCode;
112: }
113: return $this;
114: }
115: }
116: