<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class OrderRoundingAdjustment implements \JsonSerializable { private $uid; private $name; private $amountMoney; public function getUid(): ?string { return $this->uid; } public function setUid(?string $uid): void { $this->uid = $uid; } public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getAmountMoney(): ?Money { return $this->amountMoney; } public function setAmountMoney(?Money $amountMoney): void { $this->amountMoney = $amountMoney; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->uid)) { $json['uid'] = $this->uid; } if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->amountMoney)) { $json['amount_money'] = $this->amountMoney; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 