SnapdSnap

SnapdSnap — Snap metadata

Functions

Properties

GPtrArray * apps Read / Write / Construct Only
gchar * channel Read / Write / Construct Only
SnapdConfinement confinement Read / Write / Construct Only
gchar * description Read / Write / Construct Only
gchar * developer Read / Write / Construct Only
gboolean devmode Read / Write / Construct Only
gint64 download-size Read / Write / Construct Only
gchar * icon Read / Write / Construct Only
gchar * id Read / Write / Construct Only
GDateTime * install-date Read / Write / Construct Only
gint64 installed-size Read / Write / Construct Only
gchar * name Read / Write / Construct Only
GPtrArray * prices Read / Write / Construct Only
gboolean private Read / Write / Construct Only
gchar * revision Read / Write / Construct Only
GPtrArray * screenshots Read / Write / Construct Only
SnapdSnapType snap-type Read / Write / Construct Only
SnapdSnapStatus status Read / Write / Construct Only
gchar * summary Read / Write / Construct Only
gboolean trymode Read / Write / Construct Only
gchar * version Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── SnapdSnap

Includes

#include <snapd-glib/snapd-glib.h>

Description

A SnapdSnap contains the metadata for a given snap. Snap metadata can be retrieved using snapd_client_list_sync(), snapd_client_list_one_sync() or snapd_client_find_sync().

Functions

snapd_snap_get_apps ()

GPtrArray *
snapd_snap_get_apps (SnapdSnap *snap);

Get the apps this snap provides.

Parameters

snap

a SnapdSnap.

 

Returns

an array of SnapdApp.

[transfer none][element-type SnapdApp]


snapd_snap_get_channel ()

const gchar *
snapd_snap_get_channel (SnapdSnap *snap);

Get the channel this snap is from, e.g. "stable".

Parameters

snap

a SnapdSnap.

 

Returns

a channel name.


snapd_snap_get_confinement ()

SnapdConfinement
snapd_snap_get_confinement (SnapdSnap *snap);

Get the confinement this snap is using, e.g. SNAPD_CONFINEMENT_STRICT.

Parameters

snap

a SnapdSnap.

 

Returns

a SnapdConfinement.


snapd_snap_get_description ()

const gchar *
snapd_snap_get_description (SnapdSnap *snap);

Get a multi-line description of this snap.

Parameters

snap

a SnapdSnap.

 

Returns

description text.


snapd_snap_get_developer ()

const gchar *
snapd_snap_get_developer (SnapdSnap *snap);

Get the developer who created this snap.

Parameters

snap

a SnapdSnap.

 

Returns

a developer name.


snapd_snap_get_devmode ()

gboolean
snapd_snap_get_devmode (SnapdSnap *snap);

Get if this snap is running in developmer mode.

Parameters

snap

a SnapdSnap.

 

Returns

TRUE if this snap is running in devmode.


snapd_snap_get_download_size ()

gint64
snapd_snap_get_download_size (SnapdSnap *snap);

Get the download size of this snap or 0 if unknown.

Parameters

snap

a SnapdSnap.

 

Returns

a byte count.


snapd_snap_get_icon ()

const gchar *
snapd_snap_get_icon (SnapdSnap *snap);

Get the icon for this Snap, either a URL or an absolute path to retrieve it from snapd directly.

Parameters

snap

a SnapdSnap.

 

Returns

a URL or path.


snapd_snap_get_id ()

const gchar *
snapd_snap_get_id (SnapdSnap *snap);

Gets the unique ID for this snap.

Parameters

snap

a SnapdSnap.

 

Returns

an ID.


snapd_snap_get_install_date ()

GDateTime *
snapd_snap_get_install_date (SnapdSnap *snap);

Get the date this snap was installed or NULL if unknown.

Parameters

snap

a SnapdSnap.

 

Returns

a GDateTime or NULL.

[allow-none]


snapd_snap_get_installed_size ()

gint64
snapd_snap_get_installed_size (SnapdSnap *snap);

Get the installed size of this snap or 0 if unknown.

Parameters

snap

a SnapdSnap.

 

Returns

a byte count.


snapd_snap_get_name ()

const gchar *
snapd_snap_get_name (SnapdSnap *snap);

Get the name of this snap. This is used to reference this snap, e.g. for installing / removing.

Parameters

snap

a SnapdSnap.

 

Returns

a name.


snapd_snap_get_prices ()

GPtrArray *
snapd_snap_get_prices (SnapdSnap *snap);

Get the prices that this snap can be purchased at.

Parameters

snap

a SnapdSnap.

 

Returns

an array of prices.

[transfer none][element-type SnapdPrice]


snapd_snap_get_private ()

gboolean
snapd_snap_get_private (SnapdSnap *snap);

Get if this snap is only available to the developer.

Parameters

snap

a SnapdSnap.

 

Returns

TRUE if this is a private snap.


snapd_snap_get_revision ()

const gchar *
snapd_snap_get_revision (SnapdSnap *snap);

Get the revision for this snap. The format of the string is undefined. See also snapd_snap_get_version().

Parameters

snap

a SnapdSnap.

 

Returns

a revision string.


snapd_snap_get_screenshots ()

GPtrArray *
snapd_snap_get_screenshots (SnapdSnap *snap);

Get the screenshots that are available for this snap.

Parameters

snap

a SnapdSnap.

 

Returns

an array of screenshots.

[transfer none][element-type SnapdScreenshot]


snapd_snap_get_snap_type ()

SnapdSnapType
snapd_snap_get_snap_type (SnapdSnap *snap);

Get the type of snap, e.g. SNAPD_SNAP_TYPE_APP

Parameters

snap

a SnapdSnap.

 

Returns

a SnapdSnapType.


snapd_snap_get_status ()

SnapdSnapStatus
snapd_snap_get_status (SnapdSnap *snap);

Get the current status of this snap, e.g. SNAPD_SNAP_STATUS_INSTALLED.

Parameters

snap

a SnapdSnap.

 

Returns

a SnapdSnapStatus.


snapd_snap_get_summary ()

const gchar *
snapd_snap_get_summary (SnapdSnap *snap);

Get a single line summary for this snap, e.g. "Best app ever!".

Parameters

snap

a SnapdSnap.

 

Returns

a summary string.


snapd_snap_get_trymode ()

gboolean
snapd_snap_get_trymode (SnapdSnap *snap);

Get if this snap is running in try mode (installed locally and able to be directly modified).

Parameters

snap

a SnapdSnap.

 

Returns

TRUE if using trymode.


snapd_snap_get_version ()

const gchar *
snapd_snap_get_version (SnapdSnap *snap);

Get the version for this snap. The format of the string is undefined. See also snapd_snap_get_revision().

Parameters

snap

a SnapdSnap.

 

Returns

a version string.

Types and Values

enum SnapdConfinement

Confinment used by a snap.

Members

SNAPD_CONFINEMENT_UNKNOWN

the confinement of the snap is unknown.

 

SNAPD_CONFINEMENT_STRICT

the snap is using confinement.

 

SNAPD_CONFINEMENT_DEVMODE

the snap is in dev mode (i.e. unconfined).

 

enum SnapdSnapType

Type of snap.

Members

SNAPD_SNAP_TYPE_UNKNOWN

the type of snap is unknown.

 

SNAPD_SNAP_TYPE_APP

the snap is an application.

 

SNAPD_SNAP_TYPE_KERNEL

the snap is a kernel.

 

SNAPD_SNAP_TYPE_GADGET

the snapd is a gadget.

 

SNAPD_SNAP_TYPE_OS

the snap is an operating system.

 

enum SnapdSnapStatus

The current state of a snap.

Members

SNAPD_SNAP_STATUS_UNKNOWN

the snap state is unknown.

 

SNAPD_SNAP_STATUS_AVAILABLE

the snap is available for installation.

 

SNAPD_SNAP_STATUS_PRICED

the snap is available for purchase.

 

SNAPD_SNAP_STATUS_INSTALLED

the snap is installed but not active.

 

SNAPD_SNAP_STATUS_ACTIVE

the snap is installed and active.

 

SnapdSnap

typedef struct _SnapdSnap SnapdSnap;

SnapdSnap is an opaque data structure and can only be accessed using the provided functions.

Property Details

The “apps” property

  “apps”                     GPtrArray *

Apps this snap contains.

Flags: Read / Write / Construct Only


The “channel” property

  “channel”                  gchar *

Channel the snap is currently tracking.

Flags: Read / Write / Construct Only

Default value: NULL


The “confinement” property

  “confinement”              SnapdConfinement

Confinement requested by the snap.

Flags: Read / Write / Construct Only

Default value: SNAPD_CONFINEMENT_UNKNOWN


The “description” property

  “description”              gchar *

Description of the snap.

Flags: Read / Write / Construct Only

Default value: NULL


The “developer” property

  “developer”                gchar *

Developer who created the snap.

Flags: Read / Write / Construct Only

Default value: NULL


The “devmode” property

  “devmode”                  gboolean

TRUE if the snap is currently installed in devmode.

Flags: Read / Write / Construct Only

Default value: FALSE


The “download-size” property

  “download-size”            gint64

Download size in bytes.

Flags: Read / Write / Construct Only

Default value: 0


The “icon” property

  “icon”                     gchar *

URL to the snap icon.

Flags: Read / Write / Construct Only

Default value: NULL


The “id” property

  “id”                       gchar *

Unique ID for this snap.

Flags: Read / Write / Construct Only

Default value: NULL


The “install-date” property

  “install-date”             GDateTime *

Date this snap was installed.

Flags: Read / Write / Construct Only


The “installed-size” property

  “installed-size”           gint64

Installed size in bytes.

Flags: Read / Write / Construct Only

Default value: 0


The “name” property

  “name”                     gchar *

The snap name.

Flags: Read / Write / Construct Only

Default value: NULL


The “prices” property

  “prices”                   GPtrArray *

Prices this snap can be purchased for.

Flags: Read / Write / Construct Only


The “private” property

  “private”                  gboolean

TRUE if this snap is only available to its author.

Flags: Read / Write / Construct Only

Default value: FALSE


The “revision” property

  “revision”                 gchar *

Revision of this snap.

Flags: Read / Write / Construct Only

Default value: NULL


The “screenshots” property

  “screenshots”              GPtrArray *

Screenshots of this snap.

Flags: Read / Write / Construct Only


The “snap-type” property

  “snap-type”                SnapdSnapType

Snap type.

Flags: Read / Write / Construct Only

Default value: SNAPD_SNAP_TYPE_UNKNOWN


The “status” property

  “status”                   SnapdSnapStatus

State of this snap.

Flags: Read / Write / Construct Only

Default value: SNAPD_SNAP_STATUS_UNKNOWN


The “summary” property

  “summary”                  gchar *

One line description.

Flags: Read / Write / Construct Only

Default value: NULL


The “trymode” property

  “trymode”                  gboolean

TRUE if this snap is installed in try mode.

Flags: Read / Write / Construct Only

Default value: FALSE


The “version” property

  “version”                  gchar *

Snap version.

Flags: Read / Write / Construct Only

Default value: NULL