<?php
/**
 * Class CreateShipment
 *
 * @package DhlPolska\API\WebApi\Method
 */

namespace DhlPolska\API\WebApi\Method;

use DhlPolska\API\AuthDataInterface;
use DhlPolska\API\WebApi\Struct\CreateShipmentRequest;
use JsonSerializable;

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

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

	/**
	 * @var CreateShipmentRequest
	 */
	private CreateShipmentRequest $shipment;

	/**
	 * CreateShipment constructor.
	 *
	 * @param AuthDataInterface    $auth_data .
	 * @param CreateShipmentRequest $shipment .
	 */
	public function __construct( AuthDataInterface $auth_data, CreateShipmentRequest $shipment ) {
		$this->auth_data = $auth_data;
		$this->shipment  = $shipment;
	}

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