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\AndroidEnterprise\Resource;
19
20use Google\Service\AndroidEnterprise\ServiceAccountKey;
21use Google\Service\AndroidEnterprise\ServiceAccountKeysListResponse;
22
23/**
24 * The "serviceaccountkeys" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $androidenterpriseService = new Google\Service\AndroidEnterprise(...);
28 *   $serviceaccountkeys = $androidenterpriseService->serviceaccountkeys;
29 *  </code>
30 */
31class Serviceaccountkeys extends \Google\Service\Resource
32{
33  /**
34   * Removes and invalidates the specified credentials for the service account
35   * associated with this enterprise. The calling service account must have been
36   * retrieved by calling Enterprises.GetServiceAccount and must have been set as
37   * the enterprise service account by calling Enterprises.SetAccount.
38   * (serviceaccountkeys.delete)
39   *
40   * @param string $enterpriseId The ID of the enterprise.
41   * @param string $keyId The ID of the key.
42   * @param array $optParams Optional parameters.
43   */
44  public function delete($enterpriseId, $keyId, $optParams = [])
45  {
46    $params = ['enterpriseId' => $enterpriseId, 'keyId' => $keyId];
47    $params = array_merge($params, $optParams);
48    return $this->call('delete', [$params]);
49  }
50  /**
51   * Generates new credentials for the service account associated with this
52   * enterprise. The calling service account must have been retrieved by calling
53   * Enterprises.GetServiceAccount and must have been set as the enterprise
54   * service account by calling Enterprises.SetAccount. Only the type of the key
55   * should be populated in the resource to be inserted.
56   * (serviceaccountkeys.insert)
57   *
58   * @param string $enterpriseId The ID of the enterprise.
59   * @param ServiceAccountKey $postBody
60   * @param array $optParams Optional parameters.
61   * @return ServiceAccountKey
62   */
63  public function insert($enterpriseId, ServiceAccountKey $postBody, $optParams = [])
64  {
65    $params = ['enterpriseId' => $enterpriseId, 'postBody' => $postBody];
66    $params = array_merge($params, $optParams);
67    return $this->call('insert', [$params], ServiceAccountKey::class);
68  }
69  /**
70   * Lists all active credentials for the service account associated with this
71   * enterprise. Only the ID and key type are returned. The calling service
72   * account must have been retrieved by calling Enterprises.GetServiceAccount and
73   * must have been set as the enterprise service account by calling
74   * Enterprises.SetAccount. (serviceaccountkeys.listServiceaccountkeys)
75   *
76   * @param string $enterpriseId The ID of the enterprise.
77   * @param array $optParams Optional parameters.
78   * @return ServiceAccountKeysListResponse
79   */
80  public function listServiceaccountkeys($enterpriseId, $optParams = [])
81  {
82    $params = ['enterpriseId' => $enterpriseId];
83    $params = array_merge($params, $optParams);
84    return $this->call('list', [$params], ServiceAccountKeysListResponse::class);
85  }
86}
87
88// Adding a class alias for backwards compatibility with the previous class name.
89class_alias(Serviceaccountkeys::class, 'Google_Service_AndroidEnterprise_Resource_Serviceaccountkeys');
90