<?php

namespace Saswp\DTOs\Response\Vendor;

class LoginJsonDTO
{

    public readonly string $access_token;
    public readonly int $account_id;
    public readonly string $name;
    public readonly int $is_agent;
    public readonly int $is_user;


    public function __construct(array $_data)
    {
        $this->access_token  = isset($_data['access_token']) ?$_data['access_token']:'';
        $this->account_id  = isset($_data['account_id']) ?$_data['account_id']:0;
        $this->name  = isset($_data['name']) ?$_data['name']:'';
        $this->is_agent  = isset($_data['is_agent']) ?$_data['is_agent']:0;
        $this->is_user  = isset($_data['is_user']) ?$_data['is_user']:0;
    }

    public function toArray(): array
    {
        return (array)$this;
    }
}