<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class ItemVariationLocationOverrides implements \JsonSerializable { private $locationId; private $priceMoney; private $pricingType; private $trackInventory; private $inventoryAlertType; private $inventoryAlertThreshold; private $soldOut; private $soldOutValidUntil; public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getPriceMoney(): ?Money { return $this->priceMoney; } public function setPriceMoney(?Money $priceMoney): void { $this->priceMoney = $priceMoney; } public function getPricingType(): ?string { return $this->pricingType; } public function setPricingType(?string $pricingType): void { $this->pricingType = $pricingType; } public function getTrackInventory(): ?bool { return $this->trackInventory; } public function setTrackInventory(?bool $trackInventory): void { $this->trackInventory = $trackInventory; } public function getInventoryAlertType(): ?string { return $this->inventoryAlertType; } public function setInventoryAlertType(?string $inventoryAlertType): void { $this->inventoryAlertType = $inventoryAlertType; } public function getInventoryAlertThreshold(): ?int { return $this->inventoryAlertThreshold; } public function setInventoryAlertThreshold(?int $inventoryAlertThreshold): void { $this->inventoryAlertThreshold = $inventoryAlertThreshold; } public function getSoldOut(): ?bool { return $this->soldOut; } public function setSoldOut(?bool $soldOut): void { $this->soldOut = $soldOut; } public function getSoldOutValidUntil(): ?string { return $this->soldOutValidUntil; } public function setSoldOutValidUntil(?string $soldOutValidUntil): void { $this->soldOutValidUntil = $soldOutValidUntil; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->priceMoney)) { $json['price_money'] = $this->priceMoney; } if (isset($this->pricingType)) { $json['pricing_type'] = $this->pricingType; } if (isset($this->trackInventory)) { $json['track_inventory'] = $this->trackInventory; } if (isset($this->inventoryAlertType)) { $json['inventory_alert_type'] = $this->inventoryAlertType; } if (isset($this->inventoryAlertThreshold)) { $json['inventory_alert_threshold'] = $this->inventoryAlertThreshold; } if (isset($this->soldOut)) { $json['sold_out'] = $this->soldOut; } if (isset($this->soldOutValidUntil)) { $json['sold_out_valid_until'] = $this->soldOutValidUntil; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 