<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class V1PaymentItemDetail implements \JsonSerializable { private $categoryName; private $sku; private $itemId; private $itemVariationId; public function getCategoryName(): ?string { return $this->categoryName; } public function setCategoryName(?string $categoryName): void { $this->categoryName = $categoryName; } public function getSku(): ?string { return $this->sku; } public function setSku(?string $sku): void { $this->sku = $sku; } public function getItemId(): ?string { return $this->itemId; } public function setItemId(?string $itemId): void { $this->itemId = $itemId; } public function getItemVariationId(): ?string { return $this->itemVariationId; } public function setItemVariationId(?string $itemVariationId): void { $this->itemVariationId = $itemVariationId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->categoryName)) { $json['category_name'] = $this->categoryName; } if (isset($this->sku)) { $json['sku'] = $this->sku; } if (isset($this->itemId)) { $json['item_id'] = $this->itemId; } if (isset($this->itemVariationId)) { $json['item_variation_id'] = $this->itemVariationId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 