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\CloudOSLogin\Resource; 19 20use Google\Service\CloudOSLogin\ImportSshPublicKeyResponse; 21use Google\Service\CloudOSLogin\LoginProfile; 22use Google\Service\CloudOSLogin\SshPublicKey; 23 24/** 25 * The "users" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $osloginService = new Google\Service\CloudOSLogin(...); 29 * $users = $osloginService->users; 30 * </code> 31 */ 32class Users extends \Google\Service\Resource 33{ 34 /** 35 * Retrieves the profile information used for logging in to a virtual machine on 36 * Google Compute Engine. (users.getLoginProfile) 37 * 38 * @param string $name Required. The unique ID for the user in format 39 * `users/{user}`. 40 * @param array $optParams Optional parameters. 41 * 42 * @opt_param string projectId The project ID of the Google Cloud Platform 43 * project. 44 * @opt_param string systemId A system ID for filtering the results of the 45 * request. 46 * @return LoginProfile 47 */ 48 public function getLoginProfile($name, $optParams = []) 49 { 50 $params = ['name' => $name]; 51 $params = array_merge($params, $optParams); 52 return $this->call('getLoginProfile', [$params], LoginProfile::class); 53 } 54 /** 55 * Adds an SSH public key and returns the profile information. Default POSIX 56 * account information is set when no username and UID exist as part of the 57 * login profile. (users.importSshPublicKey) 58 * 59 * @param string $parent Required. The unique ID for the user in format 60 * `users/{user}`. 61 * @param SshPublicKey $postBody 62 * @param array $optParams Optional parameters. 63 * 64 * @opt_param string projectId The project ID of the Google Cloud Platform 65 * project. 66 * @return ImportSshPublicKeyResponse 67 */ 68 public function importSshPublicKey($parent, SshPublicKey $postBody, $optParams = []) 69 { 70 $params = ['parent' => $parent, 'postBody' => $postBody]; 71 $params = array_merge($params, $optParams); 72 return $this->call('importSshPublicKey', [$params], ImportSshPublicKeyResponse::class); 73 } 74} 75 76// Adding a class alias for backwards compatibility with the previous class name. 77class_alias(Users::class, 'Google_Service_CloudOSLogin_Resource_Users'); 78