Request the list of language pairs supported for glossaries.
(self)
| 1010 | ] |
| 1011 | |
| 1012 | def get_glossary_languages(self) -> List[GlossaryLanguagePair]: |
| 1013 | """Request the list of language pairs supported for glossaries.""" |
| 1014 | status, content, json = self._api_call( |
| 1015 | "v2/glossary-language-pairs", method="GET" |
| 1016 | ) |
| 1017 | |
| 1018 | self._raise_for_status(status, content, json) |
| 1019 | |
| 1020 | supported_languages = ( |
| 1021 | json.get("supported_languages", []) |
| 1022 | if (json and isinstance(json, dict)) |
| 1023 | else [] |
| 1024 | ) |
| 1025 | return [ |
| 1026 | GlossaryLanguagePair( |
| 1027 | language_pair["source_lang"], language_pair["target_lang"] |
| 1028 | ) |
| 1029 | for language_pair in supported_languages |
| 1030 | ] |
| 1031 | |
| 1032 | def get_usage(self) -> Usage: |
| 1033 | """Requests the current API usage.""" |