Class

AppStreamReviewsClient

Description [src]

class AppStream.ReviewsClient : GObject.Object
{
  /* No available fields */
}

Fetch user reviews for software components.

This class is a client for the Open Desktop Ratings Service (ODRS) or a compatible service, and can retrieve user reviews and ratings for software components.

All operations do blocking network I/O and this class is not thread-safe: When calling it from worker threads, use one instance per thread or serialize access to a shared instance with your own locking.

Hierarchy

hierarchy this AsReviewsClient ancestor_0 GObject ancestor_0--this

Ancestors

Constructors

as_reviews_client_new

Creates a new AsReviewsClient.

Instance methods

as_reviews_client_fetch_rating_for_id

Fetch the overall user rating for the given software component ID from the reviews server, as a percentage value (where 100% means a perfect five-star rating). This call does blocking network I/O.

as_reviews_client_fetch_reviews

Fetch user reviews for the given software component from the reviews server. The reviews are sorted by their score (most helpful first), so subsequent pages can be requested by increasing start in steps of limit. This call does blocking network I/O.

as_reviews_client_fetch_reviews_for_id

Fetch user reviews for the given software component ID from the reviews server. The reviews are sorted by their score (most helpful first), so subsequent pages can be requested by increasing start in steps of limit. This call does blocking network I/O.

as_reviews_client_get_client_id

Get the ID of the client application which is fetching reviews.

as_reviews_client_get_locale

Get the locale used for filtering reviews.

as_reviews_client_get_server_url

Get the URL of the reviews server that we are communicating with.

as_reviews_client_get_user_agent

Get the user agent used for communication with the reviews server.

as_reviews_client_get_user_hash

Get the (salted) hash value used to identify the current user to the reviews service, generating it if necessary. The hash is used so the user can only vote once on each application, and so their own reviews can be identified. It can not easily be traced back to an individual user.

as_reviews_client_remove_review

Remove a review that the current user has written from the reviews server. The review must have been received from the server via a previous fetch operation, and the server will refuse to remove reviews that were not written by the current user. This call does blocking network I/O.

since: 1.1.4

as_reviews_client_set_client_id

Set an ID for the client application which is fetching reviews. The ID is used when generating the user hash, so the same user gets a different identity for each client application they are submitting reviews from.

as_reviews_client_set_locale

Set the locale used for filtering reviews, so reviews in the given (or a compatible) language are preferred. Set it to NULL to restore the default of using the current system locale.

as_reviews_client_set_server_url

Set the URL of the ODRS-compatible reviews server to communicate with. Set it to NULL to restore the default server.

as_reviews_client_set_user_agent

Set the user agent to use when communicating with the reviews server. Set it to NULL to restore the default user agent.

as_reviews_client_set_user_hash

Explicitly set the opaque hash value used to identify the current user to the reviews service. Set it to NULL to have a suitable hash generated automatically, which is the default behavior.

as_reviews_client_submit_review

Submit a new user review for a software component to the reviews server. The review must have a rating, summary and description set. If it has no reviewer name set, a suitable one is chosen automatically based on the name of the current user.

since: 1.1.4

as_reviews_client_vote_review

Cast a vote on a review that was previously received from the reviews server, to mark it as helpful or unhelpful, or to report it as abusive. On success, the review is marked as voted on by the current user. This call does blocking network I/O.

since: 1.1.4

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct AppStreamReviewsClientClass {
  GObjectClass parent_class;
  void (* _as_reserved1) (
void
  );
  void (* _as_reserved2) (
void
  );
  void (* _as_reserved3) (
void
  );
  void (* _as_reserved4) (
void
  );
  void (* _as_reserved5) (
void
  );
  void (* _as_reserved6) (
void
  );
  void (* _as_reserved7) (
void
  );
  void (* _as_reserved8) (
void
  );
  
}

No description available.

Class members
parent_class: GObjectClass

No description available.

_as_reserved1: void (* _as_reserved1) ( void )

No description available.

_as_reserved2: void (* _as_reserved2) ( void )

No description available.

_as_reserved3: void (* _as_reserved3) ( void )

No description available.

_as_reserved4: void (* _as_reserved4) ( void )

No description available.

_as_reserved5: void (* _as_reserved5) ( void )

No description available.

_as_reserved6: void (* _as_reserved6) ( void )

No description available.

_as_reserved7: void (* _as_reserved7) ( void )

No description available.

_as_reserved8: void (* _as_reserved8) ( void )

No description available.