gmail v0.0.6 Gmail.OAuth2.Client

Summary

Functions

Checks if an access token has expired

Gets the config for a Gmail API connection, including a refreshed access token

Refreshes an expired access token

Functions

access_token_expired?(opts)

Specs

access_token_expired?(Gmail.OAuth2.Opts.t) :: boolean

Checks if an access token has expired

Examples

iex> Gmail.OAuth2.Client.access_token_expired?(%Gmail.OAuth2.Opts{expires_at: 1})
true

iex> Gmail.OAuth2.Client.access_token_expired?(%Gmail.OAuth2.Opts{expires_at: (Timex.Date.to_secs(Timex.Date.now) + 10)})
false
get_config()

Specs

get_config :: Gmail.OAuth2.Opts.t

Gets the config for a Gmail API connection, including a refreshed access token

refresh_access_token(opts)

Specs

refresh_access_token(Gmail.OAuth2.Opts.t) :: {:ok, Gmail.OAuth2.Opts.t}

Refreshes an expired access token