Current section

Files

Jump to
scrapped_twitch_api lib resources moderation remove_channel_moderator.ex
Raw

lib/resources/moderation/remove_channel_moderator.ex

defmodule TwitchApi.Moderation.RemoveChannelModerator do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
Removes a moderator from the broadcaster’s chat room.
### requests:
curl -X DELETE 'https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=11111&user_id=44444'
-H'Authorization: Bearer kpvy3cjboyptmdkiacwr0c19hotn5s'
-H'Client-Id: hof5gwx0su6owfnys0nyan9c87zr6t'
## Example response from twitch api docs:
### descriptions:
### responses:
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
NEW Removes a moderator from the broadcaster’s chat room.
### Required authentication:
### Required authorization:
Requires a user access token that includes the channel:manage:moderators scope. The ID in the broadcaster_id query parameter must match the user ID in the access token.
"""
@typedoc """
The ID of the broadcaster that owns the chat room.
"""
@type broadcaster_id :: %{required(:broadcaster_id) => String.t()}
@typedoc """
The ID of the user to remove as a moderator from the broadcaster’s chat room.
"""
@type user_id :: %{required(:user_id) => String.t()}
@spec call(broadcaster_id | user_id) :: {:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{broadcaster_id: broadcaster_id}) do
MyFinch.request(
"DELETE",
"https://api.twitch.tv/helix/moderation/moderators?broadcaster_id=#{broadcaster_id}",
Headers.config_headers(),
nil
)
end
def call(%{user_id: user_id}) do
MyFinch.request(
"DELETE",
"https://api.twitch.tv/helix/moderation/moderators?user_id=#{user_id}",
Headers.config_headers(),
nil
)
end
end