<?php

namespace DhlPolska\API\ParcelShop\Method;

use DhlPolska\API\AuthDataInterface;
use JsonSerializable;

/**
 * GetNearestServicepoints structure.
 */
class GetNearestServicepoints implements JsonSerializable {

	/**
	 * @var AuthDataInterface
	 */
	private AuthDataInterface $auth_data;

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

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

	/**
	 * @var int
	 */
	private int $radius;

	/**
	 * GetNearestServicepoints constructor.
	 *
	 * @param AuthDataInterface $auth_data
	 * @param string            $postcode
	 * @param string            $city
	 * @param int               $radius
	 */
	public function __construct( AuthDataInterface $auth_data, string $postcode, string $city, int $radius ) {
		$this->auth_data = $auth_data;
		$this->postcode  = $postcode;
		$this->city      = $city;
		$this->radius    = $radius;
	}

	/**
	 * @return array
	 */
	public function jsonSerialize(): array {
		return [
			'authData' => $this->auth_data,
			'postcode' => $this->postcode,
			'city'     => $this->city,
			'radius'   => $this->radius,
		];
	}
}
