<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class OrderReturn implements \JsonSerializable { private $uid; private $sourceOrderId; private $returnLineItems; private $returnServiceCharges; private $returnTaxes; private $returnDiscounts; private $roundingAdjustment; private $returnAmounts; public function getUid(): ?string { return $this->uid; } public function setUid(?string $uid): void { $this->uid = $uid; } public function getSourceOrderId(): ?string { return $this->sourceOrderId; } public function setSourceOrderId(?string $sourceOrderId): void { $this->sourceOrderId = $sourceOrderId; } public function getReturnLineItems(): ?array { return $this->returnLineItems; } public function setReturnLineItems(?array $returnLineItems): void { $this->returnLineItems = $returnLineItems; } public function getReturnServiceCharges(): ?array { return $this->returnServiceCharges; } public function setReturnServiceCharges(?array $returnServiceCharges): void { $this->returnServiceCharges = $returnServiceCharges; } public function getReturnTaxes(): ?array { return $this->returnTaxes; } public function setReturnTaxes(?array $returnTaxes): void { $this->returnTaxes = $returnTaxes; } public function getReturnDiscounts(): ?array { return $this->returnDiscounts; } public function setReturnDiscounts(?array $returnDiscounts): void { $this->returnDiscounts = $returnDiscounts; } public function getRoundingAdjustment(): ?OrderRoundingAdjustment { return $this->roundingAdjustment; } public function setRoundingAdjustment(?OrderRoundingAdjustment $roundingAdjustment): void { $this->roundingAdjustment = $roundingAdjustment; } public function getReturnAmounts(): ?OrderMoneyAmounts { return $this->returnAmounts; } public function setReturnAmounts(?OrderMoneyAmounts $returnAmounts): void { $this->returnAmounts = $returnAmounts; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->uid)) { $json['uid'] = $this->uid; } if (isset($this->sourceOrderId)) { $json['source_order_id'] = $this->sourceOrderId; } if (isset($this->returnLineItems)) { $json['return_line_items'] = $this->returnLineItems; } if (isset($this->returnServiceCharges)) { $json['return_service_charges'] = $this->returnServiceCharges; } if (isset($this->returnTaxes)) { $json['return_taxes'] = $this->returnTaxes; } if (isset($this->returnDiscounts)) { $json['return_discounts'] = $this->returnDiscounts; } if (isset($this->roundingAdjustment)) { $json['rounding_adjustment'] = $this->roundingAdjustment; } if (isset($this->returnAmounts)) { $json['return_amounts'] = $this->returnAmounts; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 