LexOffice.RequestBuilder (lexoffice.de API v0.1.9) View Source
Helper functions for building Tesla requests
Link to this section Summary
Functions
Add optional parameters to the request
Add optional parameters to the request
Handle the response for a Tesla request
Evaluates the Tesla response
Specify the request method when building a request
Specify the request method when building a request
Link to this section Functions
Specs
Add optional parameters to the request
Parameters
- request (Map) - Collected request options
- definitions (Map) - Map of parameter name to parameter location.
- options (KeywordList) - The provided optional parameters
Returns
Map
Specs
Add optional parameters to the request
Parameters
- request (Map) - Collected request options
- location (atom) - Where to put the parameter
- key (atom) - The name of the parameter
- value (any) - The value of the parameter
Returns
Map
Specs
decode(Tesla.Env.t() | term(), false | struct() | [struct()]) :: {:ok, struct()} | {:ok, Tesla.Env.t()} | {:error, any()}
Handle the response for a Tesla request
Parameters
- arg1 (Tesla.Env.t | term) - The response object
- arg2 (:false | struct | [struct]) - The shape of the struct to deserialize into
Returns
{:ok, struct()}
on success
{:ok, Tesla.Env.t()}
on failure
{:error, term}
on failure
Specs
evaluate_response({:error, any()} | {:atom, Tesla.Env.t()}, list()) :: {:ok, struct()} | {:ok, Tesla.Env.t()} | {:error, any()}
Evaluates the Tesla response
Parameters
- arg1 {:atom, Tesla.Env.t} - The response object
- arg2 list - List of Tuples matching something like [{200, %Model.ErrorResponse{}}]
Returns
{:ok, struct}
on success
{:ok, Tesla.Env.t()}
on failure
{:error, term}
on failure
Specs
Specify the request method when building a request
Parameters
- request (Map) - Collected request options
- m (atom) - Request method
Returns
Map
Specs
Specify the request method when building a request
Parameters
- request (Map) - Collected request options
- u (String) - Request URL
Returns
Map