public function create($params, $optParams = [])
    {
        if (!$params instanceof Firewall) {
            throw new InvalidParamException(Firewall::class.' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'create',
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Firewall($response->data) : $response;
        });
    }
public function create($params, $optParams = [])
    {
        if (!$params instanceof Firewall) {
            throw new InvalidParamException(Firewall::class.' is required!');
        }

        return $this->sendRequest([], [
            'restAction' => 'create',
            'postParams' => $params->toArray(),
            'getParams' => $optParams,
        ], function ($response) {
            return isset($response->data) ? new Firewall($response->data) : $response;
        });
    }
public function create ( $ params , $ optParams = [ ] ) { if ( ! $ params instanceof Firewall ) { throw new InvalidParamException ( Firewall :: class . ' is required!' ) ; } return $ this -> sendRequest ( [ ] , [ 'restAction' => 'create' , 'postParams' => $ params -> toArray ( ) , 'getParams' => $ optParams , ] , function ( $ response ) { return isset ( $ response -> data ) ? new Firewall ( $ response -> data ) : $ response ; } ) ; }
Creates a firewall.

@param Firewall $params    Firewall object
@param array    $optParams Optional API parameters

@return Firewall|Response

@throws InvalidParamException
Creates a firewall .