Skip to content

Commit

Permalink
Merge pull request #497 from ecloud-jay2/master
Browse files Browse the repository at this point in the history
Adds Availability Zones as a child resource for RegionClient
  • Loading branch information
ecloud-jay2 authored Jul 5, 2022
2 parents c2ec961 + ace7512 commit 72b4fa1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/eCloud/RegionClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UKFast\SDK\eCloud;

use UKFast\SDK\eCloud\Entities\AvailabilityZone;
use UKFast\SDK\eCloud\Entities\Product;
use UKFast\SDK\Entities\ClientEntityInterface;
use UKFast\SDK\Traits\PageItems;
Expand Down Expand Up @@ -34,4 +35,11 @@ public function getProducts($id, $filters = [])
return new Product($this->apiToFriendly($data, Product::$entityMap));
}, $filters);
}

public function getAvailabilityZones($id, $filters = [])
{
return $this->getChildResources($id, 'availability-zones', function ($data) {
return new AvailabilityZone($this->apiToFriendly($data, AvailabilityZone::$entityMap));
}, $filters);
}
}

0 comments on commit 72b4fa1

Please sign in to comment.