Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvalidArgumentException: Missing endPointUrl for entityName "PrintNode\Scale" #26

Open
archonia-erwin opened this issue Aug 19, 2019 · 0 comments

Comments

@archonia-erwin
Copy link

Activating the virtual scale using PrintNode-PHP results in an InvalidArgumentException: Missing endPointUrl for entityName "PrintNode\Scale"

Testcode:
$credentials = new \PrintNode\Credentials ();
$credentials->setApiKey ( ... );
$request = new \PrintNode\Request ( $credentials );
$scale = new \PrintNode\Scale ();
$scale->deviceNum = 0;
$scale->deviceName = 'PrintNode Test Scale';
$scale->computerId = 0;
$request->put ( $scale );//This results in InvalidArgumentException: Missing endPointUrl for entityName "PrintNode\Scale"

Solution:
in class Request: add endPointUrl: PrintNode\Scale

private $endPointUrls = array(
    'PrintNode\Client' => '/download/clients',
    'PrintNode\Download' => '/download/client',
    'PrintNode\ApiKey' => '/account/apikey',
    'PrintNode\Account' => '/account',
    'PrintNode\Tag' => '/account/tag',
    'PrintNode\Whoami' => '/whoami',
    'PrintNode\Computer' => '/computers',
    'PrintNode\Printer' => '/printers',
    'PrintNode\PrintJob' => '/printjobs',
    
    'PrintNode\Scale' => '/scale',
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant