Exyt v0.2.0 Exyt.AccessToken View Source

A struct to represent an OAuth2 access token.

Link to this section Summary

Functions

Builds a struct with OAuth access tokens

Link to this section Types

Link to this type access_token() View Source
access_token() :: binary()
Link to this type expires_in() View Source
expires_in() :: integer()
Link to this type refresh_token() View Source
refresh_token() :: binary()
Link to this type t() View Source
t() :: %Exyt.AccessToken{access_token: access_token(), expires_in: expires_in(), refresh_token: refresh_token(), token_type: token_type()}
Link to this type token_type() View Source
token_type() :: binary()

Link to this section Functions

Builds a struct with OAuth access tokens

Client struct fields

  • access_token - The access token to use with the Youtube API
  • refresh_token - The refresh token to update the access token on subsequent requests
  • expires_in - The lifetime of the access token in seconds

Examples:

iex> Exyt.AccessToken.new("1234")
%Exyt.AccessToken{access_token: "1234"}

iex> Exyt.AccessToken.new(%Exyt.AccessToken{}, %{access_token: "1234"})
%Exyt.AccessToken{access_token: "1234"}

iex> Exyt.AccessToken.new(%{access_token: "1234", refresh_token: "abcd"})
%Exyt.AccessToken{access_token: "1234", refresh_token: "abcd"}
Link to this function new(token \\ %Exyt.AccessToken{}, opts) View Source
new(t(), map()) :: t()