1 /* rest.vapi generated by vapigen, do not modify. */
3 [CCode (cprefix = "Rest", lower_case_cprefix = "rest_")]
5 [CCode (cheader_filename = "rest/facebook-proxy.h")]
6 public class FacebookProxy : Rest.Proxy {
7 [CCode (cname = "facebook_proxy_new", type = "RestProxy*", has_construct_function = false)]
8 public FacebookProxy (string api_key, string app_secret);
9 [CCode (cname = "facebook_proxy_build_login_url")]
10 public static unowned string build_login_url (Rest.FacebookProxy proxy, string frob);
11 [CCode (cname = "facebook_proxy_build_permission_url")]
12 public static unowned string build_permission_url (Rest.FacebookProxy proxy, string perms);
13 [CCode (cname = "facebook_proxy_get_api_key")]
14 public static unowned string get_api_key (Rest.FacebookProxy proxy);
15 [CCode (cname = "facebook_proxy_get_app_secret")]
16 public static unowned string get_app_secret (Rest.FacebookProxy proxy);
17 [CCode (cname = "facebook_proxy_get_session_key")]
18 public static unowned string get_session_key (Rest.FacebookProxy proxy);
19 [CCode (cname = "facebook_proxy_set_app_secret")]
20 public static void set_app_secret (Rest.FacebookProxy proxy, string secret);
21 [CCode (cname = "facebook_proxy_set_session_key")]
22 public static void set_session_key (Rest.FacebookProxy proxy, string session_key);
23 [CCode (cname = "facebook_proxy_sign")]
24 public static unowned string sign (Rest.FacebookProxy proxy, GLib.HashTable @params);
25 [CCode (cname = "facebook_proxy_new_with_session", type = "RestProxy*", has_construct_function = false)]
26 public FacebookProxy.with_session (string api_key, string app_secret, string session_key);
27 public string api_key { get; construct; }
28 public string app_secret { get; set construct; }
29 public string session_key { get; set; }
31 [CCode (cheader_filename = "rest/facebook-proxy-call.h")]
32 public class FacebookProxyCall : Rest.ProxyCall {
34 [CCode (cheader_filename = "rest/flickr-proxy.h")]
35 public class FlickrProxy : Rest.Proxy {
36 [CCode (cname = "flickr_proxy_new", type = "RestProxy*", has_construct_function = false)]
37 public FlickrProxy (string api_key, string shared_secret);
38 [CCode (cname = "flickr_proxy_build_login_url")]
39 public static unowned string build_login_url (Rest.FlickrProxy proxy, string frob);
40 [CCode (cname = "flickr_proxy_get_api_key")]
41 public static unowned string get_api_key (Rest.FlickrProxy proxy);
42 [CCode (cname = "flickr_proxy_get_shared_secret")]
43 public static unowned string get_shared_secret (Rest.FlickrProxy proxy);
44 [CCode (cname = "flickr_proxy_get_token")]
45 public static unowned string get_token (Rest.FlickrProxy proxy);
46 [CCode (cname = "flickr_proxy_set_token")]
47 public static void set_token (Rest.FlickrProxy proxy, string token);
48 [CCode (cname = "flickr_proxy_sign")]
49 public static unowned string sign (Rest.FlickrProxy proxy, GLib.HashTable @params);
50 [CCode (cname = "flickr_proxy_new_with_token", type = "RestProxy*", has_construct_function = false)]
51 public FlickrProxy.with_token (string api_key, string shared_secret, string token);
52 public string api_key { get; construct; }
53 public string shared_secret { get; construct; }
54 public string token { get; set; }
56 [CCode (cheader_filename = "rest/flickr-proxy-call.h")]
57 public class FlickrProxyCall : Rest.ProxyCall {
59 [CCode (cheader_filename = "rest/oauth-proxy.h")]
60 public class OAuthProxy : Rest.Proxy {
61 [CCode (cname = "oauth_proxy_new", type = "RestProxy*", has_construct_function = false)]
62 public OAuthProxy (string consumer_key, string consumer_secret, string url_format, bool binding_required);
63 [CCode (cname = "oauth_proxy_auth_step")]
64 public static bool auth_step (Rest.OAuthProxy proxy, string function) throws GLib.Error;
65 [CCode (cname = "oauth_proxy_auth_step_async")]
66 public static bool auth_step_async (Rest.OAuthProxy proxy, string function, Rest.OAuthProxyAuthCallback callback, GLib.Object weak_object) throws GLib.Error;
67 [CCode (cname = "oauth_proxy_get_token")]
68 public static unowned string get_token (Rest.OAuthProxy proxy);
69 [CCode (cname = "oauth_proxy_get_token_secret")]
70 public static unowned string get_token_secret (Rest.OAuthProxy proxy);
71 [CCode (cname = "oauth_proxy_set_token")]
72 public static void set_token (Rest.OAuthProxy proxy, string token);
73 [CCode (cname = "oauth_proxy_set_token_secret")]
74 public static void set_token_secret (Rest.OAuthProxy proxy, string token_secret);
75 [CCode (cname = "oauth_proxy_new_with_token", type = "RestProxy*", has_construct_function = false)]
76 public OAuthProxy.with_token (string consumer_key, string consumer_secret, string token, string token_secret, string url_format, bool binding_required);
78 public string consumer_key { owned get; construct; }
80 public string consumer_secret { owned get; construct; }
81 public string token { get; set; }
82 public string token_secret { get; set; }
84 [CCode (cheader_filename = "rest/oauth-proxy-call.h")]
85 public class OAuthProxyCall : Rest.ProxyCall {
87 [CCode (cheader_filename = "rest/rest-proxy.h")]
88 public class Proxy : GLib.Object {
89 [CCode (has_construct_function = false)]
90 public Proxy (string url_format, bool binding_required);
91 public bool bind (...);
92 public virtual bool bind_valist (void* @params);
93 public static GLib.Quark error_quark ();
94 public unowned string get_user_agent ();
95 public virtual Rest.ProxyCall new_call ();
96 public void set_user_agent (string user_agent);
97 public bool simple_run (string payload, int64 len) throws GLib.Error;
98 public virtual bool simple_run_valist (string payload, int64 len, void* @params) throws GLib.Error;
100 public bool binding_required { get; set; }
102 public string url_format { owned get; set; }
103 public string user_agent { get; set; }
105 [CCode (cheader_filename = "rest/rest-proxy-call.h")]
106 public class ProxyCall : GLib.Object {
107 public void add_header (string header, string value);
108 public void add_headers (...);
109 public void add_headers_from_valist (void* headers);
110 public void add_param (string param, string value);
111 public void add_params (...);
112 public void add_params_from_valist (void* @params);
113 public bool cancel () throws GLib.Error;
114 public static GLib.Quark error_quark ();
115 public unowned string get_method ();
116 public unowned GLib.HashTable<string,string> get_params ();
117 public unowned string get_payload ();
118 public int64 get_payload_length ();
119 public unowned GLib.HashTable get_response_headers ();
120 public uint get_status_code ();
121 public unowned string get_status_message ();
122 public unowned string lookup_header (string header);
123 public unowned string lookup_param (string param);
124 public unowned string lookup_response_header (string header);
126 public virtual bool prepare () throws GLib.Error;
127 public void remove_header (string header);
128 public void remove_param (string param);
129 public bool run (out unowned GLib.MainLoop loop) throws GLib.Error;
130 [CCode (cname = "rest_proxy_call_async")]
131 public bool run_async (Rest.ProxyCallAsyncCallback callback, GLib.Object weak_object) throws GLib.Error;
132 public void set_function (string function);
133 public void set_method (string method);
134 public bool sync () throws GLib.Error;
136 public Rest.Proxy proxy { owned get; construct; }
139 [CCode (ref_function = "rest_xml_node_ref", unref_function = "rest_xml_node_unref", type_id = "REST_TYPE_XML_NODE", cheader_filename = "rest/rest-xml-parser.h")]
140 public class XmlNode {
141 public weak GLib.HashTable attrs;
142 public weak GLib.HashTable children;
143 public weak string content;
144 public weak string name;
145 public weak Rest.XmlNode next;
146 public int ref_count;
147 public unowned Rest.XmlNode find (string tag);
148 public unowned string get_attr (string attr_name);
150 [CCode (cheader_filename = "rest/rest-xml-parser.h")]
151 public class XmlParser : GLib.Object {
152 [CCode (has_construct_function = false)]
154 public unowned Rest.XmlNode parse_from_data (string data, int64 len);
156 [CCode (cprefix = "", has_type_id = "0", cheader_filename = "rest/oauth-proxy.h")]
157 public enum OAuthSignatureMethod {
161 [CCode (cprefix = "REST_PROXY_CALL_", has_type_id = "0", cheader_filename = "rest/rest-proxy-call.h")]
162 public enum ProxyCallError {
165 [CCode (cprefix = "REST_PROXY_ERROR_", has_type_id = "0", cheader_filename = "rest/rest-proxy.h")]
166 public enum ProxyError {
173 HTTP_MULTIPLE_CHOICES,
174 HTTP_MOVED_PERMANENTLY,
180 HTTP_TEMPORARY_REDIRECT,
186 HTTP_METHOD_NOT_ALLOWED,
188 HTTP_PROXY_AUTHENTICATION_REQUIRED,
189 HTTP_REQUEST_TIMEOUT,
192 HTTP_LENGTH_REQUIRED,
193 HTTP_PRECONDITION_FAILED,
194 HTTP_REQUEST_ENTITY_TOO_LARGE,
195 HTTP_REQUEST_URI_TOO_LONG,
196 HTTP_UNSUPPORTED_MEDIA_TYPE,
197 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE,
198 HTTP_EXPECTATION_FAILED,
199 HTTP_INTERNAL_SERVER_ERROR,
200 HTTP_NOT_IMPLEMENTED,
202 HTTP_SERVICE_UNAVAILABLE,
203 HTTP_GATEWAY_TIMEOUT,
204 HTTP_HTTP_VERSION_NOT_SUPPORTED
206 [CCode (cheader_filename = "rest/oauth-proxy.h")]
207 public delegate void OAuthProxyAuthCallback (Rest.OAuthProxy proxy, GLib.Error error, GLib.Object weak_object);
208 [CCode (cheader_filename = "rest/rest-proxy-call.h")]
209 public delegate void ProxyCallAsyncCallback (Rest.ProxyCall call, GLib.Error error, GLib.Object weak_object);