<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class OrderReturnDiscount implements \JsonSerializable { private $uid; private $sourceDiscountUid; private $catalogObjectId; private $catalogVersion; private $name; private $type; private $percentage; private $amountMoney; private $appliedMoney; private $scope; public function getUid(): ?string { return $this->uid; } public function setUid(?string $uid): void { $this->uid = $uid; } public function getSourceDiscountUid(): ?string { return $this->sourceDiscountUid; } public function setSourceDiscountUid(?string $sourceDiscountUid): void { $this->sourceDiscountUid = $sourceDiscountUid; } public function getCatalogObjectId(): ?string { return $this->catalogObjectId; } public function setCatalogObjectId(?string $catalogObjectId): void { $this->catalogObjectId = $catalogObjectId; } public function getCatalogVersion(): ?int { return $this->catalogVersion; } public function setCatalogVersion(?int $catalogVersion): void { $this->catalogVersion = $catalogVersion; } public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getType(): ?string { return $this->type; } public function setType(?string $type): void { $this->type = $type; } public function getPercentage(): ?string { return $this->percentage; } public function setPercentage(?string $percentage): void { $this->percentage = $percentage; } public function getAmountMoney(): ?Money { return $this->amountMoney; } public function setAmountMoney(?Money $amountMoney): void { $this->amountMoney = $amountMoney; } public function getAppliedMoney(): ?Money { return $this->appliedMoney; } public function setAppliedMoney(?Money $appliedMoney): void { $this->appliedMoney = $appliedMoney; } public function getScope(): ?string { return $this->scope; } public function setScope(?string $scope): void { $this->scope = $scope; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->uid)) { $json['uid'] = $this->uid; } if (isset($this->sourceDiscountUid)) { $json['source_discount_uid'] = $this->sourceDiscountUid; } if (isset($this->catalogObjectId)) { $json['catalog_object_id'] = $this->catalogObjectId; } if (isset($this->catalogVersion)) { $json['catalog_version'] = $this->catalogVersion; } if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->type)) { $json['type'] = $this->type; } if (isset($this->percentage)) { $json['percentage'] = $this->percentage; } if (isset($this->amountMoney)) { $json['amount_money'] = $this->amountMoney; } if (isset($this->appliedMoney)) { $json['applied_money'] = $this->appliedMoney; } if (isset($this->scope)) { $json['scope'] = $this->scope; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 