-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b8e802
commit 6227806
Showing
3 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
namespace Df\ZohoBI\API; | ||
/** | ||
* 2017-07-06 | ||
* An error response looks like: | ||
* { | ||
* "code": 5, | ||
* "message": "Invalid URL Passed" | ||
* } | ||
* A successful response looks like: | ||
* { | ||
* "code": 0, | ||
* "message": "success", | ||
* "<data key>": <data> | ||
* } | ||
* https://www.zoho.eu/books/api/v3/#response | ||
* https://www.zoho.eu/inventory/api/v1/#response | ||
* @used-by \Df\ZohoBI\API\Client::responseValidatorC() | ||
*/ | ||
final class Validator extends \Df\API\Response\Validator { | ||
/** | ||
* 2017-07-06 | ||
* @override | ||
* @see \Df\API\Response\Validator::message() | ||
* @used-by \Df\API\Response\Validator::validate() | ||
* @return string | ||
*/ | ||
protected function message() {return $this->r()['message'];} | ||
|
||
/** | ||
* 2017-07-06 | ||
* @override | ||
* @see \Df\API\Response\Validator::rs() | ||
* @used-by \Df\API\Response\Validator::validate() | ||
* @return string | ||
*/ | ||
protected function rs() {return df_json_encode_pretty($this->r());} | ||
|
||
/** | ||
* 2017-07-06 | ||
* @override | ||
* @see \Df\API\Response\Validator::title() | ||
* @used-by \Df\API\Response\Validator::validate() | ||
* @return string | ||
*/ | ||
protected function title() {return 'Zoho ' . df_zoho_app($this->c()->m());} | ||
|
||
/** | ||
* 2017-07-06 | ||
* @override | ||
* @see \Df\API\Response\Validator::valid() | ||
* @used-by \Df\API\Response\Validator::validate() | ||
* @return bool | ||
*/ | ||
protected function valid() {return 0 === $this->r()['code'];} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters