summaryrefslogtreecommitdiffstats
path: root/internal/models/x.go
blob: b4e6eacbc0101025e2a963c002fd1cca6a2663e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package models

type XResponse struct {
	Username          string        `json:"username,omitempty"`
	PreviousUsernames []UserHistory `json:"previous_usernames,omitempty"`

	Query    string      `json:"query,omitempty"`
	Response string      `json:"response,omitempty"`
	Data     interface{} `json:"data,omitempty"`

	Credits struct {
		Remaining int  `json:"remaining"`
		Unlimited bool `json:"unlimited"`
	} `json:"credits"`
	Message string `json:"message,omitempty"`
	Error   string `json:"error,omitempty"`
}

type UserHistory struct {
	Username string `json:"username"`
	TimeAgo  string `json:"time_ago"`
}

type TweetResult struct {
	Handle  string `json:"handle"`
	Name    string `json:"name"`
	Text    string `json:"text"`
	TweetID string `json:"tweet_id"`
	Type    string `json:"type"`
	URL     string `json:"url"`
}

type Progress struct {
	Current int `json:"current"`
	Total   int `json:"total"`
}

type Complete struct {
	Duration     string   `json:"duration"`
	FailedIDs    []string `json:"failed_ids"`
	TotalFailed  int      `json:"total_failed"`
	TotalFetched int      `json:"total_fetched"`
}

type TweetsStreamResponse struct {
	Username string       `json:"username,omitempty"`
	Tweet    *TweetResult `json:"tweet,omitempty"`
	Progress *Progress    `json:"progress,omitempty"`
	Complete *Complete    `json:"complete,omitempty"`
	Error    string       `json:"error,omitempty"`
}