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
|
package api // import "github.com/SevereCloud/vksdk/v2/api"
import (
"github.com/SevereCloud/vksdk/v2/object"
)
// DocsAdd copies a document to a user's or community's document list.
//
// https://vk.com/dev/docs.add
func (vk *VK) DocsAdd(params Params) (response int, err error) {
err = vk.RequestUnmarshal("docs.add", &response, params)
return
}
// DocsDelete deletes a user or community document.
//
// https://vk.com/dev/docs.delete
func (vk *VK) DocsDelete(params Params) (response int, err error) {
err = vk.RequestUnmarshal("docs.delete", &response, params)
return
}
// DocsEdit edits a document.
//
// https://vk.com/dev/docs.edit
func (vk *VK) DocsEdit(params Params) (response int, err error) {
err = vk.RequestUnmarshal("docs.edit", &response, params)
return
}
// DocsGetResponse struct.
type DocsGetResponse struct {
Count int `json:"count"`
Items []object.DocsDoc `json:"items"`
}
// DocsGet returns detailed information about user or community documents.
//
// https://vk.com/dev/docs.get
func (vk *VK) DocsGet(params Params) (response DocsGetResponse, err error) {
err = vk.RequestUnmarshal("docs.get", &response, params)
return
}
// DocsGetByIDResponse struct.
type DocsGetByIDResponse []object.DocsDoc
// DocsGetByID returns information about documents by their IDs.
//
// https://vk.com/dev/docs.getById
func (vk *VK) DocsGetByID(params Params) (response DocsGetByIDResponse, err error) {
err = vk.RequestUnmarshal("docs.getById", &response, params)
return
}
// DocsGetMessagesUploadServerResponse struct.
type DocsGetMessagesUploadServerResponse struct {
UploadURL string `json:"upload_url"`
}
// DocsGetMessagesUploadServer returns the server address for document upload.
//
// https://vk.com/dev/docs.getMessagesUploadServer
func (vk *VK) DocsGetMessagesUploadServer(params Params) (response DocsGetMessagesUploadServerResponse, err error) {
err = vk.RequestUnmarshal("docs.getMessagesUploadServer", &response, params)
return
}
// DocsGetTypesResponse struct.
type DocsGetTypesResponse struct {
Count int `json:"count"`
Items []object.DocsDocTypes `json:"items"`
}
// DocsGetTypes returns documents types available for current user.
//
// https://vk.com/dev/docs.getTypes
func (vk *VK) DocsGetTypes(params Params) (response DocsGetTypesResponse, err error) {
err = vk.RequestUnmarshal("docs.getTypes", &response, params)
return
}
// DocsGetUploadServerResponse struct.
type DocsGetUploadServerResponse struct {
UploadURL string `json:"upload_url"`
}
// DocsGetUploadServer returns the server address for document upload.
//
// https://vk.com/dev/docs.getUploadServer
func (vk *VK) DocsGetUploadServer(params Params) (response DocsGetUploadServerResponse, err error) {
err = vk.RequestUnmarshal("docs.getUploadServer", &response, params)
return
}
// DocsGetWallUploadServerResponse struct.
type DocsGetWallUploadServerResponse struct {
UploadURL string `json:"upload_url"`
}
// DocsGetWallUploadServer returns the server address for document upload onto a user's or community's wall.
//
// https://vk.com/dev/docs.getWallUploadServer
func (vk *VK) DocsGetWallUploadServer(params Params) (response DocsGetWallUploadServerResponse, err error) {
err = vk.RequestUnmarshal("docs.getWallUploadServer", &response, params)
return
}
// DocsSaveResponse struct.
type DocsSaveResponse struct {
Type string `json:"type"`
AudioMessage object.MessagesAudioMessage `json:"audio_message"`
Doc object.DocsDoc `json:"doc"`
Graffiti object.MessagesGraffiti `json:"graffiti"`
}
// DocsSave saves a document after uploading it to a server.
//
// https://vk.com/dev/docs.save
func (vk *VK) DocsSave(params Params) (response DocsSaveResponse, err error) {
err = vk.RequestUnmarshal("docs.save", &response, params)
return
}
// DocsSearchResponse struct.
type DocsSearchResponse struct {
Count int `json:"count"`
Items []object.DocsDoc `json:"items"`
}
// DocsSearch returns a list of documents matching the search criteria.
//
// https://vk.com/dev/docs.search
func (vk *VK) DocsSearch(params Params) (response DocsSearchResponse, err error) {
err = vk.RequestUnmarshal("docs.search", &response, params)
return
}
|