-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoMiniappTemplateUpdateappAPIRequest.go
190 lines (163 loc) · 5.65 KB
/
TaobaoMiniappTemplateUpdateappAPIRequest.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package miniappopen
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoMiniappTemplateUpdateappAPIRequest 更新实例化应用 API请求
// taobao.miniapp.template.updateapp
//
// 商家应用c端模板实例化小程序更新,生成新的版本,但不会自动上线新版本
type TaobaoMiniappTemplateUpdateappAPIRequest struct {
model.Params
// 要更新的投放端,目前可投放: taobao(淘宝),tmall(天猫)
_clients []string
// 应用id,如果应用在对应端上已有的最新版本所使用的模板id,模板version和extjson,与本次入参一致,则认为不需要更新,返回已有的版本。
_appId string
// 扩展信息。线上版本使用的template_id与传入的template_id一致时,可不填。
_extJson string
// 模板id
_templateId string
// 模板版本
_templateVersion string
// Logo更新,1月5次
_icon string
// 描述更新,1年5次
_desc string
// 简称更新,1年5次
_alias string
}
// NewTaobaoMiniappTemplateUpdateappRequest 初始化TaobaoMiniappTemplateUpdateappAPIRequest对象
func NewTaobaoMiniappTemplateUpdateappRequest() *TaobaoMiniappTemplateUpdateappAPIRequest {
return &TaobaoMiniappTemplateUpdateappAPIRequest{
Params: model.NewParams(8),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) Reset() {
r._clients = r._clients[:0]
r._appId = ""
r._extJson = ""
r._templateId = ""
r._templateVersion = ""
r._icon = ""
r._desc = ""
r._alias = ""
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetApiMethodName() string {
return "taobao.miniapp.template.updateapp"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetClients is Clients Setter
// 要更新的投放端,目前可投放: taobao(淘宝),tmall(天猫)
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetClients(_clients []string) error {
r._clients = _clients
r.Set("clients", _clients)
return nil
}
// GetClients Clients Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetClients() []string {
return r._clients
}
// SetAppId is AppId Setter
// 应用id,如果应用在对应端上已有的最新版本所使用的模板id,模板version和extjson,与本次入参一致,则认为不需要更新,返回已有的版本。
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetAppId(_appId string) error {
r._appId = _appId
r.Set("app_id", _appId)
return nil
}
// GetAppId AppId Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetAppId() string {
return r._appId
}
// SetExtJson is ExtJson Setter
// 扩展信息。线上版本使用的template_id与传入的template_id一致时,可不填。
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetExtJson(_extJson string) error {
r._extJson = _extJson
r.Set("ext_json", _extJson)
return nil
}
// GetExtJson ExtJson Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetExtJson() string {
return r._extJson
}
// SetTemplateId is TemplateId Setter
// 模板id
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetTemplateId(_templateId string) error {
r._templateId = _templateId
r.Set("template_id", _templateId)
return nil
}
// GetTemplateId TemplateId Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetTemplateId() string {
return r._templateId
}
// SetTemplateVersion is TemplateVersion Setter
// 模板版本
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetTemplateVersion(_templateVersion string) error {
r._templateVersion = _templateVersion
r.Set("template_version", _templateVersion)
return nil
}
// GetTemplateVersion TemplateVersion Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetTemplateVersion() string {
return r._templateVersion
}
// SetIcon is Icon Setter
// Logo更新,1月5次
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetIcon(_icon string) error {
r._icon = _icon
r.Set("icon", _icon)
return nil
}
// GetIcon Icon Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetIcon() string {
return r._icon
}
// SetDesc is Desc Setter
// 描述更新,1年5次
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetDesc(_desc string) error {
r._desc = _desc
r.Set("desc", _desc)
return nil
}
// GetDesc Desc Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetDesc() string {
return r._desc
}
// SetAlias is Alias Setter
// 简称更新,1年5次
func (r *TaobaoMiniappTemplateUpdateappAPIRequest) SetAlias(_alias string) error {
r._alias = _alias
r.Set("alias", _alias)
return nil
}
// GetAlias Alias Getter
func (r TaobaoMiniappTemplateUpdateappAPIRequest) GetAlias() string {
return r._alias
}
var poolTaobaoMiniappTemplateUpdateappAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoMiniappTemplateUpdateappRequest()
},
}
// GetTaobaoMiniappTemplateUpdateappRequest 从 sync.Pool 获取 TaobaoMiniappTemplateUpdateappAPIRequest
func GetTaobaoMiniappTemplateUpdateappAPIRequest() *TaobaoMiniappTemplateUpdateappAPIRequest {
return poolTaobaoMiniappTemplateUpdateappAPIRequest.Get().(*TaobaoMiniappTemplateUpdateappAPIRequest)
}
// ReleaseTaobaoMiniappTemplateUpdateappAPIRequest 将 TaobaoMiniappTemplateUpdateappAPIRequest 放入 sync.Pool
func ReleaseTaobaoMiniappTemplateUpdateappAPIRequest(v *TaobaoMiniappTemplateUpdateappAPIRequest) {
v.Reset()
poolTaobaoMiniappTemplateUpdateappAPIRequest.Put(v)
}