<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SearchCatalogItemsRequest implements \JsonSerializable { private $textFilter; private $categoryIds; private $stockLevels; private $enabledLocationIds; private $cursor; private $limit; private $sortOrder; private $productTypes; private $customAttributeFilters; public function getTextFilter(): ?string { return $this->textFilter; } public function setTextFilter(?string $textFilter): void { $this->textFilter = $textFilter; } public function getCategoryIds(): ?array { return $this->categoryIds; } public function setCategoryIds(?array $categoryIds): void { $this->categoryIds = $categoryIds; } public function getStockLevels(): ?array { return $this->stockLevels; } public function setStockLevels(?array $stockLevels): void { $this->stockLevels = $stockLevels; } public function getEnabledLocationIds(): ?array { return $this->enabledLocationIds; } public function setEnabledLocationIds(?array $enabledLocationIds): void { $this->enabledLocationIds = $enabledLocationIds; } public function getCursor(): ?string { return $this->cursor; } public function setCursor(?string $cursor): void { $this->cursor = $cursor; } public function getLimit(): ?int { return $this->limit; } public function setLimit(?int $limit): void { $this->limit = $limit; } public function getSortOrder(): ?string { return $this->sortOrder; } public function setSortOrder(?string $sortOrder): void { $this->sortOrder = $sortOrder; } public function getProductTypes(): ?array { return $this->productTypes; } public function setProductTypes(?array $productTypes): void { $this->productTypes = $productTypes; } public function getCustomAttributeFilters(): ?array { return $this->customAttributeFilters; } public function setCustomAttributeFilters(?array $customAttributeFilters): void { $this->customAttributeFilters = $customAttributeFilters; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->textFilter)) { $json['text_filter'] = $this->textFilter; } if (isset($this->categoryIds)) { $json['category_ids'] = $this->categoryIds; } if (isset($this->stockLevels)) { $json['stock_levels'] = $this->stockLevels; } if (isset($this->enabledLocationIds)) { $json['enabled_location_ids'] = $this->enabledLocationIds; } if (isset($this->cursor)) { $json['cursor'] = $this->cursor; } if (isset($this->limit)) { $json['limit'] = $this->limit; } if (isset($this->sortOrder)) { $json['sort_order'] = $this->sortOrder; } if (isset($this->productTypes)) { $json['product_types'] = $this->productTypes; } if (isset($this->customAttributeFilters)) { $json['custom_attribute_filters'] = $this->customAttributeFilters; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 