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 Address extends DataObject
15: {
16: /**
17: * @var string|null
18: */
19: public ?string $additionalInfo = 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 $houseNumber = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $state = null;
40:
41: /**
42: * @var string|null
43: */
44: public ?string $stateCode = null;
45:
46: /**
47: * @var string|null
48: */
49: public ?string $street = null;
50:
51: /**
52: * @var string|null
53: */
54: public ?string $zip = null;
55:
56: /**
57: * @return object
58: */
59: public function toObject(): object
60: {
61: $object = parent::toObject();
62: if (!is_null($this->additionalInfo)) {
63: $object->additionalInfo = $this->additionalInfo;
64: }
65: if (!is_null($this->city)) {
66: $object->city = $this->city;
67: }
68: if (!is_null($this->countryCode)) {
69: $object->countryCode = $this->countryCode;
70: }
71: if (!is_null($this->houseNumber)) {
72: $object->houseNumber = $this->houseNumber;
73: }
74: if (!is_null($this->state)) {
75: $object->state = $this->state;
76: }
77: if (!is_null($this->stateCode)) {
78: $object->stateCode = $this->stateCode;
79: }
80: if (!is_null($this->street)) {
81: $object->street = $this->street;
82: }
83: if (!is_null($this->zip)) {
84: $object->zip = $this->zip;
85: }
86: return $object;
87: }
88:
89: /**
90: * @param object $object
91: *
92: * @return $this
93: * @throws UnexpectedValueException
94: */
95: public function fromObject(object $object): Address
96: {
97: parent::fromObject($object);
98: if (property_exists($object, 'additionalInfo')) {
99: $this->additionalInfo = $object->additionalInfo;
100: }
101: if (property_exists($object, 'city')) {
102: $this->city = $object->city;
103: }
104: if (property_exists($object, 'countryCode')) {
105: $this->countryCode = $object->countryCode;
106: }
107: if (property_exists($object, 'houseNumber')) {
108: $this->houseNumber = $object->houseNumber;
109: }
110: if (property_exists($object, 'state')) {
111: $this->state = $object->state;
112: }
113: if (property_exists($object, 'stateCode')) {
114: $this->stateCode = $object->stateCode;
115: }
116: if (property_exists($object, 'street')) {
117: $this->street = $object->street;
118: }
119: if (property_exists($object, 'zip')) {
120: $this->zip = $object->zip;
121: }
122: return $this;
123: }
124: }
125: