GamesManagement.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service;
  18. use Google\Client;
  19. /**
  20. * Service definition for GamesManagement (v1management).
  21. *
  22. * <p>
  23. * The Google Play Games Management API allows developers to manage resources
  24. * from the Google Play Game service.</p>
  25. *
  26. * <p>
  27. * For more information about this service, see the API
  28. * <a href="https://developers.google.com/games/" target="_blank">Documentation</a>
  29. * </p>
  30. *
  31. * @author Google, Inc.
  32. */
  33. class GamesManagement extends \Google\Service
  34. {
  35. /** Create, edit, and delete your Google Play Games activity. */
  36. const GAMES =
  37. "https://www.googleapis.com/auth/games";
  38. public $achievements;
  39. public $applications;
  40. public $events;
  41. public $players;
  42. public $scores;
  43. public $rootUrlTemplate;
  44. /**
  45. * Constructs the internal representation of the GamesManagement service.
  46. *
  47. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  48. * config array to pass to a new Client instance.
  49. * @param string $rootUrl The root URL used for requests to the service.
  50. */
  51. public function __construct($clientOrConfig = [], $rootUrl = null)
  52. {
  53. parent::__construct($clientOrConfig);
  54. $this->rootUrl = $rootUrl ?: 'https://gamesmanagement.googleapis.com/';
  55. $this->rootUrlTemplate = $rootUrl ?: 'https://gamesmanagement.UNIVERSE_DOMAIN/';
  56. $this->servicePath = '';
  57. $this->batchPath = 'batch';
  58. $this->version = 'v1management';
  59. $this->serviceName = 'gamesManagement';
  60. $this->achievements = new GamesManagement\Resource\Achievements(
  61. $this,
  62. $this->serviceName,
  63. 'achievements',
  64. [
  65. 'methods' => [
  66. 'reset' => [
  67. 'path' => 'games/v1management/achievements/{achievementId}/reset',
  68. 'httpMethod' => 'POST',
  69. 'parameters' => [
  70. 'achievementId' => [
  71. 'location' => 'path',
  72. 'type' => 'string',
  73. 'required' => true,
  74. ],
  75. ],
  76. ],'resetAll' => [
  77. 'path' => 'games/v1management/achievements/reset',
  78. 'httpMethod' => 'POST',
  79. 'parameters' => [],
  80. ],'resetAllForAllPlayers' => [
  81. 'path' => 'games/v1management/achievements/resetAllForAllPlayers',
  82. 'httpMethod' => 'POST',
  83. 'parameters' => [],
  84. ],'resetForAllPlayers' => [
  85. 'path' => 'games/v1management/achievements/{achievementId}/resetForAllPlayers',
  86. 'httpMethod' => 'POST',
  87. 'parameters' => [
  88. 'achievementId' => [
  89. 'location' => 'path',
  90. 'type' => 'string',
  91. 'required' => true,
  92. ],
  93. ],
  94. ],'resetMultipleForAllPlayers' => [
  95. 'path' => 'games/v1management/achievements/resetMultipleForAllPlayers',
  96. 'httpMethod' => 'POST',
  97. 'parameters' => [],
  98. ],
  99. ]
  100. ]
  101. );
  102. $this->applications = new GamesManagement\Resource\Applications(
  103. $this,
  104. $this->serviceName,
  105. 'applications',
  106. [
  107. 'methods' => [
  108. 'listHidden' => [
  109. 'path' => 'games/v1management/applications/{applicationId}/players/hidden',
  110. 'httpMethod' => 'GET',
  111. 'parameters' => [
  112. 'applicationId' => [
  113. 'location' => 'path',
  114. 'type' => 'string',
  115. 'required' => true,
  116. ],
  117. 'maxResults' => [
  118. 'location' => 'query',
  119. 'type' => 'integer',
  120. ],
  121. 'pageToken' => [
  122. 'location' => 'query',
  123. 'type' => 'string',
  124. ],
  125. ],
  126. ],
  127. ]
  128. ]
  129. );
  130. $this->events = new GamesManagement\Resource\Events(
  131. $this,
  132. $this->serviceName,
  133. 'events',
  134. [
  135. 'methods' => [
  136. 'reset' => [
  137. 'path' => 'games/v1management/events/{eventId}/reset',
  138. 'httpMethod' => 'POST',
  139. 'parameters' => [
  140. 'eventId' => [
  141. 'location' => 'path',
  142. 'type' => 'string',
  143. 'required' => true,
  144. ],
  145. ],
  146. ],'resetAll' => [
  147. 'path' => 'games/v1management/events/reset',
  148. 'httpMethod' => 'POST',
  149. 'parameters' => [],
  150. ],'resetAllForAllPlayers' => [
  151. 'path' => 'games/v1management/events/resetAllForAllPlayers',
  152. 'httpMethod' => 'POST',
  153. 'parameters' => [],
  154. ],'resetForAllPlayers' => [
  155. 'path' => 'games/v1management/events/{eventId}/resetForAllPlayers',
  156. 'httpMethod' => 'POST',
  157. 'parameters' => [
  158. 'eventId' => [
  159. 'location' => 'path',
  160. 'type' => 'string',
  161. 'required' => true,
  162. ],
  163. ],
  164. ],'resetMultipleForAllPlayers' => [
  165. 'path' => 'games/v1management/events/resetMultipleForAllPlayers',
  166. 'httpMethod' => 'POST',
  167. 'parameters' => [],
  168. ],
  169. ]
  170. ]
  171. );
  172. $this->players = new GamesManagement\Resource\Players(
  173. $this,
  174. $this->serviceName,
  175. 'players',
  176. [
  177. 'methods' => [
  178. 'hide' => [
  179. 'path' => 'games/v1management/applications/{applicationId}/players/hidden/{playerId}',
  180. 'httpMethod' => 'POST',
  181. 'parameters' => [
  182. 'applicationId' => [
  183. 'location' => 'path',
  184. 'type' => 'string',
  185. 'required' => true,
  186. ],
  187. 'playerId' => [
  188. 'location' => 'path',
  189. 'type' => 'string',
  190. 'required' => true,
  191. ],
  192. ],
  193. ],'unhide' => [
  194. 'path' => 'games/v1management/applications/{applicationId}/players/hidden/{playerId}',
  195. 'httpMethod' => 'DELETE',
  196. 'parameters' => [
  197. 'applicationId' => [
  198. 'location' => 'path',
  199. 'type' => 'string',
  200. 'required' => true,
  201. ],
  202. 'playerId' => [
  203. 'location' => 'path',
  204. 'type' => 'string',
  205. 'required' => true,
  206. ],
  207. ],
  208. ],
  209. ]
  210. ]
  211. );
  212. $this->scores = new GamesManagement\Resource\Scores(
  213. $this,
  214. $this->serviceName,
  215. 'scores',
  216. [
  217. 'methods' => [
  218. 'reset' => [
  219. 'path' => 'games/v1management/leaderboards/{leaderboardId}/scores/reset',
  220. 'httpMethod' => 'POST',
  221. 'parameters' => [
  222. 'leaderboardId' => [
  223. 'location' => 'path',
  224. 'type' => 'string',
  225. 'required' => true,
  226. ],
  227. ],
  228. ],'resetAll' => [
  229. 'path' => 'games/v1management/scores/reset',
  230. 'httpMethod' => 'POST',
  231. 'parameters' => [],
  232. ],'resetAllForAllPlayers' => [
  233. 'path' => 'games/v1management/scores/resetAllForAllPlayers',
  234. 'httpMethod' => 'POST',
  235. 'parameters' => [],
  236. ],'resetForAllPlayers' => [
  237. 'path' => 'games/v1management/leaderboards/{leaderboardId}/scores/resetForAllPlayers',
  238. 'httpMethod' => 'POST',
  239. 'parameters' => [
  240. 'leaderboardId' => [
  241. 'location' => 'path',
  242. 'type' => 'string',
  243. 'required' => true,
  244. ],
  245. ],
  246. ],'resetMultipleForAllPlayers' => [
  247. 'path' => 'games/v1management/scores/resetMultipleForAllPlayers',
  248. 'httpMethod' => 'POST',
  249. 'parameters' => [],
  250. ],
  251. ]
  252. ]
  253. );
  254. }
  255. }
  256. // Adding a class alias for backwards compatibility with the previous class name.
  257. class_alias(GamesManagement::class, 'Google_Service_GamesManagement');