-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi_codegen_postopenapiof.go
57 lines (50 loc) · 1.29 KB
/
openapi_codegen_postopenapiof.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
// Code generated by codegen/postopenapiof. DO NOT EDIT.
package nano
import (
"io"
"github.com/pkg/errors"
)
func (bot *Bot) postOpenAPIofChannel(ep, contenttype string, body io.Reader) (*Channel, error) {
resp := &struct {
CodeMessageBase
Channel
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return &resp.Channel, err
}
func (bot *Bot) postOpenAPIofGuildRoleCreate(ep, contenttype string, body io.Reader) (*GuildRoleCreate, error) {
resp := &struct {
CodeMessageBase
GuildRoleCreate
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return &resp.GuildRoleCreate, err
}
func (bot *Bot) postOpenAPIofMessage(ep, contenttype string, body io.Reader) (*Message, error) {
resp := &struct {
CodeMessageBase
Message
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return &resp.Message, err
}
func (bot *Bot) postOpenAPIofDMS(ep, contenttype string, body io.Reader) (*DMS, error) {
resp := &struct {
CodeMessageBase
DMS
}{}
err := bot.PostOpenAPI(ep, contenttype, resp, body)
if err != nil {
err = errors.Wrap(err, getCallerFuncName())
}
return &resp.DMS, err
}