<?php

declare(strict_types=1);

namespace Gls\GlsPoland\AdePlus\ParcelShop;

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

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

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

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

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

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

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

        return $new;
    }

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

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

        return $new;
    }
}
