<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SearchOrdersFilter implements \JsonSerializable { private $stateFilter; private $dateTimeFilter; private $fulfillmentFilter; private $sourceFilter; private $customerFilter; public function getStateFilter(): ?SearchOrdersStateFilter { return $this->stateFilter; } public function setStateFilter(?SearchOrdersStateFilter $stateFilter): void { $this->stateFilter = $stateFilter; } public function getDateTimeFilter(): ?SearchOrdersDateTimeFilter { return $this->dateTimeFilter; } public function setDateTimeFilter(?SearchOrdersDateTimeFilter $dateTimeFilter): void { $this->dateTimeFilter = $dateTimeFilter; } public function getFulfillmentFilter(): ?SearchOrdersFulfillmentFilter { return $this->fulfillmentFilter; } public function setFulfillmentFilter(?SearchOrdersFulfillmentFilter $fulfillmentFilter): void { $this->fulfillmentFilter = $fulfillmentFilter; } public function getSourceFilter(): ?SearchOrdersSourceFilter { return $this->sourceFilter; } public function setSourceFilter(?SearchOrdersSourceFilter $sourceFilter): void { $this->sourceFilter = $sourceFilter; } public function getCustomerFilter(): ?SearchOrdersCustomerFilter { return $this->customerFilter; } public function setCustomerFilter(?SearchOrdersCustomerFilter $customerFilter): void { $this->customerFilter = $customerFilter; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->stateFilter)) { $json['state_filter'] = $this->stateFilter; } if (isset($this->dateTimeFilter)) { $json['date_time_filter'] = $this->dateTimeFilter; } if (isset($this->fulfillmentFilter)) { $json['fulfillment_filter'] = $this->fulfillmentFilter; } if (isset($this->sourceFilter)) { $json['source_filter'] = $this->sourceFilter; } if (isset($this->customerFilter)) { $json['customer_filter'] = $this->customerFilter; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 