<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class BatchRetrieveCatalogObjectsRequest implements \JsonSerializable { private $objectIds; private $includeRelatedObjects; private $catalogVersion; private $includeDeletedObjects; public function __construct(array $objectIds) { $this->objectIds = $objectIds; } public function getObjectIds(): array { return $this->objectIds; } public function setObjectIds(array $objectIds): void { $this->objectIds = $objectIds; } public function getIncludeRelatedObjects(): ?bool { return $this->includeRelatedObjects; } public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void { $this->includeRelatedObjects = $includeRelatedObjects; } public function getCatalogVersion(): ?int { return $this->catalogVersion; } public function setCatalogVersion(?int $catalogVersion): void { $this->catalogVersion = $catalogVersion; } public function getIncludeDeletedObjects(): ?bool { return $this->includeDeletedObjects; } public function setIncludeDeletedObjects(?bool $includeDeletedObjects): void { $this->includeDeletedObjects = $includeDeletedObjects; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['object_ids'] = $this->objectIds; if (isset($this->includeRelatedObjects)) { $json['include_related_objects'] = $this->includeRelatedObjects; } if (isset($this->catalogVersion)) { $json['catalog_version'] = $this->catalogVersion; } if (isset($this->includeDeletedObjects)) { $json['include_deleted_objects'] = $this->includeDeletedObjects; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 