summaryrefslogtreecommitdiffstats
path: root/internal/models/x.go
blob: 07c3117fc72af5db6756dbc6a3e0f23aca5cfed9 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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"`
}

type FirstFollower struct {
	Number   int    `json:"number"`
	Username string `json:"username"`
	Name     string `json:"name"`
}

type FirstFollowersResponse struct {
	Username  string          `json:"username"`
	Followers []FirstFollower `json:"followers"`
	Credits   struct {
		Remaining int  `json:"remaining"`
		Unlimited bool `json:"unlimited"`
	} `json:"credits"`
}

type NotableFollower struct {
	Username      string  `json:"username"`
	FollowerCount string  `json:"follower_count"`
	Score         float64 `json:"score"`
}

type NotableFollowersResponse struct {
	Username  string            `json:"username"`
	Followers []NotableFollower `json:"followers"`
	Credits   struct {
		Remaining int  `json:"remaining"`
		Unlimited bool `json:"unlimited"`
	} `json:"credits"`
}