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 LineItemLevel3InterchangeInformation extends DataObject
15: {
16: /**
17: * @var int|null
18: */
19: public ?int $discountAmount = null;
20:
21: /**
22: * @var int|null
23: */
24: public ?int $lineAmountTotal = null;
25:
26: /**
27: * @var string|null
28: */
29: public ?string $productCode = null;
30:
31: /**
32: * @var int|null
33: */
34: public ?int $productPrice = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $productType = null;
40:
41: /**
42: * @var int|null
43: */
44: public ?int $quantity = null;
45:
46: /**
47: * @var int|null
48: */
49: public ?int $taxAmount = null;
50:
51: /**
52: * @var string|null
53: */
54: public ?string $unit = null;
55:
56: /**
57: * @return object
58: */
59: public function toObject(): object
60: {
61: $object = parent::toObject();
62: if (!is_null($this->discountAmount)) {
63: $object->discountAmount = $this->discountAmount;
64: }
65: if (!is_null($this->lineAmountTotal)) {
66: $object->lineAmountTotal = $this->lineAmountTotal;
67: }
68: if (!is_null($this->productCode)) {
69: $object->productCode = $this->productCode;
70: }
71: if (!is_null($this->productPrice)) {
72: $object->productPrice = $this->productPrice;
73: }
74: if (!is_null($this->productType)) {
75: $object->productType = $this->productType;
76: }
77: if (!is_null($this->quantity)) {
78: $object->quantity = $this->quantity;
79: }
80: if (!is_null($this->taxAmount)) {
81: $object->taxAmount = $this->taxAmount;
82: }
83: if (!is_null($this->unit)) {
84: $object->unit = $this->unit;
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): LineItemLevel3InterchangeInformation
96: {
97: parent::fromObject($object);
98: if (property_exists($object, 'discountAmount')) {
99: $this->discountAmount = $object->discountAmount;
100: }
101: if (property_exists($object, 'lineAmountTotal')) {
102: $this->lineAmountTotal = $object->lineAmountTotal;
103: }
104: if (property_exists($object, 'productCode')) {
105: $this->productCode = $object->productCode;
106: }
107: if (property_exists($object, 'productPrice')) {
108: $this->productPrice = $object->productPrice;
109: }
110: if (property_exists($object, 'productType')) {
111: $this->productType = $object->productType;
112: }
113: if (property_exists($object, 'quantity')) {
114: $this->quantity = $object->quantity;
115: }
116: if (property_exists($object, 'taxAmount')) {
117: $this->taxAmount = $object->taxAmount;
118: }
119: if (property_exists($object, 'unit')) {
120: $this->unit = $object->unit;
121: }
122: return $this;
123: }
124: }
125: