<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

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

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

    /**
     * @var int
     */
    private $id;

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

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

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

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

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

        return $new;
    }

    public function getId(): int
    {
        return $this->id;
    }

    public function withId(int $id): AdePreparingBoxGetConsignDocs
    {
        $new = clone $this;
        $new->id = $id;

        return $new;
    }

    public function getMode(): string
    {
        return $this->mode;
    }

    public function withMode(string $mode): AdePreparingBoxGetConsignDocs
    {
        $new = clone $this;
        $new->mode = $mode;

        return $new;
    }
}
