public function index($params = [], $optParams = [])
    {
        if ($optParams instanceof IndexParams) {
            $optParams = $optParams->toArray(true);
        }
        if (is_string($params)) {
            $params = ['cloudId' => $params];
        }

        return $this->sendRequest(['cloudId'], [
            'restAction' => 'index',
            'uri' => '/c/<cloudId>',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) use ($params) {
            $images = [];
            foreach ($response->data['items'] as $image) {
                if (!isset($image['cloudId'])) {
                    $image['cloudId'] = $this->client->getParam($params, 'cloudId');
                }
                $images[] = new Image($image);
            }

            return new Index([
                'models' => $images,
                'nextPageToken' => $response->data['nextPageToken'],
            ]);
        });
    }
public function index($params = [], $optParams = [])
    {
        if ($optParams instanceof IndexParams) {
            $optParams = $optParams->toArray(true);
        }
        if (is_string($params)) {
            $params = ['cloudId' => $params];
        }

        return $this->sendRequest(['cloudId'], [
            'restAction' => 'index',
            'uri' => '/c/<cloudId>',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) use ($params) {
            $images = [];
            foreach ($response->data['items'] as $image) {
                if (!isset($image['cloudId'])) {
                    $image['cloudId'] = $this->client->getParam($params, 'cloudId');
                }
                $images[] = new Image($image);
            }

            return new Index([
                'models' => $images,
                'nextPageToken' => $response->data['nextPageToken'],
            ]);
        });
    }
public function index ( $ params = [ ] , $ optParams = [ ] ) { if ( $ optParams instanceof IndexParams ) { $ optParams = $ optParams -> toArray ( true ) ; } if ( is_string ( $ params ) ) { $ params = [ 'cloudId' => $ params ] ; } return $ this -> sendRequest ( [ 'cloudId' ] , [ 'restAction' => 'index' , 'uri' => '/c/<cloudId>' , 'params' => $ params , 'getParams' => $ optParams , ] , function ( $ response ) use ( $ params ) { $ images = [ ] ; foreach ( $ response -> data [ 'items' ] as $ image ) { if ( ! isset ( $ image [ 'cloudId' ] ) ) { $ image [ 'cloudId' ] = $ this -> client -> getParam ( $ params , 'cloudId' ) ; } $ images [ ] = new Image ( $ image ) ; } return new Index ( [ 'models' => $ images , 'nextPageToken' => $ response -> data [ 'nextPageToken' ] , ] ) ; } ) ; }
Fetches all images.

@param array $params Required API parameters

<li>cloudId - cloud ID
@param IndexParams|array $optParams Optional API parameters

<li>projection - an array of projection flags: noExif, noObject, noDimensions
<li>order - the order of results: latest, publicId
<li>maxResults - number of results
<li>pageToken - token for next result page
<li>nextPageTokenType - type of paging token: shortTime, longTime
<li>prefix - prefix of publicId for filtering
<li>byTag - image tag for filtering

@return Index
Fetches all images .