<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class MBreak implements \JsonSerializable { private $id; private $startAt; private $endAt; private $breakTypeId; private $name; private $expectedDuration; private $isPaid; public function __construct( string $startAt, string $breakTypeId, string $name, string $expectedDuration, bool $isPaid ) { $this->startAt = $startAt; $this->breakTypeId = $breakTypeId; $this->name = $name; $this->expectedDuration = $expectedDuration; $this->isPaid = $isPaid; } public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getStartAt(): string { return $this->startAt; } public function setStartAt(string $startAt): void { $this->startAt = $startAt; } public function getEndAt(): ?string { return $this->endAt; } public function setEndAt(?string $endAt): void { $this->endAt = $endAt; } public function getBreakTypeId(): string { return $this->breakTypeId; } public function setBreakTypeId(string $breakTypeId): void { $this->breakTypeId = $breakTypeId; } public function getName(): string { return $this->name; } public function setName(string $name): void { $this->name = $name; } public function getExpectedDuration(): string { return $this->expectedDuration; } public function setExpectedDuration(string $expectedDuration): void { $this->expectedDuration = $expectedDuration; } public function getIsPaid(): bool { return $this->isPaid; } public function setIsPaid(bool $isPaid): void { $this->isPaid = $isPaid; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } $json['start_at'] = $this->startAt; if (isset($this->endAt)) { $json['end_at'] = $this->endAt; } $json['break_type_id'] = $this->breakTypeId; $json['name'] = $this->name; $json['expected_duration'] = $this->expectedDuration; $json['is_paid'] = $this->isPaid; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 