/* jsonrpc-glib-1.0.vapi generated by vapigen, do not modify. */

[CCode (cprefix = "Jsonrpc", gir_namespace = "Jsonrpc", gir_version = "1.0", lower_case_cprefix = "jsonrpc_")]
namespace Jsonrpc {
	namespace Message {
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetBoolean")]
		public struct GetBoolean {
			public Jsonrpc.MessageMagic magic;
			public bool valptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_BOOLEAN")]
			public static void* create (ref bool val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetDict")]
		public struct GetDict {
			public Jsonrpc.MessageMagic magic;
			public weak GLib.VariantDict dictptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_DICT")]
			public static void* create (ref GLib.VariantDict val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetDouble")]
		public struct GetDouble {
			public Jsonrpc.MessageMagic magic;
			public double valptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_DOUBLE")]
			public static void* create (ref double val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetInt32")]
		public struct GetInt32 {
			public Jsonrpc.MessageMagic magic;
			public int32 valptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_INT32")]
			public static void* create (ref int32 val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetInt64")]
		public struct GetInt64 {
			public Jsonrpc.MessageMagic magic;
			public int64 valptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_INT64")]
			public static void* create (ref int64 val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetIter")]
		public struct GetIter {
			public Jsonrpc.MessageMagic magic;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_ITER")]
			public static void* create (ref GLib.VariantIter val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetString")]
		public struct GetString {
			public Jsonrpc.MessageMagic magic;
			public weak string valptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_STRING")]
			public static void* create (ref unowned string val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetStrv")]
		public struct GetStrv {
			public Jsonrpc.MessageMagic magic;
			[CCode (array_length = false)]
			public weak string[] valptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_STRV")]
			public static void* create ([CCode (array_length = false)] ref string[] val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessageGetVariant")]
		public struct GetVariant {
			public Jsonrpc.MessageMagic magic;
			public weak GLib.Variant variantptr;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_GET_VARIANT")]
			public static void* create (ref GLib.Variant val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessagePutBoolean")]
		public struct PutBoolean {
			public Jsonrpc.MessageMagic magic;
			public bool val;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_PUT_BOOLEAN")]
			public static void* create (bool val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessagePutDouble")]
		public struct PutDouble {
			public Jsonrpc.MessageMagic magic;
			public double val;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_PUT_DOUBLE")]
			public static void* create (double val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessagePutInt32")]
		public struct PutInt32 {
			public Jsonrpc.MessageMagic magic;
			public int32 val;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_PUT_INT32")]
			public static void* create (int32 val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessagePutInt64")]
		public struct PutInt64 {
			public Jsonrpc.MessageMagic magic;
			public int64 val;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_PUT_INT64")]
			public static void* create (int64 val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessagePutString")]
		public struct PutString {
			public Jsonrpc.MessageMagic magic;
			public weak string val;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_PUT_STRING")]
			public static void* create (string val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
		[GIR (name = "MessagePutStrv")]
		public struct PutStrv {
			public Jsonrpc.MessageMagic magic;
			[CCode (array_length = false)]
			public weak string[] val;
			[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MESSAGE_PUT_STRV")]
			public static void* create ([CCode (array_length = false)] string[] val);
		}
		[CCode (cheader_filename = "jsonrpc-glib.h")]
		public static GLib.Variant @new (...);
		[CCode (cheader_filename = "jsonrpc-glib.h")]
		public static GLib.Variant new_array (...);
		[CCode (cheader_filename = "jsonrpc-glib.h")]
		public static bool parse (GLib.Variant message, ...);
		[CCode (cheader_filename = "jsonrpc-glib.h")]
		public static bool parse_array (GLib.VariantIter iter, ...);
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", type_id = "jsonrpc_client_get_type ()")]
	[Version (since = "3.26")]
	public class Client : GLib.Object {
		[CCode (has_construct_function = false)]
		public Client (GLib.IOStream io_stream);
		public bool call (string method, GLib.Variant? @params, GLib.Cancellable? cancellable, out GLib.Variant? return_value) throws GLib.Error;
		public async bool call_async (string method, GLib.Variant? @params, GLib.Cancellable? cancellable, out GLib.Variant? return_value) throws GLib.Error;
		[CCode (finish_name = "jsonrpc_client_call_finish")]
		[Version (since = "3.30")]
		public async bool call_with_id_async (string method, GLib.Variant? @params, GLib.Variant* id, GLib.Cancellable? cancellable, out GLib.Variant? return_value) throws GLib.Error;
		public bool close (GLib.Cancellable? cancellable = null) throws GLib.Error;
		public async bool close_async (GLib.Cancellable? cancellable) throws GLib.Error;
		public static GLib.Quark error_quark ();
		public bool get_use_gvariant ();
		public bool reply (GLib.Variant id, GLib.Variant? result, GLib.Cancellable? cancellable = null) throws GLib.Error;
		public async bool reply_async (GLib.Variant id, GLib.Variant result, GLib.Cancellable? cancellable) throws GLib.Error;
		[Version (since = "3.28")]
		public async bool reply_error_async (GLib.Variant id, int code, string? message, GLib.Cancellable? cancellable) throws GLib.Error;
		public bool send_notification (string method, GLib.Variant? @params, GLib.Cancellable? cancellable = null) throws GLib.Error;
		public async bool send_notification_async (string method, GLib.Variant? @params, GLib.Cancellable? cancellable) throws GLib.Error;
		public void set_use_gvariant (bool use_gvariant);
		public void start_listening ();
		[NoAccessorMethod]
		public GLib.IOStream io_stream { construct; }
		public bool use_gvariant { get; set; }
		[Version (since = "3.28")]
		public virtual signal void failed ();
		public virtual signal bool handle_call (string method, GLib.Variant id, GLib.Variant? @params);
		public virtual signal void notification (string method_name, GLib.Variant? @params);
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", type_id = "jsonrpc_input_stream_get_type ()")]
	public class InputStream : GLib.DataInputStream, GLib.Seekable {
		[CCode (has_construct_function = false)]
		public InputStream (GLib.InputStream base_stream);
		public bool read_message (GLib.Cancellable? cancellable, GLib.Variant message) throws GLib.Error;
		public async bool read_message_async (GLib.Cancellable? cancellable) throws GLib.Error;
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", type_id = "jsonrpc_output_stream_get_type ()")]
	public class OutputStream : GLib.DataOutputStream, GLib.Seekable {
		[CCode (has_construct_function = false)]
		public OutputStream (GLib.OutputStream base_stream);
		public bool get_use_gvariant ();
		public void set_use_gvariant (bool use_gvariant);
		[Version (since = "3.26")]
		public bool write_message (GLib.Variant message, GLib.Cancellable? cancellable = null) throws GLib.Error;
		[Version (since = "3.26")]
		public async bool write_message_async (GLib.Variant message, GLib.Cancellable? cancellable) throws GLib.Error;
		public bool use_gvariant { get; set; }
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", type_id = "jsonrpc_server_get_type ()")]
	public class Server : GLib.Object {
		[CCode (has_construct_function = false)]
		[Version (since = "3.26")]
		public Server ();
		[Version (since = "3.26")]
		public void accept_io_stream (GLib.IOStream io_stream);
		[Version (since = "3.26")]
		public uint add_handler (string method, owned Jsonrpc.ServerHandler handler);
		[Version (since = "3.28")]
		public void @foreach (GLib.Func foreach_func);
		[Version (since = "3.26")]
		public void remove_handler (uint handler_id);
		[Version (since = "3.28")]
		public virtual signal void client_accepted (Jsonrpc.Client client);
		[Version (since = "3.30")]
		public virtual signal void client_closed (Jsonrpc.Client client);
		[Version (since = "3.26")]
		public virtual signal bool handle_call (Jsonrpc.Client client, string method, GLib.Variant id, GLib.Variant @params);
		[Version (since = "3.26")]
		public virtual signal void notification (Jsonrpc.Client client, string method, GLib.Variant @params);
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
	public struct MessageAny {
		public Jsonrpc.MessageMagic magic;
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", has_type_id = false)]
	public struct MessageMagic {
		[CCode (array_length = false)]
		public weak char bytes[8];
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", cprefix = "JSONRPC_CLIENT_ERROR_", has_type_id = false)]
	public enum ClientError {
		PARSE_ERROR,
		INVALID_REQUEST,
		METHOD_NOT_FOUND,
		INVALID_PARAMS,
		INTERNAL_ERROR
	}
	[CCode (cheader_filename = "jsonrpc-glib.h", instance_pos = 5.9)]
	public delegate void ServerHandler (Jsonrpc.Server self, Jsonrpc.Client client, string method, GLib.Variant id, GLib.Variant @params);
	[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MAJOR_VERSION")]
	public const int MAJOR_VERSION;
	[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MICRO_VERSION")]
	public const int MICRO_VERSION;
	[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_MINOR_VERSION")]
	public const int MINOR_VERSION;
	[CCode (cheader_filename = "jsonrpc-glib.h", cname = "JSONRPC_VERSION_S")]
	public const string VERSION_S;
}
