Fetches all existing backups.

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

@return Index
329623
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'],
            ]);
        });
    }
1323069
public function all(array $params = array())
    {
        $endpoint = '/admin/locations.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Location::class, $response['locations']);
    }
372788
public function listCategories($optParams = array())
  {
    $params = array();
    $params = array_merge($params, $optParams);
    return $this->call('listCategories', array($params), "Books_Category");
  }
362603
public static function all($params, $opts = null)
    {
        $list = parent::all($params, $opts);
        $ntList = new NotificationCollection();
        $ntList->install($list->values, $list->opts);
        return $ntList;
    }
537527
public function getUpdates(array $params = [])
    {
        return array_map(function (stdClass $update) {
            return Update::create($update);
        }, $this->request('getUpdates', $params)->getResult());
    }
523562
public function update($params, $optParams = [])
    {
        if (!$params instanceof Cloud) {
            throw new InvalidParamException(Cloud::class . ' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'update',
            'restId' => $params->id,
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Cloud($response->data) : $response;
        });
    }
549156
protected static function all($params, $opts)
    {
        $url = self::classUrl();
        list($resp, $usedOpts) = self::request(self::METHOD_GET, $url, $params, $opts);
        $resp = Util\Util::arrayToObject($resp, $usedOpts);
        // Check the class name of the result because all feature must get the instance of Collection class.
        if (!is_a($resp, 'RpayLite\\Collection')) {
            $class = get_class($resp);
            $msg =  "'RpayLite\\Collection' is expected but '$class' is returned.";
            throw new Error\Api($msg);
        }
        return $resp;
    }
694018
public function records($params)
    {
        if ($this->hasMethod('sourceRecords')) {
            return $this->sourceRecords($params, null, null);
        } else {
            $query = $this->sourceQuery($params);
            $results = ArrayList::create();
            foreach ($query->execute() as $data) {
                $class = $this->dataClass();
                $result = Injector::inst()->create($class, $data);
                $results->push($result);
            }
            return $results;
        }
    }
986624
public function getMetagameConfig($optParams = array())
  {
    $params = array();
    $params = array_merge($params, $optParams);
    return $this->call('getMetagameConfig', array($params), "Games_MetagameConfig");
  }
708897
public function fetchAll($params = [])
    {
        return $this->table->select(
            function (Select $select) {
                $select->columns([]);
                $select->join(
                    $this->roleTableName,
                    sprintf('%s.role_id=%s.role_id', $this->roleTableName, $this->table->getTable())
                );
                $select->where(['user_id' => $this->getUserId()]);
            }
        );

//        $adapter = new DbSelect($select, $this->table->getAdapter());
//        return new $this->collectionClass($adapter);
    }
943927
public static function prepare($params = [])
    {
        $positions = array_combine(array_keys($params), array_fill(0, count($params), 0));
        $data = [];

        do {
            $data[] = self::getByIndexes($params, $positions);
        } while (self::updateIndexesToNextIteration($params, $positions));

        return $data;
    }
627172
public static function all($params = null, $opts = null)
    {
        $msg = "Subscription Schedule Revisions cannot be listed without a Subscription Schedule ID. " .
               "List those using \$schedule->allRevisions('revision_id') instead.";
        throw new Error\InvalidRequest($msg, null);
    }
928210
public function all(array $params = array())
    {
        $endpoint = '/admin/themes.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createCollection(Theme::class, $response['themes']);
    }
66252
public function getList($params = array())
    {
        $resource = 'georegion.json';
        $resource .= '?' . $this->buildQueryString($params);
        $response = $this->getServiceResponse($resource);

        $geoRegions = new Models\ResponseGeoRegionsGet($response);

        return $geoRegions;
    }
335837
public function detail($params = [], $optParams = [])
    {
        if ($optParams instanceof DetailParams) {
            $optParams = $optParams->toArray(true);
        }

        return $this->sendRequest([], [
            'customAction' => 'detail',
            'method' => 'GET',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) {
            $items = [];
            $warnings = [];
            foreach ($response->data['items'] as $item) {
                $items[] = new DetailItem($item);
            }
            foreach ($response->data['warnings'] as $warning) {
                $warnings[] = new DetailWarning($warning);
            }

            return new Detail([
                'items' => $items,
                'warnings' => $warnings,
            ]);
        });
    }
147484
public function exists($params, $optParams = [])
    {
        if (is_string($params)) {
            $params = ['publicId' => $params];
        }

        return $this->sendRequest(['cloudId', 'publicId'], [
            'restAction' => 'exists',
            'uri' => '/c/<cloudId>/o/<publicId>',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) {
            return $response->success;
        });
    }
969967
public function reset($optParams = array()) {
      $params = array();
      $params = array_merge($params, $optParams);
      $data = $this->__call('reset', array($params));
      return $data;
    }