<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class UpsertCatalogObjectResponse implements \JsonSerializable { private $errors; private $catalogObject; private $idMappings; public function getErrors(): ?array { return $this->errors; } public function setErrors(?array $errors): void { $this->errors = $errors; } public function getCatalogObject(): ?CatalogObject { return $this->catalogObject; } public function setCatalogObject(?CatalogObject $catalogObject): void { $this->catalogObject = $catalogObject; } public function getIdMappings(): ?array { return $this->idMappings; } public function setIdMappings(?array $idMappings): void { $this->idMappings = $idMappings; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->errors)) { $json['errors'] = $this->errors; } if (isset($this->catalogObject)) { $json['catalog_object'] = $this->catalogObject; } if (isset($this->idMappings)) { $json['id_mappings'] = $this->idMappings; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 