<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class LoyaltyEventFilter implements \JsonSerializable { private $loyaltyAccountFilter; private $typeFilter; private $dateTimeFilter; private $locationFilter; private $orderFilter; public function getLoyaltyAccountFilter(): ?LoyaltyEventLoyaltyAccountFilter { return $this->loyaltyAccountFilter; } public function setLoyaltyAccountFilter(?LoyaltyEventLoyaltyAccountFilter $loyaltyAccountFilter): void { $this->loyaltyAccountFilter = $loyaltyAccountFilter; } public function getTypeFilter(): ?LoyaltyEventTypeFilter { return $this->typeFilter; } public function setTypeFilter(?LoyaltyEventTypeFilter $typeFilter): void { $this->typeFilter = $typeFilter; } public function getDateTimeFilter(): ?LoyaltyEventDateTimeFilter { return $this->dateTimeFilter; } public function setDateTimeFilter(?LoyaltyEventDateTimeFilter $dateTimeFilter): void { $this->dateTimeFilter = $dateTimeFilter; } public function getLocationFilter(): ?LoyaltyEventLocationFilter { return $this->locationFilter; } public function setLocationFilter(?LoyaltyEventLocationFilter $locationFilter): void { $this->locationFilter = $locationFilter; } public function getOrderFilter(): ?LoyaltyEventOrderFilter { return $this->orderFilter; } public function setOrderFilter(?LoyaltyEventOrderFilter $orderFilter): void { $this->orderFilter = $orderFilter; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->loyaltyAccountFilter)) { $json['loyalty_account_filter'] = $this->loyaltyAccountFilter; } if (isset($this->typeFilter)) { $json['type_filter'] = $this->typeFilter; } if (isset($this->dateTimeFilter)) { $json['date_time_filter'] = $this->dateTimeFilter; } if (isset($this->locationFilter)) { $json['location_filter'] = $this->locationFilter; } if (isset($this->orderFilter)) { $json['order_filter'] = $this->orderFilter; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 