<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

use Gls\GlsPoland\AdePlus\Common\StringArray;
use Gls\GlsPoland\Soap\Client\Type\RequestInterface;
use JsonSerializable;

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

    /**
     * @var \Gls\GlsPoland\AdePlus\Common\StringArray
     */
    private $numbers;

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

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

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

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

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

        return $new;
    }

    public function getNumbers(): StringArray
    {
        return $this->numbers;
    }

    public function withNumbers(StringArray $numbers): AdePickupGetParcelsLabels
    {
        $new = clone $this;
        $new->numbers = $numbers;

        return $new;
    }

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

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

        return $new;
    }
}
