<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogProductSet implements \JsonSerializable { private $name; private $productIdsAny; private $productIdsAll; private $quantityExact; private $quantityMin; private $quantityMax; private $allProducts; public function getName(): ?string { return $this->name; } public function setName(?string $name): void { $this->name = $name; } public function getProductIdsAny(): ?array { return $this->productIdsAny; } public function setProductIdsAny(?array $productIdsAny): void { $this->productIdsAny = $productIdsAny; } public function getProductIdsAll(): ?array { return $this->productIdsAll; } public function setProductIdsAll(?array $productIdsAll): void { $this->productIdsAll = $productIdsAll; } public function getQuantityExact(): ?int { return $this->quantityExact; } public function setQuantityExact(?int $quantityExact): void { $this->quantityExact = $quantityExact; } public function getQuantityMin(): ?int { return $this->quantityMin; } public function setQuantityMin(?int $quantityMin): void { $this->quantityMin = $quantityMin; } public function getQuantityMax(): ?int { return $this->quantityMax; } public function setQuantityMax(?int $quantityMax): void { $this->quantityMax = $quantityMax; } public function getAllProducts(): ?bool { return $this->allProducts; } public function setAllProducts(?bool $allProducts): void { $this->allProducts = $allProducts; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->name)) { $json['name'] = $this->name; } if (isset($this->productIdsAny)) { $json['product_ids_any'] = $this->productIdsAny; } if (isset($this->productIdsAll)) { $json['product_ids_all'] = $this->productIdsAll; } if (isset($this->quantityExact)) { $json['quantity_exact'] = $this->quantityExact; } if (isset($this->quantityMin)) { $json['quantity_min'] = $this->quantityMin; } if (isset($this->quantityMax)) { $json['quantity_max'] = $this->quantityMax; } if (isset($this->allProducts)) { $json['all_products'] = $this->allProducts; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 