Current section

Files

Jump to
scrapped_twitch_api lib resources streams create_stream_marker.ex
Raw

lib/resources/streams/create_stream_marker.ex

defmodule TwitchApi.Streams.CreateStreamMarker do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
This creates a marker at the current location in user 123’s stream.
### requests:
curl -X POST 'https://api.twitch.tv/helix/streams/markers'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'
-H'Content-Type: application/json'
-d'{"user_id":"123", "description":"hello, this is a marker!"}'
## Example response from twitch api docs:
### descriptions:
### responses:
{"data":[{"id":123,"created_at":"2018-08-20T20:10:03Z","description":"hello, this is a marker!","position_seconds":244}]}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Creates a marker in the stream of a user specified by user ID. A marker is an arbitrary point in a stream that the broadcaster wants to mark.
### Required authentication:
OAuth token required
Required scope: channel:manage:broadcast
### Required authorization:
"""
@typedoc """
Map containing the user needed information for the fetch of the required user OAuth access token.
You will be able to choose from one way or the other for fetching previously OAuth access tokens.
:user_id field contains the user ID from twitch, e.g. 61425548 or "61425548"
:user_name field constains the user name from twitch, e.g. "hiimkamiyuzu"
"""
@type user_info :: %{user_id: integer | binary} | %{user_name: binary}
# ID of the broadcaster in whose live stream the marker is created.
@spec call(%{required(:user_id) => String.t()} | nil, user_info) ::
{:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(body_params, user_info) do
MyFinch.request(
"POST",
"https://api.twitch.tv/helix/streams/markers",
Headers.config_oauth_headers(user_info),
body_params
)
end
end