<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class OrderLineItemAppliedDiscount implements \JsonSerializable { private $uid; private $discountUid; private $appliedMoney; public function __construct(string $discountUid) { $this->discountUid = $discountUid; } public function getUid(): ?string { return $this->uid; } public function setUid(?string $uid): void { $this->uid = $uid; } public function getDiscountUid(): string { return $this->discountUid; } public function setDiscountUid(string $discountUid): void { $this->discountUid = $discountUid; } public function getAppliedMoney(): ?Money { return $this->appliedMoney; } public function setAppliedMoney(?Money $appliedMoney): void { $this->appliedMoney = $appliedMoney; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->uid)) { $json['uid'] = $this->uid; } $json['discount_uid'] = $this->discountUid; if (isset($this->appliedMoney)) { $json['applied_money'] = $this->appliedMoney; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 