Package com.podio.rating
Class RatingAPI
- java.lang.Object
-
- com.podio.BaseAPI
-
- com.podio.rating.RatingAPI
-
public class RatingAPI extends BaseAPI
Many objects can be rated including items and status messages. Ratings can be of different types and have different values.- See Also:
RatingType,RatingValue
-
-
Constructor Summary
Constructors Constructor Description RatingAPI(ResourceFactory resourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intapproves(Reference reference)Indicates that the active user approves the objectintattend(Reference reference)Indicates that the active user will attendintcreateRating(Reference reference, RatingType type, int value)Add a new rating of the user to the object.voiddeleteRating(Reference reference, RatingType type)Deletes the rating of the given type on the object by the active userintdisapproves(Reference reference)Indicates that the active user disapproves the objectintfivestar(Reference reference, int stars)Give a five star rating of the objectRatingValuesMapgetAllRatings(Reference reference)Returns all the ratings for the given object.intgetRating(Reference reference, RatingType type, int userId)Returns the rating value for the given rating type, object and user.TypeRatinggetRatings(Reference reference, RatingType type)Get the rating average (for fivestar) and totals for the given rating type on the specified object.intlike(Reference reference)Indicates that the active user likes the objectintmaybeAttend(Reference reference)Indicates that the active user will maybe attendintno(Reference reference)Indicates that the active user says "no" to the objectintnotAttend(Reference reference)Indicates that the active user will not attendintthumbsDown(Reference reference)Indicates that the active user give thumbs down to the objectintthumbsUp(Reference reference)Indicates that the active user give thumbs up to the objectintyes(Reference reference)Indicates that the active user says "yes" to the object-
Methods inherited from class com.podio.BaseAPI
getResourceFactory
-
-
-
-
Constructor Detail
-
RatingAPI
public RatingAPI(ResourceFactory resourceFactory)
-
-
Method Detail
-
createRating
public int createRating(Reference reference, RatingType type, int value)
Add a new rating of the user to the object. The rating can be one of many different types. For more details see the area. Ratings can be changed by posting a new rating, and deleted by doing a DELETE.- Parameters:
reference- The reference to the object the rating should be created ontype- The type of the ratingvalue- The value for the rating- Returns:
- The id of the newly created rating
- See Also:
RatingValue
-
deleteRating
public void deleteRating(Reference reference, RatingType type)
Deletes the rating of the given type on the object by the active user- Parameters:
reference- The reference ot the objecttype- The type of the rating
-
like
public int like(Reference reference)
Indicates that the active user likes the object- Parameters:
reference- The reference to the object that should be liked- Returns:
- The id of the newly created rating
-
yes
public int yes(Reference reference)
Indicates that the active user says "yes" to the object- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
no
public int no(Reference reference)
Indicates that the active user says "no" to the object- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
approves
public int approves(Reference reference)
Indicates that the active user approves the object- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
disapproves
public int disapproves(Reference reference)
Indicates that the active user disapproves the object- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
fivestar
public int fivestar(Reference reference, int stars)
Give a five star rating of the object- Parameters:
reference- The reference to the objectstars- The number of stars to give, between 1 and 5- Returns:
- The id of the newly created rating
-
attend
public int attend(Reference reference)
Indicates that the active user will attend- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
maybeAttend
public int maybeAttend(Reference reference)
Indicates that the active user will maybe attend- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
notAttend
public int notAttend(Reference reference)
Indicates that the active user will not attend- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
thumbsUp
public int thumbsUp(Reference reference)
Indicates that the active user give thumbs up to the object- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
thumbsDown
public int thumbsDown(Reference reference)
Indicates that the active user give thumbs down to the object- Parameters:
reference- The reference to the object- Returns:
- The id of the newly created rating
-
getAllRatings
public RatingValuesMap getAllRatings(Reference reference)
Returns all the ratings for the given object. It will only return the ratings that are enabled for the object.- Parameters:
reference- The reference to the object to get ratings for- Returns:
- The map of rating types and their values
-
getRatings
public TypeRating getRatings(Reference reference, RatingType type)
Get the rating average (for fivestar) and totals for the given rating type on the specified object.- Parameters:
reference- The reference to the object to get ratings fortype- The type of rating to return- Returns:
- The ratings for the type
-
getRating
public int getRating(Reference reference, RatingType type, int userId)
Returns the rating value for the given rating type, object and user.- Parameters:
reference- The reference to the object to get ratings fortype- The type of rating to returnuserId- The id of the user for which to return the rating for- Returns:
- The value of the rating
-
-