<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class UpsertSnippetRequest implements \JsonSerializable { private $snippet; public function __construct(Snippet $snippet) { $this->snippet = $snippet; } public function getSnippet(): Snippet { return $this->snippet; } public function setSnippet(Snippet $snippet): void { $this->snippet = $snippet; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['snippet'] = $this->snippet; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 