<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CreateShiftRequest implements \JsonSerializable { private $idempotencyKey; private $shift; public function __construct(Shift $shift) { $this->shift = $shift; } public function getIdempotencyKey(): ?string { return $this->idempotencyKey; } public function setIdempotencyKey(?string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } public function getShift(): Shift { return $this->shift; } public function setShift(Shift $shift): void { $this->shift = $shift; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->idempotencyKey)) { $json['idempotency_key'] = $this->idempotencyKey; } $json['shift'] = $this->shift; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 