types.go
changeset 196 21519d54dd4c
parent 190 0684ddad598c
child 200 67bae6c005d9
equal deleted inserted replaced
195:21994b03e339 196:21519d54dd4c
    29 // DomainName is a domain name string, as returned by the domain_blocks API
    29 // DomainName is a domain name string, as returned by the domain_blocks API
    30 type DomainName string
    30 type DomainName string
    31 
    31 
    32 // Account represents a Mastodon account entity
    32 // Account represents a Mastodon account entity
    33 type Account struct {
    33 type Account struct {
    34 	ID             int64     `json:"id"`
    34 	ID             int64     `json:"id,string"`
    35 	Username       string    `json:"username"`
    35 	Username       string    `json:"username"`
    36 	Acct           string    `json:"acct"`
    36 	Acct           string    `json:"acct"`
    37 	DisplayName    string    `json:"display_name"`
    37 	DisplayName    string    `json:"display_name"`
    38 	Note           string    `json:"note"`
    38 	Note           string    `json:"note"`
    39 	URL            string    `json:"url"`
    39 	URL            string    `json:"url"`
    53 	Website string `json:"website"`
    53 	Website string `json:"website"`
    54 }
    54 }
    55 
    55 
    56 // Attachment represents a Mastodon attachement entity
    56 // Attachment represents a Mastodon attachement entity
    57 type Attachment struct {
    57 type Attachment struct {
    58 	ID         int64   `json:"id"`
    58 	ID         int64   `json:"id,string"`
    59 	Type       string  `json:"type"`
    59 	Type       string  `json:"type"`
    60 	URL        string  `json:"url"`
    60 	URL        string  `json:"url"`
    61 	RemoteURL  *string `json:"remote_url"`
    61 	RemoteURL  *string `json:"remote_url"`
    62 	PreviewURL string  `json:"preview_url"`
    62 	PreviewURL string  `json:"preview_url"`
    63 	TextURL    *string `json:"text_url"`
    63 	TextURL    *string `json:"text_url"`
   109 	URI         string `json:"uri"`
   109 	URI         string `json:"uri"`
   110 	Title       string `json:"title"`
   110 	Title       string `json:"title"`
   111 	Description string `json:"description"`
   111 	Description string `json:"description"`
   112 	Email       string `json:"email"`
   112 	Email       string `json:"email"`
   113 	Version     string `json:"version"`
   113 	Version     string `json:"version"`
       
   114 
       
   115 	URLs struct {
       
   116 		SteamingAPI string `json:"streaming_api"`
       
   117 	} `json:"urls"`
       
   118 	Stats struct {
       
   119 		UserCount   int64 `json:"user_count"`
       
   120 		StatusCount int64 `json:"status_count"`
       
   121 		DomainCount int64 `json:"domain_count"`
       
   122 	} `json:"stats"`
       
   123 	Thumbnail *string `json:"thumbnail"`
   114 }
   124 }
   115 
   125 
   116 // Mention represents a Mastodon mention entity
   126 // Mention represents a Mastodon mention entity
   117 type Mention struct {
   127 type Mention struct {
   118 	ID       int64  `json:"id"`
   128 	ID       int64  `json:"id,string"`
   119 	URL      string `json:"url"`
   129 	URL      string `json:"url"`
   120 	Username string `json:"username"`
   130 	Username string `json:"username"`
   121 	Acct     string `json:"acct"`
   131 	Acct     string `json:"acct"`
   122 }
   132 }
   123 
   133 
   124 // Notification represents a Mastodon notification entity
   134 // Notification represents a Mastodon notification entity
   125 type Notification struct {
   135 type Notification struct {
   126 	ID        int64     `json:"id"`
   136 	ID        int64     `json:"id,string"`
   127 	Type      string    `json:"type"`
   137 	Type      string    `json:"type"`
   128 	CreatedAt time.Time `json:"created_at"`
   138 	CreatedAt time.Time `json:"created_at"`
   129 	Account   *Account  `json:"account"`
   139 	Account   *Account  `json:"account"`
   130 	Status    *Status   `json:"status"`
   140 	Status    *Status   `json:"status"`
   131 }
   141 }
   132 
   142 
   133 // Relationship represents a Mastodon relationship entity
   143 // Relationship represents a Mastodon relationship entity
   134 type Relationship struct {
   144 type Relationship struct {
   135 	ID             int64 `json:"id"`
   145 	ID             int64 `json:"id,string"`
   136 	Following      bool  `json:"following"`
   146 	Following      bool  `json:"following"`
   137 	FollowedBy     bool  `json:"followed_by"`
   147 	FollowedBy     bool  `json:"followed_by"`
   138 	Blocking       bool  `json:"blocking"`
   148 	Blocking       bool  `json:"blocking"`
   139 	Muting         bool  `json:"muting"`
   149 	Muting         bool  `json:"muting"`
   140 	Requested      bool  `json:"requested"`
   150 	Requested      bool  `json:"requested"`
   141 	DomainBlocking bool  `jsin:"domain_blocking"`
   151 	DomainBlocking bool  `jsin:"domain_blocking"`
   142 }
   152 }
   143 
   153 
   144 // Report represents a Mastodon report entity
   154 // Report represents a Mastodon report entity
   145 type Report struct {
   155 type Report struct {
   146 	ID          int64  `json:"id"`
   156 	ID          int64  `json:"id,string"`
   147 	ActionTaken string `json:"action_taken"`
   157 	ActionTaken string `json:"action_taken"`
   148 }
   158 }
   149 
   159 
   150 // Results represents a Mastodon results entity
   160 // Results represents a Mastodon results entity
   151 type Results struct {
   161 type Results struct {
   154 	Hashtags []string  `json:"hashtags"`
   164 	Hashtags []string  `json:"hashtags"`
   155 }
   165 }
   156 
   166 
   157 // Status represents a Mastodon status entity
   167 // Status represents a Mastodon status entity
   158 type Status struct {
   168 type Status struct {
   159 	ID                 int64        `json:"id"`
   169 	ID                 int64        `json:"id,string"`
   160 	URI                string       `json:"uri"`
   170 	URI                string       `json:"uri"`
   161 	URL                string       `json:"url"`
   171 	URL                string       `json:"url"`
   162 	Account            *Account     `json:"account"`
   172 	Account            *Account     `json:"account"`
   163 	InReplyToID        int64        `json:"in_reply_to_id"`
   173 	InReplyToID        *int64       `json:"in_reply_to_id,string"`
   164 	InReplyToAccountID int64        `json:"in_reply_to_account_id"`
   174 	InReplyToAccountID *int64       `json:"in_reply_to_account_id,string"`
   165 	Reblog             *Status      `json:"reblog"`
   175 	Reblog             *Status      `json:"reblog"`
   166 	Content            string       `json:"content"`
   176 	Content            string       `json:"content"`
   167 	CreatedAt          time.Time    `json:"created_at"`
   177 	CreatedAt          time.Time    `json:"created_at"`
   168 	ReblogsCount       int64        `json:"reblogs_count"`
   178 	ReblogsCount       int64        `json:"reblogs_count"`
   169 	FavouritesCount    int64        `json:"favourites_count"`
   179 	FavouritesCount    int64        `json:"favourites_count"`
   174 	SpoilerText        string       `json:"spoiler_text"`
   184 	SpoilerText        string       `json:"spoiler_text"`
   175 	Visibility         string       `json:"visibility"`
   185 	Visibility         string       `json:"visibility"`
   176 	MediaAttachments   []Attachment `json:"media_attachments"`
   186 	MediaAttachments   []Attachment `json:"media_attachments"`
   177 	Mentions           []Mention    `json:"mentions"`
   187 	Mentions           []Mention    `json:"mentions"`
   178 	Tags               []Tag        `json:"tags"`
   188 	Tags               []Tag        `json:"tags"`
   179 	Application        Application  `json:"application"`
   189 	Application        *Application `json:"application"`
   180 	Language           string       `json:"language"`
   190 	Language           *string      `json:"language"`
   181 }
   191 }
   182 
   192 
   183 // Tag represents a Mastodon tag entity
   193 // Tag represents a Mastodon tag entity
   184 type Tag struct {
   194 type Tag struct {
   185 	Name string `json:"name"`
   195 	Name string `json:"name"`