-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #534 from DawidVH/ecloud-billing-history
eCloud BillingHistory
- Loading branch information
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud; | ||
|
||
use UKFast\SDK\eCloud\Entities\BillingHistory; | ||
use UKFast\SDK\Entities\ClientEntityInterface; | ||
use UKFast\SDK\Traits\PageItems; | ||
|
||
class BillingHistoryClient extends Client implements ClientEntityInterface | ||
{ | ||
use PageItems; | ||
|
||
protected $collectionPath = 'v2/billing-history'; | ||
|
||
public function getEntityMap() | ||
{ | ||
return BillingHistory::$entityMap; | ||
} | ||
|
||
public function loadEntity($data) | ||
{ | ||
return new BillingHistory( | ||
$this->apiToFriendly($data, BillingHistory::$entityMap) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace UKFast\SDK\eCloud\Entities; | ||
|
||
use DateTime; | ||
use UKFast\SDK\Entity; | ||
|
||
/** | ||
* @property string $id | ||
* @property DateTime $billingPeriodStart | ||
* @property DateTime $billingPeriodEnd | ||
* @property float $consumptionTotal | ||
* @property float $planSpendLimit | ||
* @property float $planOverage | ||
* @property DateTime $createdAt | ||
* @property DateTime $updatedAt | ||
*/ | ||
class BillingHistory extends Entity | ||
{ | ||
protected $dates = ['billingPeriodStart', 'billingPeriodEnd', 'createdAt', 'updatedAt']; | ||
|
||
public static $entityMap = [ | ||
'id' => 'id', | ||
'billing_period_start' => 'billingPeriodStart', | ||
'billing_period_end' => 'billingPeriodEnd', | ||
'consumption_total' => 'consumptionTotal', | ||
'plan_spend_limit' => 'planSpendLimit', | ||
'plan_overage' => 'planOverage', | ||
'created_at' => 'createdAt', | ||
'updated_at' => 'updatedAt', | ||
]; | ||
} |