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\CloudSecurityToken\Resource;
19
20use Google\Service\CloudSecurityToken\GoogleIdentityStsV1ExchangeTokenRequest;
21use Google\Service\CloudSecurityToken\GoogleIdentityStsV1ExchangeTokenResponse;
22use Google\Service\CloudSecurityToken\GoogleIdentityStsV1IntrospectTokenRequest;
23use Google\Service\CloudSecurityToken\GoogleIdentityStsV1IntrospectTokenResponse;
24
25/**
26 * The "v1" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $stsService = new Google\Service\CloudSecurityToken(...);
30 *   $v1 = $stsService->v1;
31 *  </code>
32 */
33class V1 extends \Google\Service\Resource
34{
35  /**
36   * Gets information about a Google OAuth 2.0 access token issued by the Google
37   * Cloud [Security Token Service
38   * API](https://cloud.google.com/iam/docs/reference/sts/rest). (v1.introspect)
39   *
40   * @param GoogleIdentityStsV1IntrospectTokenRequest $postBody
41   * @param array $optParams Optional parameters.
42   * @return GoogleIdentityStsV1IntrospectTokenResponse
43   */
44  public function introspect(GoogleIdentityStsV1IntrospectTokenRequest $postBody, $optParams = [])
45  {
46    $params = ['postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('introspect', [$params], GoogleIdentityStsV1IntrospectTokenResponse::class);
49  }
50  /**
51   * Exchanges a credential for a Google OAuth 2.0 access token. The token asserts
52   * an external identity within an identity pool, or it applies a Credential
53   * Access Boundary to a Google access token. When you call this method, do not
54   * send the `Authorization` HTTP header in the request. This method does not
55   * require the `Authorization` header, and using the header can cause the
56   * request to fail. (v1.token)
57   *
58   * @param GoogleIdentityStsV1ExchangeTokenRequest $postBody
59   * @param array $optParams Optional parameters.
60   * @return GoogleIdentityStsV1ExchangeTokenResponse
61   */
62  public function token(GoogleIdentityStsV1ExchangeTokenRequest $postBody, $optParams = [])
63  {
64    $params = ['postBody' => $postBody];
65    $params = array_merge($params, $optParams);
66    return $this->call('token', [$params], GoogleIdentityStsV1ExchangeTokenResponse::class);
67  }
68}
69
70// Adding a class alias for backwards compatibility with the previous class name.
71class_alias(V1::class, 'Google_Service_CloudSecurityToken_Resource_V1');
72