<?php

namespace licenseplaterecognizer\helpers;

/**
 * @example raw response from license plate recognizer API
 * {
 *  "version": "1.54.0",
 *  "usage": {
 *      "calls": 98
 *  },
 * "license_key": "XXXXXXXXXX",
 * "webhooks": [],
 * "total_calls": 2500
 * }
 */
class licenseplaterecognizer_info
{
    public string $version;
    public object $usage; // e.g. {"calls": 98}
    public string $license_key;
    public array $webhooks;
    public int $total_calls;

    public function __construct($data)
    {
        $this->version = $data->version;
        $this->usage = $data->usage ?? (object) ['calls' => 0];
        $this->license_key = $data->license_key;
        $this->webhooks = $data->webhooks;
        $this->total_calls = $data->total_calls;
    }
}