View Source Nimrag.Api (Nimrag v0.1.0)
Module to interact with Garmin's API after authentication.
It handles common patterns of making the requests, pagination, list, etc.
By default first argument is always the client, second options to Req, and all requests are executed against "connectapi" subdomain unless specified otherwise.
OAuth2 token may get refreshed automatically if expired. This is why all responses
return {:ok, %Req.Response{}, client}
or {:error, %Req.Response{}}
.
Summary
Functions
@spec get(Nimrag.Client.t(), Keyword.t()) :: {:ok, Req.Response.t(), Nimrag.Client.t()} | {:error, Req.Response.t()}
@spec response_as_data( {:ok, Req.Response.t(), Nimrag.Client.t()}, data_module :: atom() ) :: {:ok, any(), Nimrag.Client.t()} | {:error, Req.Response.t()}
@spec response_as_data( {:error, any()}, data_module :: atom() ) :: {:error, any()}