<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class ShiftWorkday implements \JsonSerializable { private $dateRange; private $matchShiftsBy; private $defaultTimezone; public function getDateRange(): ?DateRange { return $this->dateRange; } public function setDateRange(?DateRange $dateRange): void { $this->dateRange = $dateRange; } public function getMatchShiftsBy(): ?string { return $this->matchShiftsBy; } public function setMatchShiftsBy(?string $matchShiftsBy): void { $this->matchShiftsBy = $matchShiftsBy; } public function getDefaultTimezone(): ?string { return $this->defaultTimezone; } public function setDefaultTimezone(?string $defaultTimezone): void { $this->defaultTimezone = $defaultTimezone; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->dateRange)) { $json['date_range'] = $this->dateRange; } if (isset($this->matchShiftsBy)) { $json['match_shifts_by'] = $this->matchShiftsBy; } if (isset($this->defaultTimezone)) { $json['default_timezone'] = $this->defaultTimezone; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 