Update types
authorMikael Berthe <mikael@lilotux.net>
Wed, 21 Mar 2018 01:00:57 +0100
changeset 219 98697242c4a0
parent 218 22ed9de1c5fe
child 220 8794323cabbe
Update types I've commented out showing_reblogs since Mastodon 2.2.0 uses weak typing -- seems to be fixed in 2.3.1.
types.go
--- a/types.go	Wed Mar 21 00:27:10 2018 +0100
+++ b/types.go	Wed Mar 21 01:00:57 2018 +0100
@@ -42,6 +42,7 @@
 	URL            string    `json:"url"`
 	Avatar         string    `json:"avatar"`
 	AvatarStatic   string    `json:"avatar_static"`
+	Header         string    `json:"header"`
 	HeaderStatic   string    `json:"header_static"`
 	Locked         bool      `json:"locked"`
 	CreatedAt      time.Time `json:"created_at"`
@@ -61,7 +62,7 @@
 	Website string `json:"website"`
 }
 
-// Attachment represents a Mastodon attachement entity
+// Attachment represents a Mastodon media attachment entity
 type Attachment struct {
 	ID         int64   `json:"id,string"`
 	Type       string  `json:"type"`
@@ -86,7 +87,7 @@
 	Description *string `json:"description"`
 }
 
-// Card represents a Mastodon card entity
+// Card represents a Mastodon preview card entity
 type Card struct {
 	URL          string  `json:"url"`
 	Title        string  `json:"title"`
@@ -97,6 +98,7 @@
 	AuthorURL    *string `json:"author_url"`
 	ProviderName *string `json:"provider_name"`
 	ProviderURL  *string `json:"provider_url"`
+	EmbedURL     *string `json:"embed_url"`
 	HTML         *string `json:"html"`
 	Width        *int    `json:"width"`
 	Height       *int    `json:"height"`
@@ -167,14 +169,15 @@
 
 // Relationship represents a Mastodon relationship entity
 type Relationship struct {
-	ID                  int64 `json:"id,string"`
-	Following           bool  `json:"following"`
-	FollowedBy          bool  `json:"followed_by"`
-	Blocking            bool  `json:"blocking"`
-	Muting              bool  `json:"muting"`
-	Requested           bool  `json:"requested"`
-	DomainBlocking      bool  `jsin:"domain_blocking"`
-	MutingNotifications bool  `json:"muting_notifications"`
+	ID        int64 `json:"id,string"`
+	Following bool  `json:"following"`
+	//ShowingReblogs      bool  `json:"showing_reblogs"` // Incoherent type
+	FollowedBy          bool `json:"followed_by"`
+	Blocking            bool `json:"blocking"`
+	Muting              bool `json:"muting"`
+	Requested           bool `json:"requested"`
+	DomainBlocking      bool `jsin:"domain_blocking"`
+	MutingNotifications bool `json:"muting_notifications"`
 }
 
 // Report represents a Mastodon report entity
@@ -183,7 +186,7 @@
 	ActionTaken string `json:"action_taken"`
 }
 
-// Results represents a Mastodon results entity
+// Results represents a Mastodon search results entity
 type Results struct {
 	Accounts []Account `json:"accounts"`
 	Statuses []Status  `json:"statuses"`
@@ -206,8 +209,8 @@
 	Reblogged          bool         `json:"reblogged"`
 	Favourited         bool         `json:"favourited"`
 	Muted              bool         `json:"muted"`
+	Pinned             bool         `json:"pinned"`
 	Sensitive          bool         `json:"sensitive"`
-	Pinned             bool         `json:"pinned"`
 	SpoilerText        string       `json:"spoiler_text"`
 	Visibility         string       `json:"visibility"`
 	MediaAttachments   []Attachment `json:"media_attachments"`