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\Directory\Resource; 19 20use 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 */ 30class 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 */ 39 public function generate($userKey, $optParams = []) 40 { 41 $params = ['userKey' => $userKey]; 42 $params = array_merge($params, $optParams); 43 return $this->call('generate', [$params]); 44 } 45 /** 46 * Invalidates the current backup verification codes for the user. 47 * (verificationCodes.invalidate) 48 * 49 * @param string $userKey Email or immutable ID of the user 50 * @param array $optParams Optional parameters. 51 */ 52 public function invalidate($userKey, $optParams = []) 53 { 54 $params = ['userKey' => $userKey]; 55 $params = array_merge($params, $optParams); 56 return $this->call('invalidate', [$params]); 57 } 58 /** 59 * Returns the current set of valid backup verification codes for the specified 60 * user. (verificationCodes.listVerificationCodes) 61 * 62 * @param string $userKey Identifies the user in the API request. The value can 63 * be the user's primary email address, alias email address, or unique user ID. 64 * @param array $optParams Optional parameters. 65 * @return VerificationCodesModel 66 */ 67 public function listVerificationCodes($userKey, $optParams = []) 68 { 69 $params = ['userKey' => $userKey]; 70 $params = array_merge($params, $optParams); 71 return $this->call('list', [$params], VerificationCodesModel::class); 72 } 73} 74 75// Adding a class alias for backwards compatibility with the previous class name. 76class_alias(VerificationCodes::class, 'Google_Service_Directory_Resource_VerificationCodes'); 77