<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class OrderServiceCharge implements \JsonSerializable { private $uid; private $name; private $catalogObjectId; private $catalogVersion; private $percentage; private $amountMoney; private $appliedMoney; private $totalMoney; private $totalTaxMoney; private $calculationPhase; private $taxable; private $appliedTaxes; private $metadata; private $type; public function getUid(): ?string { return $this->uid; } public function setUid(?string $uid): void { $this->uid = $uid; } public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } 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 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 getTotalMoney(): ?Money { return $this->totalMoney; } public function setTotalMoney(?Money $totalMoney): void { $this->totalMoney = $totalMoney; } public function getTotalTaxMoney(): ?Money { return $this->totalTaxMoney; } public function setTotalTaxMoney(?Money $totalTaxMoney): void { $this->totalTaxMoney = $totalTaxMoney; } public function getCalculationPhase(): ?string { return $this->calculationPhase; } public function setCalculationPhase(?string $calculationPhase): void { $this->calculationPhase = $calculationPhase; } public function getTaxable(): ?bool { return $this->taxable; } public function setTaxable(?bool $taxable): void { $this->taxable = $taxable; } public function getAppliedTaxes(): ?array { return $this->appliedTaxes; } public function setAppliedTaxes(?array $appliedTaxes): void { $this->appliedTaxes = $appliedTaxes; } public function getMetadata(): ?array { return $this->metadata; } public function setMetadata(?array $metadata): void { $this->metadata = $metadata; } public function getType(): ?string { return $this->type; } public function setType(?string $type): void { $this->type = $type; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->uid)) { $json['uid'] = $this->uid; } if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->catalogObjectId)) { $json['catalog_object_id'] = $this->catalogObjectId; } if (isset($this->catalogVersion)) { $json['catalog_version'] = $this->catalogVersion; } 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->totalMoney)) { $json['total_money'] = $this->totalMoney; } if (isset($this->totalTaxMoney)) { $json['total_tax_money'] = $this->totalTaxMoney; } if (isset($this->calculationPhase)) { $json['calculation_phase'] = $this->calculationPhase; } if (isset($this->taxable)) { $json['taxable'] = $this->taxable; } if (isset($this->appliedTaxes)) { $json['applied_taxes'] = $this->appliedTaxes; } if (isset($this->metadata)) { $json['metadata'] = $this->metadata; } if (isset($this->type)) { $json['type'] = $this->type; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 