<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\ParcelShop;

use Gls\GlsPoland\AdePlus\Authorization\AuthorizedRequest;

final class AdeParcelShop2GetByCountry extends AuthorizedRequest
{

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

    public function __construct(string $country)
    {
        $this->country = $country;
    }

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

    public function getCountry(): string
    {
        return $this->country;
    }

    public function withCountry(string $country): AdeParcelShop2GetByCountry
    {
        $new = clone $this;
        $new->country = $country;

        return $new;
    }
}
