public static function mapResponse(ResponseInterface $response, $class = null, LoggerInterface $logger = null)
    {
        $dec = self::jsonDecode((string)$response->getBody());
        if ($class != null) {
            return self::map($dec, $class, $logger);
        }
        return $dec;
    }