spotless/oauth_2_1/token
Types
pub type Fail {
InvalidRequest
InvalidClient
InvalidGrant
UnauthorizedClient
UnsupportedGrantType
InvalidScope
}
Constructors
-
InvalidRequest
-
InvalidClient
-
InvalidGrant
-
UnauthorizedClient
-
UnsupportedGrantType
-
InvalidScope
pub type GrantType {
AuthorizationCode
RefreshToken
}
Constructors
-
AuthorizationCode
-
RefreshToken
pub type Request {
Request(
grant_type: GrantType,
client_id: String,
code: String,
code_verifier: String,
)
}
Constructors
-
Request( grant_type: GrantType, client_id: String, code: String, code_verifier: String, )
pub type Response {
Response(
access_token: String,
token_type: String,
expires_in: Option(Int),
scope: List(String),
refresh_token: Option(String),
)
}
Constructors
-
Response( access_token: String, token_type: String, expires_in: Option(Int), scope: List(String), refresh_token: Option(String), )
Values
pub fn error_code_from_string(
string: String,
) -> Result(Fail, String)
pub fn error_code_to_string(code: Fail) -> String
pub fn params_to_http(
endpoint: #(Origin, String),
query: List(#(String, String)),
) -> Request(BitArray)
pub fn request_from_http(
request: Request(BitArray),
) -> Result(spotless/oauth_2_1/token.Request, #(Fail, String))
pub fn request_from_params(
params: List(#(String, String)),
) -> Result(Request, #(Fail, String))
pub fn request_to_http(
endpoint: #(Origin, String),
request: Request,
) -> gleam/http/request.Request(BitArray)
pub fn response_from_http(
response: Response(BitArray),
) -> Result(spotless/oauth_2_1/token.Response, DecodeError)
pub fn response_to_body(response: Response) -> String