Packages

Inofficial Erlang/OTP client application for the official DeepL API Version 2

Current section

Files

Jump to
deeperl src deeperl_usage.erl
Raw

src/deeperl_usage.erl

%%% @private
-module(deeperl_usage).
-behavior(gen_deeperl_procedure).
%% API
-export([uri/0, body_params/1, response/1]).
uri() ->
"/v2/usage".
body_params(_) ->
[].
response(#{<<"character_count">> := CharacterCount, <<"character_limit">> := CharacterLimit}) when is_integer(CharacterCount), is_integer(CharacterLimit)->
{CharacterCount, CharacterLimit};
response(_) ->
{error, invalid_response}.