-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
utils.go
167 lines (141 loc) · 4.44 KB
/
utils.go
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
package params // import "github.com/SevereCloud/vksdk/v2/api/params"
import (
"github.com/SevereCloud/vksdk/v2/api"
)
// UtilsCheckLinkBuilder builder.
//
// Checks whether a link is blocked in VK.
//
// https://vk.com/dev/utils.checkLink
type UtilsCheckLinkBuilder struct {
api.Params
}
// NewUtilsCheckLinkBuilder func.
func NewUtilsCheckLinkBuilder() *UtilsCheckLinkBuilder {
return &UtilsCheckLinkBuilder{api.Params{}}
}
// URL link to check (e.g., 'http://google.com').
func (b *UtilsCheckLinkBuilder) URL(v string) *UtilsCheckLinkBuilder {
b.Params["url"] = v
return b
}
// UtilsDeleteFromLastShortenedBuilder builder.
//
// Deletes shortened link from user's list.
//
// https://vk.com/dev/utils.deleteFromLastShortened
type UtilsDeleteFromLastShortenedBuilder struct {
api.Params
}
// NewUtilsDeleteFromLastShortenedBuilder func.
func NewUtilsDeleteFromLastShortenedBuilder() *UtilsDeleteFromLastShortenedBuilder {
return &UtilsDeleteFromLastShortenedBuilder{api.Params{}}
}
// Key link (characters after vk.cc/).
func (b *UtilsDeleteFromLastShortenedBuilder) Key(v string) *UtilsDeleteFromLastShortenedBuilder {
b.Params["key"] = v
return b
}
// UtilsGetLastShortenedLinksBuilder builder.
//
// Returns a list of user's shortened links.
//
// https://vk.com/dev/utils.getLastShortenedLinks
type UtilsGetLastShortenedLinksBuilder struct {
api.Params
}
// NewUtilsGetLastShortenedLinksBuilder func.
func NewUtilsGetLastShortenedLinksBuilder() *UtilsGetLastShortenedLinksBuilder {
return &UtilsGetLastShortenedLinksBuilder{api.Params{}}
}
// Count number of links to return.
func (b *UtilsGetLastShortenedLinksBuilder) Count(v int) *UtilsGetLastShortenedLinksBuilder {
b.Params["count"] = v
return b
}
// Offset needed to return a specific subset of links.
func (b *UtilsGetLastShortenedLinksBuilder) Offset(v int) *UtilsGetLastShortenedLinksBuilder {
b.Params["offset"] = v
return b
}
// UtilsGetLinkStatsBuilder builder.
//
// Returns stats data for shortened link.
//
// https://vk.com/dev/utils.getLinkStats
type UtilsGetLinkStatsBuilder struct {
api.Params
}
// NewUtilsGetLinkStatsBuilder func.
func NewUtilsGetLinkStatsBuilder() *UtilsGetLinkStatsBuilder {
return &UtilsGetLinkStatsBuilder{api.Params{}}
}
// Key link (characters after vk.cc/).
func (b *UtilsGetLinkStatsBuilder) Key(v string) *UtilsGetLinkStatsBuilder {
b.Params["key"] = v
return b
}
// Source of scope.
func (b *UtilsGetLinkStatsBuilder) Source(v string) *UtilsGetLinkStatsBuilder {
b.Params["source"] = v
return b
}
// AccessKey access key for private link stats.
func (b *UtilsGetLinkStatsBuilder) AccessKey(v string) *UtilsGetLinkStatsBuilder {
b.Params["access_key"] = v
return b
}
// Interval parameter.
func (b *UtilsGetLinkStatsBuilder) Interval(v string) *UtilsGetLinkStatsBuilder {
b.Params["interval"] = v
return b
}
// IntervalsCount number of intervals to return.
func (b *UtilsGetLinkStatsBuilder) IntervalsCount(v int) *UtilsGetLinkStatsBuilder {
b.Params["intervals_count"] = v
return b
}
// Extended 1 — to return extended stats data (sex, age, geo). 0 — to return views number only.
func (b *UtilsGetLinkStatsBuilder) Extended(v bool) *UtilsGetLinkStatsBuilder {
b.Params["extended"] = v
return b
}
// UtilsGetShortLinkBuilder builder.
//
// Allows to receive a link shortened via vk.cc.
//
// https://vk.com/dev/utils.getShortLink
type UtilsGetShortLinkBuilder struct {
api.Params
}
// NewUtilsGetShortLinkBuilder func.
func NewUtilsGetShortLinkBuilder() *UtilsGetShortLinkBuilder {
return &UtilsGetShortLinkBuilder{api.Params{}}
}
// URL URL to be shortened.
func (b *UtilsGetShortLinkBuilder) URL(v string) *UtilsGetShortLinkBuilder {
b.Params["url"] = v
return b
}
// Private 1 — private stats, 0 — public stats.
func (b *UtilsGetShortLinkBuilder) Private(v bool) *UtilsGetShortLinkBuilder {
b.Params["private"] = v
return b
}
// UtilsResolveScreenNameBuilder builder.
//
// Detects a type of object (e.g., user, community, application) and its ID by screen name.
//
// https://vk.com/dev/utils.resolveScreenName
type UtilsResolveScreenNameBuilder struct {
api.Params
}
// NewUtilsResolveScreenNameBuilder func.
func NewUtilsResolveScreenNameBuilder() *UtilsResolveScreenNameBuilder {
return &UtilsResolveScreenNameBuilder{api.Params{}}
}
// ScreenName of the user, community (e.g., 'apiclub,' 'andrew', or 'rules_of_war'), or application.
func (b *UtilsResolveScreenNameBuilder) ScreenName(v string) *UtilsResolveScreenNameBuilder {
b.Params["screen_name"] = v
return b
}