<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

use JsonSerializable;
use Gls\GlsPoland\Soap\Client\Type\RequestInterface;

final class AdeOptionGet implements RequestInterface, JsonSerializable
{
    /**
     * @var string
     */
    private $session;

    /**
     * @var string
     */
    private $option;

    public function __construct(string $session, string $option)
    {
        $this->session = $session;
        $this->option = $option;
    }

    public function jsonSerialize(): array
    {
        return [
            'session' => $this->session,
            'option' => $this->option,
        ];
    }

    public function getSession(): string
    {
        return $this->session;
    }

    public function withSession(string $session): AdeOptionGet
    {
        $new = clone $this;
        $new->session = $session;

        return $new;
    }

    public function getOption(): string
    {
        return $this->option;
    }

    public function withOption(string $option): AdeOptionGet
    {
        $new = clone $this;
        $new->option = $option;

        return $new;
    }
}
