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\CategoryListResponse;
21use Google\Service\Games\MetagameConfig;
22
23/**
24 * The "metagame" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $gamesService = new Google\Service\Games(...);
28 *   $metagame = $gamesService->metagame;
29 *  </code>
30 */
31class Metagame extends \Google\Service\Resource
32{
33  /**
34   * Return the metagame configuration data for the calling application.
35   * (metagame.getMetagameConfig)
36   *
37   * @param array $optParams Optional parameters.
38   * @return MetagameConfig
39   */
40  public function getMetagameConfig($optParams = [])
41  {
42    $params = [];
43    $params = array_merge($params, $optParams);
44    return $this->call('getMetagameConfig', [$params], MetagameConfig::class);
45  }
46  /**
47   * List play data aggregated per category for the player corresponding to
48   * `playerId`. (metagame.listCategoriesByPlayer)
49   *
50   * @param string $playerId A player ID. A value of `me` may be used in place of
51   * the authenticated player's ID.
52   * @param string $collection The collection of categories for which data will be
53   * returned.
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 category resources to return
59   * in the response, used for paging. For any response, the actual number of
60   * category resources returned may be less than the specified `maxResults`.
61   * @opt_param string pageToken The token returned by the previous request.
62   * @return CategoryListResponse
63   */
64  public function listCategoriesByPlayer($playerId, $collection, $optParams = [])
65  {
66    $params = ['playerId' => $playerId, 'collection' => $collection];
67    $params = array_merge($params, $optParams);
68    return $this->call('listCategoriesByPlayer', [$params], CategoryListResponse::class);
69  }
70}
71
72// Adding a class alias for backwards compatibility with the previous class name.
73class_alias(Metagame::class, 'Google_Service_Games_Resource_Metagame');
74