<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class SearchAvailabilityFilter implements \JsonSerializable { private $startAtRange; private $locationId; private $segmentFilters; private $bookingId; public function __construct(TimeRange $startAtRange) { $this->startAtRange = $startAtRange; } public function getStartAtRange(): TimeRange { return $this->startAtRange; } public function setStartAtRange(TimeRange $startAtRange): void { $this->startAtRange = $startAtRange; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getSegmentFilters(): ?array { return $this->segmentFilters; } public function setSegmentFilters(?array $segmentFilters): void { $this->segmentFilters = $segmentFilters; } public function getBookingId(): ?string { return $this->bookingId; } public function setBookingId(?string $bookingId): void { $this->bookingId = $bookingId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['start_at_range'] = $this->startAtRange; if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->segmentFilters)) { $json['segment_filters'] = $this->segmentFilters; } if (isset($this->bookingId)) { $json['booking_id'] = $this->bookingId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 