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

        return $this->sendRequest([], [
            'restAction' => 'index',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) {
            $backups = [];
            if (isset($response->data['items'])) {
                foreach ($response->data['items'] as $superbackup) {
                    $backups[] = new SuperBackup($superbackup);
                }
            }

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

        return $this->sendRequest([], [
            'restAction' => 'index',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) {
            $backups = [];
            if (isset($response->data['items'])) {
                foreach ($response->data['items'] as $superbackup) {
                    $backups[] = new SuperBackup($superbackup);
                }
            }

            return new Index([
                'models' => $backups,
                'nextPageToken' => $response->data['nextPageToken'],
            ]);
        });
    }
public function index ( $ params = [ ] , $ optParams = [ ] ) { if ( $ optParams instanceof IndexParams ) { $ optParams = $ optParams -> toArray ( true ) ; } return $ this -> sendRequest ( [ ] , [ 'restAction' => 'index' , 'params' => $ params , 'getParams' => $ optParams , ] , function ( $ response ) { $ backups = [ ] ; if ( isset ( $ response -> data [ 'items' ] ) ) { foreach ( $ response -> data [ 'items' ] as $ superbackup ) { $ backups [ ] = new SuperBackup ( $ superbackup ) ; } } return new Index ( [ 'models' => $ backups , 'nextPageToken' => $ response -> data [ 'nextPageToken' ] , ] ) ; } ) ; }
Fetches all existing backups.

@param array $params    Required API parameters
@param array $optParams Optional API parameters

@return Index
Fetches all existing backups .