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\OsloginEmpty;
21use Google\Service\CloudOSLogin\SshPublicKey;
22
23/**
24 * The "sshPublicKeys" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $osloginService = new Google\Service\CloudOSLogin(...);
28 *   $sshPublicKeys = $osloginService->sshPublicKeys;
29 *  </code>
30 */
31class UsersSshPublicKeys extends \Google\Service\Resource
32{
33  /**
34   * Create an SSH public key (sshPublicKeys.create)
35   *
36   * @param string $parent Required. The unique ID for the user in format
37   * `users/{user}`.
38   * @param SshPublicKey $postBody
39   * @param array $optParams Optional parameters.
40   * @return SshPublicKey
41   */
42  public function create($parent, SshPublicKey $postBody, $optParams = [])
43  {
44    $params = ['parent' => $parent, 'postBody' => $postBody];
45    $params = array_merge($params, $optParams);
46    return $this->call('create', [$params], SshPublicKey::class);
47  }
48  /**
49   * Deletes an SSH public key. (sshPublicKeys.delete)
50   *
51   * @param string $name Required. The fingerprint of the public key to update.
52   * Public keys are identified by their SHA-256 fingerprint. The fingerprint of
53   * the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`.
54   * @param array $optParams Optional parameters.
55   * @return OsloginEmpty
56   */
57  public function delete($name, $optParams = [])
58  {
59    $params = ['name' => $name];
60    $params = array_merge($params, $optParams);
61    return $this->call('delete', [$params], OsloginEmpty::class);
62  }
63  /**
64   * Retrieves an SSH public key. (sshPublicKeys.get)
65   *
66   * @param string $name Required. The fingerprint of the public key to retrieve.
67   * Public keys are identified by their SHA-256 fingerprint. The fingerprint of
68   * the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`.
69   * @param array $optParams Optional parameters.
70   * @return SshPublicKey
71   */
72  public function get($name, $optParams = [])
73  {
74    $params = ['name' => $name];
75    $params = array_merge($params, $optParams);
76    return $this->call('get', [$params], SshPublicKey::class);
77  }
78  /**
79   * Updates an SSH public key and returns the profile information. This method
80   * supports patch semantics. (sshPublicKeys.patch)
81   *
82   * @param string $name Required. The fingerprint of the public key to update.
83   * Public keys are identified by their SHA-256 fingerprint. The fingerprint of
84   * the public key is in format `users/{user}/sshPublicKeys/{fingerprint}`.
85   * @param SshPublicKey $postBody
86   * @param array $optParams Optional parameters.
87   *
88   * @opt_param string updateMask Mask to control which fields get updated.
89   * Updates all if not present.
90   * @return SshPublicKey
91   */
92  public function patch($name, SshPublicKey $postBody, $optParams = [])
93  {
94    $params = ['name' => $name, 'postBody' => $postBody];
95    $params = array_merge($params, $optParams);
96    return $this->call('patch', [$params], SshPublicKey::class);
97  }
98}
99
100// Adding a class alias for backwards compatibility with the previous class name.
101class_alias(UsersSshPublicKeys::class, 'Google_Service_CloudOSLogin_Resource_UsersSshPublicKeys');
102