<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class InventoryChange implements \JsonSerializable { private $type; private $physicalCount; private $adjustment; private $transfer; private $measurementUnit; private $measurementUnitId; public function getType(): ?string { return $this->type; } public function setType(?string $type): void { $this->type = $type; } public function getPhysicalCount(): ?InventoryPhysicalCount { return $this->physicalCount; } public function setPhysicalCount(?InventoryPhysicalCount $physicalCount): void { $this->physicalCount = $physicalCount; } public function getAdjustment(): ?InventoryAdjustment { return $this->adjustment; } public function setAdjustment(?InventoryAdjustment $adjustment): void { $this->adjustment = $adjustment; } public function getTransfer(): ?InventoryTransfer { return $this->transfer; } public function setTransfer(?InventoryTransfer $transfer): void { $this->transfer = $transfer; } public function getMeasurementUnit(): ?CatalogMeasurementUnit { return $this->measurementUnit; } public function setMeasurementUnit(?CatalogMeasurementUnit $measurementUnit): void { $this->measurementUnit = $measurementUnit; } public function getMeasurementUnitId(): ?string { return $this->measurementUnitId; } public function setMeasurementUnitId(?string $measurementUnitId): void { $this->measurementUnitId = $measurementUnitId; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->type)) { $json['type'] = $this->type; } if (isset($this->physicalCount)) { $json['physical_count'] = $this->physicalCount; } if (isset($this->adjustment)) { $json['adjustment'] = $this->adjustment; } if (isset($this->transfer)) { $json['transfer'] = $this->transfer; } if (isset($this->measurementUnit)) { $json['measurement_unit'] = $this->measurementUnit; } if (isset($this->measurementUnitId)) { $json['measurement_unit_id'] = $this->measurementUnitId; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 