public static function newResources($credentials)
    {
        if ((!isset($credentials[self::USERNAME])) || (!isset($credentials[self::PASSWORD]))) {
            throw new Exception('Invalid credentials');
        }
        $restClient = new Client($credentials[self::USERNAME], $credentials[self::PASSWORD]);
        return new Resources($restClient);
    }