| 1 |
<?php |
| 2 |
|
| 3 |
class DeepLApiUsage extends DeepLApi { |
| 4 |
|
| 5 |
protected $endpointURL = 'https://api.deepl.com/v1/usage'; |
| 6 |
|
| 7 |
protected $allow_cache = false; |
| 8 |
protected $http_mode = 'GET'; |
| 9 |
|
| 10 |
|
| 11 |
public function getCurrentCharacterCount() { |
| 12 |
if(!isset($this->response) || !array_key_exists('character_count',$this->response)) { |
| 13 |
return false; |
| 14 |
} |
| 15 |
return $this->response['character_count']; |
| 16 |
} |
| 17 |
|
| 18 |
public function getCharacterLimit() { |
| 19 |
if(!isset($this->response) || !array_key_exists('character_limit',$this->response)) { |
| 20 |
return false; |
| 21 |
} |
| 22 |
return $this->response['character_limit']; |
| 23 |
} |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
} |