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