<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogItemOption implements \JsonSerializable { private $name; private $displayName; private $description; private $showColors; private $values; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getDisplayName(): ?string { return $this->displayName; } public function setDisplayName(?string $displayName): void { $this->displayName = $displayName; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): void { $this->description = $description; } public function getShowColors(): ?bool { return $this->showColors; } public function setShowColors(?bool $showColors): void { $this->showColors = $showColors; } public function getValues(): ?array { return $this->values; } public function setValues(?array $values): void { $this->values = $values; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->displayName)) { $json['display_name'] = $this->displayName; } if (isset($this->description)) { $json['description'] = $this->description; } if (isset($this->showColors)) { $json['show_colors'] = $this->showColors; } if (isset($this->values)) { $json['values'] = $this->values; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 