public static function make($key, $resource, $version = 'v2')
    {
        $client = new Client($key, $version);

        $namespace = 'Rule\\ApiWrapper\\Api\\' . strtoupper($version) . '\\' . ucfirst($resource) . '\\';
        $classname = $namespace . ucfirst($resource);

        if (!class_exists($classname)) {
            throw new InvalidResourceException("Invalid resource name providen or api version not supported");
        }

        return new $classname($client);
    }
public static function make($key, $resource, $version = 'v2')
    {
        $client = new Client($key, $version);

        $namespace = 'Rule\\ApiWrapper\\Api\\' . strtoupper($version) . '\\' . ucfirst($resource) . '\\';
        $classname = $namespace . ucfirst($resource);

        if (!class_exists($classname)) {
            throw new InvalidResourceException("Invalid resource name providen or api version not supported");
        }

        return new $classname($client);
    }
public static function make ( $ key , $ resource , $ version = 'v2' ) { $ client = new Client ( $ key , $ version ) ; $ namespace = 'Rule\\ApiWrapper\\Api\\' . strtoupper ( $ version ) . '\\' . ucfirst ( $ resource ) . '\\' ; $ classname = $ namespace . ucfirst ( $ resource ) ; if ( ! class_exists ( $ classname ) ) { throw new InvalidResourceException ( "Invalid resource name providen or api version not supported" ) ; } return new $ classname ( $ client ) ; }
Creates api resource

@param string $key Rule api key
@param string $resource Resource name [subscriber, campaign, customization, suppression, tag, template, transaction]
@return Api
Creates api resource