#ifndef _NetClient_H_
#define _NetClient_H_

#include <map>
#include <string>
#include <cstring>
#include <stdbool.h>
#include <stdlib.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <glib-object.h>
#include <json-glib/json-glib.h>
#include <curl/curl.h>

using namespace std;

typedef enum {
	{{prefix}}_ERROR_NONE = 0, /**< Successful */
	{{prefix}}_ERROR_UNKNOWN, /**< Unknown error */
	{{prefix}}_ERROR_NO_RESPONSE_BODY, /**< No response body error */
	{{prefix}}_ERROR_JSON_PARSING_FAIL, /**< Parsing fail of json data */
	{{prefix}}_ERROR_UNREACHED_TO_SERVER, /**< Unreached to artik cloud server */
	{{prefix}}_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
	{{prefix}}_ERROR_PERMISSION_DENIED /**< Permission denied */
} {{prefix}}_error_e;

typedef enum {
	NET_HTTP_GET = 0,
	NET_HTTP_POST,
	NET_HTTP_PUT,
	NET_HTTP_DELETE,
	NET_HTTP_HEAD,
	NET_HTTP_TRACE,
	NET_HTTP_OPTIONS,
	NET_HTTP_CONNECT,
	NET_HTTP_PATCH
} NetHttpMethod;

struct MemoryStruct_s {
	char *memory;
	size_t size;
};

class NetClient {
public:
	NetClient();
	virtual ~NetClient();

	static int easycurl(string host, string path, string method, map<string, string> queryParams,
		string mBody, struct curl_slist* headerList, MemoryStruct_s* p_chunk, long* code, char* errormsg);

};
#endif /* NetClient_H_ */
