## AsReview AsReview — A user review |

## Functions

AsReview * | as_review_new ()
gint | as_review_get_priority ()
void | as_review_set_priority ()
const gchar * | as_review_get_id ()
void | as_review_set_id ()
const gchar * | as_review_get_summary ()
void | as_review_set_summary ()
const gchar * | as_review_get_description ()
void | as_review_set_description ()
const gchar * | as_review_get_locale ()
void | as_review_set_locale ()
gint | as_review_get_rating ()
void | as_review_set_rating ()
const gchar * | as_review_get_version ()
void | as_review_set_version ()
const gchar * | as_review_get_reviewer_id ()
void | as_review_set_reviewer_id ()
const gchar * | as_review_get_reviewer_name ()
void | as_review_set_reviewer_name ()
GDateTime * | as_review_get_date ()
void | as_review_set_date ()
AsReviewFlags | as_review_get_flags ()
void | as_review_set_flags ()
void | as_review_add_flags ()
const gchar * | as_review_get_metadata_item ()
void | as_review_add_metadata ()
gboolean | as_review_equal ()

## Types and Values

#define | AS_TYPE_REVIEW
struct | AsReviewClass
enum | AsReviewFlags
| AsReview

## Includes

    #include <appstream.h>

## Description

This object represents a user-submitted software review.

## Functions

### as_review_new ()

    AsReview *
    as_review_new (void);

Creates a new AsReview.

#### Returns

a AsReview.

[transfer full]

Since: 0.14.0

### as_review_get_priority ()

    gint
    as_review_get_priority (AsReview *review);

This allows the UI to sort reviews into the correct order. Higher numbers indicate a more important or relevant review.

#### Parameters

review | a AsReview |

#### Returns

the review priority, or 0 for unset.

Since: 0.14.0

### as_review_set_priority ()

    void
    as_review_set_priority (AsReview *review,
                            gint priority);

Sets the priority for the review, where positive numbers indicate a better review for the specific user.

#### Parameters

review | a AsReview |
priority | a priority value |

Since: 0.14.0

### as_review_get_id ()

    const gchar *
    as_review_get_id (AsReview *review);

Gets the review id.

#### Parameters

review | a AsReview |

#### Returns

the review identifier, e.g. "deadbeef"

Since: 0.14.0

### as_review_set_id ()

    void
    as_review_set_id (AsReview *review,
                      const gchar *id);

Sets the review identifier that is unique to each review.

#### Parameters

review | a AsReview |
id | review identifier, e.g. "deadbeef" |

Since: 0.14.0

### as_review_get_summary ()

    const gchar *
    as_review_get_summary (AsReview *review);

Gets the review summary.

#### Parameters

review | a AsReview |

#### Returns

the one-line summary, e.g. "Awesome application"

Since: 0.14.0

### as_review_set_summary ()

    void
    as_review_set_summary (AsReview *review,
                           const gchar *summary);

Sets the one-line summary that may be displayed in bold.

#### Parameters

review | a AsReview |
summary | a one-line summary, e.g. "Awesome application" |

Since: 0.14.0

### as_review_get_description ()

    const gchar *
    as_review_get_description (AsReview *review);

Gets the multi-line review text that forms the body of the review.

#### Parameters

review | a AsReview |

#### Returns

the string, or `NULL`

Since: 0.14.0

### as_review_set_description ()

    void
    as_review_set_description (AsReview *review,
                               const gchar *description);

Sets the multi-line review text that forms the body of the review.

#### Parameters

review | a AsReview |
description | multi-line description |

Since: 0.14.0

### as_review_get_locale ()

    const gchar *
    as_review_get_locale (AsReview *review);

Gets the locale for the review.

#### Parameters

review | a AsReview |

#### Returns

the string, or `NULL`

Since: 0.14.0

### as_review_set_locale ()

    void
    as_review_set_locale (AsReview *review,
                          const gchar *locale);

Sets the locale for the review.

#### Parameters

review | a AsReview |
locale | a BCP47 locale, e.g. "en-GB" |

Since: 0.14.0

### as_review_get_rating ()

    gint
    as_review_get_rating (AsReview *review);

Gets the star rating of the review, where 100 is 5 stars.

#### Parameters

review | a AsReview |

#### Returns

integer as a percentage, or 0 for unset

Since: 0.14.0

### as_review_set_rating ()

    void
    as_review_set_rating (AsReview *review,
                          gint rating);

Sets the star rating of the review, where 100 is 5 stars..

#### Parameters

review | a AsReview |
rating | a integer as a percentage, or 0 for unset |

Since: 0.14.0

### as_review_get_version ()

    const gchar *
    as_review_get_version (AsReview *review);

Gets the version string for the application being reviewed..

#### Parameters

review | a AsReview |

#### Returns

the version string, e.g. "0.1.2", or `NULL` for unset

Since: 0.14.0

### as_review_set_version ()

    void
    as_review_set_version (AsReview *review,
                           const gchar *version);

Sets the version string for the application being reviewed.

#### Parameters

review | a AsReview |
version | a version string, e.g. "0.1.2" |

Since: 0.14.0

### as_review_get_reviewer_id ()

    const gchar *
    as_review_get_reviewer_id (AsReview *review);

Gets the name of the reviewer.

#### Parameters

review | a AsReview |

#### Returns

the reviewer ID, e.g. "deadbeef", or `NULL`

Since: 0.14.0

### as_review_set_reviewer_id ()

    void
    as_review_set_reviewer_id (AsReview *review,
                               const gchar *reviewer_id);

Sets the name of the reviewer, which can be left unset.

#### Parameters

review | a AsReview |
reviewer_id | the reviewer ID, e.g. "deadbeef" |

Since: 0.14.0

### as_review_get_reviewer_name ()

    const gchar *
    as_review_get_reviewer_name (AsReview *review);

Gets the name of the reviewer.

#### Parameters

review | a AsReview |

#### Returns

the reviewer name, e.g. "David Smith", or `NULL`

Since: 0.14.0

### as_review_set_reviewer_name ()

    void
    as_review_set_reviewer_name (AsReview *review,
                                 const gchar *reviewer_name);

Sets the name of the reviewer, which can be left unset.

#### Parameters

review | a AsReview |
reviewer_name | the reviewer name, e.g. "David Smith" |

Since: 0.14.0

### as_review_get_date ()

    GDateTime *
    as_review_get_date (AsReview *review);

Gets the date the review was originally submitted.

#### Parameters

review | a AsReview |

#### Returns

the GDateTime, or `NULL` for unset.

[transfer none]

Since: 0.14.0

### as_review_set_date ()

    void
    as_review_set_date (AsReview *review,
                        GDateTime *date);

Sets the date the review was originally submitted.

#### Parameters

review | a AsReview |
date | a GDateTime, or `NULL` |

Since: 0.14.0

### as_review_get_flags ()

    AsReviewFlags
    as_review_get_flags (AsReview *review);

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

#### Parameters

review | a AsReview |

#### Returns

a AsReviewFlags, e.g. `AS_REVIEW_FLAG_SELF`

Since: 0.14.0

### as_review_set_flags ()

    void
    as_review_set_flags (AsReview *review,
                         AsReviewFlags flags);

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

#### Parameters

review | a AsReview |
flags | a AsReviewFlags, e.g. `AS_REVIEW_FLAG_SELF` |

Since: 0.14.0

### as_review_add_flags ()

    void
    as_review_add_flags (AsReview *review,
                         AsReviewFlags flags);

Adds flags to an existing review without replacing the other flags.

#### Parameters

review | a AsReview |
flags | a AsReviewFlags, e.g. `AS_REVIEW_FLAG_SELF` |

Since: 0.14.0

### as_review_get_metadata_item ()

    const gchar *
    as_review_get_metadata_item (AsReview *review,
                                 const gchar *key);

Gets some metadata from a review object. It is left for the the plugin to use this method as required, but a typical use would be to retrieve some secure authentication token.

#### Parameters

review | a AsReview |
key | a string |

#### Returns

A string value, or `NULL` for not found

Since: 0.14.0

### as_review_add_metadata ()

    void
    as_review_add_metadata (AsReview *review,
                            const gchar *key,
                            const gchar *value);

Adds metadata to the review object. It is left for the the plugin to use this method as required, but a typical use would be to store some secure authentication token.

#### Parameters

review | a AsReview |
key | a string |
value | a string |

Since: 0.14.0

### as_review_equal ()

    gboolean
    as_review_equal (AsReview *review1,
                     AsReview *review2);

Checks if two reviews are the same.

#### Parameters

review1 | a AsReview instance. |
review2 | a AsReview instance. |

#### Returns

`TRUE` for success

Since: 0.14.0

## Types and Values

### AS_TYPE_REVIEW

    #define AS_TYPE_REVIEW (as_review_get_type ())

### struct AsReviewClass

    struct AsReviewClass {
    	GObjectClass		parent_class;
    };

### enum AsReviewFlags

The flags for the review.

#### Members

AS_REVIEW_FLAG_NONE | No special flags set |
AS_REVIEW_FLAG_SELF | The user wrote the review themselves |
AS_REVIEW_FLAG_VOTED | The user voted on the review |

Since: 0.14.0

### AsReview

    typedef struct _AsReview AsReview;