glitch/api/api_response

Types

pub type EventSubData(data) {
  EventSubData(
    data: data,
    total: Int,
    total_cost: Int,
    max_total_cost: Int,
  )
}

Constructors

  • EventSubData(
      data: data,
      total: Int,
      total_cost: Int,
      max_total_cost: Int,
    )
pub opaque type TwitchApiResponse(data)

Functions

pub fn get_body(api_response: TwitchApiResponse(a)) -> a
pub fn get_data(
  api_response: TwitchApiResponse(String),
  data_decoder: fn(Dynamic) -> Result(a, List(DecodeError)),
) -> Result(a, TwitchError)
pub fn get_eventsub_data(
  api_response: TwitchApiResponse(String),
  data_decoder: fn(Dynamic) -> Result(a, List(DecodeError)),
) -> Result(EventSubData(List(a)), TwitchError)
pub fn get_headers(
  api_response: TwitchApiResponse(a),
) -> List(#(String, String))
pub fn get_list_data(
  api_response: TwitchApiResponse(String),
  data_decoder: fn(Dynamic) -> Result(a, List(DecodeError)),
) -> Result(List(a), TwitchError)
pub fn of_http_response(
  response: Response(String),
) -> TwitchApiResponse(String)
Search Document