Current section

Files

Jump to
scrapped_twitch_api lib resources moderation remove_blocked_term.ex
Raw

lib/resources/moderation/remove_blocked_term.ex

defmodule TwitchApi.Moderation.RemoveBlockedTerm do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
This example deletes a blocked term.
### requests:
curl -X DELETE 'https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&id=c9fc79b8-0f63-4ef7-9d38-efd811e74ac2'\ -H'Authorization: Bearer f4otqljtpbpg24v41v9gechs4yvwy'
-H'Client-Id: t214nt8z1rdtbj69hyarjvh5mi6fh'
## Example response from twitch api docs:
### descriptions:
### responses:
204NoContent
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Removes the word or phrase that the broadcaster is blocking users from using in their chat room.
### Required authentication:
Requires a User access token with scope set to
moderator:manage:blocked_terms
.
### Required authorization:
"""
@typedoc """
The ID of the broadcaster that owns the list of blocked terms.
"""
@type broadcaster_id :: %{required(:broadcaster_id) => String.t()}
@typedoc """
The ID of the blocked term you want to delete.
"""
@type id :: %{required(:id) => String.t()}
@typedoc """
The ID of the broadcaster or a user that has permission to moderate the broadcaster’s chat room. This ID must match the user ID associated with the user OAuth token.
"""
@type moderator_id :: %{required(:moderator_id) => String.t()}
@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}
@spec call(broadcaster_id | id | moderator_id, user_info) ::
{:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{broadcaster_id: broadcaster_id}, user_info) do
MyFinch.request(
"DELETE",
"https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=#{broadcaster_id}",
Headers.config_oauth_headers(user_info),
nil
)
end
def call(%{id: id}, user_info) do
MyFinch.request(
"DELETE",
"https://api.twitch.tv/helix/moderation/blocked_terms?id=#{id}",
Headers.config_oauth_headers(user_info),
nil
)
end
def call(%{moderator_id: moderator_id}, user_info) do
MyFinch.request(
"DELETE",
"https://api.twitch.tv/helix/moderation/blocked_terms?moderator_id=#{moderator_id}",
Headers.config_oauth_headers(user_info),
nil
)
end
end