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

AccountApi::info()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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 AccountApi extends BaseLinodeApi
22
{
23
    /**
24
     * Estimates the invoice for adding a new Linode or NodeBalancer as well as resizing a Linode. This
25
     * returns two fields: PRICE which is the estimated cost of the invoice, and INVOICE_TO which is the
26
     * date invoice would be though with timezone set to America/New_York.
27
     *
28
     * @param string $mode        [required] This is one of the following options: 'linode_new', 'linode_resize', or 'nodebalancer_new'.
29
     * @param int    $LinodeID    [optional] This is the LinodeID you want to resize and is required for mode 'linode_resize'.
30
     * @param int    $PlanID      [optional] The desired PlanID available from avail.LinodePlans(). This is required for modes 'linode_new' and 'linode_resize'.
31
     * @param int    $PaymentTerm [optional] Subscription term in months. One of: 1, 12, or 24. This is required for modes 'linode_new' and 'nodebalancer_new'.
32
     *
33
     * @return array
34
     */
35 1
    public function estimateInvoice($mode, $LinodeID = null, $PlanID = null, $PaymentTerm = null)
36
    {
37 1
        return $this->call('account.estimateinvoice', [
38 1
            'mode'        => $mode,
39 1
            'LinodeID'    => $LinodeID,
40 1
            'PlanID'      => $PlanID,
41 1
            'PaymentTerm' => $PaymentTerm,
42 1
        ]);
43
    }
44
45
    /**
46
     * Shows information about your account such as the date your account was opened as well as your
47
     * network utilization for the current month in gigabytes.
48
     *
49
     * @return array
50
     */
51 1
    public function info()
52
    {
53 1
        return $this->call('account.info');
54
    }
55
56
    /**
57
     * Pays current balance on file, returning it in the response.
58
     *
59
     * @return array
60
     */
61 1
    public function payBalance()
62
    {
63 1
        return $this->call('account.paybalance');
64
    }
65
66
    /**
67
     * @param int $ccNumber   [required] 
68
     * @param int $ccExpMonth [required] 
69
     * @param int $ccExpYear  [required] 
70
     *
71
     * @return array
72
     */
73 1
    public function updateCard($ccNumber, $ccExpMonth, $ccExpYear)
74
    {
75 1
        return $this->call('account.updatecard', [
76 1
            'ccNumber'   => $ccNumber,
77 1
            'ccExpMonth' => $ccExpMonth,
78 1
            'ccExpYear'  => $ccExpYear,
79 1
        ]);
80
    }
81
}
82