Google_AchievementsServiceResource

The "achievements" collection of methods.

Defined (1)

The class is defined in the following location(s).

/google-api/src/contrib/Google_GamesService.php  
  1. class Google_AchievementsServiceResource extends Google_ServiceResource { 
  2.  
  3.  
  4. /** 
  5. * Increments the steps of the achievement with the given ID for the currently authenticated player. 
  6. * (achievements.increment) 
  7. * @param string $achievementId The ID of the achievement used by this method. 
  8. * @param int $stepsToIncrement The number of steps to increment. 
  9. * @param array $optParams Optional parameters. 
  10. * @opt_param string requestId A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the increment is performed correctly across retries. 
  11. * @return Google_AchievementIncrementResponse 
  12. */ 
  13. public function increment($achievementId, $stepsToIncrement, $optParams = array()) { 
  14. $params = array('achievementId' => $achievementId, 'stepsToIncrement' => $stepsToIncrement); 
  15. $params = array_merge($params, $optParams); 
  16. $data = $this->__call('increment', array($params)); 
  17. if ($this->useObjects()) { 
  18. return new Google_AchievementIncrementResponse($data); 
  19. } else { 
  20. return $data; 
  21. /** 
  22. * Lists the progress for all your application's achievements for the currently authenticated 
  23. * player. (achievements.list) 
  24. * @param string $playerId A player ID. A value of me may be used in place of the authenticated player's ID. 
  25. * @param array $optParams Optional parameters. 
  26. * @opt_param string language The preferred language to use for strings returned by this method. 
  27. * @opt_param int maxResults The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. 
  28. * @opt_param string pageToken The token returned by the previous request. 
  29. * @opt_param string state Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned. 
  30. * @return Google_PlayerAchievementListResponse 
  31. */ 
  32. public function listAchievements($playerId, $optParams = array()) { 
  33. $params = array('playerId' => $playerId); 
  34. $params = array_merge($params, $optParams); 
  35. $data = $this->__call('list', array($params)); 
  36. if ($this->useObjects()) { 
  37. return new Google_PlayerAchievementListResponse($data); 
  38. } else { 
  39. return $data; 
  40. /** 
  41. * Sets the state of the achievement with the given ID to REVEALED for the currently authenticated 
  42. * player. (achievements.reveal) 
  43. * @param string $achievementId The ID of the achievement used by this method. 
  44. * @param array $optParams Optional parameters. 
  45. * @return Google_AchievementRevealResponse 
  46. */ 
  47. public function reveal($achievementId, $optParams = array()) { 
  48. $params = array('achievementId' => $achievementId); 
  49. $params = array_merge($params, $optParams); 
  50. $data = $this->__call('reveal', array($params)); 
  51. if ($this->useObjects()) { 
  52. return new Google_AchievementRevealResponse($data); 
  53. } else { 
  54. return $data; 
  55. /** 
  56. * Unlocks this achievement for the currently authenticated player. (achievements.unlock) 
  57. * @param string $achievementId The ID of the achievement used by this method. 
  58. * @param array $optParams Optional parameters. 
  59. * @return Google_AchievementUnlockResponse 
  60. */ 
  61. public function unlock($achievementId, $optParams = array()) { 
  62. $params = array('achievementId' => $achievementId); 
  63. $params = array_merge($params, $optParams); 
  64. $data = $this->__call('unlock', array($params)); 
  65. if ($this->useObjects()) { 
  66. return new Google_AchievementUnlockResponse($data); 
  67. } else { 
  68. return $data;