<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SearchCatalogObjectsRequest implements \JsonSerializable { private $cursor; private $objectTypes; private $includeDeletedObjects; private $includeRelatedObjects; private $beginTime; private $query; private $limit; public function getCursor(): ?string { return $this->cursor; } public function setCursor(?string $cursor): void { $this->cursor = $cursor; } public function getObjectTypes(): ?array { return $this->objectTypes; } public function setObjectTypes(?array $objectTypes): void { $this->objectTypes = $objectTypes; } public function getIncludeDeletedObjects(): ?bool { return $this->includeDeletedObjects; } public function setIncludeDeletedObjects(?bool $includeDeletedObjects): void { $this->includeDeletedObjects = $includeDeletedObjects; } public function getIncludeRelatedObjects(): ?bool { return $this->includeRelatedObjects; } public function setIncludeRelatedObjects(?bool $includeRelatedObjects): void { $this->includeRelatedObjects = $includeRelatedObjects; } public function getBeginTime(): ?string { return $this->beginTime; } public function setBeginTime(?string $beginTime): void { $this->beginTime = $beginTime; } public function getQuery(): ?CatalogQuery { return $this->query; } public function setQuery(?CatalogQuery $query): void { $this->query = $query; } public function getLimit(): ?int { return $this->limit; } public function setLimit(?int $limit): void { $this->limit = $limit; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->cursor)) { $json['cursor'] = $this->cursor; } if (isset($this->objectTypes)) { $json['object_types'] = $this->objectTypes; } if (isset($this->includeDeletedObjects)) { $json['include_deleted_objects'] = $this->includeDeletedObjects; } if (isset($this->includeRelatedObjects)) { $json['include_related_objects'] = $this->includeRelatedObjects; } if (isset($this->beginTime)) { $json['begin_time'] = $this->beginTime; } if (isset($this->query)) { $json['query'] = $this->query; } if (isset($this->limit)) { $json['limit'] = $this->limit; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 