<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class BatchChangeInventoryRequest implements \JsonSerializable { private $idempotencyKey; private $changes; private $ignoreUnchangedCounts; public function __construct(string $idempotencyKey) { $this->idempotencyKey = $idempotencyKey; } public function getIdempotencyKey(): string { return $this->idempotencyKey; } public function setIdempotencyKey(string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } public function getChanges(): ?array { return $this->changes; } public function setChanges(?array $changes): void { $this->changes = $changes; } public function getIgnoreUnchangedCounts(): ?bool { return $this->ignoreUnchangedCounts; } public function setIgnoreUnchangedCounts(?bool $ignoreUnchangedCounts): void { $this->ignoreUnchangedCounts = $ignoreUnchangedCounts; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['idempotency_key'] = $this->idempotencyKey; if (isset($this->changes)) { $json['changes'] = $this->changes; } if (isset($this->ignoreUnchangedCounts)) { $json['ignore_unchanged_counts'] = $this->ignoreUnchangedCounts; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 