<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class V1Money implements \JsonSerializable { private $amount; private $currencyCode; public function getAmount(): ?int { return $this->amount; } public function setAmount(?int $amount): void { $this->amount = $amount; } public function getCurrencyCode(): ?string { return $this->currencyCode; } public function setCurrencyCode(?string $currencyCode): void { $this->currencyCode = $currencyCode; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->amount)) { $json['amount'] = $this->amount; } if (isset($this->currencyCode)) { $json['currency_code'] = $this->currencyCode; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 