Current section

Files

Jump to
scrapped_twitch_api lib resources users get_user_active_extensions.ex
Raw

lib/resources/users/get_user_active_extensions.ex

defmodule TwitchApi.Users.GetUserActiveExtensions do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
This updates the description of the user specified by Bearer token cfabdegwdoklmawdzdo98xt2fo512y.
### requests:
curl -X GET 'https://api.twitch.tv/helix/users/extensions'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'
## Example response from twitch api docs:
### descriptions:
### responses:
{"data":{"panel":{"1":{"active":true,"id":"rh6jq1q334hqc2rr1qlzqbvwlfl3x0","version":"1.1.0","name":"TopClip"},"2":{"active":true,"id":"wi08ebtatdc7oj83wtl9uxwz807l8b","version":"1.1.8","name":"Streamlabs Leaderboard"},"3":{"active":true,"id":"naty2zwfp7vecaivuve8ef1hohh6bo","version":"1.0.9","name":"Streamlabs Stream Schedule & Countdown"}},"overlay":{"1":{"active":true,"id":"zfh2irvx2jb4s60f02jq0ajm8vwgka","version":"1.0.19","name":"Streamlabs"}},"component":{"1":{"active":true,"id":"lqnf3zxk0rv0g7gq92mtmnirjz2cjj","version":"0.0.1","name":"Dev Experience Test","x":0,"y":0},"2":{"active":false}}}}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Gets information about active extensions installed by a specified user, identified by a user ID or Bearer token.
### Required authentication:
OAuth token required
Optional scope: user:read:broadcast or user:edit:broadcast
### Required authorization:
"""
# ID of the user whose installed extensions will be returned. Limit: 1.
@type user_id :: %{required(:user_id) => String.t()}
# Map containing the user needed information for the user OAuth access token fetch
@type user_info :: %{user_id: integer | binary} | %{user_name: binary}
@spec call(user_id, user_info) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{user_id: user_id}, user_info) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/users/extensions?user_id=#{user_id}",
Headers.config_oauth_headers(user_info),
nil
)
end
end