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\CloudIAP\Resource;
19
20use Google\Service\CloudIAP\IapEmpty;
21use Google\Service\CloudIAP\IdentityAwareProxyClient;
22use Google\Service\CloudIAP\ListIdentityAwareProxyClientsResponse;
23use Google\Service\CloudIAP\ResetIdentityAwareProxyClientSecretRequest;
24
25/**
26 * The "identityAwareProxyClients" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $iapService = new Google\Service\CloudIAP(...);
30 *   $identityAwareProxyClients = $iapService->identityAwareProxyClients;
31 *  </code>
32 */
33class ProjectsBrandsIdentityAwareProxyClients extends \Google\Service\Resource
34{
35  /**
36   * Creates an Identity Aware Proxy (IAP) OAuth client. The client is owned by
37   * IAP. Requires that the brand for the project exists and that it is set for
38   * internal-only use. (identityAwareProxyClients.create)
39   *
40   * @param string $parent Required. Path to create the client in. In the
41   * following format: projects/{project_number/id}/brands/{brand}. The project
42   * must belong to a G Suite account.
43   * @param IdentityAwareProxyClient $postBody
44   * @param array $optParams Optional parameters.
45   * @return IdentityAwareProxyClient
46   */
47  public function create($parent, IdentityAwareProxyClient $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('create', [$params], IdentityAwareProxyClient::class);
52  }
53  /**
54   * Deletes an Identity Aware Proxy (IAP) OAuth client. Useful for removing
55   * obsolete clients, managing the number of clients in a given project, and
56   * cleaning up after tests. Requires that the client is owned by IAP.
57   * (identityAwareProxyClients.delete)
58   *
59   * @param string $name Required. Name of the Identity Aware Proxy client to be
60   * deleted. In the following format: projects/{project_number/id}/brands/{brand}
61   * /identityAwareProxyClients/{client_id}.
62   * @param array $optParams Optional parameters.
63   * @return IapEmpty
64   */
65  public function delete($name, $optParams = [])
66  {
67    $params = ['name' => $name];
68    $params = array_merge($params, $optParams);
69    return $this->call('delete', [$params], IapEmpty::class);
70  }
71  /**
72   * Retrieves an Identity Aware Proxy (IAP) OAuth client. Requires that the
73   * client is owned by IAP. (identityAwareProxyClients.get)
74   *
75   * @param string $name Required. Name of the Identity Aware Proxy client to be
76   * fetched. In the following format: projects/{project_number/id}/brands/{brand}
77   * /identityAwareProxyClients/{client_id}.
78   * @param array $optParams Optional parameters.
79   * @return IdentityAwareProxyClient
80   */
81  public function get($name, $optParams = [])
82  {
83    $params = ['name' => $name];
84    $params = array_merge($params, $optParams);
85    return $this->call('get', [$params], IdentityAwareProxyClient::class);
86  }
87  /**
88   * Lists the existing clients for the brand.
89   * (identityAwareProxyClients.listProjectsBrandsIdentityAwareProxyClients)
90   *
91   * @param string $parent Required. Full brand path. In the following format:
92   * projects/{project_number/id}/brands/{brand}.
93   * @param array $optParams Optional parameters.
94   *
95   * @opt_param int pageSize The maximum number of clients to return. The service
96   * may return fewer than this value. If unspecified, at most 100 clients will be
97   * returned. The maximum value is 1000; values above 1000 will be coerced to
98   * 1000.
99   * @opt_param string pageToken A page token, received from a previous
100   * `ListIdentityAwareProxyClients` call. Provide this to retrieve the subsequent
101   * page. When paginating, all other parameters provided to
102   * `ListIdentityAwareProxyClients` must match the call that provided the page
103   * token.
104   * @return ListIdentityAwareProxyClientsResponse
105   */
106  public function listProjectsBrandsIdentityAwareProxyClients($parent, $optParams = [])
107  {
108    $params = ['parent' => $parent];
109    $params = array_merge($params, $optParams);
110    return $this->call('list', [$params], ListIdentityAwareProxyClientsResponse::class);
111  }
112  /**
113   * Resets an Identity Aware Proxy (IAP) OAuth client secret. Useful if the
114   * secret was compromised. Requires that the client is owned by IAP.
115   * (identityAwareProxyClients.resetSecret)
116   *
117   * @param string $name Required. Name of the Identity Aware Proxy client to that
118   * will have its secret reset. In the following format: projects/{project_number
119   * /id}/brands/{brand}/identityAwareProxyClients/{client_id}.
120   * @param ResetIdentityAwareProxyClientSecretRequest $postBody
121   * @param array $optParams Optional parameters.
122   * @return IdentityAwareProxyClient
123   */
124  public function resetSecret($name, ResetIdentityAwareProxyClientSecretRequest $postBody, $optParams = [])
125  {
126    $params = ['name' => $name, 'postBody' => $postBody];
127    $params = array_merge($params, $optParams);
128    return $this->call('resetSecret', [$params], IdentityAwareProxyClient::class);
129  }
130}
131
132// Adding a class alias for backwards compatibility with the previous class name.
133class_alias(ProjectsBrandsIdentityAwareProxyClients::class, 'Google_Service_CloudIAP_Resource_ProjectsBrandsIdentityAwareProxyClients');
134