types.go
changeset 228 21056fc9563e
parent 221 f9228d1f4267
child 232 de13b1d39099
equal deleted inserted replaced
227:2b46eb72c78a 228:21056fc9563e
    37 // InstancePeer is a peer name, as returned by the instance/peers API
    37 // InstancePeer is a peer name, as returned by the instance/peers API
    38 type InstancePeer string
    38 type InstancePeer string
    39 
    39 
    40 // Account represents a Mastodon account entity
    40 // Account represents a Mastodon account entity
    41 type Account struct {
    41 type Account struct {
    42 	ID             int64     `json:"id,string"`
    42 	ID             int64         `json:"id,string"`
    43 	Username       string    `json:"username"`
    43 	Username       string        `json:"username"`
    44 	Acct           string    `json:"acct"`
    44 	Acct           string        `json:"acct"`
    45 	DisplayName    string    `json:"display_name"`
    45 	DisplayName    string        `json:"display_name"`
    46 	Note           string    `json:"note"`
    46 	Note           string        `json:"note"`
    47 	URL            string    `json:"url"`
    47 	URL            string        `json:"url"`
    48 	Avatar         string    `json:"avatar"`
    48 	Avatar         string        `json:"avatar"`
    49 	AvatarStatic   string    `json:"avatar_static"`
    49 	AvatarStatic   string        `json:"avatar_static"`
    50 	Header         string    `json:"header"`
    50 	Header         string        `json:"header"`
    51 	HeaderStatic   string    `json:"header_static"`
    51 	HeaderStatic   string        `json:"header_static"`
    52 	Locked         bool      `json:"locked"`
    52 	Locked         bool          `json:"locked"`
    53 	CreatedAt      time.Time `json:"created_at"`
    53 	CreatedAt      time.Time     `json:"created_at"`
    54 	FollowersCount int64     `json:"followers_count"`
    54 	FollowersCount int64         `json:"followers_count"`
    55 	FollowingCount int64     `json:"following_count"`
    55 	FollowingCount int64         `json:"following_count"`
    56 	StatusesCount  int64     `json:"statuses_count"`
    56 	StatusesCount  int64         `json:"statuses_count"`
    57 	Moved          *Account  `json:"moved"`
    57 	Moved          *Account      `json:"moved"`
    58 	Source         *struct { // Used for verify_credentials
    58 	Bot            bool          `json:"bot"`
    59 		Privacy   string `json:"privacy"`
    59 	Emojis         []Emoji       `json:"emojis"`
    60 		Sensitive bool   `json:"sensitive"`
    60 	Fields         *[]Field      `json:"fields"`
    61 		Note      string `json:"note"`
    61 	Source         *SourceParams `json:"source"`
    62 	} `json:"source"`
       
    63 }
    62 }
    64 
    63 
    65 // Application represents a Mastodon application entity
    64 // Application represents a Mastodon application entity
    66 type Application struct {
    65 type Application struct {
    67 	Name    string `json:"name"`
    66 	Name    string `json:"name"`
   182 	Blocking            bool `json:"blocking"`
   181 	Blocking            bool `json:"blocking"`
   183 	Muting              bool `json:"muting"`
   182 	Muting              bool `json:"muting"`
   184 	Requested           bool `json:"requested"`
   183 	Requested           bool `json:"requested"`
   185 	DomainBlocking      bool `jsin:"domain_blocking"`
   184 	DomainBlocking      bool `jsin:"domain_blocking"`
   186 	MutingNotifications bool `json:"muting_notifications"`
   185 	MutingNotifications bool `json:"muting_notifications"`
       
   186 	ShowingReblogs      bool `json:"showing_reblogs"`
       
   187 	Endorsed            bool `json:"endorsed"`
   187 }
   188 }
   188 
   189 
   189 // Report represents a Mastodon report entity
   190 // Report represents a Mastodon report entity
   190 type Report struct {
   191 type Report struct {
   191 	ID          int64  `json:"id,string"`
   192 	ID          int64  `json:"id,string"`
   210 	Reblog             *Status      `json:"reblog"`
   211 	Reblog             *Status      `json:"reblog"`
   211 	Content            string       `json:"content"`
   212 	Content            string       `json:"content"`
   212 	CreatedAt          time.Time    `json:"created_at"`
   213 	CreatedAt          time.Time    `json:"created_at"`
   213 	ReblogsCount       int64        `json:"reblogs_count"`
   214 	ReblogsCount       int64        `json:"reblogs_count"`
   214 	FavouritesCount    int64        `json:"favourites_count"`
   215 	FavouritesCount    int64        `json:"favourites_count"`
       
   216 	RepliesCount       int64        `json:"replies_count"`
   215 	Reblogged          bool         `json:"reblogged"`
   217 	Reblogged          bool         `json:"reblogged"`
   216 	Favourited         bool         `json:"favourited"`
   218 	Favourited         bool         `json:"favourited"`
   217 	Muted              bool         `json:"muted"`
   219 	Muted              bool         `json:"muted"`
   218 	Pinned             bool         `json:"pinned"`
   220 	Pinned             bool         `json:"pinned"`
   219 	Sensitive          bool         `json:"sensitive"`
   221 	Sensitive          bool         `json:"sensitive"`
   227 	Language           *string      `json:"language"`
   229 	Language           *string      `json:"language"`
   228 }
   230 }
   229 
   231 
   230 // Tag represents a Mastodon tag entity
   232 // Tag represents a Mastodon tag entity
   231 type Tag struct {
   233 type Tag struct {
   232 	Name string `json:"name"`
   234 	Name    string `json:"name"`
   233 	URL  string `json:"url"`
   235 	URL     string `json:"url"`
       
   236 	History []struct {
       
   237 		Day      int64 `json:"day"`
       
   238 		Uses     int64 `json:"uses"`
       
   239 		Accounts int64 `json:"accounts"`
       
   240 	} `json:"history"`
   234 }
   241 }
   235 
   242 
   236 // WeekActivity represents a Mastodon instance activity "week" entity
   243 // WeekActivity represents a Mastodon instance activity "week" entity
   237 type WeekActivity struct {
   244 type WeekActivity struct {
   238 	Week          ActivityTime `json:"week"`
   245 	Week          ActivityTime `json:"week"`
   239 	Statuses      int64        `json:"statuses,string"`
   246 	Statuses      int64        `json:"statuses,string"`
   240 	Logins        int64        `json:"logins,string"`
   247 	Logins        int64        `json:"logins,string"`
   241 	Registrations int64        `json:"registrations,string"`
   248 	Registrations int64        `json:"registrations,string"`
   242 }
   249 }
       
   250 
       
   251 // Field is a single field structure
       
   252 // (Used for the verify_credentials endpoint)
       
   253 type Field struct {
       
   254 	Name  string `json:"name"`
       
   255 	Value string `json:"value"`
       
   256 }
       
   257 
       
   258 // SourceParams is a source params structure
       
   259 type SourceParams struct { // Used for verify_credentials
       
   260 	Privacy   *string  `json:"privacy"`
       
   261 	Language  *string  `json:"language"`
       
   262 	Sensitive *bool    `json:"sensitive"`
       
   263 	Note      *string  `json:"note"`
       
   264 	Fields    *[]Field `json:"fields"`
       
   265 }