types.go
changeset 219 98697242c4a0
parent 211 12f0761e6442
child 220 8794323cabbe
equal deleted inserted replaced
218:22ed9de1c5fe 219:98697242c4a0
    40 	DisplayName    string    `json:"display_name"`
    40 	DisplayName    string    `json:"display_name"`
    41 	Note           string    `json:"note"`
    41 	Note           string    `json:"note"`
    42 	URL            string    `json:"url"`
    42 	URL            string    `json:"url"`
    43 	Avatar         string    `json:"avatar"`
    43 	Avatar         string    `json:"avatar"`
    44 	AvatarStatic   string    `json:"avatar_static"`
    44 	AvatarStatic   string    `json:"avatar_static"`
       
    45 	Header         string    `json:"header"`
    45 	HeaderStatic   string    `json:"header_static"`
    46 	HeaderStatic   string    `json:"header_static"`
    46 	Locked         bool      `json:"locked"`
    47 	Locked         bool      `json:"locked"`
    47 	CreatedAt      time.Time `json:"created_at"`
    48 	CreatedAt      time.Time `json:"created_at"`
    48 	FollowersCount int64     `json:"followers_count"`
    49 	FollowersCount int64     `json:"followers_count"`
    49 	FollowingCount int64     `json:"following_count"`
    50 	FollowingCount int64     `json:"following_count"`
    59 type Application struct {
    60 type Application struct {
    60 	Name    string `json:"name"`
    61 	Name    string `json:"name"`
    61 	Website string `json:"website"`
    62 	Website string `json:"website"`
    62 }
    63 }
    63 
    64 
    64 // Attachment represents a Mastodon attachement entity
    65 // Attachment represents a Mastodon media attachment entity
    65 type Attachment struct {
    66 type Attachment struct {
    66 	ID         int64   `json:"id,string"`
    67 	ID         int64   `json:"id,string"`
    67 	Type       string  `json:"type"`
    68 	Type       string  `json:"type"`
    68 	URL        string  `json:"url"`
    69 	URL        string  `json:"url"`
    69 	RemoteURL  *string `json:"remote_url"`
    70 	RemoteURL  *string `json:"remote_url"`
    84 		} `json:"small"`
    85 		} `json:"small"`
    85 	} `json:"meta"`
    86 	} `json:"meta"`
    86 	Description *string `json:"description"`
    87 	Description *string `json:"description"`
    87 }
    88 }
    88 
    89 
    89 // Card represents a Mastodon card entity
    90 // Card represents a Mastodon preview card entity
    90 type Card struct {
    91 type Card struct {
    91 	URL          string  `json:"url"`
    92 	URL          string  `json:"url"`
    92 	Title        string  `json:"title"`
    93 	Title        string  `json:"title"`
    93 	Description  string  `json:"description"`
    94 	Description  string  `json:"description"`
    94 	Image        string  `json:"image"`
    95 	Image        string  `json:"image"`
    95 	Type         *string `json:"type"`
    96 	Type         *string `json:"type"`
    96 	AuthorName   *string `json:"author_name"`
    97 	AuthorName   *string `json:"author_name"`
    97 	AuthorURL    *string `json:"author_url"`
    98 	AuthorURL    *string `json:"author_url"`
    98 	ProviderName *string `json:"provider_name"`
    99 	ProviderName *string `json:"provider_name"`
    99 	ProviderURL  *string `json:"provider_url"`
   100 	ProviderURL  *string `json:"provider_url"`
       
   101 	EmbedURL     *string `json:"embed_url"`
   100 	HTML         *string `json:"html"`
   102 	HTML         *string `json:"html"`
   101 	Width        *int    `json:"width"`
   103 	Width        *int    `json:"width"`
   102 	Height       *int    `json:"height"`
   104 	Height       *int    `json:"height"`
   103 }
   105 }
   104 
   106 
   165 	Status    *Status   `json:"status"`
   167 	Status    *Status   `json:"status"`
   166 }
   168 }
   167 
   169 
   168 // Relationship represents a Mastodon relationship entity
   170 // Relationship represents a Mastodon relationship entity
   169 type Relationship struct {
   171 type Relationship struct {
   170 	ID                  int64 `json:"id,string"`
   172 	ID        int64 `json:"id,string"`
   171 	Following           bool  `json:"following"`
   173 	Following bool  `json:"following"`
   172 	FollowedBy          bool  `json:"followed_by"`
   174 	//ShowingReblogs      bool  `json:"showing_reblogs"` // Incoherent type
   173 	Blocking            bool  `json:"blocking"`
   175 	FollowedBy          bool `json:"followed_by"`
   174 	Muting              bool  `json:"muting"`
   176 	Blocking            bool `json:"blocking"`
   175 	Requested           bool  `json:"requested"`
   177 	Muting              bool `json:"muting"`
   176 	DomainBlocking      bool  `jsin:"domain_blocking"`
   178 	Requested           bool `json:"requested"`
   177 	MutingNotifications bool  `json:"muting_notifications"`
   179 	DomainBlocking      bool `jsin:"domain_blocking"`
       
   180 	MutingNotifications bool `json:"muting_notifications"`
   178 }
   181 }
   179 
   182 
   180 // Report represents a Mastodon report entity
   183 // Report represents a Mastodon report entity
   181 type Report struct {
   184 type Report struct {
   182 	ID          int64  `json:"id,string"`
   185 	ID          int64  `json:"id,string"`
   183 	ActionTaken string `json:"action_taken"`
   186 	ActionTaken string `json:"action_taken"`
   184 }
   187 }
   185 
   188 
   186 // Results represents a Mastodon results entity
   189 // Results represents a Mastodon search results entity
   187 type Results struct {
   190 type Results struct {
   188 	Accounts []Account `json:"accounts"`
   191 	Accounts []Account `json:"accounts"`
   189 	Statuses []Status  `json:"statuses"`
   192 	Statuses []Status  `json:"statuses"`
   190 	Hashtags []string  `json:"hashtags"`
   193 	Hashtags []string  `json:"hashtags"`
   191 }
   194 }
   204 	ReblogsCount       int64        `json:"reblogs_count"`
   207 	ReblogsCount       int64        `json:"reblogs_count"`
   205 	FavouritesCount    int64        `json:"favourites_count"`
   208 	FavouritesCount    int64        `json:"favourites_count"`
   206 	Reblogged          bool         `json:"reblogged"`
   209 	Reblogged          bool         `json:"reblogged"`
   207 	Favourited         bool         `json:"favourited"`
   210 	Favourited         bool         `json:"favourited"`
   208 	Muted              bool         `json:"muted"`
   211 	Muted              bool         `json:"muted"`
       
   212 	Pinned             bool         `json:"pinned"`
   209 	Sensitive          bool         `json:"sensitive"`
   213 	Sensitive          bool         `json:"sensitive"`
   210 	Pinned             bool         `json:"pinned"`
       
   211 	SpoilerText        string       `json:"spoiler_text"`
   214 	SpoilerText        string       `json:"spoiler_text"`
   212 	Visibility         string       `json:"visibility"`
   215 	Visibility         string       `json:"visibility"`
   213 	MediaAttachments   []Attachment `json:"media_attachments"`
   216 	MediaAttachments   []Attachment `json:"media_attachments"`
   214 	Mentions           []Mention    `json:"mentions"`
   217 	Mentions           []Mention    `json:"mentions"`
   215 	Tags               []Tag        `json:"tags"`
   218 	Tags               []Tag        `json:"tags"`