-
Notifications
You must be signed in to change notification settings - Fork 13
/
标签管理-更新标签名字.go
executable file
·57 lines (48 loc) · 1.48 KB
/
标签管理-更新标签名字.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
package apis
import (
"encoding/json"
)
// 自动生成的文件, 生成方式: make api doc=微信文档地址url
// 可自行修改生成的文件,以满足开发需求
// ReqUpdateTag 更新标签名字请求
// 文档:https://developer.work.weixin.qq.com/document/path/90347#更新标签名字
type ReqUpdateTag struct {
// Tagid 标签ID,必填
Tagid int `json:"tagid"`
// Tagname 标签名称,长度限制为32个字(汉字或英文字母),标签不可与其他标签重名。,必填
Tagname string `json:"tagname"`
}
var _ bodyer = ReqUpdateTag{}
func (x ReqUpdateTag) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
// RespUpdateTag 更新标签名字响应
// 文档:https://developer.work.weixin.qq.com/document/path/90347#更新标签名字
type RespUpdateTag struct {
CommonResp
}
var _ bodyer = RespUpdateTag{}
func (x RespUpdateTag) intoBody() ([]byte, error) {
result, err := json.Marshal(x)
if err != nil {
return nil, err
}
return result, nil
}
// ExecUpdateTag 更新标签名字
// 文档:https://developer.work.weixin.qq.com/document/path/90347#更新标签名字
func (c *ApiClient) ExecUpdateTag(req ReqUpdateTag) (RespUpdateTag, error) {
var resp RespUpdateTag
err := c.executeWXApiPost("/cgi-bin/tag/update", req, &resp, true)
if err != nil {
return RespUpdateTag{}, err
}
if bizErr := resp.TryIntoErr(); bizErr != nil {
return RespUpdateTag{}, bizErr
}
return resp, nil
}