<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class Snippet implements \JsonSerializable { private $id; private $siteId; private $content; private $createdAt; private $updatedAt; public function __construct(string $content) { $this->content = $content; } public function getId(): ?string { return $this->id; } public function setId(?string $id): void { $this->id = $id; } public function getSiteId(): ?string { return $this->siteId; } public function setSiteId(?string $siteId): void { $this->siteId = $siteId; } public function getContent(): string { return $this->content; } public function setContent(string $content): void { $this->content = $content; } public function getCreatedAt(): ?string { return $this->createdAt; } public function setCreatedAt(?string $createdAt): void { $this->createdAt = $createdAt; } public function getUpdatedAt(): ?string { return $this->updatedAt; } public function setUpdatedAt(?string $updatedAt): void { $this->updatedAt = $updatedAt; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->id)) { $json['id'] = $this->id; } if (isset($this->siteId)) { $json['site_id'] = $this->siteId; } $json['content'] = $this->content; if (isset($this->createdAt)) { $json['created_at'] = $this->createdAt; } if (isset($this->updatedAt)) { $json['updated_at'] = $this->updatedAt; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 