<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogDiscount implements \JsonSerializable { private $name; private $discountType; private $percentage; private $amountMoney; private $pinRequired; private $labelColor; private $modifyTaxBasis; private $maximumAmountMoney; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getDiscountType(): ?string { return $this->discountType; } public function setDiscountType(?string $discountType): void { $this->discountType = $discountType; } 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 getPinRequired(): ?bool { return $this->pinRequired; } public function setPinRequired(?bool $pinRequired): void { $this->pinRequired = $pinRequired; } public function getLabelColor(): ?string { return $this->labelColor; } public function setLabelColor(?string $labelColor): void { $this->labelColor = $labelColor; } public function getModifyTaxBasis(): ?string { return $this->modifyTaxBasis; } public function setModifyTaxBasis(?string $modifyTaxBasis): void { $this->modifyTaxBasis = $modifyTaxBasis; } public function getMaximumAmountMoney(): ?Money { return $this->maximumAmountMoney; } public function setMaximumAmountMoney(?Money $maximumAmountMoney): void { $this->maximumAmountMoney = $maximumAmountMoney; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->discountType)) { $json['discount_type'] = $this->discountType; } if (isset($this->percentage)) { $json['percentage'] = $this->percentage; } if (isset($this->amountMoney)) { $json['amount_money'] = $this->amountMoney; } if (isset($this->pinRequired)) { $json['pin_required'] = $this->pinRequired; } if (isset($this->labelColor)) { $json['label_color'] = $this->labelColor; } if (isset($this->modifyTaxBasis)) { $json['modify_tax_basis'] = $this->modifyTaxBasis; } if (isset($this->maximumAmountMoney)) { $json['maximum_amount_money'] = $this->maximumAmountMoney; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 