blue-twilight/app/Services/Rackspace/ObjectStoreCdn/v1/Service.php

27 lines
848 B
PHP

<?php
namespace App\Services\Rackspace\ObjectStoreCdn\v1;
use App\Services\Rackspace\ObjectStoreCdn\v1\Models\Container;
use OpenStack\Common\Service\AbstractService;
/**
* Represents the Rackspace Cloud Files CDN v1 service.
*
* @property Api $api
*/
class Service extends AbstractService
{
/**
* Retrieves a collection of CDN-enabled container resources in a generator format.
*
* @param array $options {@see Api::getAccount()}
* @param callable|null $mapFn allows a function to be mapped over each element in the collection
*/
public function listContainers(array $options = [], callable $mapFn = null): \Generator
{
$options = array_merge($options, ['format' => 'json']);
return $this->model(Container::class)->enumerate($this->api->getAccount(), $options, $mapFn);
}
}