go-twitch/eventsub/events/channelpoints.go

314 lines
10 KiB
Go
Raw Permalink Normal View History

2024-03-05 12:14:18 -05:00
package events
import "time"
type MaxPerStream struct {
// Is the setting enabled.
IsEnabled bool `json:"is_enabled"`
// The max per stream limit.
Value int `json:"value"`
}
type MaxPerUserPerStream struct {
// Is the setting enabled.
IsEnabled bool `json:"is_enabled"`
// The max per user per stream limit.
Value int `json:"value"`
}
type Image struct {
// URL for the image at 1x size.
URL1x string `json:"url_1x"`
// URL for the image at 2x size.
URL2x string `json:"url_2x"`
// URL for the image at 4x size.
URL4x string `json:"url_4x"`
}
type GlobalCooldown struct {
// Is the setting enabled.
IsEnabled bool `json:"is_enabled"`
// The cooldown in seconds.
Seconds int `json:"seconds"`
}
type ChannelPointsCustomRewardAddEvent struct {
// The reward identifier.
ID string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserID string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// Is the reward currently enabled. If false, the reward wont show up to viewers.
IsEnabled bool `json:"is_enabled"`
// Is the reward currently paused. If true, viewers cant redeem.
IsPaused bool `json:"is_paused"`
// Is the reward currently in stock. If false, viewers cant redeem.
IsInStock bool `json:"is_in_stock"`
// The reward title.
Title string `json:"title"`
// The reward cost.
Cost int `json:"cost"`
// The reward description.
Prompt string `json:"prompt"`
// Does the viewer need to enter information when redeeming the reward.
IsUserInputRequired bool `json:"is_user_input_required"`
// Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.
ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
// Whether a maximum per stream is enabled and what the maximum is.
MaxPerStream MaxPerStream `json:"max_per_stream"`
// Whether a maximum per user per stream is enabled and what the maximum is.
MaxPerUserPerStream MaxPerUserPerStream `json:"max_per_user_per_stream"`
// Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2.
BackgroundColor string `json:"background_color"`
// Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded.
Image *Image `json:"image"`
// Set of default images of 1x, 2x and 4x sizes for the reward.
DefaultImage Image `json:"default_image"`
// Whether a cooldown is enabled and what the cooldown is in seconds.
GlobalCooldown GlobalCooldown `json:"global_cooldown"`
// Timestamp of the cooldown expiration. null if the reward isnt on cooldown.
CooldownExpiresAt *time.Time `json:"cooldown_expires_at"`
// The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit.
// null if the broadcasters stream isnt live or max_per_stream isnt enabled.
RedemptionsRedeemedCurrentStream *int `json:"redemptions_redeemed_current_stream"`
}
type ChannelPointsCustomRewardUpdateEvent struct {
// The reward identifier.
Id string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// Is the reward currently enabled. If false, the reward wont show up to viewers.
IsEnabled bool `json:"is_enabled"`
// Is the reward currently paused. If true, viewers cant redeem.
IsPaused bool `json:"is_paused"`
// Is the reward currently in stock. If false, viewers cant redeem.
IsInStock bool `json:"is_in_stock"`
// The reward title.
Title string `json:"title"`
// The reward cost.
Cost int `json:"cost"`
// The reward description.
Prompt string `json:"prompt"`
// Does the viewer need to enter information when redeeming the reward.
IsUserInputRequired bool `json:"is_user_input_required"`
// Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.
ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
// Whether a maximum per stream is enabled and what the maximum is.
MaxPerStream MaxPerStream `json:"max_per_stream"`
// Whether a maximum per user per stream is enabled and what the maximum is.
MaxPerUserPerStream MaxPerUserPerStream `json:"max_per_user_per_stream"`
// Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2.
BackgroundColor string `json:"background_color"`
// Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded.
Image *Image `json:"image"`
// Set of default images of 1x, 2x and 4x sizes for the reward.
DefaultImage Image `json:"default_image"`
// Whether a cooldown is enabled and what the cooldown is in seconds.
GlobalCooldown GlobalCooldown `json:"global_cooldown"`
// Timestamp of the cooldown expiration. null if the reward isnt on cooldown.
CooldownExpiresAt *time.Time `json:"cooldown_expires_at"`
// The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit.
// null if the broadcasters stream isnt live or max_per_stream isnt enabled.
RedemptionsRedeemedCurrentStream *int `json:"redemptions_redeemed_current_stream"`
}
type ChannelPointsCustomRewardRemoveEvent struct {
// The reward identifier.
Id string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// Is the reward currently enabled. If false, the reward wont show up to viewers.
IsEnabled bool `json:"is_enabled"`
// Is the reward currently paused. If true, viewers cant redeem.
IsPaused bool `json:"is_paused"`
// Is the reward currently in stock. If false, viewers cant redeem.
IsInStock bool `json:"is_in_stock"`
// The reward title.
Title string `json:"title"`
// The reward cost.
Cost int `json:"cost"`
// The reward description.
Prompt string `json:"prompt"`
// Does the viewer need to enter information when redeeming the reward.
IsUserInputRequired bool `json:"is_user_input_required"`
// Should redemptions be set to fulfilled status immediately when redeemed and skip the request queue instead of the normal unfulfilled status.
ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
// Whether a maximum per stream is enabled and what the maximum is.
MaxPerStream MaxPerStream `json:"max_per_stream"`
// Whether a maximum per user per stream is enabled and what the maximum is.
MaxPerUserPerStream MaxPerStream `json:"max_per_user_per_stream"`
// Custom background color for the reward. Format: Hex with # prefix. Example: #FA1ED2.
BackgroundColor string `json:"background_color"`
// Set of custom images of 1x, 2x and 4x sizes for the reward. Can be null if no images have been uploaded.
Image *Image `json:"image"`
// Set of default images of 1x, 2x and 4x sizes for the reward.
DefaultImage Image `json:"default_image"`
// Whether a cooldown is enabled and what the cooldown is in seconds.
GlobalCooldown GlobalCooldown `json:"global_cooldown"`
// Timestamp of the cooldown expiration. null if the reward isnt on cooldown.
CooldownExpiresAt *time.Time `json:"cooldown_expires_at"`
// The number of redemptions redeemed during the current live stream. Counts against the max_per_stream limit.
// null if the broadcasters stream isnt live or max_per_stream isnt enabled.
RedemptionsRedeemedCurrentStream *int `json:"redemptions_redeemed_current_stream"`
}
type Reward struct {
// The reward identifier.
Id string `json:"id"`
// The reward title.
Title string `json:"title"`
// The reward cost.
Cost int `json:"cost"`
// The reward prompt.
Prompt string `json:"prompt"`
}
type ChannelPointsCustomRewardRedemptionAddEvent struct {
// The redemption identifier.
Id string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// User ID of the user that redeemed the reward.
UserId string `json:"user_id"`
// Login of the user that redeemed the reward.
UserLogin string `json:"user_login"`
// Display name of the user that redeemed the reward.
UserName string `json:"user_name"`
// The user input provided. Empty string if not provided.
UserInput string `json:"user_input"`
// Defaults to unfulfilled. Possible values are unknown, unfulfilled, fulfilled, and canceled.
Status string `json:"status"`
// Basic information about the reward that was redeemed, at the time it was redeemed.
Reward Reward `json:"reward"`
// RFC3339 timestamp of when the reward was redeemed.
RedeemedAt time.Time `json:"redeemed_at"`
}
type ChannelPointsCustomRewardRedemptionUpdateEvent struct {
// The redemption identifier.
Id string `json:"id"`
// The requested broadcaster ID.
BroadcasterUserId string `json:"broadcaster_user_id"`
// The requested broadcaster login.
BroadcasterUserLogin string `json:"broadcaster_user_login"`
// The requested broadcaster display name.
BroadcasterUserName string `json:"broadcaster_user_name"`
// User ID of the user that redeemed the reward.
UserId string `json:"user_id"`
// Login of the user that redeemed the reward.
UserLogin string `json:"user_login"`
// Display name of the user that redeemed the reward.
UserName string `json:"user_name"`
// The user input provided. Empty string if not provided.
UserInput string `json:"user_input"`
// Defaults to unfulfilled. Possible values are unknown, unfulfilled, fulfilled, and canceled.
Status string `json:"status"`
// Basic information about the reward that was redeemed, at the time it was redeemed.
Reward Reward `json:"reward"`
// RFC3339 timestamp of when the reward was redeemed.
RedeemedAt time.Time `json:"redeemed_at"`
}