Completed
Push — master ( d0d40f...472735 )
by Artem
02:46
created

UserApi   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 1
c 5
b 0
f 0
lcom 0
cbo 1
dl 0
loc 26
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getApiKey() 0 10 1
1
<?php
2
3
//----------------------------------------------------------------------
4
//
5
//  Copyright (C) 2015-2016 Artem Rodygin
6
//
7
//  This file is part of Linode API Client Library for PHP.
8
//
9
//  You should have received a copy of the MIT License along with
10
//  the library. If not, see <http://opensource.org/licenses/MIT>.
11
//
12
//----------------------------------------------------------------------
13
14
namespace Linode;
15
16
/**
17
 * This class is autogenerated.
18
 *
19
 * @version Linode API v3.3
20
 */
21
class UserApi extends BaseLinodeApi
22
{
23
    /**
24
     * Authenticates a Linode Manager user against their username, password, and two-factor token (when
25
     * enabled), and then returns a new API key, which can be used until it expires.  The number of active
26
     * keys is limited to 20.  Batch requests will be rejected if they include this API action.
27
     *
28
     * @param string $username [required] 
29
     * @param string $password [required] 
30
     * @param string $token    [optional] Required when two-factor authentication is enabled.
31
     * @param int    $expires  [optional] Number of hours the key will remain valid, between 0 and 8760. 0 means no expiration. Defaults to 168.
32
     * @param string $label    [optional] An optional label for this key.
33
     *
34
     * @return array
35
     */
36 1
    public function getApiKey($username, $password, $token = null, $expires = null, $label = null)
37
    {
38 1
        return $this->call('user.getapikey', [
39 1
            'username' => $username,
40 1
            'password' => $password,
41 1
            'token'    => $token,
42 1
            'expires'  => $expires,
43 1
            'label'    => $label,
44 1
        ]);
45
    }
46
}
47