ReviewsClient
Object Hierarchy:
Description:
[
CCode ( type_id =
"as_reviews_client_get_type ()" ) ]
public class ReviewsClient :
Object
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.
Content:
Creation methods:
Methods:
- public int fetch_rating_for_id (string component_id) throws Error
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).
- public GenericArray<unowned Review> fetch_reviews (Component cpt, uint start, uint limit) throws Error
Fetch user reviews for the given software component from the reviews
server.
- public GenericArray<unowned Review> fetch_reviews_for_id (string component_id, string? version, uint start, uint limit) throws Error
Fetch user reviews for the given software component ID from the
reviews server.
- public unowned string get_client_id ()
Get the ID of the client application which is fetching reviews.
- public unowned string get_locale ()
Get the locale used for filtering reviews.
- public unowned string get_server_url ()
Get the URL of the reviews server that we are communicating with.
- public unowned string? get_user_agent ()
Get the user agent used for communication with the reviews server.
- public unowned string get_user_hash ()
Get the (salted) hash value used to identify the current user to the
reviews service, generating it if necessary.
- public bool remove_review (Review review) throws Error
Remove a review that the current user has written from the reviews
server.
- public void set_client_id (string? client_id)
Set an ID for the client application which is fetching reviews.
- public void set_locale (string? locale)
Set the locale used for filtering reviews, so reviews in the given (or
a compatible) language are preferred.
- public void set_server_url (string? url)
Set the URL of the ODRS-compatible reviews server to communicate with.
- public void set_user_agent (string? user_agent)
Set the user agent to use when communicating with the reviews server.
- public void set_user_hash (string? user_hash)
Explicitly set the opaque hash value used to identify the current user
to the reviews service.
- public bool submit_review (string component_id, Review review) throws Error
Submit a new user review for a software component to the reviews
server.
- public bool vote_review (Review review, ReviewVoteKind vote) throws Error
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.
Inherited Members:
All known members inherited from class GLib.Object