<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class RetrieveGiftCardResponse implements \JsonSerializable { private $errors; private $giftCard; public function getErrors(): ?array { return $this->errors; } public function setErrors(?array $errors): void { $this->errors = $errors; } public function getGiftCard(): ?GiftCard { return $this->giftCard; } public function setGiftCard(?GiftCard $giftCard): void { $this->giftCard = $giftCard; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->errors)) { $json['errors'] = $this->errors; } if (isset($this->giftCard)) { $json['gift_card'] = $this->giftCard; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 