[e3d4e0a] | 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\PlayGrouping\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\PlayGrouping\VerifyTokenRequest;
|
---|
| 21 | use Google\Service\PlayGrouping\VerifyTokenResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "tokens" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $playgroupingService = new Google\Service\PlayGrouping(...);
|
---|
| 28 | * $tokens = $playgroupingService->apps_tokens;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class AppsTokens extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Verify an API token by asserting the app and persona it belongs to. The
|
---|
| 35 | * verification is a protection against client-side attacks and will fail if the
|
---|
| 36 | * contents of the token don't match the provided values. A token must be
|
---|
| 37 | * verified before it can be used to manipulate user tags. (tokens.verify)
|
---|
| 38 | *
|
---|
| 39 | * @param string $appPackage Required. App the token belongs to. Format:
|
---|
| 40 | * apps/{package_name}
|
---|
| 41 | * @param string $token Required. The token to be verified. Format:
|
---|
| 42 | * tokens/{token}
|
---|
| 43 | * @param VerifyTokenRequest $postBody
|
---|
| 44 | * @param array $optParams Optional parameters.
|
---|
| 45 | * @return VerifyTokenResponse
|
---|
| 46 | * @throws \Google\Service\Exception
|
---|
| 47 | */
|
---|
| 48 | public function verify($appPackage, $token, VerifyTokenRequest $postBody, $optParams = [])
|
---|
| 49 | {
|
---|
| 50 | $params = ['appPackage' => $appPackage, 'token' => $token, 'postBody' => $postBody];
|
---|
| 51 | $params = array_merge($params, $optParams);
|
---|
| 52 | return $this->call('verify', [$params], VerifyTokenResponse::class);
|
---|
| 53 | }
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 57 | class_alias(AppsTokens::class, 'Google_Service_PlayGrouping_Resource_AppsTokens');
|
---|