Documentation
¶
Index ¶
- Constants
- func CodeOf(err error) int
- type APIError
- type AdSchedule
- type AdSnooze
- type AdsInsertRequest
- type AdsInsertResponse
- type AdsResource
- type AdsScheduleListRequest
- type AdsScheduleListResponse
- type AdsScheduleResource
- type AdsSnoozeRequest
- type AdsSnoozeResource
- type AdsSnoozeResponse
- type AnalyticsDateRange
- type AnalyticsExtensionListCall
- func (r *AnalyticsExtensionListCall) After(cursor string) *AnalyticsExtensionListCall
- func (r *AnalyticsExtensionListCall) Do(ctx context.Context, opts ...RequestOption) (*AnalyticsExtensionListResponse, error)
- func (r *AnalyticsExtensionListCall) EndedAt(t time.Time) *AnalyticsExtensionListCall
- func (r *AnalyticsExtensionListCall) ExtensionID(id string) *AnalyticsExtensionListCall
- func (r *AnalyticsExtensionListCall) First(n int) *AnalyticsExtensionListCall
- func (r *AnalyticsExtensionListCall) StartedAt(t time.Time) *AnalyticsExtensionListCall
- func (r *AnalyticsExtensionListCall) Type(t string) *AnalyticsExtensionListCall
- type AnalyticsExtensionListResponse
- type AnalyticsExtensionResource
- type AnalyticsGameListCall
- func (r *AnalyticsGameListCall) After(a string) *AnalyticsGameListCall
- func (r *AnalyticsGameListCall) Do(ctx context.Context, opts ...RequestOption) (*AnalyticsGameListResponse, error)
- func (r *AnalyticsGameListCall) EndedAt(t time.Time) *AnalyticsGameListCall
- func (r *AnalyticsGameListCall) First(f int) *AnalyticsGameListCall
- func (r *AnalyticsGameListCall) GameID(id string) *AnalyticsGameListCall
- func (r *AnalyticsGameListCall) StartedAt(t time.Time) *AnalyticsGameListCall
- type AnalyticsGameListResponse
- type AnalyticsGameResource
- type AnalyticsResource
- type BitsExtensionTransactionsResource
- type BitsLeaderboardEntry
- type BitsLeaderboardListCall
- func (c *BitsLeaderboardListCall) Count(n int) *BitsLeaderboardListCall
- func (c *BitsLeaderboardListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsLeaderboardListResponse, error)
- func (c *BitsLeaderboardListCall) Period(period string) *BitsLeaderboardListCall
- func (c *BitsLeaderboardListCall) StartedAt(t time.Time) *BitsLeaderboardListCall
- func (c *BitsLeaderboardListCall) UserID(userId string) *BitsLeaderboardListCall
- type BitsLeaderboardListResponse
- type BitsLeaderboardResource
- type BitsResource
- type BitsTransactionsListCall
- func (c *BitsTransactionsListCall) After(cursor string) *BitsTransactionsListCall
- func (c *BitsTransactionsListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsTransactionsListResponse, error)
- func (c *BitsTransactionsListCall) First(n int) *BitsTransactionsListCall
- func (c *BitsTransactionsListCall) TransactionID(ids ...string) *BitsTransactionsListCall
- type BitsTransactionsListResponse
- type Channel
- type ChannelPointsResource
- type ChannelsListCall
- type ChannelsListResponse
- type ChannelsResource
- type CharityResource
- type ChatResource
- type Chatter
- type ChatterBan
- type ChattersListCall
- type ChattersResource
- type ChattersResponse
- type Cheermote
- type CheermoteTier
- type CheermotesListCall
- type CheermotesListResponse
- type CheermotesResource
- type ClearChatRequest
- type Client
- type ClientOption
- type Clip
- type ClipDuration
- type ClipsListCall
- func (c *ClipsListCall) After(cursor string) *ClipsListCall
- func (c *ClipsListCall) Before(cursor string) *ClipsListCall
- func (c *ClipsListCall) BroadcasterID(id string) *ClipsListCall
- func (c *ClipsListCall) Do(ctx context.Context, opts ...RequestOption) (*ClipsListResponse, error)
- func (c *ClipsListCall) EndedAt(t time.Time) *ClipsListCall
- func (c *ClipsListCall) Featured() *ClipsListCall
- func (c *ClipsListCall) First(n int) *ClipsListCall
- func (c *ClipsListCall) GameID(id string) *ClipsListCall
- func (c *ClipsListCall) ID(ids []string) *ClipsListCall
- func (c *ClipsListCall) StartedAt(t time.Time) *ClipsListCall
- type ClipsListResponse
- type ClipsResource
- type Commercial
- type Conduit
- type ConduitDeleteCall
- type ConduitInsertCall
- type ConduitShard
- type ConduitShardListCall
- type ConduitShardUpdateCall
- type ConduitShardsResource
- type ConduitShardsResponse
- type ConduitUpdateCall
- type ConduitsListCall
- type ConduitsResource
- type ConduitsResponse
- type CreateBanRequest
- func (c *CreateBanRequest) Do(ctx context.Context, opts ...RequestOption) ([]ChatterBan, error)
- func (c *CreateBanRequest) Duration(duration time.Duration) *CreateBanRequest
- func (c *CreateBanRequest) Reason(reason string) *CreateBanRequest
- func (c *CreateBanRequest) TargetID(userId string) *CreateBanRequest
- type CustomReward
- type CustomRewardRedemption
- type CustomRewardsDeleteCall
- type CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) BackgroundColor(hexCode string) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) Cost(cost int64) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsInsertResponse, error)
- func (c *CustomRewardsInsertCall) GlobalCooldown(d time.Duration) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) IsEnabled(enabled bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) IsGlobalCooldownEnabled(enabled bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) IsMaxPerStreamEnabled(enabled bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) IsMaxPerUserPerStreamEnabled(enabled bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) IsPaused(paused bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) IsUserInputRequired(required bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) MaxPerStream(max int64) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) MaxPerUserPerStream(max int64) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) Prompt(prompt string) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) ShouldRedemptionsSkipRequestQueue(b bool) *CustomRewardsInsertCall
- func (c *CustomRewardsInsertCall) Title(title string) *CustomRewardsInsertCall
- type CustomRewardsInsertResponse
- type CustomRewardsListCall
- type CustomRewardsListResponse
- type CustomRewardsRedemptionListCall
- func (c *CustomRewardsRedemptionListCall) After(cursor string) *CustomRewardsRedemptionListCall
- func (c *CustomRewardsRedemptionListCall) Before(cursor string) *CustomRewardsRedemptionListCall
- func (c *CustomRewardsRedemptionListCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsRedemptionListResponse, error)
- func (c *CustomRewardsRedemptionListCall) ID(ids []string) *CustomRewardsRedemptionListCall
- func (c *CustomRewardsRedemptionListCall) Sort(sort string) *CustomRewardsRedemptionListCall
- func (c *CustomRewardsRedemptionListCall) Status(status string) *CustomRewardsRedemptionListCall
- type CustomRewardsRedemptionListResponse
- type CustomRewardsRedemptionResource
- type CustomRewardsRedemptionUpdateCall
- func (c *CustomRewardsRedemptionUpdateCall) Cancel() *CustomRewardsRedemptionUpdateCall
- func (c *CustomRewardsRedemptionUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsRedemptionUpdateResponse, error)
- func (c *CustomRewardsRedemptionUpdateCall) Fulfill() *CustomRewardsRedemptionUpdateCall
- type CustomRewardsRedemptionUpdateResponse
- type CustomRewardsResource
- func (r *CustomRewardsResource) Delete(broadcasterId, id string) *CustomRewardsDeleteCall
- func (r *CustomRewardsResource) Insert(broadcasterId string) *CustomRewardsInsertCall
- func (r *CustomRewardsResource) List(broadcasterId string) *CustomRewardsListCall
- func (r *CustomRewardsResource) Update(broadcasterId, id string) *CustomRewardsUpdateCall
- type CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) BackgroundColor(hexCode string) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) Cost(cost int64) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsUpdateResponse, error)
- func (c *CustomRewardsUpdateCall) GlobalCooldown(d time.Duration) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) IsEnabled(enabled bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) IsGlobalCooldownEnabled(enabled bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) IsMaxPerStreamEnabled(enabled bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) IsMaxPerUserPerStreamEnabled(enabled bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) IsPaused(paused bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) IsUserInputRequired(required bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) MaxPerStream(max int64) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) MaxPerUserPerStream(max int64) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) Prompt(prompt string) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) ShouldRedemptionsSkipRequestQueue(b bool) *CustomRewardsUpdateCall
- func (c *CustomRewardsUpdateCall) Title(title string) *CustomRewardsUpdateCall
- type CustomRewardsUpdateResponse
- type EntitlementsResource
- type EventSubResource
- type ExtensionAnalytics
- type ExtensionProduct
- type ExtensionProductCost
- type ExtensionTransaction
- type ExtensionsResource
- type Followed
- type FollowedListCall
- func (c *FollowedListCall) After(n int) *FollowedListCall
- func (c *FollowedListCall) BroadcasterID(id string) *FollowedListCall
- func (c *FollowedListCall) Do(ctx context.Context, opts ...RequestOption) (*FollowedListResponse, error)
- func (c *FollowedListCall) First(n int) *FollowedListCall
- func (c *FollowedListCall) UserID(id string) *FollowedListCall
- type FollowedListResponse
- type FollowedResource
- type Follower
- type FollowersListCall
- func (c *FollowersListCall) After(n int) *FollowersListCall
- func (c *FollowersListCall) BroadcasterID(id string) *FollowersListCall
- func (c *FollowersListCall) Do(ctx context.Context, opts ...RequestOption) (*FollowersListResponse, error)
- func (c *FollowersListCall) First(n int) *FollowersListCall
- func (c *FollowersListCall) UserID(id string) *FollowersListCall
- type FollowersListResponse
- type FollowersResource
- type Game
- type GameAnalytics
- type GamesResource
- type GoalsResource
- type GuestStarResource
- type HTTPClient
- type HypeTrainResource
- type ModerationResource
- type Pagination
- type PollsResource
- type PredictionsResource
- type RaidsResource
- type RemoveBanRequest
- type RequestOption
- type ResponseData
- type ScheduleResource
- type SearchResource
- type Stream
- type StreamsListCall
- func (c *StreamsListCall) After(cursor string) *StreamsListCall
- func (c *StreamsListCall) Before(cursor string) *StreamsListCall
- func (c *StreamsListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamsListResponse, error)
- func (c *StreamsListCall) First(n int) *StreamsListCall
- func (c *StreamsListCall) GameID(ids []string) *StreamsListCall
- func (c *StreamsListCall) Languages(languages []string) *StreamsListCall
- func (c *StreamsListCall) Type(t string) *StreamsListCall
- func (c *StreamsListCall) UserID(ids []string) *StreamsListCall
- func (c *StreamsListCall) Username(usernames []string) *StreamsListCall
- type StreamsListResponse
- type StreamsResource
- type SubscriptionsResource
- type TagsResource
- type TeamsResource
- type TopGamesListCall
- type TopGamesListResponse
- type TopGamesResource
- type Transport
- type User
- type UsersListCall
- type UsersListResponse
- type UsersResource
- type Video
- type VideoDuration
- type VideosDeleteCall
- type VideosDeleteResponse
- type VideosListCall
- func (c *VideosListCall) After(cursor string) *VideosListCall
- func (c *VideosListCall) Before(cursor string) *VideosListCall
- func (c *VideosListCall) Do(ctx context.Context, opts ...RequestOption) (*VideosListResponse, error)
- func (c *VideosListCall) First(n int) *VideosListCall
- func (c *VideosListCall) GameID(id string) *VideosListCall
- func (c *VideosListCall) ID(ids []string) *VideosListCall
- func (c *VideosListCall) Language(language string) *VideosListCall
- func (c *VideosListCall) Period(p string) *VideosListCall
- func (c *VideosListCall) Sort(s string) *VideosListCall
- func (c *VideosListCall) Type(t string) *VideosListCall
- func (c *VideosListCall) UserID(id string) *VideosListCall
- type VideosListResponse
- type VideosResource
- type WhispersInsertCall
- type WhispersResource
Constants ¶
const BaseURL = "https://api.twitch.tv/helix"
BaseURL is the base URL for the Twitch API.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type AdSchedule ¶
type AdsInsertRequest ¶
type AdsInsertRequest struct {
// contains filtered or unexported fields
}
func (*AdsInsertRequest) Do ¶
func (c *AdsInsertRequest) Do(ctx context.Context, opts ...RequestOption) (*AdsInsertResponse, error)
Do executes the request.
req := client.Ads.Insert("41245072").Duration(60) data, err := req.Do(ctx, api.WithBearerToken("2gbdx6oar67tqtcmt49t3wpcgycthx")
func (*AdsInsertRequest) Duration ¶
func (c *AdsInsertRequest) Duration(seconds int) *AdsInsertRequest
Duration sets the duration of the commercial in seconds.
Twitch tries to serve a commercial that’s the requested length, but it may be shorter or longer. The maximum length you should request is 180 seconds.
type AdsInsertResponse ¶
type AdsInsertResponse struct { Header http.Header Data []Commercial }
type AdsResource ¶
type AdsResource struct { Schedule *AdsScheduleResource Snooze *AdsSnoozeResource // contains filtered or unexported fields }
func NewAdsResource ¶
func NewAdsResource(client *Client) *AdsResource
func (*AdsResource) Insert ¶
func (r *AdsResource) Insert(broadcasterId string) *AdsInsertRequest
Insert creates a request to start a commercial for the specified broadcaster.
Required Scope: channel:edit:commercial
type AdsScheduleListRequest ¶
type AdsScheduleListRequest struct {
// contains filtered or unexported fields
}
func (*AdsScheduleListRequest) Do ¶
func (r *AdsScheduleListRequest) Do(ctx context.Context, opts ...RequestOption) (*AdsScheduleListResponse, error)
Do executes the request.
type AdsScheduleListResponse ¶
type AdsScheduleListResponse struct { Header http.Header Data []AdSchedule }
type AdsScheduleResource ¶
type AdsScheduleResource struct {
// contains filtered or unexported fields
}
func NewAdsScheduleResource ¶
func NewAdsScheduleResource(client *Client) *AdsScheduleResource
func (*AdsScheduleResource) List ¶
func (r *AdsScheduleResource) List(broadcasterId string) *AdsScheduleListRequest
List returns ad schedule related information, including snooze, when the last ad was run, when the next ad is scheduled, and if the channel is currently in pre-roll free time.
NOTE: A new advertisement can NOT be run until 8 minutes running the previous.
Required Scope: channel:read:ads
type AdsSnoozeRequest ¶
type AdsSnoozeRequest struct {
// contains filtered or unexported fields
}
func (*AdsSnoozeRequest) Do ¶
func (r *AdsSnoozeRequest) Do(ctx context.Context, opts ...RequestOption) (*AdsSnoozeResponse, error)
Do executes the request.
type AdsSnoozeResource ¶
type AdsSnoozeResource struct {
// contains filtered or unexported fields
}
func NewAdsSnoozeResource ¶
func NewAdsSnoozeResource(client *Client) *AdsSnoozeResource
func (*AdsSnoozeResource) Insert ¶
func (r *AdsSnoozeResource) Insert(broadcasterId string) *AdsSnoozeRequest
Insert if available, pushes back the timestamp of the upcoming automatic advertisement mid-roll by 5 minutes. This endpoint duplicates the snooze functionality in the creator dashboard's Ad Manager.
Required Scope: channel:manage:ads
type AdsSnoozeResponse ¶
type AnalyticsDateRange ¶
type AnalyticsExtensionListCall ¶
type AnalyticsExtensionListCall struct {
// contains filtered or unexported fields
}
func (*AnalyticsExtensionListCall) After ¶
func (r *AnalyticsExtensionListCall) After(cursor string) *AnalyticsExtensionListCall
After A cursor for forward pagination: the first set of results to return. Provide this value in the after query parameter.
func (*AnalyticsExtensionListCall) Do ¶
func (r *AnalyticsExtensionListCall) Do(ctx context.Context, opts ...RequestOption) (*AnalyticsExtensionListResponse, error)
Do executes the request.
func (*AnalyticsExtensionListCall) EndedAt ¶
func (r *AnalyticsExtensionListCall) EndedAt(t time.Time) *AnalyticsExtensionListCall
EndedAt The end of the date range for the report.
func (*AnalyticsExtensionListCall) ExtensionID ¶
func (r *AnalyticsExtensionListCall) ExtensionID(id string) *AnalyticsExtensionListCall
ExtensionID If specified, the response contains a report for the specified extension. If not specified, the response includes a report for each extension that the authenticated user owns.
func (*AnalyticsExtensionListCall) First ¶
func (r *AnalyticsExtensionListCall) First(n int) *AnalyticsExtensionListCall
First The number of records to return. Maximum: 100. Default: 20.
func (*AnalyticsExtensionListCall) StartedAt ¶
func (r *AnalyticsExtensionListCall) StartedAt(t time.Time) *AnalyticsExtensionListCall
StartedAt The start of the date range for the report.
func (*AnalyticsExtensionListCall) Type ¶
func (r *AnalyticsExtensionListCall) Type(t string) *AnalyticsExtensionListCall
Type The type of analytics report to get. Possible values are:
- overview_v2
type AnalyticsExtensionListResponse ¶
type AnalyticsExtensionListResponse struct { Header http.Header Data []ExtensionAnalytics Pagination Pagination }
type AnalyticsExtensionResource ¶
type AnalyticsExtensionResource struct {
// contains filtered or unexported fields
}
func NewAnalyticsExtensionResource ¶
func NewAnalyticsExtensionResource(client *Client) *AnalyticsExtensionResource
func (*AnalyticsExtensionResource) List ¶
func (r *AnalyticsExtensionResource) List() *AnalyticsExtensionListCall
type AnalyticsGameListCall ¶
type AnalyticsGameListCall struct {
// contains filtered or unexported fields
}
func (*AnalyticsGameListCall) After ¶
func (r *AnalyticsGameListCall) After(a string) *AnalyticsGameListCall
After A cursor for forward pagination: the first set of results to return. Provide this value in the after query parameter.
func (*AnalyticsGameListCall) Do ¶
func (r *AnalyticsGameListCall) Do(ctx context.Context, opts ...RequestOption) (*AnalyticsGameListResponse, error)
Do executes the request.
func (*AnalyticsGameListCall) EndedAt ¶
func (r *AnalyticsGameListCall) EndedAt(t time.Time) *AnalyticsGameListCall
EndedAt The end of the date range for the report.
func (*AnalyticsGameListCall) First ¶
func (r *AnalyticsGameListCall) First(f int) *AnalyticsGameListCall
First The number of records to return. Maximum: 100. Default: 20.
func (*AnalyticsGameListCall) GameID ¶
func (r *AnalyticsGameListCall) GameID(id string) *AnalyticsGameListCall
GameID If specified, the response contains a report for the specified game. If not specified, the response includes a report for each game that the authenticated user has played.
func (*AnalyticsGameListCall) StartedAt ¶
func (r *AnalyticsGameListCall) StartedAt(t time.Time) *AnalyticsGameListCall
StartedAt The start of the date range for the report.
type AnalyticsGameListResponse ¶
type AnalyticsGameListResponse struct { Header http.Header Data []GameAnalytics Pagination Pagination }
type AnalyticsGameResource ¶
type AnalyticsGameResource struct {
// contains filtered or unexported fields
}
func NewAnalyticsGameResource ¶
func NewAnalyticsGameResource(client *Client) *AnalyticsGameResource
func (*AnalyticsGameResource) List ¶
func (r *AnalyticsGameResource) List() *AnalyticsGameListCall
type AnalyticsResource ¶
type AnalyticsResource struct { Extensions *AnalyticsExtensionResource Games *AnalyticsGameResource // contains filtered or unexported fields }
func NewAnalyticsResource ¶
func NewAnalyticsResource(client *Client) *AnalyticsResource
type BitsExtensionTransactionsResource ¶
type BitsExtensionTransactionsResource struct {
// contains filtered or unexported fields
}
func NewBitsExtensionTransactionsResource ¶
func NewBitsExtensionTransactionsResource(client *Client) *BitsExtensionTransactionsResource
func (*BitsExtensionTransactionsResource) List ¶
func (r *BitsExtensionTransactionsResource) List(extensionId string) *BitsTransactionsListCall
type BitsLeaderboardEntry ¶
type BitsLeaderboardListCall ¶
type BitsLeaderboardListCall struct {
// contains filtered or unexported fields
}
func (*BitsLeaderboardListCall) Count ¶
func (c *BitsLeaderboardListCall) Count(n int) *BitsLeaderboardListCall
Count limits the number of results to return.
Maximum: 100 (default: 10)
func (*BitsLeaderboardListCall) Do ¶
func (c *BitsLeaderboardListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsLeaderboardListResponse, error)
Do executes the request.
func (*BitsLeaderboardListCall) Period ¶
func (c *BitsLeaderboardListCall) Period(period string) *BitsLeaderboardListCall
Period sets the time period over which data is aggregated.
Possible values: "day", "week", "month", "year", "all" (default: "all")
func (*BitsLeaderboardListCall) StartedAt ¶
func (c *BitsLeaderboardListCall) StartedAt(t time.Time) *BitsLeaderboardListCall
StartedAt the start date used for determining the aggregation period.
func (*BitsLeaderboardListCall) UserID ¶
func (c *BitsLeaderboardListCall) UserID(userId string) *BitsLeaderboardListCall
UserID limits the aggregated results to the specified user ID. If count is greater than 1, the response may include users ranked above and below the specified user.
To get the leaderboard's top leaders, don't specify this.
type BitsLeaderboardListResponse ¶
type BitsLeaderboardListResponse struct { Header http.Header Total int Data []BitsLeaderboardEntry }
type BitsLeaderboardResource ¶
type BitsLeaderboardResource struct {
// contains filtered or unexported fields
}
func NewBitsLeaderboardResource ¶
func NewBitsLeaderboardResource(client *Client) *BitsLeaderboardResource
func (*BitsLeaderboardResource) List ¶
func (r *BitsLeaderboardResource) List() *BitsLeaderboardListCall
List creates a request to list users from the authenticated users Bits leaderboard.
type BitsResource ¶
type BitsResource struct { Cheermotes *CheermotesResource Leaderboard *BitsLeaderboardResource ExtensionTransactions *BitsExtensionTransactionsResource // contains filtered or unexported fields }
func NewBitsResource ¶
func NewBitsResource(client *Client) *BitsResource
type BitsTransactionsListCall ¶
type BitsTransactionsListCall struct {
// contains filtered or unexported fields
}
func (*BitsTransactionsListCall) After ¶
func (c *BitsTransactionsListCall) After(cursor string) *BitsTransactionsListCall
func (*BitsTransactionsListCall) Do ¶
func (c *BitsTransactionsListCall) Do(ctx context.Context, opts ...RequestOption) (*BitsTransactionsListResponse, error)
func (*BitsTransactionsListCall) First ¶
func (c *BitsTransactionsListCall) First(n int) *BitsTransactionsListCall
func (*BitsTransactionsListCall) TransactionID ¶
func (c *BitsTransactionsListCall) TransactionID(ids ...string) *BitsTransactionsListCall
type BitsTransactionsListResponse ¶
type BitsTransactionsListResponse struct { Header http.Header Data []ExtensionTransaction Pagination Pagination }
type Channel ¶
type Channel struct { ID string `json:"broadcaster_id"` Login string `json:"broadcaster_login"` DisplayName string `json:"broadcaster_name"` GameID string `json:"game_id"` GameName string `json:"game_name"` Title string `json:"title"` Delay int `json:"delay"` Tags []string `json:"tags"` ContentClassificationLabels []string `json:"content_classification_labels"` IsBrandedContent bool `json:"is_branded_content"` }
type ChannelPointsResource ¶
type ChannelPointsResource struct { CustomRewards *CustomRewardsResource // contains filtered or unexported fields }
func NewChannelPointsResource ¶
func NewChannelPointsResource(client *Client) *ChannelPointsResource
type ChannelsListCall ¶
type ChannelsListCall struct {
// contains filtered or unexported fields
}
func (*ChannelsListCall) BroadcasterID ¶
func (c *ChannelsListCall) BroadcasterID(ids []string) *ChannelsListCall
BroadcasterID filters the results to the specified broadcaster ID.
func (*ChannelsListCall) Do ¶
func (c *ChannelsListCall) Do(ctx context.Context, opts ...RequestOption) (*ChannelsListResponse, error)
Do executes the request.
type ChannelsListResponse ¶
type ChannelsResource ¶
type ChannelsResource struct { Followed *FollowedResource Followers *FollowersResource // contains filtered or unexported fields }
func NewChannelsResource ¶
func NewChannelsResource(client *Client) *ChannelsResource
func (*ChannelsResource) List ¶
func (r *ChannelsResource) List() *ChannelsListCall
List creates a request to list channels based on the specified criteria.
type CharityResource ¶
type CharityResource struct {
// contains filtered or unexported fields
}
func NewCharityResource ¶
func NewCharityResource(client *Client) *CharityResource
type ChatResource ¶
type ChatResource struct { Chatters *ChattersResource // contains filtered or unexported fields }
func NewChatResource ¶
func NewChatResource(client *Client) *ChatResource
func (*ChatResource) List ¶
func (r *ChatResource) List(broadcasterId, moderatorId string) *ChattersListCall
List creates a new call to list chatters.
type ChatterBan ¶
type ChattersListCall ¶
type ChattersListCall struct {
// contains filtered or unexported fields
}
func (*ChattersListCall) After ¶
func (c *ChattersListCall) After(cursor string) *ChattersListCall
After filters the results to those after the specified cursor.
func (*ChattersListCall) Do ¶
func (c *ChattersListCall) Do(ctx context.Context, opts ...RequestOption) (*ChattersResponse, error)
func (*ChattersListCall) First ¶
func (c *ChattersListCall) First(n int) *ChattersListCall
First filters the results to the first n chatters.
type ChattersResource ¶
type ChattersResource struct {
// contains filtered or unexported fields
}
func NewChattersResource ¶
func NewChattersResource(client *Client) *ChattersResource
type ChattersResponse ¶
type CheermoteTier ¶
type CheermotesListCall ¶
type CheermotesListCall struct {
// contains filtered or unexported fields
}
func (*CheermotesListCall) BroadcasterID ¶
func (c *CheermotesListCall) BroadcasterID(id string) *CheermotesListCall
BroadcasterID filters the results to the specified broadcaster ID.
func (*CheermotesListCall) Do ¶
func (c *CheermotesListCall) Do(ctx context.Context, opts ...RequestOption) (*CheermotesListResponse, error)
BroadcasterName filters the results to the specified broadcaster name.
type CheermotesListResponse ¶
type CheermotesResource ¶
type CheermotesResource struct {
// contains filtered or unexported fields
}
func NewCheermotesResource ¶
func NewCheermotesResource(client *Client) *CheermotesResource
func (*CheermotesResource) List ¶
func (r *CheermotesResource) List() *CheermotesListCall
List creates a request to list cheermotes based on the specified criteria.
Requires an app or user access token. No scope is required.
type ClearChatRequest ¶
type ClearChatRequest struct {
// contains filtered or unexported fields
}
func (*ClearChatRequest) Do ¶
func (c *ClearChatRequest) Do(ctx context.Context, opts ...RequestOption) error
Do executes the request.
func (*ClearChatRequest) MessageID ¶
func (c *ClearChatRequest) MessageID(messageId string) *ClearChatRequest
MessageID the ID of the message to delete.
type Client ¶
type Client struct { Ads *AdsResource Analytics *AnalyticsResource Bits *BitsResource Channels *ChannelsResource ChannelPoints *ChannelPointsResource Charity *CharityResource Chat *ChatResource Clips *ClipsResource Conduits *ConduitsResource Entitlements *EntitlementsResource Extensions *ExtensionsResource EventSub *EventSubResource Games *GamesResource Goals *GoalsResource GuestStar *GuestStarResource HypeTrain *HypeTrainResource Moderation *ModerationResource Polls *PollsResource Predictions *PredictionsResource Raids *RaidsResource Schedule *ScheduleResource Search *SearchResource Streams *StreamsResource Subscriptions *SubscriptionsResource Tags *TagsResource Teams *TeamsResource Users *UsersResource Videos *VideosResource Whispers *WhispersResource // contains filtered or unexported fields }
func New ¶
func New(clientID string, opts ...ClientOption) *Client
New creates a new API client for Twitch.
type ClientOption ¶
type ClientOption func(*Client)
func WithClientSecret ¶
func WithClientSecret(secret string) ClientOption
WithClientSecret sets the client secret to use for API requests.
func WithDefaultBearerToken ¶
func WithDefaultBearerToken(token string) ClientOption
WithDefaultBearerToken sets the bearer token to use for API requests.
This can be considered dangerous as if a token is not provided per request, this will become the default token. Some developers may prefer to default to the App Access Token using this method. However, it is recommended to still use the WithBearerToken option for requests that require a token as this method always will fail if the App Access Token has expired.
func WithHTTPClient ¶
func WithHTTPClient(client HTTPClient) ClientOption
WithHTTPClient sets the HTTP client to use for API requests.
type Clip ¶
type Clip struct { ID string `json:"id"` URL string `json:"url"` EmbedURL string `json:"embed_url"` BroadcasterID string `json:"broadcaster_id"` BroadcasterName string `json:"broadcaster_name"` CreatorID string `json:"creator_id"` CreatorName string `json:"creator_name"` VideoID string `json:"video_id"` GameID string `json:"game_id"` Language string `json:"language"` Title string `json:"title"` ViewCount int `json:"view_count"` ThumbnailURL string `json:"thumbnail_url"` Duration ClipDuration `json:"duration"` VODOffset int `json:"vod_offset"` Featured bool `json:"is_featured"` CreatedAt time.Time `json:"created_at"` }
type ClipDuration ¶
func (ClipDuration) AsDuration ¶
func (d ClipDuration) AsDuration() time.Duration
func (*ClipDuration) UnmarshalJSON ¶
func (d *ClipDuration) UnmarshalJSON(data []byte) error
type ClipsListCall ¶
type ClipsListCall struct {
// contains filtered or unexported fields
}
func (*ClipsListCall) After ¶
func (c *ClipsListCall) After(cursor string) *ClipsListCall
After filters the results to those after the specified cursor.
func (*ClipsListCall) Before ¶
func (c *ClipsListCall) Before(cursor string) *ClipsListCall
Before filters the results to those before the specified cursor.
func (*ClipsListCall) BroadcasterID ¶
func (c *ClipsListCall) BroadcasterID(id string) *ClipsListCall
BroadcasterID filters the results to those with the specified broadcaster ID.
func (*ClipsListCall) Do ¶
func (c *ClipsListCall) Do(ctx context.Context, opts ...RequestOption) (*ClipsListResponse, error)
Do executes the call.
func (*ClipsListCall) EndedAt ¶
func (c *ClipsListCall) EndedAt(t time.Time) *ClipsListCall
EndedAt filters the results to those created before the specified time.
func (*ClipsListCall) Featured ¶
func (c *ClipsListCall) Featured() *ClipsListCall
Featured filters the results to only those that are featured.
func (*ClipsListCall) First ¶
func (c *ClipsListCall) First(n int) *ClipsListCall
First filters the results to the first n clips.
func (*ClipsListCall) GameID ¶
func (c *ClipsListCall) GameID(id string) *ClipsListCall
GameID filters the results to those with the specified game ID.
func (*ClipsListCall) ID ¶
func (c *ClipsListCall) ID(ids []string) *ClipsListCall
ID filters the results to those with the specified clip IDs.
func (*ClipsListCall) StartedAt ¶
func (c *ClipsListCall) StartedAt(t time.Time) *ClipsListCall
StartedAt filters the results to those created after the specified time.
type ClipsListResponse ¶
type ClipsResource ¶
type ClipsResource struct {
// contains filtered or unexported fields
}
func NewClipsResource ¶
func NewClipsResource(client *Client) *ClipsResource
func (*ClipsResource) List ¶
func (r *ClipsResource) List() *ClipsListCall
List creates a new call to list clips.
One or more of ID, BroadcasterID, or GameID must be specified.
type Commercial ¶
type ConduitDeleteCall ¶
type ConduitDeleteCall struct {
// contains filtered or unexported fields
}
ConduitDeleteCall is the API call for deleting a Twitch Eventsub Conduit.
func (*ConduitDeleteCall) Do ¶
func (c *ConduitDeleteCall) Do(ctx context.Context, opts ...RequestOption) error
Do executes the request.
type ConduitInsertCall ¶
type ConduitInsertCall struct {
// contains filtered or unexported fields
}
ConduitInsertCall is the API call for creating a new Twitch Eventsub Conduit.
func (*ConduitInsertCall) Do ¶
func (c *ConduitInsertCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsResponse, error)
Do executes the request.
func (*ConduitInsertCall) ShardCount ¶
func (c *ConduitInsertCall) ShardCount(n int) *ConduitInsertCall
ShardCount sets the shard count for the new conduit.
type ConduitShard ¶
type ConduitShard struct { ID string `json:"id"` Status string `json:"status"` Transport Transport `json:"transport"` }
ConduitShard is a shard for a Twitch Eventsub Conduit.
type ConduitShardListCall ¶
type ConduitShardListCall struct {
// contains filtered or unexported fields
}
ConduitShardListCall is the API call for listing Twitch Eventsub Conduit Shards.
func (*ConduitShardListCall) After ¶
func (c *ConduitShardListCall) After(cursor string) *ConduitShardListCall
After sets the cursor for pagination.
func (*ConduitShardListCall) Do ¶
func (c *ConduitShardListCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitShardsResponse, error)
Do executes the request.
func (*ConduitShardListCall) Status ¶
func (c *ConduitShardListCall) Status(status string) *ConduitShardListCall
Status filters the list of shards by status.
type ConduitShardUpdateCall ¶
type ConduitShardUpdateCall struct {
// contains filtered or unexported fields
}
ConduitShardUpdateCall is the API call for updating Twitch Eventsub Conduit Shards.
func (*ConduitShardUpdateCall) Do ¶
func (c *ConduitShardUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitShardsResponse, error)
Do executes the request.
func (*ConduitShardUpdateCall) Shard ¶
func (c *ConduitShardUpdateCall) Shard(shardID string, transport Transport) *ConduitShardUpdateCall
Shard adds a shard to the update call.
type ConduitShardsResource ¶
type ConduitShardsResource struct {
// contains filtered or unexported fields
}
ConduitShardsResource is the API resource for managing Twitch Eventsub Conduit Shards.
func NewConduitShardsResource ¶
func NewConduitShardsResource(client *Client) *ConduitShardsResource
NewConduitShardsResource creates a new ConduitShardsResource.
func (*ConduitShardsResource) List ¶
func (r *ConduitShardsResource) List(conduitID string) *ConduitShardListCall
List creates a new ConduitShardListCall.
func (*ConduitShardsResource) Update ¶
func (r *ConduitShardsResource) Update(conduitID string) *ConduitShardUpdateCall
Update creates a new ConduitShardUpdateCall.
type ConduitShardsResponse ¶
type ConduitShardsResponse struct { Header http.Header Shards []ConduitShard Cursor string }
ConduitShardsResponse represents the response from the Twitch Eventsub Conduit Shards API.
type ConduitUpdateCall ¶
type ConduitUpdateCall struct {
// contains filtered or unexported fields
}
ConduitUpdateCall is the API call for updating a Twitch Eventsub Conduit.
func (*ConduitUpdateCall) Do ¶
func (c *ConduitUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsResponse, error)
Do executes the request.
func (*ConduitUpdateCall) ShardCount ¶
func (c *ConduitUpdateCall) ShardCount(n int) *ConduitUpdateCall
ShardCount sets the shard count for the conduit.
type ConduitsListCall ¶
type ConduitsListCall struct {
// contains filtered or unexported fields
}
ConduitsListCall is the API call for listing an apps Twitch Eventsub Conduits.
func (*ConduitsListCall) Do ¶
func (c *ConduitsListCall) Do(ctx context.Context, opts ...RequestOption) (*ConduitsResponse, error)
Do executes the request.
type ConduitsResource ¶
type ConduitsResource struct { Shards *ConduitShardsResource // contains filtered or unexported fields }
ConduitsResource is the API resource for managing Twitch Eventsub Conduits.
func NewConduitsResource ¶
func NewConduitsResource(client *Client) *ConduitsResource
NewConduitsResource creates a new ConduitsResource.
func (*ConduitsResource) Delete ¶
func (r *ConduitsResource) Delete(id string) *ConduitDeleteCall
Delete creates a new ConduitDeleteCall.
func (*ConduitsResource) Insert ¶
func (r *ConduitsResource) Insert() *ConduitInsertCall
Insert creates a new ConduitInsertCall.
func (*ConduitsResource) List ¶
func (r *ConduitsResource) List() *ConduitsListCall
List creates a new ConduitsListCall.
func (*ConduitsResource) Update ¶
func (r *ConduitsResource) Update(id string) *ConduitUpdateCall
Update creates a new ConduitUpdateCall.
type ConduitsResponse ¶
ConduitsResponse represents the response from the Twitch Eventsub Conduits API.
type CreateBanRequest ¶
type CreateBanRequest struct {
// contains filtered or unexported fields
}
func (*CreateBanRequest) Do ¶
func (c *CreateBanRequest) Do(ctx context.Context, opts ...RequestOption) ([]ChatterBan, error)
Do executes the request.
func (*CreateBanRequest) Duration ¶
func (c *CreateBanRequest) Duration(duration time.Duration) *CreateBanRequest
Duration the duration of the timeout, in seconds. If omitted, the ban is permanent.
The minimum timeout is 1 second and the maximum is 1,209,600 seconds (2 weeks).
To end a user's timeout early, set this field to 1, or use the Unban user endpoint.
func (*CreateBanRequest) Reason ¶
func (c *CreateBanRequest) Reason(reason string) *CreateBanRequest
Reason the reason the you're banning the user or putting them in a timeout. This is optional and may be an empty string.
Reason is limited to a maximum of 500 characters.
func (*CreateBanRequest) TargetID ¶
func (c *CreateBanRequest) TargetID(userId string) *CreateBanRequest
UserID the ID of the user to ban or put in a timeout.
type CustomReward ¶
type CustomReward struct { ID string `json:"id"` BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterDisplayName string `json:"broadcaster_name"` BackgroundColor string `json:"background_color"` Title string `json:"title"` Prompt string `json:"prompt"` Cost int64 `json:"cost"` Enabled bool `json:"is_enabled"` Paused bool `json:"is_paused"` InStock bool `json:"is_in_stock"` IsUserInputRequired bool `json:"is_user_input_required"` RedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"` CooldownExpiresAt time.Time `json:"cooldown_expires_at"` }
type CustomRewardRedemption ¶
type CustomRewardRedemption struct { ID string `json:"id"` BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterDisplayName string `json:"broadcaster_name"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserDisplayName string `json:"user_name"` UserInput string `json:"user_input"` Status string `json:"status"` Reward struct { ID string `json:"id"` Title string `json:"title"` Prompt string `json:"prompt"` Cost int64 `json:"cost"` } `json:"reward"` RedeemedAt time.Time `json:"redeemed_at"` }
type CustomRewardsDeleteCall ¶
type CustomRewardsDeleteCall struct {
// contains filtered or unexported fields
}
func (*CustomRewardsDeleteCall) Do ¶
func (c *CustomRewardsDeleteCall) Do(ctx context.Context, opts ...RequestOption) error
Do executes the request.
type CustomRewardsInsertCall ¶
type CustomRewardsInsertCall struct {
// contains filtered or unexported fields
}
func (*CustomRewardsInsertCall) BackgroundColor ¶
func (c *CustomRewardsInsertCall) BackgroundColor(hexCode string) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) Cost ¶
func (c *CustomRewardsInsertCall) Cost(cost int64) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) Do ¶
func (c *CustomRewardsInsertCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsInsertResponse, error)
Do executes the request.
func (*CustomRewardsInsertCall) GlobalCooldown ¶
func (c *CustomRewardsInsertCall) GlobalCooldown(d time.Duration) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) IsEnabled ¶
func (c *CustomRewardsInsertCall) IsEnabled(enabled bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) IsGlobalCooldownEnabled ¶
func (c *CustomRewardsInsertCall) IsGlobalCooldownEnabled(enabled bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) IsMaxPerStreamEnabled ¶
func (c *CustomRewardsInsertCall) IsMaxPerStreamEnabled(enabled bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) IsMaxPerUserPerStreamEnabled ¶
func (c *CustomRewardsInsertCall) IsMaxPerUserPerStreamEnabled(enabled bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) IsPaused ¶
func (c *CustomRewardsInsertCall) IsPaused(paused bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) IsUserInputRequired ¶
func (c *CustomRewardsInsertCall) IsUserInputRequired(required bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) MaxPerStream ¶
func (c *CustomRewardsInsertCall) MaxPerStream(max int64) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) MaxPerUserPerStream ¶
func (c *CustomRewardsInsertCall) MaxPerUserPerStream(max int64) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) Prompt ¶
func (c *CustomRewardsInsertCall) Prompt(prompt string) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) ShouldRedemptionsSkipRequestQueue ¶
func (c *CustomRewardsInsertCall) ShouldRedemptionsSkipRequestQueue(b bool) *CustomRewardsInsertCall
func (*CustomRewardsInsertCall) Title ¶
func (c *CustomRewardsInsertCall) Title(title string) *CustomRewardsInsertCall
type CustomRewardsInsertResponse ¶
type CustomRewardsInsertResponse struct { Header http.Header Data []CustomReward }
type CustomRewardsListCall ¶
type CustomRewardsListCall struct {
// contains filtered or unexported fields
}
func (*CustomRewardsListCall) Do ¶
func (c *CustomRewardsListCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsListResponse, error)
Do executes the request.
func (*CustomRewardsListCall) ID ¶
func (c *CustomRewardsListCall) ID(ids []string) *CustomRewardsListCall
ID filters the results to the specified reward IDs.
func (*CustomRewardsListCall) OnlyManageable ¶
func (c *CustomRewardsListCall) OnlyManageable() *CustomRewardsListCall
OnlyManageable filters the results to only rewards that the app may manage.
type CustomRewardsListResponse ¶
type CustomRewardsListResponse struct { Header http.Header Data []CustomReward }
type CustomRewardsRedemptionListCall ¶
type CustomRewardsRedemptionListCall struct {
// contains filtered or unexported fields
}
func (*CustomRewardsRedemptionListCall) After ¶
func (c *CustomRewardsRedemptionListCall) After(cursor string) *CustomRewardsRedemptionListCall
After filters the results to those with a cursor value after the specified cursor.
func (*CustomRewardsRedemptionListCall) Before ¶
func (c *CustomRewardsRedemptionListCall) Before(cursor string) *CustomRewardsRedemptionListCall
Before filters the results to those with a cursor value before the specified cursor.
func (*CustomRewardsRedemptionListCall) Do ¶
func (c *CustomRewardsRedemptionListCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsRedemptionListResponse, error)
Do executes the request.
func (*CustomRewardsRedemptionListCall) ID ¶
func (c *CustomRewardsRedemptionListCall) ID(ids []string) *CustomRewardsRedemptionListCall
ID filters the results to the specified reward redemption IDs.
func (*CustomRewardsRedemptionListCall) Sort ¶
func (c *CustomRewardsRedemptionListCall) Sort(sort string) *CustomRewardsRedemptionListCall
Sort specifies the order in which to sort the results.
Possible values: "OLDEST", "NEWEST" (default: OLDEST)
func (*CustomRewardsRedemptionListCall) Status ¶
func (c *CustomRewardsRedemptionListCall) Status(status string) *CustomRewardsRedemptionListCall
Status filters the results to the specified statuses.
Possible values: "UNFULFILLED", "FULFILLED", "CANCELED" (default: UNFULFILLED)
type CustomRewardsRedemptionListResponse ¶
type CustomRewardsRedemptionListResponse struct { Header http.Header Data []CustomRewardRedemption Cursor string }
type CustomRewardsRedemptionResource ¶
type CustomRewardsRedemptionResource struct {
// contains filtered or unexported fields
}
func NewCustomRewardsRedemptionResource ¶
func NewCustomRewardsRedemptionResource(client *Client) *CustomRewardsRedemptionResource
func (*CustomRewardsRedemptionResource) List ¶
func (r *CustomRewardsRedemptionResource) List(broadcasterId, rewardId string) *CustomRewardsRedemptionListCall
List creates a request to list custom channel point reward redemptions for a given broadcaster.
func (*CustomRewardsRedemptionResource) Update ¶
func (r *CustomRewardsRedemptionResource) Update(broadcasterId, rewardId string, id []string) *CustomRewardsRedemptionUpdateCall
type CustomRewardsRedemptionUpdateCall ¶
type CustomRewardsRedemptionUpdateCall struct {
// contains filtered or unexported fields
}
func (*CustomRewardsRedemptionUpdateCall) Cancel ¶
func (c *CustomRewardsRedemptionUpdateCall) Cancel() *CustomRewardsRedemptionUpdateCall
func (*CustomRewardsRedemptionUpdateCall) Do ¶
func (c *CustomRewardsRedemptionUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsRedemptionUpdateResponse, error)
Do executes the request.
func (*CustomRewardsRedemptionUpdateCall) Fulfill ¶
func (c *CustomRewardsRedemptionUpdateCall) Fulfill() *CustomRewardsRedemptionUpdateCall
type CustomRewardsRedemptionUpdateResponse ¶
type CustomRewardsRedemptionUpdateResponse struct { Header http.Header Data []CustomRewardRedemption }
type CustomRewardsResource ¶
type CustomRewardsResource struct { Redemption *CustomRewardsRedemptionResource // contains filtered or unexported fields }
func NewCustomRewardsResource ¶
func NewCustomRewardsResource(client *Client) *CustomRewardsResource
func (*CustomRewardsResource) Delete ¶
func (r *CustomRewardsResource) Delete(broadcasterId, id string) *CustomRewardsDeleteCall
func (*CustomRewardsResource) Insert ¶
func (r *CustomRewardsResource) Insert(broadcasterId string) *CustomRewardsInsertCall
func (*CustomRewardsResource) List ¶
func (r *CustomRewardsResource) List(broadcasterId string) *CustomRewardsListCall
List creates a reqyest to list custom channel point rewards for a given broadcaster.
func (*CustomRewardsResource) Update ¶
func (r *CustomRewardsResource) Update(broadcasterId, id string) *CustomRewardsUpdateCall
type CustomRewardsUpdateCall ¶
type CustomRewardsUpdateCall struct {
// contains filtered or unexported fields
}
func (*CustomRewardsUpdateCall) BackgroundColor ¶
func (c *CustomRewardsUpdateCall) BackgroundColor(hexCode string) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) Cost ¶
func (c *CustomRewardsUpdateCall) Cost(cost int64) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) Do ¶
func (c *CustomRewardsUpdateCall) Do(ctx context.Context, opts ...RequestOption) (*CustomRewardsUpdateResponse, error)
Do executes the request.
func (*CustomRewardsUpdateCall) GlobalCooldown ¶
func (c *CustomRewardsUpdateCall) GlobalCooldown(d time.Duration) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) IsEnabled ¶
func (c *CustomRewardsUpdateCall) IsEnabled(enabled bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) IsGlobalCooldownEnabled ¶
func (c *CustomRewardsUpdateCall) IsGlobalCooldownEnabled(enabled bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) IsMaxPerStreamEnabled ¶
func (c *CustomRewardsUpdateCall) IsMaxPerStreamEnabled(enabled bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) IsMaxPerUserPerStreamEnabled ¶
func (c *CustomRewardsUpdateCall) IsMaxPerUserPerStreamEnabled(enabled bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) IsPaused ¶
func (c *CustomRewardsUpdateCall) IsPaused(paused bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) IsUserInputRequired ¶
func (c *CustomRewardsUpdateCall) IsUserInputRequired(required bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) MaxPerStream ¶
func (c *CustomRewardsUpdateCall) MaxPerStream(max int64) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) MaxPerUserPerStream ¶
func (c *CustomRewardsUpdateCall) MaxPerUserPerStream(max int64) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) Prompt ¶
func (c *CustomRewardsUpdateCall) Prompt(prompt string) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) ShouldRedemptionsSkipRequestQueue ¶
func (c *CustomRewardsUpdateCall) ShouldRedemptionsSkipRequestQueue(b bool) *CustomRewardsUpdateCall
func (*CustomRewardsUpdateCall) Title ¶
func (c *CustomRewardsUpdateCall) Title(title string) *CustomRewardsUpdateCall
type CustomRewardsUpdateResponse ¶
type CustomRewardsUpdateResponse struct { Header http.Header Data []CustomReward }
type EntitlementsResource ¶
type EntitlementsResource struct {
// contains filtered or unexported fields
}
func NewEntitlementsResource ¶
func NewEntitlementsResource(client *Client) *EntitlementsResource
type EventSubResource ¶
type EventSubResource struct {
// contains filtered or unexported fields
}
func NewEventSubResource ¶
func NewEventSubResource(client *Client) *EventSubResource
type ExtensionAnalytics ¶
type ExtensionAnalytics struct { ExtensionID string `json:"extension_id"` URL string `json:"URL"` Type string `json:"type"` DateRate AnalyticsDateRange `json:"date_range"` }
type ExtensionProduct ¶
type ExtensionProductCost ¶
type ExtensionTransaction ¶
type ExtensionTransaction struct { ID string `json:"id"` BroadcasterID string `json:"broadcaster_id"` BroadcasterLogin string `json:"broadcaster_login"` BroadcasterName string `json:"broadcaster_name"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserName string `json:"user_name"` ProductType string `json:"product_type"` Product ExtensionProduct `json:"product_data"` Timestamp time.Time `json:"timestamp"` }
type ExtensionsResource ¶
type ExtensionsResource struct {
// contains filtered or unexported fields
}
func NewExtensionsResource ¶
func NewExtensionsResource(client *Client) *ExtensionsResource
type FollowedListCall ¶
type FollowedListCall struct {
// contains filtered or unexported fields
}
func (*FollowedListCall) After ¶
func (c *FollowedListCall) After(n int) *FollowedListCall
The cursor used to get the next page of results.
func (*FollowedListCall) BroadcasterID ¶
func (c *FollowedListCall) BroadcasterID(id string) *FollowedListCall
Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows.
func (*FollowedListCall) Do ¶
func (c *FollowedListCall) Do(ctx context.Context, opts ...RequestOption) (*FollowedListResponse, error)
func (*FollowedListCall) First ¶
func (c *FollowedListCall) First(n int) *FollowedListCall
The minimum page size is 1 item per page and the maximum is 100. The default is 20.
func (*FollowedListCall) UserID ¶
func (c *FollowedListCall) UserID(id string) *FollowedListCall
UserID returns the list of broadcasters that this user follows
type FollowedListResponse ¶
type FollowedResource ¶
type FollowedResource struct {
// contains filtered or unexported fields
}
func NewFollowedResource ¶
func NewFollowedResource(client *Client) *FollowedResource
func (*FollowedResource) List ¶
func (r *FollowedResource) List() *FollowedListCall
type FollowersListCall ¶
type FollowersListCall struct {
// contains filtered or unexported fields
}
func (*FollowersListCall) After ¶
func (c *FollowersListCall) After(n int) *FollowersListCall
The cursor used to get the next page of results.
func (*FollowersListCall) BroadcasterID ¶
func (c *FollowersListCall) BroadcasterID(id string) *FollowersListCall
BroadcasterID filters the results to the specified broadcaster ID.
func (*FollowersListCall) Do ¶
func (c *FollowersListCall) Do(ctx context.Context, opts ...RequestOption) (*FollowersListResponse, error)
func (*FollowersListCall) First ¶
func (c *FollowersListCall) First(n int) *FollowersListCall
The minimum page size is 1 item per page and the maximum is 100. The default is 20.
func (*FollowersListCall) UserID ¶
func (c *FollowersListCall) UserID(id string) *FollowersListCall
UserID filters the results to the specified user ID.
type FollowersListResponse ¶
type FollowersResource ¶
type FollowersResource struct {
// contains filtered or unexported fields
}
func NewFollowersResource ¶
func NewFollowersResource(client *Client) *FollowersResource
func (*FollowersResource) List ¶
func (r *FollowersResource) List() *FollowersListCall
type GameAnalytics ¶
type GameAnalytics struct { GameID string `json:"game_id"` URL string `json:"URL"` DateRate AnalyticsDateRange `json:"date_range"` }
type GamesResource ¶
type GamesResource struct { Top *TopGamesResource // contains filtered or unexported fields }
func NewGamesResource ¶
func NewGamesResource(client *Client) *GamesResource
type GoalsResource ¶
type GoalsResource struct {
// contains filtered or unexported fields
}
func NewGoalsResource ¶
func NewGoalsResource(client *Client) *GoalsResource
type GuestStarResource ¶
type GuestStarResource struct {
// contains filtered or unexported fields
}
func NewGuestStarResource ¶
func NewGuestStarResource(client *Client) *GuestStarResource
type HypeTrainResource ¶
type HypeTrainResource struct {
// contains filtered or unexported fields
}
func NewHypeTrainResource ¶
func NewHypeTrainResource(client *Client) *HypeTrainResource
type ModerationResource ¶
type ModerationResource struct {
// contains filtered or unexported fields
}
func NewModerationResource ¶
func NewModerationResource(client *Client) *ModerationResource
func (*ModerationResource) ClearChat ¶
func (r *ModerationResource) ClearChat(broadcasterId, moderatorId string) *ClearChatRequest
ClearChat creates a request to clear all messages from a channel.
Required Scope: moderator:manage:chat_messages
func (*ModerationResource) CreateBan ¶
func (r *ModerationResource) CreateBan(broadcasterId, moderatorId, userId string) *CreateBanRequest
CreateBan creates a request to ban a user from a channel.
Required Scope: moderator:manage:banned_users
func (*ModerationResource) RemoveBan ¶
func (r *ModerationResource) RemoveBan(broadcasterId, moderatorId, userId string) *RemoveBanRequest
RemoveBan creates a request to remove a ban on a user from a channel.
Required Scope: moderator:manage:banned_users
type Pagination ¶
type Pagination struct {
Cursor string `json:"cursor,omitempty"`
}
type PollsResource ¶
type PollsResource struct {
// contains filtered or unexported fields
}
func NewPollsResource ¶
func NewPollsResource(client *Client) *PollsResource
type PredictionsResource ¶
type PredictionsResource struct {
// contains filtered or unexported fields
}
func NewPredictionsResource ¶
func NewPredictionsResource(client *Client) *PredictionsResource
type RaidsResource ¶
type RaidsResource struct {
// contains filtered or unexported fields
}
func NewRaidsResource ¶
func NewRaidsResource(client *Client) *RaidsResource
type RemoveBanRequest ¶
type RemoveBanRequest struct {
// contains filtered or unexported fields
}
func (*RemoveBanRequest) Do ¶
func (c *RemoveBanRequest) Do(ctx context.Context, opts ...RequestOption) error
Do executes the request.
func (*RemoveBanRequest) TargetID ¶
func (c *RemoveBanRequest) TargetID(userId string) *RemoveBanRequest
UserID the ID of the user to unban.
type RequestOption ¶
func AddQueryParameter ¶
func AddQueryParameter(key, value string) RequestOption
AddQueryParameter adds a query parameter to the request without replacing any existing values.
func SetQueryParameter ¶
func SetQueryParameter(key, value string) RequestOption
SetQueryParameter sets a query parameter on the request, replacing any existing values.
func WithBearerToken ¶
func WithBearerToken(token string) RequestOption
WithBearerToken sets the bearer token to use for API requests.
type ResponseData ¶
type ResponseData[T any] struct { Total int `json:"total,omitempty"` // Only present in some endpoints. Points int `json:"points,omitempty"` // Only present in some endpoints. Data []T `json:"data"` Pagination Pagination `json:"pagination,omitempty"` Status int `json:"status"` // If not provided by Twitch, defaults to HTTP status code. Code string `json:"error"` // If not provided by Twitch, defaults to HTTP status text. Message string `json:"message,omitempty"` // Only present if status is non-200 }
type ScheduleResource ¶
type ScheduleResource struct {
// contains filtered or unexported fields
}
func NewScheduleResource ¶
func NewScheduleResource(client *Client) *ScheduleResource
type SearchResource ¶
type SearchResource struct {
// contains filtered or unexported fields
}
func NewSearchResource ¶
func NewSearchResource(client *Client) *SearchResource
type Stream ¶
type Stream struct { ID string `json:"id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserDisplayName string `json:"user_name"` GameID string `json:"game_id"` GameName string `json:"game_name"` Type string `json:"type"` Title string `json:"title"` Tags []string `json:"tags"` ViewerCount int `json:"viewer_count"` Language string `json:"language"` ThumbnailURL string `json:"thumbnail_url"` IsMature bool `json:"is_mature"` StartedAt time.Time `json:"started_at"` }
type StreamsListCall ¶
type StreamsListCall struct {
// contains filtered or unexported fields
}
func (*StreamsListCall) After ¶
func (c *StreamsListCall) After(cursor string) *StreamsListCall
After filters the results to streams that started after the specified cursor.
func (*StreamsListCall) Before ¶
func (c *StreamsListCall) Before(cursor string) *StreamsListCall
Before filters the results to streams that started before the specified cursor.
func (*StreamsListCall) Do ¶
func (c *StreamsListCall) Do(ctx context.Context, opts ...RequestOption) (*StreamsListResponse, error)
Do executes the request.
func (*StreamsListCall) First ¶
func (c *StreamsListCall) First(n int) *StreamsListCall
First limits the number of results to the specified amount.
Maximum: 100 (default: 20)
func (*StreamsListCall) GameID ¶
func (c *StreamsListCall) GameID(ids []string) *StreamsListCall
GameID filters the results to the specified game IDs.
func (*StreamsListCall) Languages ¶
func (c *StreamsListCall) Languages(languages []string) *StreamsListCall
Language filters the results to the specified languages.
func (*StreamsListCall) Type ¶
func (c *StreamsListCall) Type(t string) *StreamsListCall
Type filters the results to the specified stream types.
Possible values: "all", "live" (Default: "all")
func (*StreamsListCall) UserID ¶
func (c *StreamsListCall) UserID(ids []string) *StreamsListCall
UserID filters the results to the specified user IDs.
func (*StreamsListCall) Username ¶
func (c *StreamsListCall) Username(usernames []string) *StreamsListCall
Username filters the results to the specified usernames.
type StreamsListResponse ¶
type StreamsResource ¶
type StreamsResource struct {
// contains filtered or unexported fields
}
func NewStreamsResource ¶
func NewStreamsResource(client *Client) *StreamsResource
func (*StreamsResource) List ¶
func (r *StreamsResource) List() *StreamsListCall
List creates a request to list streams based on the specified criteria.
Requires an app or user access token. No scope is required.
type SubscriptionsResource ¶
type SubscriptionsResource struct {
// contains filtered or unexported fields
}
func NewSubscriptionsResource ¶
func NewSubscriptionsResource(client *Client) *SubscriptionsResource
type TagsResource ¶
type TagsResource struct {
// contains filtered or unexported fields
}
func NewTagsResource ¶
func NewTagsResource(client *Client) *TagsResource
type TeamsResource ¶
type TeamsResource struct {
// contains filtered or unexported fields
}
func NewTeamsResource ¶
func NewTeamsResource(client *Client) *TeamsResource
type TopGamesListCall ¶
type TopGamesListCall struct {
// contains filtered or unexported fields
}
func (*TopGamesListCall) After ¶
func (c *TopGamesListCall) After(cursor string) *TopGamesListCall
After filters the results to those with a cursor value after the specified cursor.
func (*TopGamesListCall) Before ¶
func (c *TopGamesListCall) Before(cursor string) *TopGamesListCall
Before filters the results to those with a cursor value before the specified cursor.
func (*TopGamesListCall) Do ¶
func (c *TopGamesListCall) Do(ctx context.Context, opts ...RequestOption) (*TopGamesListResponse, error)
Do executes the request.
func (*TopGamesListCall) First ¶
func (c *TopGamesListCall) First(n int) *TopGamesListCall
First limits the number of results to the specified amount.
Maximum: 100 (default: 20)
type TopGamesListResponse ¶
type TopGamesResource ¶
type TopGamesResource struct {
// contains filtered or unexported fields
}
func NewTopGamesResource ¶
func NewTopGamesResource(client *Client) *TopGamesResource
func (*TopGamesResource) List ¶
func (r *TopGamesResource) List() *TopGamesListCall
List creates a request to list top games based on the specified criteria.
type Transport ¶
type Transport struct { Method string `json:"method"` Callback *string `json:"callback,omitempty"` Secret *string `json:"secret,omitempty"` SessionID *string `json:"session_id,omitempty"` ConnectedAt *time.Time `json:"connected_at,omitempty"` DisconnectedAt *time.Time `json:"disconnected_at,omitempty"` }
Transport is the transport method for a Twitch Eventsub Conduit Shard.
func NewWebSocketTransport ¶
NewWebSocketTransport creates a new websocket transport for a Twitch Eventsub Conduit Shard.
func NewWebhookTransport ¶
NewWebhookTransport creates a new webhook transport for a Twitch Eventsub Conduit Shard.
type User ¶
type User struct { ID string `json:"id"` Login string `json:"login"` DisplayName string `json:"display_name"` Type string `json:"type"` BroadcasterType string `json:"broadcaster_type"` Description string `json:"description"` ProfileImageURL string `json:"profile_image_url"` OfflineImageURL string `json:"offline_image_url"` Email string `json:"email,omitempty"` CreatedAt time.Time `json:"created_at"` }
type UsersListCall ¶
type UsersListCall struct {
// contains filtered or unexported fields
}
func (*UsersListCall) Do ¶
func (c *UsersListCall) Do(ctx context.Context, opts ...RequestOption) (*UsersListResponse, error)
Do executes the request.
func (*UsersListCall) ID ¶
func (c *UsersListCall) ID(ids []string) *UsersListCall
ID filters the results to the specified user IDs.
func (*UsersListCall) Login ¶
func (c *UsersListCall) Login(logins []string) *UsersListCall
Login filters the results to the specified usernames.
type UsersListResponse ¶
type UsersResource ¶
type UsersResource struct {
// contains filtered or unexported fields
}
func NewUsersResource ¶
func NewUsersResource(client *Client) *UsersResource
func (*UsersResource) List ¶
func (r *UsersResource) List() *UsersListCall
List creates a request to list users based on the specified criteria.
The email field will be empty unless the access token has the user:read:email scope.
type Video ¶
type Video struct { ID string `json:"id"` StreamID string `json:"stream_id"` UserID string `json:"user_id"` UserLogin string `json:"user_login"` UserDisplayName string `json:"user_name"` Title string `json:"title"` Description string `json:"description"` URL string `json:"url"` ThumbnailURL string `json:"thumbnail_url"` Viewable string `json:"viewable"` ViewCount int `json:"view_count"` Language string `json:"language"` Type string `json:"type"` Duration VideoDuration `json:"duration"` PublishedAt time.Time `json:"published_at"` CreatedAt time.Time `json:"created_at"` }
type VideoDuration ¶
func (VideoDuration) AsDuration ¶
func (d VideoDuration) AsDuration() time.Duration
func (*VideoDuration) UnmarshalJSON ¶
func (d *VideoDuration) UnmarshalJSON(data []byte) error
type VideosDeleteCall ¶
type VideosDeleteCall struct {
// contains filtered or unexported fields
}
func (*VideosDeleteCall) Do ¶
func (c *VideosDeleteCall) Do(ctx context.Context, opts ...RequestOption) (*VideosDeleteResponse, error)
type VideosDeleteResponse ¶
type VideosListCall ¶
type VideosListCall struct {
// contains filtered or unexported fields
}
func (*VideosListCall) After ¶
func (c *VideosListCall) After(cursor string) *VideosListCall
After filters the results to those with a cursor value after the specified cursor.
func (*VideosListCall) Before ¶
func (c *VideosListCall) Before(cursor string) *VideosListCall
Before filters the results to those with a cursor value before the specified cursor.
func (*VideosListCall) Do ¶
func (c *VideosListCall) Do(ctx context.Context, opts ...RequestOption) (*VideosListResponse, error)
func (*VideosListCall) First ¶
func (c *VideosListCall) First(n int) *VideosListCall
func (*VideosListCall) GameID ¶
func (c *VideosListCall) GameID(id string) *VideosListCall
GameID filters the results to those with the specified game ID.
func (*VideosListCall) ID ¶
func (c *VideosListCall) ID(ids []string) *VideosListCall
ID filters the results to those with the specified ID.
func (*VideosListCall) Language ¶
func (c *VideosListCall) Language(language string) *VideosListCall
Language filters the results to those with the specified language.
func (*VideosListCall) Period ¶
func (c *VideosListCall) Period(p string) *VideosListCall
Period filters the results to those with a specified period.
Possible values: "all", "day", "week", "month" (default: all)
func (*VideosListCall) Sort ¶
func (c *VideosListCall) Sort(s string) *VideosListCall
Sort sets the order in which to list videos.
Possible values: "time", "trending", "views" (default: time)
func (*VideosListCall) Type ¶
func (c *VideosListCall) Type(t string) *VideosListCall
Type filters the results to those with the specified type.
Possible values: "all", "upload", "archive", "highlight" (default: all)
func (*VideosListCall) UserID ¶
func (c *VideosListCall) UserID(id string) *VideosListCall
UserID filters the results to those with the specified user ID.
type VideosListResponse ¶
type VideosResource ¶
type VideosResource struct {
// contains filtered or unexported fields
}
func NewVideosResource ¶
func NewVideosResource(client *Client) *VideosResource
func (*VideosResource) Delete ¶
func (r *VideosResource) Delete(ids []string) *VideosDeleteCall
Delete creates a new call to delete videos.
func (*VideosResource) List ¶
func (r *VideosResource) List() *VideosListCall
List creates a new call to list videos.
One of ID, UserID, or GameID must be specified.
type WhispersInsertCall ¶
type WhispersInsertCall struct {
// contains filtered or unexported fields
}
func (*WhispersInsertCall) Do ¶
func (c *WhispersInsertCall) Do(ctx context.Context, opts ...RequestOption) error
Do executes the request.
req := client.Whispers.SendWhisper("123", "456").Message("Hello") data, err := req.Do(ctx, api.WithBearerToken("kpvy3cjboyptmdkiacwr0c19hotn5s")
func (*WhispersInsertCall) Message ¶
func (c *WhispersInsertCall) Message(message string) *WhispersInsertCall
Message the whisper message to send. The message must not be empty.
The maximum message lengths are:
- 500 characters if the user you're sending the message to hasn't whispered you before.
- 10,000 characters if the user you're sending the message to has whispered you before.
Messages that exceed the maximum length are truncated.
type WhispersResource ¶
type WhispersResource struct {
// contains filtered or unexported fields
}
func NewWhispersResource ¶
func NewWhispersResource(client *Client) *WhispersResource
func (*WhispersResource) Insert ¶
func (r *WhispersResource) Insert(senderId, recipientId string) *WhispersInsertCall
Source Files
¶
- client.go
- options.go
- twitch_ads.go
- twitch_analytics.go
- twitch_bits.go
- twitch_channel_points.go
- twitch_channels.go
- twitch_charity.go
- twitch_chat.go
- twitch_clips.go
- twitch_conduit_shards.go
- twitch_conduits.go
- twitch_entitlements.go
- twitch_eventsub.go
- twitch_extensions.go
- twitch_games.go
- twitch_goals.go
- twitch_guest_star.go
- twitch_hype_train.go
- twitch_moderation.go
- twitch_polls.go
- twitch_predictions.go
- twitch_raids.go
- twitch_schedule.go
- twitch_search.go
- twitch_streams.go
- twitch_subscriptions.go
- twitch_tags.go
- twitch_teams.go
- twitch_users.go
- twitch_videos.go
- twitch_whispers.go
- types.go