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