<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class CreateCatalogImageRequest implements \JsonSerializable { private $idempotencyKey; private $objectId; private $image; private $isPrimary; public function __construct(string $idempotencyKey, CatalogObject $image) { $this->idempotencyKey = $idempotencyKey; $this->image = $image; } public function getIdempotencyKey(): string { return $this->idempotencyKey; } public function setIdempotencyKey(string $idempotencyKey): void { $this->idempotencyKey = $idempotencyKey; } public function getObjectId(): ?string { return $this->objectId; } public function setObjectId(?string $objectId): void { $this->objectId = $objectId; } public function getImage(): CatalogObject { return $this->image; } public function setImage(CatalogObject $image): void { $this->image = $image; } public function getIsPrimary(): ?bool { return $this->isPrimary; } public function setIsPrimary(?bool $isPrimary): void { $this->isPrimary = $isPrimary; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; $json['idempotency_key'] = $this->idempotencyKey; if (isset($this->objectId)) { $json['object_id'] = $this->objectId; } $json['image'] = $this->image; if (isset($this->isPrimary)) { $json['is_primary'] = $this->isPrimary; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 