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 OrderLineDetails extends DataObject
15: {
16: /**
17: * @var int|null
18: */
19: public ?int $discountAmount = null;
20:
21: /**
22: * @var int|null
23: */
24: public ?int $googleProductCategoryId = null;
25:
26: /**
27: * @var int|null
28: */
29: public ?int $lineAmountTotal = null;
30:
31: /**
32: * @var string|null
33: */
34: public ?string $naicsCommodityCode = null;
35:
36: /**
37: * @var string|null
38: */
39: public ?string $productCategory = null;
40:
41: /**
42: * @var string|null
43: */
44: public ?string $productCode = null;
45:
46: /**
47: * @var string|null
48: */
49: public ?string $productImageUrl = null;
50:
51: /**
52: * @var string|null
53: */
54: public ?string $productName = null;
55:
56: /**
57: * @var int|null
58: */
59: public ?int $productPrice = null;
60:
61: /**
62: * @var string|null
63: */
64: public ?string $productSku = null;
65:
66: /**
67: * @var string|null
68: */
69: public ?string $productType = null;
70:
71: /**
72: * @var string|null
73: */
74: public ?string $productUrl = null;
75:
76: /**
77: * @var int|null
78: */
79: public ?int $quantity = null;
80:
81: /**
82: * @var int|null
83: */
84: public ?int $taxAmount = null;
85:
86: /**
87: * @var string|null
88: */
89: public ?string $unit = null;
90:
91: /**
92: * @return object
93: */
94: public function toObject(): object
95: {
96: $object = parent::toObject();
97: if (!is_null($this->discountAmount)) {
98: $object->discountAmount = $this->discountAmount;
99: }
100: if (!is_null($this->googleProductCategoryId)) {
101: $object->googleProductCategoryId = $this->googleProductCategoryId;
102: }
103: if (!is_null($this->lineAmountTotal)) {
104: $object->lineAmountTotal = $this->lineAmountTotal;
105: }
106: if (!is_null($this->naicsCommodityCode)) {
107: $object->naicsCommodityCode = $this->naicsCommodityCode;
108: }
109: if (!is_null($this->productCategory)) {
110: $object->productCategory = $this->productCategory;
111: }
112: if (!is_null($this->productCode)) {
113: $object->productCode = $this->productCode;
114: }
115: if (!is_null($this->productImageUrl)) {
116: $object->productImageUrl = $this->productImageUrl;
117: }
118: if (!is_null($this->productName)) {
119: $object->productName = $this->productName;
120: }
121: if (!is_null($this->productPrice)) {
122: $object->productPrice = $this->productPrice;
123: }
124: if (!is_null($this->productSku)) {
125: $object->productSku = $this->productSku;
126: }
127: if (!is_null($this->productType)) {
128: $object->productType = $this->productType;
129: }
130: if (!is_null($this->productUrl)) {
131: $object->productUrl = $this->productUrl;
132: }
133: if (!is_null($this->quantity)) {
134: $object->quantity = $this->quantity;
135: }
136: if (!is_null($this->taxAmount)) {
137: $object->taxAmount = $this->taxAmount;
138: }
139: if (!is_null($this->unit)) {
140: $object->unit = $this->unit;
141: }
142: return $object;
143: }
144:
145: /**
146: * @param object $object
147: *
148: * @return $this
149: * @throws UnexpectedValueException
150: */
151: public function fromObject(object $object): OrderLineDetails
152: {
153: parent::fromObject($object);
154: if (property_exists($object, 'discountAmount')) {
155: $this->discountAmount = $object->discountAmount;
156: }
157: if (property_exists($object, 'googleProductCategoryId')) {
158: $this->googleProductCategoryId = $object->googleProductCategoryId;
159: }
160: if (property_exists($object, 'lineAmountTotal')) {
161: $this->lineAmountTotal = $object->lineAmountTotal;
162: }
163: if (property_exists($object, 'naicsCommodityCode')) {
164: $this->naicsCommodityCode = $object->naicsCommodityCode;
165: }
166: if (property_exists($object, 'productCategory')) {
167: $this->productCategory = $object->productCategory;
168: }
169: if (property_exists($object, 'productCode')) {
170: $this->productCode = $object->productCode;
171: }
172: if (property_exists($object, 'productImageUrl')) {
173: $this->productImageUrl = $object->productImageUrl;
174: }
175: if (property_exists($object, 'productName')) {
176: $this->productName = $object->productName;
177: }
178: if (property_exists($object, 'productPrice')) {
179: $this->productPrice = $object->productPrice;
180: }
181: if (property_exists($object, 'productSku')) {
182: $this->productSku = $object->productSku;
183: }
184: if (property_exists($object, 'productType')) {
185: $this->productType = $object->productType;
186: }
187: if (property_exists($object, 'productUrl')) {
188: $this->productUrl = $object->productUrl;
189: }
190: if (property_exists($object, 'quantity')) {
191: $this->quantity = $object->quantity;
192: }
193: if (property_exists($object, 'taxAmount')) {
194: $this->taxAmount = $object->taxAmount;
195: }
196: if (property_exists($object, 'unit')) {
197: $this->unit = $object->unit;
198: }
199: return $this;
200: }
201: }
202: