<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Availability implements \JsonSerializable { private $startAt; private $locationId; private $appointmentSegments; public function getStartAt(): ?string { return $this->startAt; } public function setStartAt(?string $startAt): void { $this->startAt = $startAt; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getAppointmentSegments(): ?array { return $this->appointmentSegments; } public function setAppointmentSegments(?array $appointmentSegments): void { $this->appointmentSegments = $appointmentSegments; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->startAt)) { $json['start_at'] = $this->startAt; } if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->appointmentSegments)) { $json['appointment_segments'] = $this->appointmentSegments; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 