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
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 section Functions
Builds a struct with OAuth access tokens
Client struct fields
access_token
- The access token to use with the Youtube APIrefresh_token
- The refresh token to update the access token on subsequent requestsexpires_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"}