<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CustomerPreferences implements \JsonSerializable { private $emailUnsubscribed; public function getEmailUnsubscribed(): ?bool { return $this->emailUnsubscribed; } public function setEmailUnsubscribed(?bool $emailUnsubscribed): void { $this->emailUnsubscribed = $emailUnsubscribed; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->emailUnsubscribed)) { $json['email_unsubscribed'] = $this->emailUnsubscribed; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 