View Source Reydenx.Client (Reyden-X v0.1.1)

A wrapper for 'HTTPoison'. Used to obtain an API access token, implements the 'GET', 'POST', 'PATCH' methods

Summary

Types

@type s() :: String.t()
@type t() ::
  {:error,
   %Reydenx.Model.ResponseError{
     message: term(),
     path: term(),
     status_code: term()
   }}
  | {:ok,
     %Reydenx.Model.ActionResult{
       action: term(),
       order_id: term(),
       request_id: term(),
       task: term(),
       value: term()
     }
     | %Reydenx.Model.Result{
         cache_expires_at: term(),
         cached: term(),
         cursor: term(),
         request_id: term(),
         result: term()
       }
     | %Reydenx.Model.User{
         currency_id: term(),
         date_joined: term(),
         discount_value: term(),
         email: term(),
         has_image: term(),
         id: term(),
         image_extension: term(),
         image_url: term(),
         is_active: term(),
         is_blocked: term(),
         is_reseller: term(),
         twitch_id: term(),
         twitch_login: term(),
         username: term()
       }
     | %Reydenx.Model.Balance{
         amount: term(),
         currency: term(),
         currency_id: term(),
         formatted_amount: term(),
         id: term(),
         user_id: term()
       }}

Functions

Link to this function

get(token, path, to \\ Result)

View Source (since 0.1.0)
@spec get(token :: Token, path :: s(), to :: Reydenx.Model.Result | any()) :: t()

GET Request

Link to this function

patch(token, path, to)

View Source (since 0.1.0)
@spec patch(token :: Token, path :: s(), to :: Reydenx.Model.ActionResult | any()) ::
  t()

PATCH Request

Link to this function

patch(token, path, body, to)

View Source (since 0.1.1)
@spec patch(
  token :: Token,
  path :: s(),
  body :: map(),
  to :: Reydenx.Model.ActionResult | any()
) :: t()
Link to this function

post(token, path, body)

View Source (since 0.1.0)
@spec post(token :: Token, path :: s(), body :: map()) :: t()

POST Request