Skip to content

Commit

Permalink
Merge pull request #103 from nicklaw5/comments
Browse files Browse the repository at this point in the history
Remove all unnecessary comments
  • Loading branch information
nicklaw5 committed Jun 28, 2021
2 parents d28dfe1 + da577e3 commit 1fa0a41
Show file tree
Hide file tree
Showing 26 changed files with 8 additions and 221 deletions.
6 changes: 0 additions & 6 deletions ads.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package helix

// AdLengthEnum ...
type AdLengthEnum int

// AdLen30 ...
const (
_ AdLengthEnum = iota * 30
AdLen30
Expand All @@ -14,25 +12,21 @@ const (
AdLen180
)

// StartCommercialParams ...
type StartCommercialParams struct {
BroadcasterID string `query:"broadcaster_id"`
Length AdLengthEnum `query:"length"`
}

// AdDetails ...
type AdDetails struct {
Length AdLengthEnum `json:"length"`
Message string `json:"message"`
RetryAfter int `json:"retry_after"`
}

// ManyAdDetails ...
type ManyAdDetails struct {
AdDetails []AdDetails `json:"data"`
}

// StartCommercialResponse ...
type StartCommercialResponse struct {
ResponseCommon
Data ManyAdDetails
Expand Down
8 changes: 0 additions & 8 deletions analytics.go
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
package helix

// ExtensionAnalytic ...
type ExtensionAnalytic struct {
ExtensionID string `json:"extension_id"`
URL string `json:"URL"`
Type string `json:"type"`
DateRange DateRange `json:"date_range"`
}

// ManyExtensionAnalytics ...
type ManyExtensionAnalytics struct {
ExtensionAnalytics []ExtensionAnalytic `json:"data"`
Pagination Pagination `json:"pagination"`
}

// ExtensionAnalyticsResponse ...
type ExtensionAnalyticsResponse struct {
ResponseCommon
Data ManyExtensionAnalytics
}

// ExtensionAnalyticsParams ...
type ExtensionAnalyticsParams struct {
ExtensionID string `query:"extension_id"`
First int `query:"first,20"`
Expand All @@ -45,27 +41,23 @@ func (c *Client) GetExtensionAnalytics(params *ExtensionAnalyticsParams) (*Exten
return users, nil
}

// GameAnalytic ...
type GameAnalytic struct {
GameID string `json:"game_id"`
URL string `json:"URL"`
Type string `json:"type"`
DateRange DateRange `json:"date_range"`
}

// ManyGameAnalytics ...
type ManyGameAnalytics struct {
GameAnalytics []GameAnalytic `json:"data"`
Pagination Pagination `json:"pagination"`
}

// GameAnalyticsResponse ...
type GameAnalyticsResponse struct {
ResponseCommon
Data ManyGameAnalytics
}

// GameAnalyticsParams ...
type GameAnalyticsParams struct {
GameID string `query:"game_id"`
First int `query:"first,20"`
Expand Down
10 changes: 0 additions & 10 deletions authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ var authPaths = map[string]string{
"validate": "/validate",
}

// AuthorizationURLParams ...
type AuthorizationURLParams struct {
ResponseType string // (Required) Options: "code" or "token"
Scopes []string // (Required)
State string // (Optional)
ForceVerify bool // (Optional)
}

// GetAuthorizationURL ...
func (c *Client) GetAuthorizationURL(params *AuthorizationURLParams) string {
url := AuthBaseURL + "/authorize"
url += "?response_type=" + params.ResponseType
Expand All @@ -41,21 +39,18 @@ func (c *Client) GetAuthorizationURL(params *AuthorizationURLParams) string {
return url
}

// AccessCredentials ...
type AccessCredentials struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
ExpiresIn int `json:"expires_in"`
Scopes []string `json:"scope"`
}

// AppAccessTokenResponse ...
type AppAccessTokenResponse struct {
ResponseCommon
Data AccessCredentials
}

// RequestAppAccessToken ...
func (c *Client) RequestAppAccessToken(scopes []string) (*AppAccessTokenResponse, error) {
opts := c.opts
data := &accessTokenRequestData{
Expand All @@ -81,7 +76,6 @@ func (c *Client) RequestAppAccessToken(scopes []string) (*AppAccessTokenResponse
return token, nil
}

// UserAccessTokenResponse ...
type UserAccessTokenResponse struct {
ResponseCommon
Data AccessCredentials
Expand All @@ -96,7 +90,6 @@ type accessTokenRequestData struct {
Scopes string `query:"scope"`
}

// RequestUserAccessToken ...
func (c *Client) RequestUserAccessToken(code string) (*UserAccessTokenResponse, error) {
opts := c.opts
data := &accessTokenRequestData{
Expand All @@ -122,7 +115,6 @@ func (c *Client) RequestUserAccessToken(code string) (*UserAccessTokenResponse,
return token, nil
}

// RefreshTokenResponse ...
type RefreshTokenResponse struct {
ResponseCommon
Data AccessCredentials
Expand Down Expand Up @@ -163,7 +155,6 @@ func (c *Client) RefreshUserAccessToken(refreshToken string) (*RefreshTokenRespo
return refresh, nil
}

// RevokeAccessTokenResponse ...
type RevokeAccessTokenResponse struct {
ResponseCommon
}
Expand Down Expand Up @@ -195,7 +186,6 @@ func (c *Client) RevokeUserAccessToken(accessToken string) (*RevokeAccessTokenRe
return revoke, nil
}

// ValidateTokenResponse ...
type ValidateTokenResponse struct {
ResponseCommon
Data validateTokenDetails
Expand Down
13 changes: 0 additions & 13 deletions bits.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package helix

import "time"

// UserBitTotal ...
type UserBitTotal struct {
UserID string `json:"user_id"`
UserLogin string `json:"user_login"`
Expand All @@ -11,20 +10,17 @@ type UserBitTotal struct {
Score int `json:"score"`
}

// ManyUserBitTotals ...
type ManyUserBitTotals struct {
Total int `json:"total"`
DateRange DateRange `json:"date_range"`
UserBitTotals []UserBitTotal `json:"data"`
}

// BitsLeaderboardResponse ...
type BitsLeaderboardResponse struct {
ResponseCommon
Data ManyUserBitTotals
}

// BitsLeaderboardParams ...
type BitsLeaderboardParams struct {
Count int `query:"count,10"` // Maximum 100
Period string `query:"period,all"` // "all" (default), "day", "week", "month" and "year"
Expand All @@ -51,12 +47,10 @@ func (c *Client) GetBitsLeaderboard(params *BitsLeaderboardParams) (*BitsLeaderb
return bits, nil
}

// CheermotesParams ...
type CheermotesParams struct {
BroadcasterID string `query:"broadcaster_id"` // optional
}

// TierImages ...
type TierImages struct {
Image1 string `json:"1"`
Image1_5 string `json:"1.5"`
Expand All @@ -65,19 +59,16 @@ type TierImages struct {
Image4 string `json:"4"`
}

// TierImageTypes ...
type TierImageTypes struct {
Animated TierImages `json:"animated"`
Static TierImages `json:"static"`
}

// CheermoteTierImages ...
type CheermoteTierImages struct {
Dark TierImageTypes `json:"dark"`
Light TierImageTypes `json:"light"`
}

// CheermoteTiers ...
type CheermoteTiers struct {
MinBits uint `json:"min_bits"`
ID string `json:"id"`
Expand All @@ -87,7 +78,6 @@ type CheermoteTiers struct {
ShowInBitsCard bool `json:"show_in_bits_card"`
}

// Cheermotes ...
type Cheermotes struct {
Prefix string `json:"prefix"`
Tiers []CheermoteTiers `json:"tiers"`
Expand All @@ -97,18 +87,15 @@ type Cheermotes struct {
IsCharitable bool `json:"is_charitable"`
}

// ManyCheermotes ...
type ManyCheermotes struct {
Cheermotes []Cheermotes `json:"data"`
}

// CheermotesResponse ...
type CheermotesResponse struct {
ResponseCommon
Data ManyCheermotes
}

// GetCheermotes ...
func (c *Client) GetCheermotes(params *CheermotesParams) (*CheermotesResponse, error) {
resp, err := c.get("/bits/cheermotes", &ManyCheermotes{}, params)
if err != nil {
Expand Down
8 changes: 0 additions & 8 deletions channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ func (c *Client) SearchChannels(params *SearchChannelsParams) (*SearchChannelsRe
return channels, nil
}

// GetChannelInformationParams ...
type GetChannelInformationParams struct {
BroadcasterID string `query:"broadcaster_id"`
}

// EditChannelInformationParams ...
type EditChannelInformationParams struct {
BroadcasterID string `query:"broadcaster_id" json:"-"`
GameID string `json:"game_id"`
Expand All @@ -65,23 +63,19 @@ type EditChannelInformationParams struct {
Delay int `json:"delay,omitempty"`
}

// GetChannelInformationResponse ...
type GetChannelInformationResponse struct {
ResponseCommon
Data ManyChannelInformation
}

// EditChannelInformationResponse ...
type EditChannelInformationResponse struct {
ResponseCommon
}

// ManyChannelInformation ...
type ManyChannelInformation struct {
Channels []ChannelInformation `json:"data"`
}

// ChannelInformation ...
type ChannelInformation struct {
BroadcasterID string `json:"broadcaster_id"`
BroadcasterName string `json:"broadcaster_name"`
Expand All @@ -92,7 +86,6 @@ type ChannelInformation struct {
Delay int `json:"delay"`
}

// GetChannelInformation ...
func (c *Client) GetChannelInformation(params *GetChannelInformationParams) (*GetChannelInformationResponse, error) {
resp, err := c.get("/channels", &ManyChannelInformation{}, params)
if err != nil {
Expand All @@ -106,7 +99,6 @@ func (c *Client) GetChannelInformation(params *GetChannelInformationParams) (*Ge
return channels, nil
}

// EditChannelInformation ...
func (c *Client) EditChannelInformation(params *EditChannelInformationParams) (*EditChannelInformationResponse, error) {
resp, err := c.patchAsJSON("/channels", &EditChannelInformationResponse{}, params)
if err != nil {
Expand Down
3 changes: 0 additions & 3 deletions channels_editors.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package helix

// ChannelEditorParams ...
type ChannelEditorsParams struct {
BroadcasterID string `query:"broadcaster_id"`
}

// ManyChannelEditors ...
type ManyChannelEditors struct {
ChannelEditors []ChannelEditor `json:"data"`
}
Expand All @@ -17,7 +15,6 @@ type ChannelEditor struct {
CreatedAt Time `json:"created_at"`
}

// ChannelEditorsResponse ...
type ChannelEditorsResponse struct {
ResponseCommon
Data ManyChannelEditors
Expand Down
8 changes: 0 additions & 8 deletions channels_points.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package helix

// ChannelCustomRewardsParams ...
type ChannelCustomRewardsParams struct {
BroadcasterID string `query:"broadcaster_id"`
Title string `json:"title"`
Expand All @@ -18,12 +17,10 @@ type ChannelCustomRewardsParams struct {
ShouldRedemptionsSkipRequestQueue bool `json:"should_redemptions_skip_request_queue"`
}

// ChannelCustomRewards ...
type ManyChannelCustomRewards struct {
ChannelCustomRewards []ChannelCustomReward `json:"data"`
}

// ChannelCustomReward ...
type ChannelCustomReward struct {
BroadcasterID string `json:"broadcaster_id"`
BroadcasterLogin string `json:"broadcaster_login"`
Expand All @@ -46,32 +43,27 @@ type ChannelCustomReward struct {
CooldownExpiresAt string `json:"cooldown_expires_at"`
}

// RewardImage ...
type RewardImage struct {
Url1x string `json:"url_1x"`
Url2x string `json:"url_2x"`
Url4x string `json:"url_4x"`
}

// MaxPerUserPerStreamSettings ...
type MaxPerUserPerStreamSettings struct {
IsEnabled bool `json:"is_enabled"`
MaxPerUserPerStream int `json:"max_per_user_per_stream"`
}

// MaxPerStreamSettings ...
type MaxPerStreamSettings struct {
IsEnabled bool `json:"is_enabled"`
MaxPerStream int `json:"max_per_stream"`
}

// GlobalCooldownSettings ...
type GlobalCooldownSettings struct {
IsEnabled bool `json:"is_enabled"`
GlobalCooldownSeconds int `json:"global_cooldown_seconds"`
}

// ChannelCustomRewardResponse ...
type ChannelCustomRewardResponse struct {
ResponseCommon
Data ManyChannelCustomRewards
Expand Down

0 comments on commit 1fa0a41

Please sign in to comment.