Current section

Files

Jump to
scrapped_twitch_api lib resources moderation get_blocked_terms.ex
Raw

lib/resources/moderation/get_blocked_terms.ex

defmodule TwitchApi.Moderation.GetBlockedTerms do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
This example gets the last 10 blocked terms (see the first query parameter) that were added.
This example gets the next page of blocked terms. By default, the response includes 20 terms per page. To change the number of items per page, include the first query parameter.
### requests:
curl -X GET 'https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&after=eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6I...'
-H'Authorization: Bearer f4otqljtpbpg24v41v9gechs4yvwy'
-H'Client-Id: t214nt8z1rdtbj69hyarjvh5mi6fh'
curl -X GET 'https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=1234&moderator_id=5678&first=10'
-H'Authorization: Bearer f4otqljtpbpg24v41v9gechs4yvwy'
-H'Client-Id: t214nt8z1rdtbj69hyarjvh5mi6fh'
## Example response from twitch api docs:
### descriptions:
### responses:
{"data":[{"broadcaster_id":"1234","moderator_id":"5678","id":"520e4d4e-0cda-49c7-821e-e5ef4f88c2f2","text":"A phrase I’m not fond of","created_at":"2021-09-29T19:45:37Z","updated_at":"2021-09-29T19:45:37Z","expires_at":null},...],"pagination":{"cursor":"eyJiIjpudWxsLCJhIjp7IkN1cnNvciI6I..."}}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Gets the broadcaster’s list of non-private, blocked words or phrases.
### Required authentication:
### Required authorization:
Requires a User access token with scope set to moderator:read:blocked_terms.
"""
@typedoc """
The cursor used to get the next page of results. The Pagination object in the response contains the cursor’s value.
"""
@type after_query_param :: %{required(:after_query_param) => String.t()}
@typedoc """
The ID of the broadcaster whose blocked terms you’re getting.
"""
@type broadcaster_id :: %{required(:broadcaster_id) => String.t()}
@typedoc """
The maximum number of blocked terms to return per page in the response. The minimum page size is 1 blocked term per page and the maximum is 100. The default is 20.
"""
@type first :: %{required(:first) => integer}
@typedoc """
The ID of 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.If the broadcaster wants to get their own block terms (instead of having the moderator do it), set this parameter to the broadcaster’s ID, too.
"""
@type moderator_id :: %{required(:moderator_id) => String.t()}
@spec call(after_query_param | broadcaster_id | first | moderator_id) ::
{:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{after: after_query_param}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/moderation/blocked_terms?after=#{after_query_param}",
Headers.config_headers(),
nil
)
end
def call(%{broadcaster_id: broadcaster_id}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/moderation/blocked_terms?broadcaster_id=#{broadcaster_id}",
Headers.config_headers(),
nil
)
end
def call(%{first: first}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/moderation/blocked_terms?first=#{first}",
Headers.config_headers(),
nil
)
end
def call(%{moderator_id: moderator_id}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/moderation/blocked_terms?moderator_id=#{moderator_id}",
Headers.config_headers(),
nil
)
end
end