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\Directory\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Directory\VerificationCodes as VerificationCodesModel;
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * The "verificationCodes" collection of methods.
|
---|
24 | * Typical usage is:
|
---|
25 | * <code>
|
---|
26 | * $adminService = new Google\Service\Directory(...);
|
---|
27 | * $verificationCodes = $adminService->verificationCodes;
|
---|
28 | * </code>
|
---|
29 | */
|
---|
30 | class VerificationCodes extends \Google\Service\Resource
|
---|
31 | {
|
---|
32 | /**
|
---|
33 | * Generates new backup verification codes for the user.
|
---|
34 | * (verificationCodes.generate)
|
---|
35 | *
|
---|
36 | * @param string $userKey Email or immutable ID of the user
|
---|
37 | * @param array $optParams Optional parameters.
|
---|
38 | * @throws \Google\Service\Exception
|
---|
39 | */
|
---|
40 | public function generate($userKey, $optParams = [])
|
---|
41 | {
|
---|
42 | $params = ['userKey' => $userKey];
|
---|
43 | $params = array_merge($params, $optParams);
|
---|
44 | return $this->call('generate', [$params]);
|
---|
45 | }
|
---|
46 | /**
|
---|
47 | * Invalidates the current backup verification codes for the user.
|
---|
48 | * (verificationCodes.invalidate)
|
---|
49 | *
|
---|
50 | * @param string $userKey Email or immutable ID of the user
|
---|
51 | * @param array $optParams Optional parameters.
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function invalidate($userKey, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['userKey' => $userKey];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('invalidate', [$params]);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Returns the current set of valid backup verification codes for the specified
|
---|
62 | * user. (verificationCodes.listVerificationCodes)
|
---|
63 | *
|
---|
64 | * @param string $userKey Identifies the user in the API request. The value can
|
---|
65 | * be the user's primary email address, alias email address, or unique user ID.
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return VerificationCodesModel
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function listVerificationCodes($userKey, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['userKey' => $userKey];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('list', [$params], VerificationCodesModel::class);
|
---|
75 | }
|
---|
76 | }
|
---|
77 |
|
---|
78 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
79 | class_alias(VerificationCodes::class, 'Google_Service_Directory_Resource_VerificationCodes');
|
---|