1: <?php
2: /*
3: * This file was automatically generated.
4: */
5: namespace Worldline\Acquiring\Sdk\V1\Domain;
6:
7: use UnexpectedValueException;
8: use Worldline\Acquiring\Sdk\Domain\DataObject;
9:
10: /**
11: * @package Worldline\Acquiring\Sdk\V1\Domain
12: */
13: class ServiceLocationAddress extends DataObject
14: {
15: /**
16: * @var string|null
17: */
18: public ?string $city = null;
19:
20: /**
21: * @var string|null
22: */
23: public ?string $countryCode = null;
24:
25: /**
26: * @var string|null
27: */
28: public ?string $countrySubdivisionCode = null;
29:
30: /**
31: * @var string|null
32: */
33: public ?string $postalCode = null;
34:
35: /**
36: * @return object
37: */
38: public function toObject(): object
39: {
40: $object = parent::toObject();
41: if (!is_null($this->city)) {
42: $object->city = $this->city;
43: }
44: if (!is_null($this->countryCode)) {
45: $object->countryCode = $this->countryCode;
46: }
47: if (!is_null($this->countrySubdivisionCode)) {
48: $object->countrySubdivisionCode = $this->countrySubdivisionCode;
49: }
50: if (!is_null($this->postalCode)) {
51: $object->postalCode = $this->postalCode;
52: }
53: return $object;
54: }
55:
56: /**
57: * @param object $object
58: *
59: * @return $this
60: * @throws UnexpectedValueException
61: */
62: public function fromObject(object $object): ServiceLocationAddress
63: {
64: parent::fromObject($object);
65: if (property_exists($object, 'city')) {
66: $this->city = $object->city;
67: }
68: if (property_exists($object, 'countryCode')) {
69: $this->countryCode = $object->countryCode;
70: }
71: if (property_exists($object, 'countrySubdivisionCode')) {
72: $this->countrySubdivisionCode = $object->countrySubdivisionCode;
73: }
74: if (property_exists($object, 'postalCode')) {
75: $this->postalCode = $object->postalCode;
76: }
77: return $this;
78: }
79: }
80: