<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class PrePopulatedData implements \JsonSerializable { private $buyerEmail; private $buyerPhoneNumber; private $buyerAddress; public function getBuyerEmail(): ?string { return $this->buyerEmail; } public function setBuyerEmail(?string $buyerEmail): void { $this->buyerEmail = $buyerEmail; } public function getBuyerPhoneNumber(): ?string { return $this->buyerPhoneNumber; } public function setBuyerPhoneNumber(?string $buyerPhoneNumber): void { $this->buyerPhoneNumber = $buyerPhoneNumber; } public function getBuyerAddress(): ?Address { return $this->buyerAddress; } public function setBuyerAddress(?Address $buyerAddress): void { $this->buyerAddress = $buyerAddress; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->buyerEmail)) { $json['buyer_email'] = $this->buyerEmail; } if (isset($this->buyerPhoneNumber)) { $json['buyer_phone_number'] = $this->buyerPhoneNumber; } if (isset($this->buyerAddress)) { $json['buyer_address'] = $this->buyerAddress; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 