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