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: * @deprecated Use ShoppingCart.amountBreakdown instead
15: */
16: class Level3SummaryData extends DataObject
17: {
18: /**
19: * @var int|null
20: *
21: * @deprecated Use ShoppingCart.amountBreakdown with type DISCOUNT instead
22: */
23: public ?int $discountAmount = null;
24:
25: /**
26: * @var int|null
27: *
28: * @deprecated Use ShoppingCart.amountBreakdown with type DUTY instead
29: */
30: public ?int $dutyAmount = null;
31:
32: /**
33: * @var int|null
34: *
35: * @deprecated Use ShoppingCart.amountBreakdown with type SHIPPING instead
36: */
37: public ?int $shippingAmount = null;
38:
39: /**
40: * @return object
41: */
42: public function toObject(): object
43: {
44: $object = parent::toObject();
45: if (!is_null($this->discountAmount)) {
46: $object->discountAmount = $this->discountAmount;
47: }
48: if (!is_null($this->dutyAmount)) {
49: $object->dutyAmount = $this->dutyAmount;
50: }
51: if (!is_null($this->shippingAmount)) {
52: $object->shippingAmount = $this->shippingAmount;
53: }
54: return $object;
55: }
56:
57: /**
58: * @param object $object
59: *
60: * @return $this
61: * @throws UnexpectedValueException
62: */
63: public function fromObject(object $object): Level3SummaryData
64: {
65: parent::fromObject($object);
66: if (property_exists($object, 'discountAmount')) {
67: $this->discountAmount = $object->discountAmount;
68: }
69: if (property_exists($object, 'dutyAmount')) {
70: $this->dutyAmount = $object->dutyAmount;
71: }
72: if (property_exists($object, 'shippingAmount')) {
73: $this->shippingAmount = $object->shippingAmount;
74: }
75: return $this;
76: }
77: }
78: