<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class OrderQuantityUnit implements \JsonSerializable { private $measurementUnit; private $precision; private $catalogObjectId; private $catalogVersion; public function getMeasurementUnit(): ?MeasurementUnit { return $this->measurementUnit; } public function setMeasurementUnit(?MeasurementUnit $measurementUnit): void { $this->measurementUnit = $measurementUnit; } public function getPrecision(): ?int { return $this->precision; } public function setPrecision(?int $precision): void { $this->precision = $precision; } public function getCatalogObjectId(): ?string { return $this->catalogObjectId; } public function setCatalogObjectId(?string $catalogObjectId): void { $this->catalogObjectId = $catalogObjectId; } public function getCatalogVersion(): ?int { return $this->catalogVersion; } public function setCatalogVersion(?int $catalogVersion): void { $this->catalogVersion = $catalogVersion; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->measurementUnit)) { $json['measurement_unit'] = $this->measurementUnit; } if (isset($this->precision)) { $json['precision'] = $this->precision; } if (isset($this->catalogObjectId)) { $json['catalog_object_id'] = $this->catalogObjectId; } if (isset($this->catalogVersion)) { $json['catalog_version'] = $this->catalogVersion; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 