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 18namespace Google\Service\Games\Resource; 19 20use Google\Service\Games\Leaderboard; 21use Google\Service\Games\LeaderboardListResponse; 22 23/** 24 * The "leaderboards" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $gamesService = new Google\Service\Games(...); 28 * $leaderboards = $gamesService->leaderboards; 29 * </code> 30 */ 31class Leaderboards extends \Google\Service\Resource 32{ 33 /** 34 * Retrieves the metadata of the leaderboard with the given ID. 35 * (leaderboards.get) 36 * 37 * @param string $leaderboardId The ID of the leaderboard. 38 * @param array $optParams Optional parameters. 39 * 40 * @opt_param string language The preferred language to use for strings returned 41 * by this method. 42 * @return Leaderboard 43 */ 44 public function get($leaderboardId, $optParams = []) 45 { 46 $params = ['leaderboardId' => $leaderboardId]; 47 $params = array_merge($params, $optParams); 48 return $this->call('get', [$params], Leaderboard::class); 49 } 50 /** 51 * Lists all the leaderboard metadata for your application. 52 * (leaderboards.listLeaderboards) 53 * 54 * @param array $optParams Optional parameters. 55 * 56 * @opt_param string language The preferred language to use for strings returned 57 * by this method. 58 * @opt_param int maxResults The maximum number of leaderboards to return in the 59 * response. For any response, the actual number of leaderboards returned may be 60 * less than the specified `maxResults`. 61 * @opt_param string pageToken The token returned by the previous request. 62 * @return LeaderboardListResponse 63 */ 64 public function listLeaderboards($optParams = []) 65 { 66 $params = []; 67 $params = array_merge($params, $optParams); 68 return $this->call('list', [$params], LeaderboardListResponse::class); 69 } 70} 71 72// Adding a class alias for backwards compatibility with the previous class name. 73class_alias(Leaderboards::class, 'Google_Service_Games_Resource_Leaderboards'); 74