<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

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

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

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

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

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

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

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

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

        return $new;
    }

    public function getNumber(): string
    {
        return $this->number;
    }

    public function withNumber(string $number): AdePickupGetParcelLabel
    {
        $new = clone $this;
        $new->number = $number;

        return $new;
    }

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

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

        return $new;
    }
}
