Top | ![]() |
![]() |
![]() |
![]() |
A SnapdClient is the means of talking to snapd.
To communicate with snapd create a client with snapd_client_new()
then
connect with snapd_client_connect_sync()
.
Some requests require authorization which can be set with
snapd_client_set_auth_data()
.
void (*SnapdProgressCallback) (SnapdClient *client
,SnapdTask *main_task
,GPtrArray *tasks
,gpointer user_data
);
Signature for callback function used in
snapd_client_connect_interface_sync()
,
snapd_client_disconnect_interface_async()
,
snapd_client_install_sync()
,
snapd_client_refresh_sync()
,
snapd_client_remove_sync()
,
snapd_client_enable_sync()
and
snapd_client_disable_sync()
.
client |
||
main_task |
a SnapdTask describing the overall task in progress |
|
tasks |
tasks to be done / being done. |
[element-type SnapdTask] |
user_data |
user data passed to the callback |
gboolean snapd_client_connect_sync (SnapdClient *client
,GCancellable *cancellable
,GError **error
);
Connect to snapd.
void snapd_client_connect_async (SnapdClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously connect to snapd.
See snapd_client_connect_sync()
for more information.
gboolean snapd_client_connect_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_connect_async()
.
See snapd_client_connect_sync()
for more information.
SnapdAuthData * snapd_client_login_sync (SnapdClient *client
,const gchar *username
,const gchar *password
,const gchar *otp
,GCancellable *cancellable
,GError **error
);
Log in to snapd and get authorization to install/remove snaps.
This call requires root access; use snapd_login_sync()
if you are non-root.
client |
a SnapdClient. |
|
username |
usename to log in with. |
|
password |
password to log in with. |
|
otp |
response to one-time password challenge. |
[allow-none] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_login_async (SnapdClient *client
,const gchar *username
,const gchar *password
,const gchar *otp
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get authorization to install/remove snaps.
See snapd_client_login_sync()
for more information.
client |
a SnapdClient. |
|
username |
usename to log in with. |
|
password |
password to log in with. |
|
otp |
response to one-time password challenge. |
[allow-none] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
SnapdAuthData * snapd_client_login_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_login_async()
.
See snapd_client_login_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_set_auth_data (SnapdClient *client
,SnapdAuthData *auth_data
);
Set the authorization data to use for requests. Authorization data can be obtained by:
Logging into snapd using snapd_login_sync()
or snapd_client_login_sync()
(requires root access)
Using an existing authorization with snapd_auth_data_new()
.
SnapdAuthData *
snapd_client_get_auth_data (SnapdClient *client
);
Get the authorization data that is used for requests.
SnapdSystemInformation * snapd_client_get_system_information_sync (SnapdClient *client
,GCancellable *cancellable
,GError **error
);
Request system information from snapd. While this blocks, snapd is expected to return the information quickly.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_get_system_information_async (SnapdClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Request system information asynchronously from snapd.
See snapd_client_get_system_information_sync()
for more information.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
SnapdSystemInformation * snapd_client_get_system_information_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_get_system_information_async()
.
See snapd_client_get_system_information_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
GPtrArray * snapd_client_list_sync (SnapdClient *client
,GCancellable *cancellable
,GError **error
);
Get information on all installed snaps.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_list_async (SnapdClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get information on all installed snaps.
See snapd_client_list_sync()
for more information.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
GPtrArray * snapd_client_list_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_list_async()
.
See snapd_client_list_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
SnapdSnap * snapd_client_list_one_sync (SnapdClient *client
,const gchar *name
,GCancellable *cancellable
,GError **error
);
Get information of a single installed snap.
client |
a SnapdClient. |
|
name |
name of snap to get. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_list_one_async (SnapdClient *client
,const gchar *name
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get information of a single installed snap.
See snapd_client_list_one_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to get. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
SnapdSnap * snapd_client_list_one_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_list_one_async()
.
See snapd_client_list_one_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
SnapdIcon * snapd_client_get_icon_sync (SnapdClient *client
,const gchar *name
,GCancellable *cancellable
,GError **error
);
Get the icon for an installed snap.
client |
a SnapdClient. |
|
name |
name of snap to get icon for. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_get_icon_async (SnapdClient *client
,const gchar *name
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get the icon for an installed snap.
See snapd_client_get_icon_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to get icon for. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
SnapdIcon * snapd_client_get_icon_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_get_icon_async()
.
See snapd_client_get_icon_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_get_interfaces_sync (SnapdClient *client
,GPtrArray **plugs
,GPtrArray **slots
,GCancellable *cancellable
,GError **error
);
Get the installed snap interfaces.
client |
a SnapdClient. |
|
plugs |
the location to store the plug array or |
[out][allow-none][transfer container][element-type SnapdPlug] |
slots |
the location to store the slot array or |
[out][allow-none][transfer container][element-type SnapdSlot] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_get_interfaces_async (SnapdClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get the installed snap interfaces.
See snapd_client_get_interfaces_sync()
for more information.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_get_interfaces_finish (SnapdClient *client
,GAsyncResult *result
,GPtrArray **plugs
,GPtrArray **slots
,GError **error
);
Complete request started with snapd_client_get_interfaces_async()
.
See snapd_client_get_interfaces_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
plugs |
the location to store the plug array or |
[out][allow-none][transfer container][element-type SnapdPlug] |
slots |
the location to store the slot array or |
[out][allow-none][transfer container][element-type SnapdSlot] |
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_connect_interface_sync (SnapdClient *client
,const gchar *plug_snap
,const gchar *plug_name
,const gchar *slot_snap
,const gchar *slot_name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Connect two interfaces together.
An asynchronous version of this function is snapd_client_connect_interface_async()
.
client |
a SnapdClient. |
|
plug_snap |
name of snap containing plug. |
|
plug_name |
name of plug to connect. |
|
slot_snap |
name of snap containing socket. |
|
slot_name |
name of slot to connect. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_connect_interface_async (SnapdClient *client
,const gchar *plug_snap
,const gchar *plug_name
,const gchar *slot_snap
,const gchar *slot_name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously connect two interfaces together.
See snapd_client_connect_interface_sync()
for more information.
client |
a SnapdClient. |
|
plug_snap |
name of snap containing plug. |
|
plug_name |
name of plug to connect. |
|
slot_snap |
name of snap containing socket. |
|
slot_name |
name of slot to connect. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_connect_interface_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_connect_interface_async()
.
See snapd_client_connect_interface_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_disconnect_interface_sync (SnapdClient *client
,const gchar *plug_snap
,const gchar *plug_name
,const gchar *slot_snap
,const gchar *slot_name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Disconnect two interfaces.
client |
a SnapdClient. |
|
plug_snap |
name of snap containing plug. |
|
plug_name |
name of plug to disconnect. |
|
slot_snap |
name of snap containing socket. |
|
slot_name |
name of slot to disconnect. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope call] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_disconnect_interface_async (SnapdClient *client
,const gchar *plug_snap
,const gchar *plug_name
,const gchar *slot_snap
,const gchar *slot_name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously disconnect two interfaces.
See snapd_client_disconnect_interface_sync()
for more information.
client |
a SnapdClient. |
|
plug_snap |
name of snap containing plug. |
|
plug_name |
name of plug to disconnect. |
|
slot_snap |
name of snap containing socket. |
|
slot_name |
name of slot to disconnect. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_disconnect_interface_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_disconnect_interface_async()
.
See snapd_client_disconnect_interface_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
GPtrArray * snapd_client_find_sync (SnapdClient *client
,SnapdFindFlags flags
,const gchar *query
,gchar **suggested_currency
,GCancellable *cancellable
,GError **error
);
Find snaps in the store.
client |
a SnapdClient. |
|
flags |
a set of SnapdFindFlags to control how the find is performed. |
|
query |
query string to send. |
|
suggested_currency |
location to store the ISO 4217 currency that is suggested to purchase with. |
[allow-none] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_find_async (SnapdClient *client
,SnapdFindFlags flags
,const gchar *query
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously find snaps in the store.
See snapd_client_find_sync()
for more information.
client |
a SnapdClient. |
|
flags |
a set of SnapdFindFlags to control how the find is performed. |
|
query |
query string to send. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
GPtrArray * snapd_client_find_finish (SnapdClient *client
,GAsyncResult *result
,gchar **suggested_currency
,GError **error
);
Complete request started with snapd_client_find_async()
.
See snapd_client_find_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
suggested_currency |
location to store the ISO 4217 currency that is suggested to purchase with. |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_install_sync (SnapdClient *client
,const gchar *name
,const gchar *channel
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Install a snap from the store.
client |
a SnapdClient. |
|
name |
name of snap to install. |
|
channel |
channel to install from or |
[allow-none] |
progress_callback |
function to callback with progress. |
[allow-none][scope call] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_install_async (SnapdClient *client
,const gchar *name
,const gchar *channel
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously install a snap from the store.
See snapd_client_install_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to install. |
|
channel |
channel to install from or |
[allow-none] |
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_install_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_install_async()
.
See snapd_client_install_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_refresh_sync (SnapdClient *client
,const gchar *name
,const gchar *channel
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Ensure an installed snap is at the latest version.
client |
a SnapdClient. |
|
name |
name of snap to refresh. |
|
channel |
channel to refresh from or |
[allow-none] |
progress_callback |
function to callback with progress. |
[allow-none][scope call] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_refresh_async (SnapdClient *client
,const gchar *name
,const gchar *channel
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously ensure an installed snap is at the latest version.
See snapd_client_refresh_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to refresh. |
|
channel |
channel to refresh from or |
[allow-none] |
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_refresh_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_refresh_async()
.
See snapd_client_refresh_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_remove_sync (SnapdClient *client
,const gchar *name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Uninstall a snap.
client |
a SnapdClient. |
|
name |
name of snap to remove. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope call] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_remove_async (SnapdClient *client
,const gchar *name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously uninstall a snap.
See snapd_client_remove_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to remove. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_remove_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_remove_async()
.
See snapd_client_remove_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_enable_sync (SnapdClient *client
,const gchar *name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Enable an installed snap.
client |
a SnapdClient. |
|
name |
name of snap to enable. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope call] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_enable_async (SnapdClient *client
,const gchar *name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously enable an installed snap.
See snapd_client_enable_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to enable. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_enable_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_enable_async()
.
See snapd_client_enable_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_disable_sync (SnapdClient *client
,const gchar *name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GError **error
);
Disable an installed snap.
client |
a SnapdClient. |
|
name |
name of snap to disable. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope call] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_disable_async (SnapdClient *client
,const gchar *name
,SnapdProgressCallback progress_callback
,gpointer progress_callback_data
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously disable an installed snap.
See snapd_client_disable_sync()
for more information.
client |
a SnapdClient. |
|
name |
name of snap to disable. |
|
progress_callback |
function to callback with progress. |
[allow-none][scope async] |
progress_callback_data |
user data to pass to |
[closure] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_disable_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_disable_async()
.
See snapd_client_disable_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_check_buy_sync (SnapdClient *client
,GCancellable *cancellable
,GError **error
);
Check if able to buy snaps.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_check_buy_async (SnapdClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously check if able to buy snaps.
See snapd_client_check_buy_sync()
for more information.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_check_buy_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_check_buy_async()
.
See snapd_client_check_buy_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
gboolean snapd_client_buy_sync (SnapdClient *client
,const gchar *id
,gdouble amount
,const gchar *currency
,GCancellable *cancellable
,GError **error
);
Buy a snap from the store. Once purchased, this snap can be installed with
snapd_client_install_sync()
.
client |
a SnapdClient. |
|
id |
id of snap to buy. |
|
amount |
amount of currency to spend, e.g. 0.99. |
|
currency |
the currency to buy with as an ISO 4217 currency code, e.g. "NZD". |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_buy_async (SnapdClient *client
,const gchar *id
,gdouble amount
,const gchar *currency
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously buy a snap from the store.
See snapd_client_buy_sync()
for more information.
client |
a SnapdClient. |
|
id |
id of snap to buy. |
|
amount |
amount of currency to spend, e.g. 0.99. |
|
currency |
the currency to buy with as an ISO 4217 currency code, e.g. "NZD". |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
gboolean snapd_client_buy_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_buy_async()
.
See snapd_client_buy_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
SnapdUserInformation * snapd_client_create_user_sync (SnapdClient *client
,const gchar *email
,SnapdCreateUserFlags flags
,GCancellable *cancellable
,GError **error
);
Create a local user account for the given user.
client |
a SnapdClient. |
|
the email of the user to create. |
||
flags |
a set of SnapdCreateUserFlags to control how the user account is created. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
void snapd_client_create_user_async (SnapdClient *client
,const gchar *email
,SnapdCreateUserFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously create a local user account.
See snapd_client_create_user_sync()
for more information.
client |
a SnapdClient. |
|
the email of the user to create. |
||
flags |
a set of SnapdCreateUserFlags to control how the user account is created. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
SnapdUserInformation * snapd_client_create_user_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_create_user_async()
.
See snapd_client_create_user_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
GPtrArray * snapd_client_create_users_sync (SnapdClient *client
,GCancellable *cancellable
,GError **error
);
Create local user accounts using the system-user assertions that are valid for this device.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
error |
GError location to store the error occurring, or |
[allow-none] |
an array of SnapdUserInformation or NULL
on error.
[transfer container][element-type SnapdUserInformation]
void snapd_client_create_users_async (SnapdClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously create a local user account.
See snapd_client_create_user_sync()
for more information.
client |
a SnapdClient. |
|
cancellable |
a GCancellable or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when the request is satisfied. |
[scope async] |
user_data |
the data to pass to callback function. |
[closure] |
GPtrArray * snapd_client_create_users_finish (SnapdClient *client
,GAsyncResult *result
,GError **error
);
Complete request started with snapd_client_create_users_async()
.
See snapd_client_create_users_sync()
for more information.
client |
a SnapdClient. |
|
result |
a GAsyncResult. |
|
error |
GError location to store the error occurring, or |
[allow-none] |
an array of SnapdUserInformation or NULL
on error.
[transfer container][element-type SnapdUserInformation]
typedef struct _SnapdClient SnapdClient;
SnapdClient is an opaque data structure and can only be accessed using the provided functions.