<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

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

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

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

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

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

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

        return $new;
    }
}
