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