<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

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

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

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

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

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

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

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

        return $new;
    }

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

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

        return $new;
    }
}
