gs-odrs-provider: GNOME Software Reference Manual

## gs-odrs-provider gs-odrs-provider |

## Functions

GQuark | gs_odrs_provider_error_quark ()
GsOdrsProvider * | gs_odrs_provider_new ()
void | gs_odrs_provider_refresh_ratings_async ()
gboolean | gs_odrs_provider_refresh_ratings_finish ()
void | gs_odrs_provider_refine_async ()
gboolean | gs_odrs_provider_refine_finish ()
void | gs_odrs_provider_submit_review_async ()
gboolean | gs_odrs_provider_submit_review_finish ()
void | gs_odrs_provider_upvote_review_async ()
gboolean | gs_odrs_provider_upvote_review_finish ()
void | gs_odrs_provider_downvote_review_async ()
gboolean | gs_odrs_provider_downvote_review_finish ()
void | gs_odrs_provider_report_review_async ()
gboolean | gs_odrs_provider_report_review_finish ()
void | gs_odrs_provider_remove_review_async ()
gboolean | gs_odrs_provider_remove_review_finish ()

## Types and Values

enum | GsOdrsProviderError
#define | GS_ODRS_PROVIDER_ERROR
enum | GsOdrsProviderRefineFlags
#define | GS_TYPE_ODRS_PROVIDER
| GsOdrsProvider

## Description

## Functions

### gs_odrs_provider_error_quark ()

    GQuark
    gs_odrs_provider_error_quark (void);

### gs_odrs_provider_new ()

    GsOdrsProvider *
    gs_odrs_provider_new (const gchar *review_server,
                          const gchar *user_hash,
                          const gchar *distro,
                          guint64 max_cache_age_secs,
                          guint n_results_max,
                          SoupSession *session);

Create a new GsOdrsProvider. This does no network activity.

#### Parameters

review_server | value for “review-server”. | [not nullable]
user_hash | value for “user-hash”. | [not nullable]
distro | value for “distro”. | [not nullable]
max_cache_age_secs | value for “max-cache-age-secs” |
n_results_max | value for “n-results-max” |
session | value for “session” |

#### Returns

a new GsOdrsProvider.

[transfer full]

Since: 41

### gs_odrs_provider_refresh_ratings_async ()

    void
    gs_odrs_provider_refresh_ratings_async
                                   (GsOdrsProvider *self,
                                    guint64 cache_age_secs,
                                    GsDownloadProgressCallback progress_callback,
                                    gpointer progress_user_data,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Refresh the cached ODRS ratings and re-load them asynchronously.

#### Parameters

self | a GsOdrsProvider |
cache_age_secs | cache age, in seconds, as passed to `GsPluginClass.refresh_metadata_async()` |
progress_callback | callback to call with progress information. | [nullable]
progress_user_data | data to pass to `progress_callback` . | [nullable][closure progress_callback]
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 42

### gs_odrs_provider_refresh_ratings_finish ()

    gboolean
    gs_odrs_provider_refresh_ratings_finish
                                   (GsOdrsProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish an asynchronous refresh operation started with `gs_odrs_provider_refresh_ratings_async()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 42

### gs_odrs_provider_refine_async ()

    void
    gs_odrs_provider_refine_async (GsOdrsProvider *self,
                                   GsAppList *list,
                                   GsOdrsProviderRefineFlags flags,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

Asynchronously refine the given `list` of apps to add ratings and review data to them, as specified in `flags` .

#### Parameters

self | a GsOdrsProvider |
list | list of apps to refine |
flags | refine flags |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | callback for asynchronous completion |
user_data | data to pass to `callback` |

Since: 42

### gs_odrs_provider_refine_finish ()

    gboolean
    gs_odrs_provider_refine_finish (GsOdrsProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish an asynchronous refine operation started with `gs_odrs_provider_refine_finish()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 42

### gs_odrs_provider_submit_review_async ()

    void
    gs_odrs_provider_submit_review_async (GsOdrsProvider *self,
                                          GsApp *app,
                                          AsReview *review,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Submit a new `review` for `app` asynchronously.

#### Parameters

self | a GsOdrsProvider |
app | the app being reviewed |
review | the review |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 48

### gs_odrs_provider_submit_review_finish ()

    gboolean
    gs_odrs_provider_submit_review_finish (GsOdrsProvider *self,
                                           GAsyncResult *result,
                                           GError **error);

Finish an asynchronous submit operation started with `gs_odrs_provider_submit_review_async()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 48

### gs_odrs_provider_upvote_review_async ()

    void
    gs_odrs_provider_upvote_review_async (GsOdrsProvider *self,
                                          GsApp *app,
                                          AsReview *review,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Add one vote to `review` on `app` asynchronously.

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being upvoted |
review | the review to upvote |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 48

### gs_odrs_provider_upvote_review_finish ()

    gboolean
    gs_odrs_provider_upvote_review_finish (GsOdrsProvider *self,
                                           GAsyncResult *result,
                                           GError **error);

Finish an asynchronous upvote operation started with `gs_odrs_provider_upvote_review_async()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 48

### gs_odrs_provider_downvote_review_async ()

    void
    gs_odrs_provider_downvote_review_async
                                   (GsOdrsProvider *self,
                                    GsApp *app,
                                    AsReview *review,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Remove one vote from `review` on `app` asynchronously.

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being downvoted |
review | the review to downvote |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 48

### gs_odrs_provider_downvote_review_finish ()

    gboolean
    gs_odrs_provider_downvote_review_finish
                                   (GsOdrsProvider *self,
                                    GAsyncResult *result,
                                    GError **error);

Finish an asynchronous downvote operation started with `gs_odrs_provider_downvote_review_async()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 48

### gs_odrs_provider_report_review_async ()

    void
    gs_odrs_provider_report_review_async (GsOdrsProvider *self,
                                          GsApp *app,
                                          AsReview *review,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Report the given `review` on `app` for being incorrect or breaking the code of conduct asynchronously.

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being reported |
review | the review to report |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 48

### gs_odrs_provider_report_review_finish ()

    gboolean
    gs_odrs_provider_report_review_finish (GsOdrsProvider *self,
                                           GAsyncResult *result,
                                           GError **error);

Finish an asynchronous report operation started with `gs_odrs_provider_report_review_async()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 48

### gs_odrs_provider_remove_review_async ()

    void
    gs_odrs_provider_remove_review_async (GsOdrsProvider *self,
                                          GsApp *app,
                                          AsReview *review,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback callback,
                                          gpointer user_data);

Remove a `review` written by the user, from `app` asynchronously.

#### Parameters

self | a GsOdrsProvider |
app | the app whose review is being removed |
review | the review to remove |
cancellable | a GCancellable, or `NULL`. | [nullable]
callback | function to call when the asynchronous operation is complete |
user_data | data to pass to `callback` |

Since: 48

### gs_odrs_provider_remove_review_finish ()

    gboolean
    gs_odrs_provider_remove_review_finish (GsOdrsProvider *self,
                                           GAsyncResult *result,
                                           GError **error);

Finish an asynchronous remove operation started with `gs_odrs_provider_remove_review_async()`.

#### Parameters

self | a GsOdrsProvider |
result | result of the asynchronous operation |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` on success, `FALSE` otherwise

Since: 48

## Types and Values

### enum GsOdrsProviderError

Error codes for GsOdrsProvider.

#### Members

GS_ODRS_PROVIDER_ERROR_DOWNLOADING | Error while downloading ODRS data. |
GS_ODRS_PROVIDER_ERROR_PARSING_DATA | Problem parsing downloaded ODRS data. |
GS_ODRS_PROVIDER_ERROR_NO_NETWORK | Offline or network unavailable. |
GS_ODRS_PROVIDER_ERROR_SERVER_ERROR | Server returned an error. |
GS_ODRS_PROVIDER_ERROR_CLIENT_ERROR | Client made an invalid submission, such as upvoting a review twice. (Since: 48) |

Since: 42

### GS_ODRS_PROVIDER_ERROR

    #define GS_ODRS_PROVIDER_ERROR gs_odrs_provider_error_quark ()

### enum GsOdrsProviderRefineFlags

The flags for refining apps to get their reviews or ratings.

#### Members

GS_ODRS_PROVIDER_REFINE_FLAGS_GET_RATINGS | Get the numerical ratings for the app. |
GS_ODRS_PROVIDER_REFINE_FLAGS_GET_REVIEWS | Get the written reviews for the app. |

Since: 42

### GS_TYPE_ODRS_PROVIDER

    #define GS_TYPE_ODRS_PROVIDER (gs_odrs_provider_get_type ())

### GsOdrsProvider

    typedef struct _GsOdrsProvider GsOdrsProvider;