<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyProgramAccrualRuleSpendData implements \JsonSerializable { private $amountMoney; private $excludedCategoryIds; private $excludedItemVariationIds; private $taxMode; public function __construct(Money $amountMoney, string $taxMode) { $this->amountMoney = $amountMoney; $this->taxMode = $taxMode; } public function getAmountMoney(): Money { return $this->amountMoney; } public function setAmountMoney(Money $amountMoney): void { $this->amountMoney = $amountMoney; } public function getExcludedCategoryIds(): ?array { return $this->excludedCategoryIds; } public function setExcludedCategoryIds(?array $excludedCategoryIds): void { $this->excludedCategoryIds = $excludedCategoryIds; } public function getExcludedItemVariationIds(): ?array { return $this->excludedItemVariationIds; } public function setExcludedItemVariationIds(?array $excludedItemVariationIds): void { $this->excludedItemVariationIds = $excludedItemVariationIds; } public function getTaxMode(): string { return $this->taxMode; } public function setTaxMode(string $taxMode): void { $this->taxMode = $taxMode; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['amount_money'] = $this->amountMoney; if (isset($this->excludedCategoryIds)) { $json['excluded_category_ids'] = $this->excludedCategoryIds; } if (isset($this->excludedItemVariationIds)) { $json['excluded_item_variation_ids'] = $this->excludedItemVariationIds; } $json['tax_mode'] = $this->taxMode; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 