Current section

Files

Jump to
scrapped_twitch_api lib resources bits get_extension_transactions.ex
Raw

lib/resources/bits/get_extension_transactions.ex

defmodule TwitchApi.Bits.GetExtensionTransactions do
@moduledoc """
⛔ This module is autogenerated please do not modify manually.
## Example request from twitch api docs:
### descriptions:
### requests:
curl -X GET
'https://api.twitch.tv/helix/extensions/transactions?extension_id=1234'
-H'Authorization: Bearer cfabdegwdoklmawdzdo98xt2fo512y'
-H'Client-Id: uo6dggojyb8d6soh92zknwmi5ej1q2'
## Example response from twitch api docs:
### descriptions:
### responses:
{"data":[{"id":"74c52265-e214-48a6-91b9-23b6014e8041","timestamp":"2019-01-28T04:15:53.325Z","broadcaster_id":"439964613","broadcaster_login":"chikuseuma","broadcaster_name":"chikuseuma","user_id":"424596340","user_login":"quotrok","user_name":"quotrok","product_type":"BITS_IN_EXTENSION","product_data":{"domain":"twitch.ext.uo6dggojyb8d6soh92zknwmi5ej1q2","sku":"testSku100","cost":{"amount":100,"type":"bits"},"inDevelopment":false"displayName":"Test Product 100","expiration":"","broadcast":false}},{"id":"8d303dc6-a460-4945-9f48-59c31d6735cb","timestamp":"2019-01-18T09:10:13.397Z","broadcaster_id":"439964613","broadcaster_login":"chikuseuma","broadcaster_name":"chikuseuma""user_id":"439966926","user_login":"liscuit","user_name":"liscuit","product_type":"BITS_IN_EXTENSION","product_data":{"domain":"twitch.ext.uo6dggojyb8d6soh92zknwmi5ej1q2","sku":"testSku200","cost":{"amount":200,"type":"bits"},"inDevelopment":false,"displayName":"Test Product 200","expiration":"","broadcast":false}},...],"pagination":{"cursor":"cursorString"}}
"""
alias TwitchApi.MyFinch
alias TwitchApi.ApiJson.Template.Method.Headers
@doc """
### Description:
Gets the list of Extension transactions for a given Extension. This allows Extension back-end servers to fetch a list of transactions that have occurred for their Extension across all of Twitch.
### Required authentication:
App Access Token
### Required authorization:
"""
@typedoc """
ID of the Extension to list transactions for.Maximum: 1
"""
@type extension_id :: %{required(:extension_id) => String.t()}
@typedoc """
Transaction IDs to look up. Can include multiple to fetch multiple transactions in a single request.For example, /helix/extensions/transactions?extension_id=1234&id=1&id=2&id=3Maximum: 100.
"""
@type id :: %{required(:id) => String.t()}
@typedoc """
The cursor used to fetch the next page of data. This only applies to queries without ID. If an ID is specified, it supersedes the cursor.
"""
@type after_query_param :: %{required(:after_query_param) => String.t()}
@typedoc """
Maximum number of objects to return.Maximum: 100. Default: 20.
"""
@type first :: %{required(:first) => integer}
@spec call(extension_id | id | after_query_param | first) ::
{:ok, Finch.Response.t()} | {:error, Exception.t()}
def call(%{extension_id: extension_id}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/extensions/transactions?extension_id=#{extension_id}",
Headers.config_headers(),
nil
)
end
def call(%{id: id}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/extensions/transactions?id=#{id}",
Headers.config_headers(),
nil
)
end
def call(%{after: after_query_param}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/extensions/transactions?after=#{after_query_param}",
Headers.config_headers(),
nil
)
end
def call(%{first: first}) do
MyFinch.request(
"GET",
"https://api.twitch.tv/helix/extensions/transactions?first=#{first}",
Headers.config_headers(),
nil
)
end
end