## AsAgreement AsAgreement — Object representing a privacy policy |

## Stability Level

Unstable, unless otherwise indicated

## Functions

AsAgreement * | as_agreement_new ()
const gchar * | as_agreement_kind_to_string ()
AsAgreementKind | as_agreement_kind_from_string ()
AsAgreementKind | as_agreement_get_kind ()
void | as_agreement_set_kind ()
const gchar * | as_agreement_get_version_id ()
void | as_agreement_set_version_id ()
AsAgreementSection * | as_agreement_get_section_default ()
GPtrArray * | as_agreement_get_sections ()
void | as_agreement_add_section ()

## Types and Values

#define | AS_TYPE_AGREEMENT
struct | AsAgreementClass
enum | AsAgreementKind
| AsAgreement

## Includes

    #include <appstream.h>

## Description

Agreements can be used by components to specify GDPR, EULA or other warnings.

See also: AsAgreementSection

## Functions

### as_agreement_new ()

    AsAgreement *
    as_agreement_new (void);

Creates a new AsAgreement.

#### Returns

a AsAgreement.

[transfer full]

Since: 0.12.1

### as_agreement_kind_to_string ()

    const gchar *
    as_agreement_kind_to_string (AsAgreementKind value);

Converts the enumerated value to an text representation.

#### Parameters

value | the AsAgreementKind. |

#### Returns

string version of `value`

Since: 0.12.1

### as_agreement_kind_from_string ()

    AsAgreementKind
    as_agreement_kind_from_string (const gchar *value);

Converts the text representation to an enumerated value.

#### Parameters

value | the string. |

#### Returns

a AsAgreementKind or `AS_AGREEMENT_KIND_UNKNOWN` for unknown

Since: 0.12.1

### as_agreement_get_kind ()

    AsAgreementKind
    as_agreement_get_kind (AsAgreement *agreement);

Gets the agreement kind.

#### Parameters

agreement | a AsAgreement instance. |

#### Returns

a string, e.g. `AS_AGREEMENT_KIND_EULA`

Since: 0.12.1

### as_agreement_set_kind ()

    void
    as_agreement_set_kind (AsAgreement *agreement,
                           AsAgreementKind kind);

Sets the agreement kind.

#### Parameters

agreement | a AsAgreement instance. |
kind | the agreement kind, e.g. `AS_AGREEMENT_KIND_EULA` |

Since: 0.12.1

### as_agreement_get_version_id ()

    const gchar *
    as_agreement_get_version_id (AsAgreement *agreement);

Gets the agreement version_id.

#### Parameters

agreement | a AsAgreement instance. |

#### Returns

a string, e.g. "1.4a", or NULL

Since: 0.12.1

### as_agreement_set_version_id ()

    void
    as_agreement_set_version_id (AsAgreement *agreement,
                                 const gchar *version_id);

Sets the agreement version identifier.

#### Parameters

agreement | a AsAgreement instance. |
version_id | the agreement version ID, e.g. "1.4a" |

Since: 0.12.1

### as_agreement_get_section_default ()

    AsAgreementSection *
    as_agreement_get_section_default (AsAgreement *agreement);

Gets the first section in the agreement.

#### Parameters

agreement | a AsAgreement instance. |

#### Returns

agreement section, or `NULL`.

[transfer none][nullable]

Since: 0.12.1

### as_agreement_get_sections ()

    GPtrArray *
    as_agreement_get_sections (AsAgreement *agreement);

Gets all the sections in the agreement.

#### Parameters

agreement | a AsAgreement instance. |

#### Returns

array.

[transfer container][element-type AsAgreementSection]

Since: 0.12.1

### as_agreement_add_section ()

    void
    as_agreement_add_section (AsAgreement *agreement,
                              AsAgreementSection *agreement_section);

## Types and Values

### AS_TYPE_AGREEMENT

    #define AS_TYPE_AGREEMENT (as_agreement_get_type ())

### struct AsAgreementClass

    struct AsAgreementClass {
    	GObjectClass		parent_class;
    };

### enum AsAgreementKind

The kind of the agreement.

#### Members

AS_AGREEMENT_KIND_UNKNOWN | Unknown value |
AS_AGREEMENT_KIND_GENERIC | A generic agreement without a specific type |
AS_AGREEMENT_KIND_EULA | An End User License Agreement |
AS_AGREEMENT_KIND_PRIVACY | A privacy agreement, typically a GDPR statement |

### AsAgreement

    typedef struct _AsAgreement AsAgreement;