/* rest-0.7.vapi generated by vapigen, do not modify. */

[CCode (cprefix = "Rest", gir_namespace = "Rest", gir_version = "0.7", lower_case_cprefix = "rest_")]
namespace Rest {
	[CCode (cheader_filename = "rest/oauth2-proxy.h", cname = "OAuth2Proxy", cprefix = "oauth2_proxy_", type_id = "oauth2_proxy_get_type ()")]
	public class OAuth2Proxy : Rest.Proxy {
		[CCode (has_construct_function = false, type = "RestProxy*")]
		public OAuth2Proxy (string client_id, string auth_endpoint, string url_format, bool binding_required);
		public string build_login_url (string redirect_uri);
		public string build_login_url_full (string redirect_uri, GLib.HashTable<void*,void*> extra_params);
		public static string extract_access_token (string url);
		public unowned string get_access_token ();
		public void set_access_token (string access_token);
		[CCode (has_construct_function = false, type = "RestProxy*")]
		public OAuth2Proxy.with_token (string client_id, string access_token, string auth_endpoint, string url_format, bool binding_required);
		public string access_token { get; set; }
		[NoAccessorMethod]
		public string auth_endpoint { owned get; construct; }
		[NoAccessorMethod]
		public string client_id { owned get; construct; }
	}
	[CCode (cheader_filename = "rest/oauth2-proxy-call.h", cname = "OAuth2ProxyCall", cprefix = "oauth2_proxy_call_", type_id = "oauth2_proxy_call_get_type ()")]
	public class OAuth2ProxyCall : Rest.ProxyCall {
		[CCode (has_construct_function = false)]
		protected OAuth2ProxyCall ();
	}
	[CCode (cheader_filename = "rest/oauth-proxy.h", cname = "OAuthProxy", cprefix = "oauth_proxy_", type_id = "oauth_proxy_get_type ()")]
	public class OAuthProxy : Rest.Proxy {
		[CCode (has_construct_function = false, type = "RestProxy*")]
		public OAuthProxy (string consumer_key, string consumer_secret, string url_format, bool binding_required);
		public bool access_token (string function, string verifier) throws GLib.Error;
		public bool auth_step (string function) throws GLib.Error;
		public unowned string get_signature_host ();
		public unowned string get_token ();
		public unowned string get_token_secret ();
		public bool is_oauth10a ();
		public bool request_token (string function, string callback_uri) throws GLib.Error;
		public void set_signature_host (string signature_host);
		public void set_token (string token);
		public void set_token_secret (string token_secret);
		[CCode (has_construct_function = false, type = "RestProxy*")]
		public OAuthProxy.with_token (string consumer_key, string consumer_secret, string token, string token_secret, string url_format, bool binding_required);
		[NoAccessorMethod]
		public string consumer_key { owned get; construct; }
		[NoAccessorMethod]
		public string consumer_secret { owned get; construct; }
		public string signature_host { get; set; }
		[NoAccessorMethod]
		public Rest.OAuthSignatureMethod signature_method { get; set; }
		public string token { get; set; }
		public string token_secret { get; set; }
	}
	[CCode (cheader_filename = "rest/oauth-proxy-call.h", cname = "OAuthProxyCall", cprefix = "oauth_proxy_call_", type_id = "oauth_proxy_call_get_type ()")]
	public class OAuthProxyCall : Rest.ProxyCall {
		[CCode (has_construct_function = false)]
		protected OAuthProxyCall ();
		public void parse_token_reponse ();
	}
	[CCode (cheader_filename = "rest/rest-param.h")]
	[Compact]
	public class Param {
		public size_t get_content_length ();
		public unowned string get_content_type ();
		public unowned string get_file_name ();
		public unowned string get_name ();
		public bool is_string ();
		public void unref ();
	}
	[CCode (cheader_filename = "rest/rest-params.h")]
	[Compact]
	public class Params {
		public void add (Rest.Param param);
		public bool are_strings ();
		public unowned GLib.HashTable<string,string> as_string_hash_table ();
		public void free ();
		public void remove (string name);
	}
	[CCode (cheader_filename = "rest/rest-params.h")]
	[Compact]
	public class ParamsIter {
		public void init (Rest.Params @params);
		public bool next (string name, Rest.Param param);
	}
	[CCode (cheader_filename = "rest/rest-proxy.h", type_id = "rest_proxy_get_type ()")]
	public class Proxy : GLib.Object {
		[CCode (has_construct_function = false)]
		public Proxy (string url_format, bool binding_required);
		public bool bind (...);
		public unowned string get_user_agent ();
		public virtual unowned Rest.ProxyCall new_call ();
		public void set_user_agent (string user_agent);
		[NoAccessorMethod]
		public bool binding_required { get; set; }
		[NoAccessorMethod]
		public bool disable_cookies { get; construct; }
		[NoAccessorMethod]
		public string url_format { owned get; set; }
		public string user_agent { get; set; }
	}
	[CCode (cheader_filename = "rest/rest-proxy-call.h", type_id = "rest_proxy_call_get_type ()")]
	public class ProxyCall : GLib.Object {
		[CCode (has_construct_function = false)]
		protected ProxyCall ();
		public void add_header (string header, string value);
		public void add_headers (...);
		public void add_param (string name, string value);
		public void add_param_full (Rest.Param param);
		public void add_params (...);
		public bool cancel ();
		public bool continuous ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallContinuousCallback cb, GLib.Object weak_object) throws GLib.Error;
		public unowned string get_method ();
		public unowned Rest.Params get_params ();
		public unowned string get_payload ();
		public int64 get_payload_length ();
		public unowned GLib.HashTable<void*,void*> get_response_headers ();
		public uint get_status_code ();
		public unowned string get_status_message ();
		public unowned string lookup_header (string header);
		public unowned string lookup_response_header (string header);
		[NoWrapper]
		public virtual bool prepare () throws GLib.Error;
		public void remove_header (string header);
		public void remove_param (string name);
		public bool run (out unowned GLib.MainLoop loop = null) throws GLib.Error;
		[CCode (cname = "rest_proxy_call_async")]
		public bool run_async ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallAsyncCallback callback, GLib.Object? weak_object = null) throws GLib.Error;
		public virtual bool serialize_params (out string content_type, out string content, out size_t content_len) throws GLib.Error;
		public void set_function (string function);
		public void set_method (string method);
		public bool sync () throws GLib.Error;
		public bool upload ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallUploadCallback cb, GLib.Object weak_object) throws GLib.Error;
		[NoAccessorMethod]
		public Rest.Proxy proxy { owned get; construct; }
	}
	[CCode (cheader_filename = "rest/rest-xml-node.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "rest_xml_node_get_type ()")]
	[Compact]
	public class XmlNode {
		public weak GLib.HashTable<void*,void*> attrs;
		public weak GLib.HashTable<void*,void*> children;
		public weak string content;
		public weak string name;
		public weak Rest.XmlNode next;
		public void add_attr (string attribute, string value);
		public unowned Rest.XmlNode add_child (string tag);
		public Rest.XmlNode find (string tag);
		public void free ();
		public unowned string get_attr (string attr_name);
		public string print ();
		public Rest.XmlNode @ref ();
		public void set_content (string value);
		public void unref ();
	}
	[CCode (cheader_filename = "rest/rest-xml-parser.h", type_id = "rest_xml_parser_get_type ()")]
	public class XmlParser : GLib.Object {
		[CCode (has_construct_function = false)]
		public XmlParser ();
		public Rest.XmlNode parse_from_data (string data, int64 len);
	}
	[CCode (cheader_filename = "rest/rest-param.h", cprefix = "REST_MEMORY_")]
	public enum MemoryUse {
		STATIC,
		TAKE,
		COPY
	}
	[CCode (cheader_filename = "rest/oauth-proxy.h", cname = "OAuthSignatureMethod", cprefix = "")]
	public enum OAuthSignatureMethod {
		PLAINTEXT,
		HMAC_SHA1
	}
	[CCode (cheader_filename = "rest/rest-proxy-call.h", cprefix = "REST_PROXY_CALL_")]
	public errordomain ProxyCallError {
		FAILED;
		public static GLib.Quark quark ();
	}
	[CCode (cheader_filename = "rest/rest-proxy.h", cprefix = "REST_PROXY_ERROR_")]
	public errordomain ProxyError {
		CANCELLED,
		RESOLUTION,
		CONNECTION,
		SSL,
		IO,
		FAILED,
		HTTP_MULTIPLE_CHOICES,
		HTTP_MOVED_PERMANENTLY,
		HTTP_FOUND,
		HTTP_SEE_OTHER,
		HTTP_NOT_MODIFIED,
		HTTP_USE_PROXY,
		HTTP_THREEOHSIX,
		HTTP_TEMPORARY_REDIRECT,
		HTTP_BAD_REQUEST,
		HTTP_UNAUTHORIZED,
		HTTP_FOUROHTWO,
		HTTP_FORBIDDEN,
		HTTP_NOT_FOUND,
		HTTP_METHOD_NOT_ALLOWED,
		HTTP_NOT_ACCEPTABLE,
		HTTP_PROXY_AUTHENTICATION_REQUIRED,
		HTTP_REQUEST_TIMEOUT,
		HTTP_CONFLICT,
		HTTP_GONE,
		HTTP_LENGTH_REQUIRED,
		HTTP_PRECONDITION_FAILED,
		HTTP_REQUEST_ENTITY_TOO_LARGE,
		HTTP_REQUEST_URI_TOO_LONG,
		HTTP_UNSUPPORTED_MEDIA_TYPE,
		HTTP_REQUESTED_RANGE_NOT_SATISFIABLE,
		HTTP_EXPECTATION_FAILED,
		HTTP_INTERNAL_SERVER_ERROR,
		HTTP_NOT_IMPLEMENTED,
		HTTP_BAD_GATEWAY,
		HTTP_SERVICE_UNAVAILABLE,
		HTTP_GATEWAY_TIMEOUT,
		HTTP_HTTP_VERSION_NOT_SUPPORTED;
		public static GLib.Quark quark ();
	}
	[CCode (cheader_filename = "rest/oauth-proxy.h", cname = "OAuthProxyAuthCallback", instance_pos = 3.9)]
	public delegate void OAuthProxyAuthCallback (Rest.OAuthProxy proxy, GLib.Error? error, GLib.Object? weak_object);
	[CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 3.9)]
	public delegate void ProxyCallAsyncCallback (Rest.ProxyCall call, GLib.Error? error, GLib.Object? weak_object);
	[CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 5.9)]
	public delegate void ProxyCallContinuousCallback (Rest.ProxyCall call, string buf, size_t len, GLib.Error? error, GLib.Object? weak_object);
	[CCode (cheader_filename = "rest/rest-proxy-call.h", instance_pos = 5.9)]
	public delegate void ProxyCallUploadCallback (Rest.ProxyCall call, size_t total, size_t uploaded, GLib.Error? error, GLib.Object? weak_object);
}
