SnapdAlias: snapd-glib Reference Manual

## SnapdAlias SnapdAlias — App aliases. |

## Functions

const gchar * | snapd_alias_get_app ()
const gchar * | snapd_alias_get_app_auto ()
const gchar * | snapd_alias_get_command ()
const gchar * | snapd_alias_get_app_manual ()
const gchar * | snapd_alias_get_name ()
const gchar * | snapd_alias_get_snap ()
SnapdAliasStatus | snapd_alias_get_status ()

## Properties

char * | app-auto | Read / Write / Construct Only
char * | app-manual | Read / Write / Construct Only
char * | command | Read / Write / Construct Only
char * | name | Read / Write / Construct Only
char * | snap | Read / Write / Construct Only
SnapdAliasStatus | status | Read / Write / Construct Only

## Types and Values

| SnapdAlias
enum | SnapdAliasStatus

## Object Hierarchy

        GEnum
        ╰── SnapdAliasStatus
        GObject
        ╰── SnapdAlias

## Includes

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

## Description

A SnapdAlias represents an optional alias that can be used for an app. Aliases can be queried using `snapd_client_get_aliases_sync()` and are used in `snapd_client_enable_aliases_sync()`, `snapd_client_disable_aliases_sync()` and `snapd_client_reset_aliases_sync()`.

## Functions

### snapd_alias_get_app ()

    const gchar *
    snapd_alias_get_app (SnapdAlias *alias);

`snapd_alias_get_app` has been deprecated since version 1.25 and should not be used in newly-written code.

Use `snapd_alias_get_app_manual()` or `snapd_alias_get_app_auto()`.

Get the app this is an alias for.

#### Parameters

alias | a SnapdAlias. |

#### Returns

an app name or `NULL`.

[allow-none]

Since: 1.8

### snapd_alias_get_app_auto ()

    const gchar *
    snapd_alias_get_app_auto (SnapdAlias *alias);

Get the app this alias has been automatically set to (status is `SNAPD_ALIAS_STATUS_AUTO`). Can be overridden when status is `SNAPD_ALIAS_STATUS_MANUAL`.

#### Parameters

alias | a SnapdAlias. |

#### Returns

an app name or `NULL`.

[allow-none]

Since: 1.25

### snapd_alias_get_command ()

    const gchar *
    snapd_alias_get_command (SnapdAlias *alias);

Get the command this alias runs.

#### Parameters

alias | a SnapdAlias. |

#### Returns

a command.

Since: 1.25

### snapd_alias_get_app_manual ()

    const gchar *
    snapd_alias_get_app_manual (SnapdAlias *alias);

Get the app this alias has been manually set to (status is `SNAPD_ALIAS_STATUS_MANUAL`). This overrides the app from `snapd_alias_get_app_auto()`.

#### Parameters

alias | a SnapdAlias. |

#### Returns

an app name or `NULL`.

[allow-none]

Since: 1.25

### snapd_alias_get_name ()

    const gchar *
    snapd_alias_get_name (SnapdAlias *alias);

Get the name of this alias.

#### Parameters

alias | a SnapdAlias. |

#### Returns

an alias name.

Since: 1.8

### snapd_alias_get_snap ()

    const gchar *
    snapd_alias_get_snap (SnapdAlias *alias);

Get the snap this alias is for.

#### Parameters

alias | a SnapdAlias. |

#### Returns

a snap name.

Since: 1.8

### snapd_alias_get_status ()

    SnapdAliasStatus
    snapd_alias_get_status (SnapdAlias *alias);

Get the status of this alias.

Return: a SnapdAliasStatus.

#### Parameters

alias | a SnapdAlias. |

Since: 1.8

## Types and Values

### SnapdAlias

    typedef struct _SnapdAlias SnapdAlias;

SnapdAlias contains alias information for a Snap.

Aliases are used to provide alternative binary names for Snap apps.

Since: 1.8

### enum SnapdAliasStatus

Status of an alias.

#### Members

SNAPD_ALIAS_STATUS_UNKNOWN | the alias status is unknown. |
SNAPD_ALIAS_STATUS_DEFAULT | deprecated, do not use. |
SNAPD_ALIAS_STATUS_ENABLED | deprecated, do not use. |
SNAPD_ALIAS_STATUS_DISABLED | the alias is disabled. |
SNAPD_ALIAS_STATUS_AUTO | the alias is automatically enabled. |
SNAPD_ALIAS_STATUS_MANUAL | the alias is manually enabled. |

Since: 1.8

## Property Details

### The `“app-auto”` property

      “app-auto”                 char *

App this alias is for (when status is SNAPD_ALIAS_STATUS_AUTO).

Owner: SnapdAlias

Flags: Read / Write / Construct Only

Default value: NULL

### The `“app-manual”` property

      “app-manual”               char *

App this alias is for (when status is SNAPD_ALIAS_STATUS_MANUAL).

Owner: SnapdAlias

Flags: Read / Write / Construct Only

Default value: NULL

### The `“command”` property

      “command”                  char *

Command this alias runs.

Owner: SnapdAlias

Flags: Read / Write / Construct Only

Default value: NULL

### The `“name”` property

      “name”                     char *

Name of alias.

Owner: SnapdAlias

Flags: Read / Write / Construct Only

Default value: NULL

### The `“snap”` property

      “snap”                     char *

Snap this alias is for.

Owner: SnapdAlias

Flags: Read / Write / Construct Only

Default value: NULL

### The `“status”` property

      “status”                   SnapdAliasStatus

Alias status.

Owner: SnapdAlias

Flags: Read / Write / Construct Only

Default value: SNAPD_ALIAS_STATUS_UNKNOWN