<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogCustomAttributeDefinitionSelectionConfig implements \JsonSerializable { private $maxAllowedSelections; private $allowedSelections; public function getMaxAllowedSelections(): ?int { return $this->maxAllowedSelections; } public function setMaxAllowedSelections(?int $maxAllowedSelections): void { $this->maxAllowedSelections = $maxAllowedSelections; } public function getAllowedSelections(): ?array { return $this->allowedSelections; } public function setAllowedSelections(?array $allowedSelections): void { $this->allowedSelections = $allowedSelections; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->maxAllowedSelections)) { $json['max_allowed_selections'] = $this->maxAllowedSelections; } if (isset($this->allowedSelections)) { $json['allowed_selections'] = $this->allowedSelections; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 