webinarium /
linode-api3
| 1 | <?php |
||
| 2 | |||
| 3 | //---------------------------------------------------------------------- |
||
| 4 | // |
||
| 5 | // Copyright (C) 2015-2017 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', [ |
|
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||
| 38 | 1 | 'mode' => $mode, |
|
| 39 | 1 | 'LinodeID' => $LinodeID, |
|
| 40 | 1 | 'PlanID' => $PlanID, |
|
| 41 | 1 | 'PaymentTerm' => $PaymentTerm, |
|
| 42 | ]); |
||
| 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'); |
|
|
0 ignored issues
–
show
|
|||
| 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'); |
|
|
0 ignored issues
–
show
|
|||
| 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', [ |
|
|
0 ignored issues
–
show
|
|||
| 76 | 1 | 'ccNumber' => $ccNumber, |
|
| 77 | 1 | 'ccExpMonth' => $ccExpMonth, |
|
| 78 | 1 | 'ccExpYear' => $ccExpYear, |
|
| 79 | ]); |
||
| 80 | } |
||
| 81 | } |
||
| 82 |