-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
database.go
162 lines (137 loc) · 5.72 KB
/
database.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
package api // import "github.com/SevereCloud/vksdk/5.92/api"
import (
"github.com/SevereCloud/vksdk/5.92/object"
)
// DatabaseGetChairsResponse struct
type DatabaseGetChairsResponse struct {
Count int `json:"count"`
Items []object.BaseObject `json:"items"`
}
// DatabaseGetChairs returns list of chairs on a specified faculty.
//
// https://vk.com/dev/database.getChairs
func (vk *VK) DatabaseGetChairs(params map[string]string) (response DatabaseGetChairsResponse, vkErr Error) {
vk.RequestUnmarshal("database.getChairs", params, &response, &vkErr)
return
}
// DatabaseGetCitiesResponse struct
type DatabaseGetCitiesResponse struct {
Count int `json:"count"`
Items []object.DatabaseCity `json:"items"`
}
// DatabaseGetCities returns a list of cities
//
// https://vk.com/dev/database.getCities
func (vk *VK) DatabaseGetCities(params map[string]string) (response DatabaseGetCitiesResponse, vkErr Error) {
vk.RequestUnmarshal("database.getCities", params, &response, &vkErr)
return
}
// DatabaseGetCitiesByIDResponse struct
type DatabaseGetCitiesByIDResponse []object.DatabaseCity
// DatabaseGetCitiesByID returns information about cities by their IDs.
//
// https://vk.com/dev/database.getCitiesByID
func (vk *VK) DatabaseGetCitiesByID(params map[string]string) (response DatabaseGetCitiesByIDResponse, vkErr Error) {
vk.RequestUnmarshal("database.getCitiesById", params, &response, &vkErr)
return
}
// DatabaseGetCountriesResponse struct
type DatabaseGetCountriesResponse struct {
Count int `json:"count"`
Items []object.BaseObject `json:"items"`
}
// DatabaseGetCountries returns a list of countries.
//
// https://vk.com/dev/database.getCountries
func (vk *VK) DatabaseGetCountries(params map[string]string) (response DatabaseGetCountriesResponse, vkErr Error) {
vk.RequestUnmarshal("database.getCountries", params, &response, &vkErr)
return
}
// DatabaseGetCountriesByIDResponse struct
type DatabaseGetCountriesByIDResponse []object.BaseObject
// DatabaseGetCountriesByID returns information about countries by their IDs.
//
// https://vk.com/dev/database.getCountriesByID
func (vk *VK) DatabaseGetCountriesByID(params map[string]string) (response DatabaseGetCountriesByIDResponse, vkErr Error) {
vk.RequestUnmarshal("database.getCountriesById", params, &response, &vkErr)
return
}
// DatabaseGetFacultiesResponse struct
type DatabaseGetFacultiesResponse struct {
Count int `json:"count"`
Items []object.DatabaseFaculty `json:"items"`
}
// DatabaseGetFaculties returns a list of faculties (i.e., university departments).
//
// https://vk.com/dev/database.getFaculties
func (vk *VK) DatabaseGetFaculties(params map[string]string) (response DatabaseGetFacultiesResponse, vkErr Error) {
vk.RequestUnmarshal("database.getFaculties", params, &response, &vkErr)
return
}
// DatabaseGetMetroStationsResponse struct
type DatabaseGetMetroStationsResponse struct {
Count int `json:"count"`
Items []object.DatabaseMetroStation `json:"items"`
}
// DatabaseGetMetroStations returns the list of metro stations.
//
// https://vk.com/dev/database.getMetroStations
func (vk *VK) DatabaseGetMetroStations(params map[string]string) (response DatabaseGetMetroStationsResponse, vkErr Error) {
vk.RequestUnmarshal("database.getMetroStations", params, &response, &vkErr)
return
}
// DatabaseGetMetroStationsByIDResponse struct
type DatabaseGetMetroStationsByIDResponse []object.DatabaseMetroStation
// DatabaseGetMetroStationsByID returns information about one or several metro stations by their identifiers.
//
// https://vk.com/dev/database.getMetroStationsById
func (vk *VK) DatabaseGetMetroStationsByID(params map[string]string) (response DatabaseGetMetroStationsByIDResponse, vkErr Error) {
vk.RequestUnmarshal("database.getMetroStationsById", params, &response, &vkErr)
return
}
// DatabaseGetRegionsResponse struct
type DatabaseGetRegionsResponse struct {
Count int `json:"count"`
Items []object.DatabaseRegion `json:"items"`
}
// DatabaseGetRegions returns a list of regions.
//
// https://vk.com/dev/database.getRegions
func (vk *VK) DatabaseGetRegions(params map[string]string) (response DatabaseGetRegionsResponse, vkErr Error) {
vk.RequestUnmarshal("database.getRegions", params, &response, &vkErr)
return
}
// DatabaseGetSchoolClassesResponse struct
type DatabaseGetSchoolClassesResponse [][]interface{}
// DatabaseGetSchoolClasses returns a list of school classes specified for the country.
// BUG(VK): database.getSchoolClasses bad return
//
// https://vk.com/dev/database.getSchoolClasses
func (vk *VK) DatabaseGetSchoolClasses(params map[string]string) (response DatabaseGetSchoolClassesResponse, vkErr Error) {
vk.RequestUnmarshal("database.getSchoolClasses", params, &response, &vkErr)
return
}
// DatabaseGetSchoolsResponse struct
type DatabaseGetSchoolsResponse struct {
Count int `json:"count"`
Items []object.DatabaseSchool `json:"items"`
}
// DatabaseGetSchools returns a list of schools.
//
// https://vk.com/dev/database.getSchools
func (vk *VK) DatabaseGetSchools(params map[string]string) (response DatabaseGetSchoolsResponse, vkErr Error) {
vk.RequestUnmarshal("database.getSchools", params, &response, &vkErr)
return
}
// DatabaseGetUniversitiesResponse struct
type DatabaseGetUniversitiesResponse struct {
Count int `json:"count"`
Items []object.DatabaseUniversity `json:"items"`
}
// DatabaseGetUniversities returns a list of higher education institutions.
//
// https://vk.com/dev/database.getUniversities
func (vk *VK) DatabaseGetUniversities(params map[string]string) (response DatabaseGetUniversitiesResponse, vkErr Error) {
vk.RequestUnmarshal("database.getUniversities", params, &response, &vkErr)
return
}