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

        return $this->sendRequest([], [
            'restAction' => 'index',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) {
            $firewalls = [];
            foreach ($response->data['items'] as $firewall) {
                $firewalls[] = new Firewall($firewall);
            }

            return new Index([
                'models' => $firewalls,
                'totalCount' => (int) $response->data['totalCount'],
                '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) {
            $firewalls = [];
            foreach ($response->data['items'] as $firewall) {
                $firewalls[] = new Firewall($firewall);
            }

            return new Index([
                'models' => $firewalls,
                'totalCount' => (int) $response->data['totalCount'],
                '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 ) { $ firewalls = [ ] ; foreach ( $ response -> data [ 'items' ] as $ firewall ) { $ firewalls [ ] = new Firewall ( $ firewall ) ; } return new Index ( [ 'models' => $ firewalls , 'totalCount' => ( int ) $ response -> data [ 'totalCount' ] , 'nextPageToken' => $ response -> data [ 'nextPageToken' ] , ] ) ; } ) ; }
Fetches all firewalls.

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

<li>projection - an array of projection flags: noRules, noClouds, noCloudIds
<li>order - the order of results: name, -name, created, -created
<li>maxResults - number of results
<li>pageToken - token for next result page

@return Index
Fetches all firewalls .