<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogTax implements \JsonSerializable { private $name; private $calculationPhase; private $inclusionType; private $percentage; private $appliesToCustomAmounts; private $enabled; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getCalculationPhase(): ?string { return $this->calculationPhase; } public function setCalculationPhase(?string $calculationPhase): void { $this->calculationPhase = $calculationPhase; } public function getInclusionType(): ?string { return $this->inclusionType; } public function setInclusionType(?string $inclusionType): void { $this->inclusionType = $inclusionType; } public function getPercentage(): ?string { return $this->percentage; } public function setPercentage(?string $percentage): void { $this->percentage = $percentage; } public function getAppliesToCustomAmounts(): ?bool { return $this->appliesToCustomAmounts; } public function setAppliesToCustomAmounts(?bool $appliesToCustomAmounts): void { $this->appliesToCustomAmounts = $appliesToCustomAmounts; } public function getEnabled(): ?bool { return $this->enabled; } public function setEnabled(?bool $enabled): void { $this->enabled = $enabled; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->calculationPhase)) { $json['calculation_phase'] = $this->calculationPhase; } if (isset($this->inclusionType)) { $json['inclusion_type'] = $this->inclusionType; } if (isset($this->percentage)) { $json['percentage'] = $this->percentage; } if (isset($this->appliesToCustomAmounts)) { $json['applies_to_custom_amounts'] = $this->appliesToCustomAmounts; } if (isset($this->enabled)) { $json['enabled'] = $this->enabled; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 