rest-0.7.vapi 12.8 KB
Newer Older
Luca Bruno's avatar
Luca Bruno committed
1
/* rest-0.7.vapi generated by vapigen, do not modify. */
Michal Hruby's avatar
Michal Hruby committed
2

3
[CCode (cprefix = "Rest", gir_namespace = "Rest", gir_version = "0.7", lower_case_cprefix = "rest_")]
Michal Hruby's avatar
Michal Hruby committed
4
namespace Rest {
5
	[CCode (cheader_filename = "rest/oauth2-proxy.h", cname = "OAuth2Proxy", lower_case_cprefix = "oauth2_proxy_", type_id = "oauth2_proxy_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
6
	public class OAuth2Proxy : Rest.Proxy {
7
		[CCode (has_construct_function = false, type = "RestProxy*")]
Michal Hruby's avatar
Michal Hruby committed
8 9 10 11 12 13
		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);
14
		[CCode (has_construct_function = false, type = "RestProxy*")]
Michal Hruby's avatar
Michal Hruby committed
15 16 17 18 19 20 21
		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; }
	}
22
	[CCode (cheader_filename = "rest/oauth2-proxy-call.h", cname = "OAuth2ProxyCall", lower_case_cprefix = "oauth2_proxy_call_", type_id = "oauth2_proxy_call_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
23 24 25 26
	public class OAuth2ProxyCall : Rest.ProxyCall {
		[CCode (has_construct_function = false)]
		protected OAuth2ProxyCall ();
	}
27
	[CCode (cheader_filename = "rest/oauth-proxy.h", cname = "OAuthProxy", lower_case_cprefix = "oauth_proxy_", type_id = "oauth_proxy_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
28
	public class OAuthProxy : Rest.Proxy {
29
		[CCode (has_construct_function = false, type = "RestProxy*")]
Michal Hruby's avatar
Michal Hruby committed
30 31
		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;
32
		public bool access_token_async (string function, string verifier, [CCode (delegate_target_pos = 4.1, scope = "async")] Rest.OAuthProxyAuthCallback callback, GLib.Object weak_object) throws GLib.Error;
Michal Hruby's avatar
Michal Hruby committed
33
		public bool auth_step (string function) throws GLib.Error;
34
		public bool auth_step_async (string function, [CCode (delegate_target_pos = 3.1, scope = "async")] Rest.OAuthProxyAuthCallback callback, GLib.Object weak_object) throws GLib.Error;
Michal Hruby's avatar
Michal Hruby committed
35 36 37 38
		public unowned string get_signature_host ();
		public unowned string get_token ();
		public unowned string get_token_secret ();
		public bool is_oauth10a ();
39
		public Rest.Proxy new_echo_proxy (string service_url, string url_format, bool binding_required);
Michal Hruby's avatar
Michal Hruby committed
40
		public bool request_token (string function, string callback_uri) throws GLib.Error;
41
		public bool request_token_async (string function, string callback_uri, [CCode (delegate_target_pos = 4.1, scope = "async")] Rest.OAuthProxyAuthCallback callback, GLib.Object weak_object) throws GLib.Error;
Michal Hruby's avatar
Michal Hruby committed
42 43 44
		public void set_signature_host (string signature_host);
		public void set_token (string token);
		public void set_token_secret (string token_secret);
45
		[CCode (has_construct_function = false, type = "RestProxy*")]
Michal Hruby's avatar
Michal Hruby committed
46 47 48 49 50 51 52 53 54 55 56
		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; }
	}
57
	[CCode (cheader_filename = "rest/oauth-proxy-call.h", cname = "OAuthProxyCall", lower_case_cprefix = "oauth_proxy_call_", type_id = "oauth_proxy_call_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
58 59 60 61
	public class OAuthProxyCall : Rest.ProxyCall {
		[CCode (has_construct_function = false)]
		protected OAuthProxyCall ();
		public void parse_token_reponse ();
62
		public void parse_token_response ();
Michal Hruby's avatar
Michal Hruby committed
63
	}
64
	[CCode (cheader_filename = "rest/rest-param.h", ref_function = "rest_param_ref", type_id = "rest_param_get_type ()", unref_function = "rest_param_unref")]
65
	[Compact]
Michal Hruby's avatar
Michal Hruby committed
66
	public class Param {
67 68 69
		[CCode (has_construct_function = false)]
		public Param.full (global::string name, Rest.MemoryUse use, [CCode (array_length_cname = "length", array_length_pos = 3.5, array_length_type = "gsize")] uint8[] data, global::string content_type, global::string filename);
		public void* get_content ();
Michal Hruby's avatar
Michal Hruby committed
70
		public size_t get_content_length ();
71 72 73
		public unowned global::string get_content_type ();
		public unowned global::string get_file_name ();
		public unowned global::string get_name ();
Michal Hruby's avatar
Michal Hruby committed
74
		public bool is_string ();
75
		public unowned Rest.Param @ref ();
76 77
		[CCode (has_construct_function = false)]
		public Param.string (global::string name, Rest.MemoryUse use, global::string string);
Michal Hruby's avatar
Michal Hruby committed
78
		public void unref ();
79 80
		[CCode (has_construct_function = false)]
		public Param.with_owner (global::string name, [CCode (array_length_cname = "length", array_length_pos = 2.5, array_length_type = "gsize")] uint8[] data, global::string content_type, global::string? filename, owned void* owner, GLib.DestroyNotify? owner_dnotify);
Michal Hruby's avatar
Michal Hruby committed
81
	}
82
	[CCode (cheader_filename = "rest/rest-params.h", has_type_id = false)]
83
	[Compact]
Michal Hruby's avatar
Michal Hruby committed
84
	public class Params {
85
		public void add (owned Rest.Param param);
Michal Hruby's avatar
Michal Hruby committed
86
		public bool are_strings ();
87
		public GLib.HashTable<weak string,weak string> as_string_hash_table ();
Michal Hruby's avatar
Michal Hruby committed
88
		public void free ();
89
		public unowned Rest.Param? @get (string name);
Michal Hruby's avatar
Michal Hruby committed
90 91
		public void remove (string name);
	}
92
	[CCode (cheader_filename = "rest/rest-params.h", has_type_id = false)]
93
	[Compact]
Michal Hruby's avatar
Michal Hruby committed
94 95 96 97
	public class ParamsIter {
		public void init (Rest.Params @params);
		public bool next (string name, Rest.Param param);
	}
98
	[CCode (cheader_filename = "rest/rest-proxy.h", type_id = "rest_proxy_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
99 100 101
	public class Proxy : GLib.Object {
		[CCode (has_construct_function = false)]
		public Proxy (string url_format, bool binding_required);
102
		[Version (since = "0.7.92")]
103
		public void add_soup_feature (Soup.SessionFeature feature);
Michal Hruby's avatar
Michal Hruby committed
104 105
		public bool bind (...);
		public unowned string get_user_agent ();
106
		public virtual Rest.ProxyCall new_call ();
Michal Hruby's avatar
Michal Hruby committed
107
		public void set_user_agent (string user_agent);
108 109
		[CCode (has_construct_function = false)]
		public Proxy.with_authentication (string url_format, bool binding_required, string username, string password);
Michal Hruby's avatar
Michal Hruby committed
110 111 112 113 114
		[NoAccessorMethod]
		public bool binding_required { get; set; }
		[NoAccessorMethod]
		public bool disable_cookies { get; construct; }
		[NoAccessorMethod]
115
		public string password { owned get; set; }
116
		[NoAccessorMethod]
117 118
		public string ssl_ca_file { owned get; set; }
		[NoAccessorMethod]
119 120
		public bool ssl_strict { get; set; }
		[NoAccessorMethod]
Michal Hruby's avatar
Michal Hruby committed
121 122
		public string url_format { owned get; set; }
		public string user_agent { get; set; }
123
		[NoAccessorMethod]
124 125 126 127 128 129 130
		public string username { owned get; set; }
		public virtual signal bool authenticate (Rest.ProxyAuth auth, bool retrying);
	}
	[CCode (cheader_filename = "rest/oauth-proxy-call.h,rest/oauth-proxy.h,rest/oauth2-proxy-call.h,rest/oauth2-proxy.h,rest/rest-enum-types.h,rest/rest-param.h,rest/rest-params.h,rest/rest-proxy-auth.h,rest/rest-proxy-call.h,rest/rest-proxy.h,rest/rest-xml-node.h,rest/rest-xml-parser.h", type_id = "rest_proxy_auth_get_type ()")]
	public class ProxyAuth : GLib.Object {
		[CCode (has_construct_function = false)]
		protected ProxyAuth ();
131
		public void cancel ();
132 133
		public void pause ();
		public void unpause ();
Michal Hruby's avatar
Michal Hruby committed
134
	}
135
	[CCode (cheader_filename = "rest/rest-proxy-call.h", type_id = "rest_proxy_call_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
136 137 138 139 140 141
	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);
142
		public void add_param_full (owned Rest.Param param);
Michal Hruby's avatar
Michal Hruby committed
143
		public void add_params (...);
144
		public bool cancel ();
145
		public bool continuous ([CCode (delegate_target_pos = 2.1)] Rest.ProxyCallContinuousCallback callback, GLib.Object weak_object) throws GLib.Error;
146
		[Version (since = "0.7.92")]
147
		public unowned string get_function ();
Michal Hruby's avatar
Michal Hruby committed
148 149 150 151
		public unowned string get_method ();
		public unowned Rest.Params get_params ();
		public unowned string get_payload ();
		public int64 get_payload_length ();
152
		public GLib.HashTable<weak string,weak string> get_response_headers ();
Michal Hruby's avatar
Michal Hruby committed
153 154
		public uint get_status_code ();
		public unowned string get_status_message ();
155
		public async bool invoke_async (GLib.Cancellable? cancellable) throws GLib.Error;
Michal Hruby's avatar
Michal Hruby committed
156
		public unowned string lookup_header (string header);
157
		public Rest.Param lookup_param (string name);
Michal Hruby's avatar
Michal Hruby committed
158 159 160 161 162 163 164 165 166 167 168 169
		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;
170
		public bool upload ([CCode (delegate_target_pos = 2.1, scope = "async")] Rest.ProxyCallUploadCallback callback, GLib.Object weak_object) throws GLib.Error;
Michal Hruby's avatar
Michal Hruby committed
171 172 173
		[NoAccessorMethod]
		public Rest.Proxy proxy { owned get; construct; }
	}
174
	[CCode (cheader_filename = "rest/rest-xml-node.h", ref_function = "rest_xml_node_ref", type_id = "rest_xml_node_get_type ()", unref_function = "rest_xml_node_unref")]
Michal Hruby's avatar
Michal Hruby committed
175 176 177 178 179 180 181 182 183 184 185 186 187
	[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 ();
188
		public unowned Rest.XmlNode @ref ();
Michal Hruby's avatar
Michal Hruby committed
189
		public void set_content (string value);
190
		public void unref ();
Michal Hruby's avatar
Michal Hruby committed
191
	}
192
	[CCode (cheader_filename = "rest/rest-xml-parser.h", type_id = "rest_xml_parser_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
193 194 195 196 197
	public class XmlParser : GLib.Object {
		[CCode (has_construct_function = false)]
		public XmlParser ();
		public Rest.XmlNode parse_from_data (string data, int64 len);
	}
198
	[CCode (cheader_filename = "rest/rest-param.h", cprefix = "REST_MEMORY_", has_type_id = false)]
Michal Hruby's avatar
Michal Hruby committed
199 200 201 202 203
	public enum MemoryUse {
		STATIC,
		TAKE,
		COPY
	}
204
	[CCode (cheader_filename = "rest/oauth-proxy.h", cname = "OAuthSignatureMethod", cprefix = "", type_id = "oauth_signature_method_get_type ()")]
Michal Hruby's avatar
Michal Hruby committed
205 206 207 208
	public enum OAuthSignatureMethod {
		PLAINTEXT,
		HMAC_SHA1
	}
209
	[CCode (cheader_filename = "rest/rest-proxy-call.h", cprefix = "REST_PROXY_CALL_")]
Michal Hruby's avatar
Michal Hruby committed
210 211 212 213
	public errordomain ProxyCallError {
		FAILED;
		public static GLib.Quark quark ();
	}
214
	[CCode (cheader_filename = "rest/rest-proxy.h", cprefix = "REST_PROXY_ERROR_")]
Michal Hruby's avatar
Michal Hruby committed
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
	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 ();
	}
256
	[CCode (cheader_filename = "rest/oauth-proxy.h", instance_pos = 3.9)]
Michal Hruby's avatar
Michal Hruby committed
257 258 259 260 261 262 263 264
	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);
}