2021-01-28 23:25:14 +00:00
|
|
|
package api // import "github.com/SevereCloud/vksdk/v2/api"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/SevereCloud/vksdk/v2/object"
|
|
|
|
)
|
|
|
|
|
2022-08-13 14:14:26 +00:00
|
|
|
// AppsAddUsersToTestingGroup method.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.addUsersToTestingGroup
|
2022-08-13 14:14:26 +00:00
|
|
|
func (vk *VK) AppsAddUsersToTestingGroup(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.addUsersToTestingGroup", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-01-28 23:25:14 +00:00
|
|
|
// AppsDeleteAppRequests deletes all request notifications from the current app.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.deleteAppRequests
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsDeleteAppRequests(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.deleteAppRequests", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetResponse struct.
|
|
|
|
type AppsGetResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []object.AppsApp `json:"items"`
|
|
|
|
object.ExtendedResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGet returns applications data.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.get
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGet(params Params) (response AppsGetResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.get", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetCatalogResponse struct.
|
|
|
|
type AppsGetCatalogResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []object.AppsApp `json:"items"`
|
|
|
|
object.ExtendedResponse
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetCatalog returns a list of applications (apps) available to users in the App Catalog.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getCatalog
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetCatalog(params Params) (response AppsGetCatalogResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getCatalog", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetFriendsListResponse struct.
|
|
|
|
type AppsGetFriendsListResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []int `json:"items"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetFriendsList creates friends list for requests and invites in current app.
|
|
|
|
//
|
2023-03-09 21:48:00 +00:00
|
|
|
// extended=0
|
2021-01-28 23:25:14 +00:00
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getFriendsList
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetFriendsList(params Params) (response AppsGetFriendsListResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getFriendsList", &response, params, Params{"extended": false})
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetFriendsListExtendedResponse struct.
|
|
|
|
type AppsGetFriendsListExtendedResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []object.UsersUser `json:"items"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetFriendsListExtended creates friends list for requests and invites in current app.
|
|
|
|
//
|
2023-03-09 21:48:00 +00:00
|
|
|
// extended=1
|
2021-01-28 23:25:14 +00:00
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getFriendsList
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetFriendsListExtended(params Params) (response AppsGetFriendsListExtendedResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getFriendsList", &response, params, Params{"extended": true})
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetLeaderboardResponse struct.
|
|
|
|
type AppsGetLeaderboardResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []object.AppsLeaderboard `json:"items"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetLeaderboard returns players rating in the game.
|
|
|
|
//
|
2023-03-09 21:48:00 +00:00
|
|
|
// extended=0
|
2021-01-28 23:25:14 +00:00
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getLeaderboard
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetLeaderboard(params Params) (response AppsGetLeaderboardResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getLeaderboard", &response, params, Params{"extended": false})
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetLeaderboardExtendedResponse struct.
|
|
|
|
type AppsGetLeaderboardExtendedResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []struct {
|
|
|
|
Score int `json:"score"`
|
|
|
|
UserID int `json:"user_id"`
|
|
|
|
} `json:"items"`
|
|
|
|
Profiles []object.UsersUser `json:"profiles"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetLeaderboardExtended returns players rating in the game.
|
|
|
|
//
|
2023-03-09 21:48:00 +00:00
|
|
|
// extended=1
|
2021-01-28 23:25:14 +00:00
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getLeaderboard
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetLeaderboardExtended(params Params) (response AppsGetLeaderboardExtendedResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getLeaderboard", &response, params, Params{"extended": true})
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetScopesResponse struct.
|
|
|
|
type AppsGetScopesResponse struct {
|
|
|
|
Count int `json:"count"`
|
|
|
|
Items []object.AppsScope `json:"items"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetScopes ...
|
|
|
|
//
|
|
|
|
// TODO: write docs.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getScopes
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetScopes(params Params) (response AppsGetScopesResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getScopes", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsGetScore returns user score in app.
|
|
|
|
//
|
|
|
|
// NOTE: vk wtf!?
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getScore
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsGetScore(params Params) (response string, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getScore", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-08-13 14:14:26 +00:00
|
|
|
// AppsGetTestingGroupsResponse struct.
|
|
|
|
type AppsGetTestingGroupsResponse []object.AppsTestingGroup
|
|
|
|
|
|
|
|
// AppsGetTestingGroups method.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.getTestingGroups
|
2022-08-13 14:14:26 +00:00
|
|
|
func (vk *VK) AppsGetTestingGroups(params Params) (response AppsGetTestingGroupsResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.getTestingGroups", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsRemoveTestingGroup method.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.removeTestingGroup
|
2022-08-13 14:14:26 +00:00
|
|
|
func (vk *VK) AppsRemoveTestingGroup(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.removeTestingGroup", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsRemoveUsersFromTestingGroups method.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.removeUsersFromTestingGroups
|
2022-08-13 14:14:26 +00:00
|
|
|
func (vk *VK) AppsRemoveUsersFromTestingGroups(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.removeUsersFromTestingGroups", &response, params)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-01-28 23:25:14 +00:00
|
|
|
// AppsSendRequest sends a request to another user in an app that uses VK authorization.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.sendRequest
|
2021-01-28 23:25:14 +00:00
|
|
|
func (vk *VK) AppsSendRequest(params Params) (response int, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.sendRequest", &response, params)
|
|
|
|
return
|
|
|
|
}
|
2022-08-13 14:14:26 +00:00
|
|
|
|
|
|
|
// AppsUpdateMetaForTestingGroupResponse struct.
|
|
|
|
type AppsUpdateMetaForTestingGroupResponse struct {
|
|
|
|
GroupID int `json:"group_id"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// AppsUpdateMetaForTestingGroup method.
|
|
|
|
//
|
2024-08-27 17:04:05 +00:00
|
|
|
// https://dev.vk.com/method/apps.updateMetaForTestingGroup
|
2022-08-13 14:14:26 +00:00
|
|
|
func (vk *VK) AppsUpdateMetaForTestingGroup(params Params) (response AppsUpdateMetaForTestingGroupResponse, err error) {
|
|
|
|
err = vk.RequestUnmarshal("apps.updateMetaForTestingGroup", &response, params)
|
|
|
|
return
|
|
|
|
}
|