forked from SevereCloud/vksdk
/
appwidgets.go
139 lines (123 loc) · 4.65 KB
/
appwidgets.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
package api // import "github.com/akss1/vksdk/5.92/api"
// AppWidgetsGetAppImageUploadServerResponse struct
type AppWidgetsGetAppImageUploadServerResponse struct {
UploadURL string `json:"upload_url"`
}
// AppWidgetsGetAppImageUploadServer returns a URL for uploading a
// photo to the app collection for community app widgets.
//
// https://vk.com/dev/appWidgets.getAppImageUploadServer
func (vk *VK) AppWidgetsGetAppImageUploadServer(params map[string]string) (response AppWidgetsGetAppImageUploadServerResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.getAppImageUploadServer", params, &response, &vkErr)
return
}
// AppWidgetsGetAppImagesResponse struct
type AppWidgetsGetAppImagesResponse struct {
Count int `json:"count"`
Items []struct {
ID string `json:"id"`
Type string `json:"type"`
Images struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"images"`
} `json:"items"`
}
// AppWidgetsGetAppImages returns an app collection of images for community app widgets.
//
// https://vk.com/dev/appWidgets.getAppImages
func (vk *VK) AppWidgetsGetAppImages(params map[string]string) (response AppWidgetsGetAppImagesResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.getAppImages", params, &response, &vkErr)
return
}
// AppWidgetsGetGroupImageUploadServerResponse struct
type AppWidgetsGetGroupImageUploadServerResponse struct {
UploadURL string `json:"upload_url"`
}
// AppWidgetsGetGroupImageUploadServer returns a URL for uploading
// a photo to the community collection for community app widgets.
//
// https://vk.com/dev/appWidgets.getGroupImageUploadServer
func (vk *VK) AppWidgetsGetGroupImageUploadServer(params map[string]string) (response AppWidgetsGetGroupImageUploadServerResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.getGroupImageUploadServer", params, &response, &vkErr)
return
}
// AppWidgetsGetGroupImagesResponse struct
type AppWidgetsGetGroupImagesResponse struct {
Count int `json:"count"`
Items []struct {
ID string `json:"id"`
Type string `json:"type"`
Images struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"images"`
} `json:"items"`
}
// AppWidgetsGetGroupImages returns a community collection of images for community app widgets.
//
// https://vk.com/dev/appWidgets.getGroupImages
func (vk *VK) AppWidgetsGetGroupImages(params map[string]string) (response AppWidgetsGetGroupImagesResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.getGroupImages", params, &response, &vkErr)
return
}
// AppWidgetsGetImagesByIDResponse struct
type AppWidgetsGetImagesByIDResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Images struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"images"`
}
// AppWidgetsGetImagesByID returns an image for community app widgets by its ID.
//
// https://vk.com/dev/appWidgets.getImagesById
func (vk *VK) AppWidgetsGetImagesByID(params map[string]string) (response AppWidgetsGetImagesByIDResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.getImagesById", params, &response, &vkErr)
return
}
// AppWidgetsSaveAppImageResponse struct
type AppWidgetsSaveAppImageResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Images struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"images"`
}
// AppWidgetsSaveAppImage allows to save image into app collection for community app widgets.
//
// https://vk.com/dev/appWidgets.saveAppImage
func (vk *VK) AppWidgetsSaveAppImage(params map[string]string) (response AppWidgetsSaveAppImageResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.saveAppImage", params, &response, &vkErr)
return
}
// AppWidgetsSaveGroupImageResponse struct
type AppWidgetsSaveGroupImageResponse struct {
ID string `json:"id"`
Type string `json:"type"`
Images struct {
URL string `json:"url"`
Width int `json:"width"`
Height int `json:"height"`
} `json:"images"`
}
// AppWidgetsSaveGroupImage allows to save image into community collection for community app widgets.
//
// https://vk.com/dev/appWidgets.saveGroupImage
func (vk *VK) AppWidgetsSaveGroupImage(params map[string]string) (response AppWidgetsSaveGroupImageResponse, vkErr Error) {
vk.RequestUnmarshal("appWidgets.saveGroupImage", params, &response, &vkErr)
return
}
// AppWidgetsUpdate allows to update community app widget.
//
// https://vk.com/dev/appWidgets.update
func (vk *VK) AppWidgetsUpdate(params map[string]string) (response int, vkErr Error) {
vk.RequestUnmarshal("appWidgets.update", params, &response, &vkErr)
return
}