<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogQuickAmountsSettings implements \JsonSerializable { private $option; private $eligibleForAutoAmounts; private $amounts; public function __construct(string $option) { $this->option = $option; } public function getOption(): string { return $this->option; } public function setOption(string $option): void { $this->option = $option; } public function getEligibleForAutoAmounts(): ?bool { return $this->eligibleForAutoAmounts; } public function setEligibleForAutoAmounts(?bool $eligibleForAutoAmounts): void { $this->eligibleForAutoAmounts = $eligibleForAutoAmounts; } public function getAmounts(): ?array { return $this->amounts; } public function setAmounts(?array $amounts): void { $this->amounts = $amounts; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['option'] = $this->option; if (isset($this->eligibleForAutoAmounts)) { $json['eligible_for_auto_amounts'] = $this->eligibleForAutoAmounts; } if (isset($this->amounts)) { $json['amounts'] = $this->amounts; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 