summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/SevereCloud/vksdk/v2/api/leadforms.go
blob: a79c5cd34d5c66196a2b9dfbabd46b8261d599f0 (plain) (blame)
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
package api // import "github.com/SevereCloud/vksdk/v2/api"

import (
	"github.com/SevereCloud/vksdk/v2/object"
)

// LeadFormsCreateResponse struct.
type LeadFormsCreateResponse struct {
	FormID int    `json:"form_id"`
	URL    string `json:"url"`
}

// LeadFormsCreate leadForms.create.
//
// https://vk.com/dev/leadForms.create
func (vk *VK) LeadFormsCreate(params Params) (response LeadFormsCreateResponse, err error) {
	err = vk.RequestUnmarshal("leadForms.create", &response, params)
	return
}

// LeadFormsDeleteResponse struct.
type LeadFormsDeleteResponse struct {
	FormID int `json:"form_id"`
}

// LeadFormsDelete leadForms.delete.
//
// https://vk.com/dev/leadForms.delete
func (vk *VK) LeadFormsDelete(params Params) (response LeadFormsDeleteResponse, err error) {
	err = vk.RequestUnmarshal("leadForms.delete", &response, params)
	return
}

// LeadFormsGetResponse struct.
type LeadFormsGetResponse object.LeadFormsForm

// LeadFormsGet leadForms.get.
//
// https://vk.com/dev/leadForms.get
func (vk *VK) LeadFormsGet(params Params) (response LeadFormsGetResponse, err error) {
	err = vk.RequestUnmarshal("leadForms.get", &response, params)
	return
}

// LeadFormsGetLeadsResponse struct.
type LeadFormsGetLeadsResponse struct {
	Leads []object.LeadFormsLead `json:"leads"`
}

// LeadFormsGetLeads leadForms.getLeads.
//
// https://vk.com/dev/leadForms.getLeads
func (vk *VK) LeadFormsGetLeads(params Params) (response LeadFormsGetLeadsResponse, err error) {
	err = vk.RequestUnmarshal("leadForms.getLeads", &response, params)
	return
}

// LeadFormsGetUploadURL leadForms.getUploadURL.
//
// https://vk.com/dev/leadForms.getUploadURL
func (vk *VK) LeadFormsGetUploadURL(params Params) (response string, err error) {
	err = vk.RequestUnmarshal("leadForms.getUploadURL", &response, params)
	return
}

// LeadFormsListResponse struct.
type LeadFormsListResponse []object.LeadFormsForm

// LeadFormsList leadForms.list.
//
// https://vk.com/dev/leadForms.list
func (vk *VK) LeadFormsList(params Params) (response LeadFormsListResponse, err error) {
	err = vk.RequestUnmarshal("leadForms.list", &response, params)
	return
}

// LeadFormsUpdateResponse struct.
type LeadFormsUpdateResponse struct {
	FormID int    `json:"form_id"`
	URL    string `json:"url"`
}

// LeadFormsUpdate leadForms.update.
//
// https://vk.com/dev/leadForms.update
func (vk *VK) LeadFormsUpdate(params Params) (response LeadFormsUpdateResponse, err error) {
	err = vk.RequestUnmarshal("leadForms.update", &response, params)
	return
}