## AsArtifact

AsArtifact — Object describing a artifact artifact

## Functions

const gchar * | as_size_kind_to_string ()
AsSizeKind | as_size_kind_from_string ()
AsArtifactKind | as_artifact_kind_from_string ()
const gchar * | as_artifact_kind_to_string ()
AsArtifact * | as_artifact_new ()
AsArtifactKind | as_artifact_get_kind ()
void | as_artifact_set_kind ()
GPtrArray * | as_artifact_get_locations ()
void | as_artifact_add_location ()
GPtrArray * | as_artifact_get_checksums ()
AsChecksum * | as_artifact_get_checksum ()
void | as_artifact_add_checksum ()
guint64 | as_artifact_get_size ()
void | as_artifact_set_size ()
const gchar * | as_artifact_get_platform ()
void | as_artifact_set_platform ()
AsBundleKind | as_artifact_get_bundle_kind ()
void | as_artifact_set_bundle_kind ()
const gchar * | as_artifact_get_filename ()
void | as_artifact_set_filename ()

## Types and Values

#define | AS_TYPE_ARTIFACT
struct | AsArtifactClass
enum | AsSizeKind
enum | AsArtifactKind
| AsArtifact

## Description

Describes a artifact artifact

See also: AsArtifact

## Functions

### 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`

### 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

### as_artifact_kind_from_string ()

    AsArtifactKind
    as_artifact_kind_from_string (const gchar *kind);

Converts the text representation to an enumerated value.

#### Parameters

kind | the string. |

#### Returns

a AsArtifactKind, or `AS_ARTIFACT_KIND_UNKNOWN` for unknown.

[transfer full]

### as_artifact_kind_to_string ()

    const gchar *
    as_artifact_kind_to_string (AsArtifactKind kind);

Converts the enumerated value to an text representation.

#### Parameters

kind | the AsArtifactKind. |

#### Returns

string version of `kind`

### as_artifact_new ()

    AsArtifact *
    as_artifact_new (void);

Creates a new AsArtifact.

#### Returns

a AsArtifact.

[transfer full]

### as_artifact_get_kind ()

    AsArtifactKind
    as_artifact_get_kind (AsArtifact *artifact);

Gets the artifact kind.

#### Parameters

artifact | a AsArtifact instance. |

#### Returns

the AsArtifactKind

### as_artifact_set_kind ()

    void
    as_artifact_set_kind (AsArtifact *artifact,
                          AsArtifactKind kind);

Sets the artifact kind.

#### Parameters

artifact | a AsArtifact instance. |
kind | the AsArtifactKind, e.g. `AS_ARTIFACT_KIND_SOURCE`. |

### as_artifact_get_locations ()

    GPtrArray *
    as_artifact_get_locations (AsArtifact *artifact);

Gets the artifact locations, typically URLs.

#### Returns

list of locations.

[transfer none][element-type utf8]

### as_artifact_add_location ()

    void
    as_artifact_add_location (AsArtifact *artifact,
                              const gchar *location);

Adds a artifact location.

#### Parameters

location | An URL of the download location |

### as_artifact_get_checksums ()

    GPtrArray *
    as_artifact_get_checksums (AsArtifact *artifact);

Get a list of all checksums we have for this artifact.

#### Returns

an array of AsChecksum objects.

[transfer none][element-type AsChecksum]

### as_artifact_get_checksum ()

    AsChecksum *
    as_artifact_get_checksum (AsArtifact *artifact,
                              AsChecksumKind kind);

Gets the artifact checksum

#### Parameters

artifact | a AsArtifact instance. |

#### Returns

an AsChecksum, or `NULL` for not set or invalid.

[transfer none][nullable]

### as_artifact_add_checksum ()

    void
    as_artifact_add_checksum (AsArtifact *artifact,
                              AsChecksum *cs);

Add a checksum for the file associated with this artifact.

#### Parameters

artifact | An instance of AsArtifact. |
cs | The AsChecksum. |

### as_artifact_get_size ()

    guint64
    as_artifact_get_size (AsArtifact *artifact,
                          AsSizeKind kind);

Gets the artifact size.

#### Parameters

artifact | a AsArtifact instance |
kind | a AsSizeKind |

#### Returns

The size of the given kind of this artifact.

### as_artifact_set_size ()

    void
    as_artifact_set_size (AsArtifact *artifact,
                          guint64 size,
                          AsSizeKind kind);

Sets the artifact size for the given kind.

#### Parameters

artifact | a AsArtifact instance |
size | a size in bytes, or 0 for unknown |
kind | a AsSizeKind |

### as_artifact_get_platform ()

    const gchar *
    as_artifact_get_platform (AsArtifact *artifact);

Gets the artifact platform string (e.g. a triplet like "x86_64-linux-gnu").

#### Parameters

artifact | a AsArtifact instance. |

#### Returns

The platform triplet or identifier string.

### as_artifact_set_platform ()

    void
    as_artifact_set_platform (AsArtifact *artifact,
                              const gchar *platform);

Sets the artifact platform triplet or identifier string.

#### Parameters

artifact | a AsArtifact instance. |
platform | the platform triplet. |

### as_artifact_get_bundle_kind ()

    AsBundleKind
    as_artifact_get_bundle_kind (AsArtifact *artifact);

Gets the bundle kind of this artifact.

#### Parameters

artifact | an AsArtifact instance. |

#### Returns

the AsBundleKind

### as_artifact_set_bundle_kind ()

    void
    as_artifact_set_bundle_kind (AsArtifact *artifact,
                                 AsBundleKind kind);

Sets the bundle kind for this release artifact.

#### Parameters

artifact | an AsArtifact instance. |
kind | the AsBundleKind, e.g. `AS_BUNDLE_KIND_TARBALL`. |

### as_artifact_get_filename ()

    const gchar *
    as_artifact_get_filename (AsArtifact *artifact);

Gets a suggested filename for the downloaded artifact, or `NULL` if none is suggested.

#### Parameters

artifact | a AsArtifact instance. |

#### Returns

The platform triplet or identifier string.

### as_artifact_set_filename ()

    void
    as_artifact_set_filename (AsArtifact *artifact,
                              const gchar *filename);

Sets a suggested filename for this artifact after it has been downloaded.

#### Parameters

artifact | a AsArtifact instance. |
filename | the file name suggestion. |

## Types and Values

### AS_TYPE_ARTIFACT

    #define AS_TYPE_ARTIFACT (as_artifact_get_type ())

### struct AsArtifactClass

    struct AsArtifactClass {
    	GObjectClass		parent_class;
    };

### enum AsSizeKind

The artifact 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

### enum AsArtifactKind

The artifact type.

#### Members

AS_ARTIFACT_KIND_UNKNOWN | Type invalid or not known |
AS_ARTIFACT_KIND_SOURCE | The artifact describes software sources. |
AS_ARTIFACT_KIND_BINARY | The artifact describes a binary distribution of the component. |

### AsArtifact

    typedef struct _AsArtifact AsArtifact;