<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CatalogStockConversion implements \JsonSerializable { private $stockableItemVariationId; private $stockableQuantity; private $nonstockableQuantity; public function __construct( string $stockableItemVariationId, string $stockableQuantity, string $nonstockableQuantity ) { $this->stockableItemVariationId = $stockableItemVariationId; $this->stockableQuantity = $stockableQuantity; $this->nonstockableQuantity = $nonstockableQuantity; } public function getStockableItemVariationId(): string { return $this->stockableItemVariationId; } public function setStockableItemVariationId(string $stockableItemVariationId): void { $this->stockableItemVariationId = $stockableItemVariationId; } public function getStockableQuantity(): string { return $this->stockableQuantity; } public function setStockableQuantity(string $stockableQuantity): void { $this->stockableQuantity = $stockableQuantity; } public function getNonstockableQuantity(): string { return $this->nonstockableQuantity; } public function setNonstockableQuantity(string $nonstockableQuantity): void { $this->nonstockableQuantity = $nonstockableQuantity; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['stockable_item_variation_id'] = $this->stockableItemVariationId; $json['stockable_quantity'] = $this->stockableQuantity; $json['nonstockable_quantity'] = $this->nonstockableQuantity; $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 