<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

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

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

    /**
     * @var \Gls\GlsPoland\AdePlus\Type\CConsignExt
     */
    private $consign_prep_data;

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

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

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

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

        return $new;
    }

    public function getConsign_prep_data(): CConsignExt
    {
        return $this->consign_prep_data;
    }

    public function withConsign_prep_data(CConsignExt $consign_prep_data): AdePreparingBoxInsertExt
    {
        $new = clone $this;
        $new->consign_prep_data = $consign_prep_data;

        return $new;
    }
}
