2021-01-28 23:25:14 +00:00
|
|
|
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
|
|
|
|
|
|
|
import "github.com/SevereCloud/vksdk/v2/object"
|
|
|
|
|
|
|
|
// PollsAddVote adds the current user's vote to the selected answer in the poll.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.addVote
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsAddVote(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.addVote", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsCreateResponse struct.
|
|
|
|
type PollsCreateResponse object.PollsPoll
|
|
|
|
|
|
|
|
// PollsCreate creates polls that can be attached to the users' or communities' posts.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.create
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsCreate(params Params) (response PollsCreateResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.create", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsDeleteVote deletes the current user's vote from the selected answer in the poll.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.deleteVote
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsDeleteVote(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.deleteVote", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsEdit edits created polls.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.edit
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsEdit(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.edit", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsGetBackgroundsResponse struct.
|
|
|
|
type PollsGetBackgroundsResponse []object.PollsBackground
|
|
|
|
|
|
|
|
// PollsGetBackgrounds return default backgrounds for polls.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.getBackgrounds
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsGetBackgrounds(params Params) (response PollsGetBackgroundsResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.getBackgrounds", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsGetByIDResponse struct.
|
|
|
|
type PollsGetByIDResponse object.PollsPoll
|
|
|
|
|
|
|
|
// PollsGetByID returns detailed information about a poll by its ID.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.getById
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsGetByID(params Params) (response PollsGetByIDResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.getById", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsGetPhotoUploadServerResponse struct.
|
|
|
|
type PollsGetPhotoUploadServerResponse struct {
|
|
|
|
UploadURL string `json:"upload_url"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsGetPhotoUploadServer returns a URL for uploading a photo to a poll.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.getPhotoUploadServer
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsGetPhotoUploadServer(params Params) (response PollsGetPhotoUploadServerResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.getPhotoUploadServer", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsGetVotersResponse struct.
|
|
|
|
type PollsGetVotersResponse []object.PollsVoters
|
|
|
|
|
|
|
|
// PollsGetVoters returns a list of IDs of users who selected specific answers in the poll.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.getVoters
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsGetVoters(params Params) (response PollsGetVotersResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.getVoters", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsGetVotersFieldsResponse struct.
|
|
|
|
type PollsGetVotersFieldsResponse []object.PollsVotersFields
|
|
|
|
|
|
|
|
// PollsGetVotersFields returns a list of IDs of users who selected specific answers in the poll.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.getVoters
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsGetVotersFields(params Params) (response PollsGetVotersFieldsResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.getVoters", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// PollsSavePhotoResponse struct.
|
|
|
|
type PollsSavePhotoResponse object.PollsPhoto
|
|
|
|
|
|
|
|
// PollsSavePhoto allows to save poll's uploaded photo.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/polls.savePhoto
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) PollsSavePhoto(params Params) (response PollsSavePhotoResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("polls.savePhoto", &response, params)
|
|
|
|
return
|
|
|
|
}
|