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 |
|
---|
18 | namespace Google\Service\Games\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Games\LinkPersonaRequest;
|
---|
21 | use Google\Service\Games\LinkPersonaResponse;
|
---|
22 | use Google\Service\Games\ResetPersonaRequest;
|
---|
23 | use Google\Service\Games\ResetPersonaResponse;
|
---|
24 | use Google\Service\Games\RetrieveDeveloperGamesLastPlayerTokenResponse;
|
---|
25 | use Google\Service\Games\RetrieveGamesPlayerTokensResponse;
|
---|
26 | use Google\Service\Games\RetrievePlayerTokensResponse;
|
---|
27 | use Google\Service\Games\UnlinkPersonaRequest;
|
---|
28 | use Google\Service\Games\UnlinkPersonaResponse;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The "recall" collection of methods.
|
---|
32 | * Typical usage is:
|
---|
33 | * <code>
|
---|
34 | * $gamesService = new Google\Service\Games(...);
|
---|
35 | * $recall = $gamesService->recall;
|
---|
36 | * </code>
|
---|
37 | */
|
---|
38 | class Recall extends \Google\Service\Resource
|
---|
39 | {
|
---|
40 | /**
|
---|
41 | * Retrieve the Recall tokens from all requested games that is associated with
|
---|
42 | * the PGS Player encoded in the provided recall session id. The API is only
|
---|
43 | * available for users that have an active PGS Player profile.
|
---|
44 | * (recall.gamesPlayerTokens)
|
---|
45 | *
|
---|
46 | * @param string $sessionId Required. Opaque server-generated string that
|
---|
47 | * encodes all the necessary information to identify the PGS player / Google
|
---|
48 | * user and application.
|
---|
49 | * @param array $optParams Optional parameters.
|
---|
50 | *
|
---|
51 | * @opt_param string applicationIds Required. The application IDs from the
|
---|
52 | * Google Play developer console for the games to return scoped ids for.
|
---|
53 | * @return RetrieveGamesPlayerTokensResponse
|
---|
54 | * @throws \Google\Service\Exception
|
---|
55 | */
|
---|
56 | public function gamesPlayerTokens($sessionId, $optParams = [])
|
---|
57 | {
|
---|
58 | $params = ['sessionId' => $sessionId];
|
---|
59 | $params = array_merge($params, $optParams);
|
---|
60 | return $this->call('gamesPlayerTokens', [$params], RetrieveGamesPlayerTokensResponse::class);
|
---|
61 | }
|
---|
62 | /**
|
---|
63 | * Retrieve the last Recall token from all developer games that is associated
|
---|
64 | * with the PGS Player encoded in the provided recall session id. The API is
|
---|
65 | * only available for users that have active PGS Player profile.
|
---|
66 | * (recall.lastTokenFromAllDeveloperGames)
|
---|
67 | *
|
---|
68 | * @param string $sessionId Required. Opaque server-generated string that
|
---|
69 | * encodes all the necessary information to identify the PGS player / Google
|
---|
70 | * user and application.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | * @return RetrieveDeveloperGamesLastPlayerTokenResponse
|
---|
73 | * @throws \Google\Service\Exception
|
---|
74 | */
|
---|
75 | public function lastTokenFromAllDeveloperGames($sessionId, $optParams = [])
|
---|
76 | {
|
---|
77 | $params = ['sessionId' => $sessionId];
|
---|
78 | $params = array_merge($params, $optParams);
|
---|
79 | return $this->call('lastTokenFromAllDeveloperGames', [$params], RetrieveDeveloperGamesLastPlayerTokenResponse::class);
|
---|
80 | }
|
---|
81 | /**
|
---|
82 | * Associate the PGS Player principal encoded in the provided recall session id
|
---|
83 | * with an in-game account (recall.linkPersona)
|
---|
84 | *
|
---|
85 | * @param LinkPersonaRequest $postBody
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | * @return LinkPersonaResponse
|
---|
88 | * @throws \Google\Service\Exception
|
---|
89 | */
|
---|
90 | public function linkPersona(LinkPersonaRequest $postBody, $optParams = [])
|
---|
91 | {
|
---|
92 | $params = ['postBody' => $postBody];
|
---|
93 | $params = array_merge($params, $optParams);
|
---|
94 | return $this->call('linkPersona', [$params], LinkPersonaResponse::class);
|
---|
95 | }
|
---|
96 | /**
|
---|
97 | * Delete all Recall tokens linking the given persona to any player (with or
|
---|
98 | * without a profile). (recall.resetPersona)
|
---|
99 | *
|
---|
100 | * @param ResetPersonaRequest $postBody
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | * @return ResetPersonaResponse
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function resetPersona(ResetPersonaRequest $postBody, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['postBody' => $postBody];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('resetPersona', [$params], ResetPersonaResponse::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Retrieve all Recall tokens associated with the PGS Player encoded in the
|
---|
113 | * provided recall session id. The API is only available for users that have
|
---|
114 | * active PGS Player profile. (recall.retrieveTokens)
|
---|
115 | *
|
---|
116 | * @param string $sessionId Required. Opaque server-generated string that
|
---|
117 | * encodes all the necessary information to identify the PGS player / Google
|
---|
118 | * user and application.
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | * @return RetrievePlayerTokensResponse
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function retrieveTokens($sessionId, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['sessionId' => $sessionId];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('retrieveTokens', [$params], RetrievePlayerTokensResponse::class);
|
---|
128 | }
|
---|
129 | /**
|
---|
130 | * Delete a Recall token linking the PGS Player principal identified by the
|
---|
131 | * Recall session and an in-game account identified either by the 'persona' or
|
---|
132 | * by the token value. (recall.unlinkPersona)
|
---|
133 | *
|
---|
134 | * @param UnlinkPersonaRequest $postBody
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | * @return UnlinkPersonaResponse
|
---|
137 | * @throws \Google\Service\Exception
|
---|
138 | */
|
---|
139 | public function unlinkPersona(UnlinkPersonaRequest $postBody, $optParams = [])
|
---|
140 | {
|
---|
141 | $params = ['postBody' => $postBody];
|
---|
142 | $params = array_merge($params, $optParams);
|
---|
143 | return $this->call('unlinkPersona', [$params], UnlinkPersonaResponse::class);
|
---|
144 | }
|
---|
145 | }
|
---|
146 |
|
---|
147 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
148 | class_alias(Recall::class, 'Google_Service_Games_Resource_Recall');
|
---|