<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogObjectReference implements \JsonSerializable { private $objectId; private $catalogVersion; public function getObjectId(): ?string { return $this->objectId; } public function setObjectId(?string $objectId): void { $this->objectId = $objectId; } public function getCatalogVersion(): ?int { return $this->catalogVersion; } public function setCatalogVersion(?int $catalogVersion): void { $this->catalogVersion = $catalogVersion; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->objectId)) { $json['object_id'] = $this->objectId; } if (isset($this->catalogVersion)) { $json['catalog_version'] = $this->catalogVersion; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 