123 lines
3.3 KiB
Go
123 lines
3.3 KiB
Go
|
package users
|
|||
|
|
|||
|
import "time"
|
|||
|
|
|||
|
type User struct {
|
|||
|
// An ID that identifies the user.
|
|||
|
ID string `json:"id"`
|
|||
|
|
|||
|
// The user's login name.
|
|||
|
Login string `json:"login"`
|
|||
|
|
|||
|
// The user's display name.
|
|||
|
DisplayName string `json:"display_name"`
|
|||
|
|
|||
|
// The type of user. Possible values are:
|
|||
|
//
|
|||
|
// admin — Twitch administrator
|
|||
|
//
|
|||
|
// global_mod
|
|||
|
//
|
|||
|
// staff — Twitch staff
|
|||
|
//
|
|||
|
// "" — Normal user
|
|||
|
Type Type `json:"type"`
|
|||
|
|
|||
|
// The type of broadcaster. Possible values are:
|
|||
|
//
|
|||
|
// affiliate — An affiliate broadcaster
|
|||
|
//
|
|||
|
// partner — A partner broadcaster
|
|||
|
//
|
|||
|
// "" — A normal broadcaster
|
|||
|
BroadcasterType BroadcasterType `json:"broadcaster_type"`
|
|||
|
|
|||
|
// The user's description of their channel.
|
|||
|
Description string `json:"description"`
|
|||
|
|
|||
|
// A URL to the user's profile image.
|
|||
|
ProfileImageUrl string `json:"profile_image_url"`
|
|||
|
|
|||
|
// A URL to the user's offline image.
|
|||
|
OfflineImageUrl string `json:"offline_image_url"`
|
|||
|
|
|||
|
// The user's verified email address. The object includes this field only if the user access token includes the user:read:email scope.
|
|||
|
//
|
|||
|
// If the request contains more than one user, only the user associated with the access token that provided consent will include an email address —
|
|||
|
// the email address for all other users will be empty.
|
|||
|
Email *string `json:"email"`
|
|||
|
|
|||
|
// The UTC date and time that the user's account was created. The timestamp is in RFC3339 format.
|
|||
|
CreatedAt time.Time `json:"created_at"`
|
|||
|
}
|
|||
|
|
|||
|
type Type string
|
|||
|
|
|||
|
const (
|
|||
|
// Twitch administrator
|
|||
|
TypeAdmin Type = "admin"
|
|||
|
|
|||
|
// Twitch global moderator
|
|||
|
TypeGlobalMod Type = "global_mod"
|
|||
|
|
|||
|
// Twitch staff
|
|||
|
TypeStaff Type = "staff"
|
|||
|
|
|||
|
// Normal user
|
|||
|
TypeNormal Type = ""
|
|||
|
)
|
|||
|
|
|||
|
type BroadcasterType string
|
|||
|
|
|||
|
const (
|
|||
|
// An affiliate broadcaster
|
|||
|
BroadcasterTypeAffiliate BroadcasterType = "affiliate"
|
|||
|
|
|||
|
// A partner broadcaster
|
|||
|
BroadcasterTypePartner BroadcasterType = "partner"
|
|||
|
|
|||
|
// A normal broadcaster
|
|||
|
BroadcasterTypeNormal BroadcasterType = ""
|
|||
|
)
|
|||
|
|
|||
|
type ActiveExtension struct {
|
|||
|
// A dictionary that contains the data for a panel extension.
|
|||
|
// The dictionary’s key is a sequential number beginning with 1.
|
|||
|
// The following fields contain the panel’s data for each key.
|
|||
|
Panel map[string]ExtensionData `json:"panel"`
|
|||
|
|
|||
|
// A dictionary that contains the data for a video-overlay extension.
|
|||
|
// The dictionary’s key is a sequential number beginning with 1.
|
|||
|
// The following fields contain the overlay’s data for each key.
|
|||
|
Overlay map[string]ExtensionData `json:"overlay"`
|
|||
|
|
|||
|
// A dictionary that contains the data for a video-component extension.
|
|||
|
// The dictionary’s key is a sequential number beginning with 1.
|
|||
|
// The following fields contain the component’s data for each key.
|
|||
|
Component map[string]ComponentExtensionData `json:"component"`
|
|||
|
}
|
|||
|
|
|||
|
type ExtensionData struct {
|
|||
|
// A Boolean value that determines the extension’s activation state. If false, the user has not configured this panel extension.
|
|||
|
Active bool `json:"active"`
|
|||
|
|
|||
|
// An ID that identifies the extension.
|
|||
|
ID string `json:"id"`
|
|||
|
|
|||
|
// The extension’s version.
|
|||
|
Version string `json:"version"`
|
|||
|
|
|||
|
// The extension’s name.
|
|||
|
Name string `json:"name"`
|
|||
|
}
|
|||
|
|
|||
|
type ComponentExtensionData struct {
|
|||
|
ExtensionData `json:",inline"`
|
|||
|
|
|||
|
// The x-coordinate where the extension is placed.
|
|||
|
X int `json:"x"`
|
|||
|
|
|||
|
// The y-coordinate where the extension is placed.
|
|||
|
Y int `json:"y"`
|
|||
|
}
|