<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class RetrieveGiftCardFromNonceRequest implements \JsonSerializable { private $nonce; public function __construct(string $nonce) { $this->nonce = $nonce; } public function getNonce(): string { return $this->nonce; } public function setNonce(string $nonce): void { $this->nonce = $nonce; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['nonce'] = $this->nonce; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 