## AsRelease AsRelease — Object representing a single upstream release |

## Functions

const gchar * | as_checksum_kind_to_string ()
AsChecksumKind | as_checksum_kind_from_string ()
const gchar * | as_size_kind_to_string ()
AsSizeKind | as_size_kind_from_string ()
AsRelease * | as_release_new ()
const gchar * | as_release_get_version ()
void | as_release_set_version ()
guint64 | as_release_get_timestamp ()
void | as_release_set_timestamp ()
const gchar * | as_release_get_description ()
void | as_release_set_description ()
gchar * | as_release_get_active_locale ()
void | as_release_set_active_locale ()
GPtrArray * | as_release_get_locations ()
void | as_release_add_location ()
const gchar * | as_release_get_checksum ()
void | as_release_set_checksum ()
AsUrgencyKind | as_release_get_urgency ()
void | as_release_set_urgency ()
guint64 | as_release_get_size ()
void | as_release_set_size ()

## Types and Values

#define | AS_TYPE_RELEASE
struct | AsReleaseClass
enum | AsChecksumKind
enum | AsSizeKind
| AsRelease

## Object Hierarchy

        GObject
        ╰── AsRelease

## Includes

    #include <appstream.h>

## Description

This object represents a single upstream release, typically a minor update. Releases can contain a localized description of paragraph and list elements and also have a version number and timestamp.

Releases can be automatically generated by parsing upstream ChangeLogs or .spec files, or can be populated using MetaInfo files.

See also: AsComponent

## Functions

### as_checksum_kind_to_string ()

    const gchar *
    as_checksum_kind_to_string (AsChecksumKind kind);

Converts the enumerated value to an text representation.

#### Parameters

kind | the `AsChecksumKind`. |

#### Returns

string version of `kind`

### as_checksum_kind_from_string ()

    AsChecksumKind
    as_checksum_kind_from_string (const gchar *kind_str);

Converts the text representation to an enumerated value.

#### Parameters

kind_str | the string. |

#### Returns

a AsChecksumKind or `AS_CHECKSUM_KIND_NONE` for unknown

### as_size_kind_to_string ()

    const gchar *
    as_size_kind_to_string (AsSizeKind size_kind);

Converts the enumerated value to an text representation.

#### Parameters

size_kind | the AsSizeKind. |

#### Returns

string version of `size_kind`

Since: 0.8.6

### as_size_kind_from_string ()

    AsSizeKind
    as_size_kind_from_string (const gchar *size_kind);

Converts the text representation to an enumerated value.

#### Parameters

size_kind | the string. |

#### Returns

an AsSizeKind or `AS_SIZE_KIND_UNKNOWN` for unknown

Since: 0.8.6

### as_release_new ()

    AsRelease *
    as_release_new (void);

Creates a new AsRelease.

#### Returns

a AsRelease.

[transfer full]

### as_release_get_version ()

    const gchar *
    as_release_get_version (AsRelease *release);

Gets the release version.

#### Parameters

release | a AsRelease instance. |

#### Returns

string, or `NULL` for not set or invalid

### as_release_set_version ()

    void
    as_release_set_version (AsRelease *release,
                            const gchar *version);

Sets the release version.

#### Parameters

release | a AsRelease instance. |
version | the version string. |

### as_release_get_timestamp ()

    guint64
    as_release_get_timestamp (AsRelease *release);

Gets the release timestamp.

#### Parameters

release | a AsRelease instance. |

#### Returns

timestamp, or 0 for unset

### as_release_set_timestamp ()

    void
    as_release_set_timestamp (AsRelease *release,
                              guint64 timestamp);

Sets the release timestamp.

#### Parameters

release | a AsRelease instance. |
timestamp | the timestamp value. |

### as_release_get_description ()

    const gchar *
    as_release_get_description (AsRelease *release);

Gets the release description markup for a given locale.

#### Parameters

release | a AsRelease instance. |

#### Returns

markup, or `NULL` for not set or invalid

### as_release_set_description ()

    void
    as_release_set_description (AsRelease *release,
                                const gchar *description,
                                const gchar *locale);

Sets the description release markup.

#### Parameters

release | a AsRelease instance. |
description | the description markup. |

### as_release_get_active_locale ()

    gchar *
    as_release_get_active_locale (AsRelease *release);

Get the current active locale, which is used to get localized messages.

### as_release_set_active_locale ()

    void
    as_release_set_active_locale (AsRelease *release,
                                  const gchar *locale);

Set the current active locale, which is used to get localized messages. If the AsComponent linking this AsRelease was fetched from a localized database, usually only one locale is available.

### as_release_get_locations ()

    GPtrArray *
    as_release_get_locations (AsRelease *release);

Gets the release locations, typically URLs.

#### Returns

list of locations.

[transfer none][element-type utf8]

Since: 0.8.1

### as_release_add_location ()

    void
    as_release_add_location (AsRelease *release,
                             const gchar *location);

Adds a release location.

#### Parameters

location | An URL of the download location |

Since: 0.8.1

### as_release_get_checksum ()

    const gchar *
    as_release_get_checksum (AsRelease *release,
                             AsChecksumKind kind);

Gets the release checksum

#### Returns

string, or `NULL` for not set or invalid

Since: 0.8.2

### as_release_set_checksum ()

    void
    as_release_set_checksum (AsRelease *release,
                             const gchar *checksum,
                             AsChecksumKind kind);

Set the release checksum.

#### Parameters

release | An instance of AsRelease. |
checksum | The checksum as string. |
kind | The kind of this checksum, e.g. `AS_CHECKSUM_KIND_SHA256` |

Since: 0.8.2

### as_release_get_urgency ()

    AsUrgencyKind
    as_release_get_urgency (AsRelease *release);

Gets the urgency of the release (showing how important it is to update to a more recent release)

#### Parameters

release | a AsRelease instance. |

#### Returns

AsUrgencyKind, or `AS_URGENCY_KIND_UNKNOWN` for not set

Since: 0.6.5

### as_release_set_urgency ()

    void
    as_release_set_urgency (AsRelease *release,
                            AsUrgencyKind urgency);

Sets the release urgency.

#### Parameters

release | a AsRelease instance. |
urgency | the urgency of this release/update (as AsUrgencyKind) |

Since: 0.6.5

### as_release_get_size ()

    guint64
    as_release_get_size (AsRelease *release,
                         AsSizeKind kind);

Gets the release size.

#### Parameters

release | a AsRelease instance |
kind | a AsSizeKind |

#### Returns

The size of the given kind of this release.

Since: 0.8.6

### as_release_set_size ()

    void
    as_release_set_size (AsRelease *release,
                         guint64 size,
                         AsSizeKind kind);

Sets the release size for the given kind.

#### Parameters

release | a AsRelease instance |
size | a size in bytes, or 0 for unknown |
kind | a AsSizeKind |

Since: 0.8.6

## Types and Values

### AS_TYPE_RELEASE

    #define AS_TYPE_RELEASE (as_release_get_type ())

### struct AsReleaseClass

    struct AsReleaseClass {
    	GObjectClass		parent_class;
    };

### enum AsChecksumKind

Checksums supported by AsRelease

#### Members

AS_CHECKSUM_KIND_NONE | No checksum |
AS_CHECKSUM_KIND_SHA1 | SHA1 |
AS_CHECKSUM_KIND_SHA256 | SHA256 |

### enum AsSizeKind

The release size kind.

#### Members

AS_SIZE_KIND_UNKNOWN | Unknown size |
AS_SIZE_KIND_DOWNLOAD | Size of download of component |
AS_SIZE_KIND_INSTALLED | Size of installed component |

Since: 0.8.6

### AsRelease

    typedef struct _AsRelease AsRelease;