<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CustomAttributeFilter implements \JsonSerializable { private $customAttributeDefinitionId; private $key; private $stringFilter; private $numberFilter; private $selectionUidsFilter; private $boolFilter; public function getCustomAttributeDefinitionId(): ?string { return $this->customAttributeDefinitionId; } public function setCustomAttributeDefinitionId(?string $customAttributeDefinitionId): void { $this->customAttributeDefinitionId = $customAttributeDefinitionId; } public function getKey(): ?string { return $this->key; } public function setKey(?string $key): void { $this->key = $key; } public function getStringFilter(): ?string { return $this->stringFilter; } public function setStringFilter(?string $stringFilter): void { $this->stringFilter = $stringFilter; } public function getNumberFilter(): ?Range { return $this->numberFilter; } public function setNumberFilter(?Range $numberFilter): void { $this->numberFilter = $numberFilter; } public function getSelectionUidsFilter(): ?array { return $this->selectionUidsFilter; } public function setSelectionUidsFilter(?array $selectionUidsFilter): void { $this->selectionUidsFilter = $selectionUidsFilter; } public function getBoolFilter(): ?bool { return $this->boolFilter; } public function setBoolFilter(?bool $boolFilter): void { $this->boolFilter = $boolFilter; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->customAttributeDefinitionId)) { $json['custom_attribute_definition_id'] = $this->customAttributeDefinitionId; } if (isset($this->key)) { $json['key'] = $this->key; } if (isset($this->stringFilter)) { $json['string_filter'] = $this->stringFilter; } if (isset($this->numberFilter)) { $json['number_filter'] = $this->numberFilter; } if (isset($this->selectionUidsFilter)) { $json['selection_uids_filter'] = $this->selectionUidsFilter; } if (isset($this->boolFilter)) { $json['bool_filter'] = $this->boolFilter; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 