<?php
 declare(strict_types=1); namespace Square\Models; use stdClass; class DeviceMetadata implements \JsonSerializable { private $batteryPercentage; private $chargingState; private $locationId; private $merchantId; private $networkConnectionType; private $paymentRegion; private $serialNumber; private $osVersion; private $appVersion; private $wifiNetworkName; private $wifiNetworkStrength; private $ipAddress; public function getBatteryPercentage(): ?string { return $this->batteryPercentage; } public function setBatteryPercentage(?string $batteryPercentage): void { $this->batteryPercentage = $batteryPercentage; } public function getChargingState(): ?string { return $this->chargingState; } public function setChargingState(?string $chargingState): void { $this->chargingState = $chargingState; } public function getLocationId(): ?string { return $this->locationId; } public function setLocationId(?string $locationId): void { $this->locationId = $locationId; } public function getMerchantId(): ?string { return $this->merchantId; } public function setMerchantId(?string $merchantId): void { $this->merchantId = $merchantId; } public function getNetworkConnectionType(): ?string { return $this->networkConnectionType; } public function setNetworkConnectionType(?string $networkConnectionType): void { $this->networkConnectionType = $networkConnectionType; } public function getPaymentRegion(): ?string { return $this->paymentRegion; } public function setPaymentRegion(?string $paymentRegion): void { $this->paymentRegion = $paymentRegion; } public function getSerialNumber(): ?string { return $this->serialNumber; } public function setSerialNumber(?string $serialNumber): void { $this->serialNumber = $serialNumber; } public function getOsVersion(): ?string { return $this->osVersion; } public function setOsVersion(?string $osVersion): void { $this->osVersion = $osVersion; } public function getAppVersion(): ?string { return $this->appVersion; } public function setAppVersion(?string $appVersion): void { $this->appVersion = $appVersion; } public function getWifiNetworkName(): ?string { return $this->wifiNetworkName; } public function setWifiNetworkName(?string $wifiNetworkName): void { $this->wifiNetworkName = $wifiNetworkName; } public function getWifiNetworkStrength(): ?string { return $this->wifiNetworkStrength; } public function setWifiNetworkStrength(?string $wifiNetworkStrength): void { $this->wifiNetworkStrength = $wifiNetworkStrength; } public function getIpAddress(): ?string { return $this->ipAddress; } public function setIpAddress(?string $ipAddress): void { $this->ipAddress = $ipAddress; } #[\ReturnTypeWillChange] public function jsonSerialize(bool $asArrayWhenEmpty = false) { $json = []; if (isset($this->batteryPercentage)) { $json['battery_percentage'] = $this->batteryPercentage; } if (isset($this->chargingState)) { $json['charging_state'] = $this->chargingState; } if (isset($this->locationId)) { $json['location_id'] = $this->locationId; } if (isset($this->merchantId)) { $json['merchant_id'] = $this->merchantId; } if (isset($this->networkConnectionType)) { $json['network_connection_type'] = $this->networkConnectionType; } if (isset($this->paymentRegion)) { $json['payment_region'] = $this->paymentRegion; } if (isset($this->serialNumber)) { $json['serial_number'] = $this->serialNumber; } if (isset($this->osVersion)) { $json['os_version'] = $this->osVersion; } if (isset($this->appVersion)) { $json['app_version'] = $this->appVersion; } if (isset($this->wifiNetworkName)) { $json['wifi_network_name'] = $this->wifiNetworkName; } if (isset($this->wifiNetworkStrength)) { $json['wifi_network_strength'] = $this->wifiNetworkStrength; } if (isset($this->ipAddress)) { $json['ip_address'] = $this->ipAddress; } $json = array_filter($json, function ($val) { return $val !== null; }); return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json; } } 