<?php

namespace Opencart\Extension\Alsendo\DTO\ConfigurationRequests;

require_once(DIR_EXTENSION . 'alsendo/src/DTO/ConfigurationRequests/CoreConfigurationRequestDTO.php');

class SaveApiKeysRequestDTO
{
    public ?string $appId = null;
    public ?string $appSecret = null;
    public ?string $token = null;
    public ?string $apiKey = null;
    public ?string $roClientId = null;
    public ?string $roClientSecret = null;
    public ?string $sandbox = null;
    public ?string $roSandbox = null;
    public ?string $czSandbox = null;

    public static function fromCoreConfigurationRequestDTO(CoreConfigurationRequestDTO $coreDto): self
    {
        $dto = new self();
        $dto->appId = $coreDto->appId;
        $dto->appSecret = $coreDto->appSecret;
        $dto->token = $coreDto->token;
        $dto->apiKey = $coreDto->apiKey;
        $dto->roClientId = $coreDto->roClientId;
        $dto->roClientSecret = $coreDto->roClientSecret;
        $dto->sandbox = $coreDto->sandbox;
        $dto->roSandbox = $coreDto->roSandbox;
        $dto->czSandbox = $coreDto->czSandbox;
        return $dto;
    }
}
