<?php

namespace PeytzMail;

use PeytzMail\Config;
use PeytzMail\Exception\RuntimeException;

/**
 * @package PeytzMail
 */
interface Client
{
    /**
     * A client needs a Config instance.
     *
     * @param Config $config
     */
    public function __construct(Config $config);

    /**
     * Return the name of the client.
     *
     * @return string
     */
    public function getName();

    /**
     * Call the Peytz Mail API.
     *
     * @param  string           $path   The ressource path should starts with a "/".
     * @param  mixed            $data   The optional data.
     * @param  string           $method The method GET is the default method.
     * @throws RuntimeException         If status code is not in [200 - 300[.
     * @return string                   A JSON string.
     */
    public function getContent($path, $data = null, $method = 'GET');
}
