go-twitch/api/users/models.go

123 lines
3.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 dictionarys key is a sequential number beginning with 1.
// The following fields contain the panels data for each key.
Panel map[string]ExtensionData `json:"panel"`
// A dictionary that contains the data for a video-overlay extension.
// The dictionarys key is a sequential number beginning with 1.
// The following fields contain the overlays data for each key.
Overlay map[string]ExtensionData `json:"overlay"`
// A dictionary that contains the data for a video-component extension.
// The dictionarys key is a sequential number beginning with 1.
// The following fields contain the components data for each key.
Component map[string]ComponentExtensionData `json:"component"`
}
type ExtensionData struct {
// A Boolean value that determines the extensions 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 extensions version.
Version string `json:"version"`
// The extensions 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"`
}