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