<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\Type;

use Gls\GlsPoland\AdePlus\Common\Id;
use Gls\GlsPoland\AdePlus\Response;
use Gls\GlsPoland\Soap\Client\Type\ResultInterface;
use JsonSerializable;

final class AdePreparingBoxInsertExtResponse extends Response implements ResultInterface, JsonSerializable
{
    /**
     * @var \Gls\GlsPoland\AdePlus\Common\Id
     */
    protected $return;

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

    public function getReturn(): Id
    {
        return $this->return;
    }

    public function withReturn(Id $return): AdePreparingBoxInsertExtResponse
    {
        $new = clone $this;
        $new->return = $return;

        return $new;
    }
}
