-
Notifications
You must be signed in to change notification settings - Fork 38
/
apis.go
409 lines (295 loc) · 11.6 KB
/
apis.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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
// Code is generated by ucloud-model, DO NOT EDIT IT.
package udi
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// UDI API Schema
// CreateFunctionTemplateRequest is request schema for CreateFunctionTemplate action
type CreateFunctionTemplateRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 音频比特率
AudioBitRate *string `required:"false"`
// 自定义音频比特率
AudioBitRateCustom *string `required:"false"`
// 音频声道
AudioChannel *string `required:"false"`
// 音频采样率
AudioSampleRate *string `required:"false"`
// CRF压缩率
CRF *string `required:"false"`
// 自定义CRF压缩率
CRFCustom *string `required:"false"`
// 文件输出格式
ContainerFormat *string `required:"true"`
// 编码格式
EncodeFormat *string `required:"true"`
// 帧率
FrameRate *string `required:"false"`
// 自定义帧率
FrameRateCustom *string `required:"false"`
// 功能名称
Function *string `required:"true"`
// 项目名称
ProjectName *string `required:"true"`
// 分辨率
Resolution *string `required:"false"`
// 分辨率高
ResolutionHeight *string `required:"false"`
// 分辨率宽
ResolutionWidth *string `required:"false"`
// 模板名称
TemplateName *string `required:"true"`
// 视频比特率
VideoBitRate *string `required:"false"`
// 自定义视频比特率
VideoBitRateCustom *string `required:"false"`
}
// CreateFunctionTemplateResponse is response schema for CreateFunctionTemplate action
type CreateFunctionTemplateResponse struct {
response.CommonBase
// 创建的模板ID
TemplateId string
}
// NewCreateFunctionTemplateRequest will create request of CreateFunctionTemplate action.
func (c *UDIClient) NewCreateFunctionTemplateRequest() *CreateFunctionTemplateRequest {
req := &CreateFunctionTemplateRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(false)
return req
}
/*
API: CreateFunctionTemplate
创建功能参数模板
*/
func (c *UDIClient) CreateFunctionTemplate(req *CreateFunctionTemplateRequest) (*CreateFunctionTemplateResponse, error) {
var err error
var res CreateFunctionTemplateResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateFunctionTemplate", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateMediaTaskRequest is request schema for CreateMediaTask action
type CreateMediaTaskRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// Bucket名称
Bucket *string `required:"true"`
// 目标生成文件
DstKey *string `required:"true"`
// 功能名称:例VideoTranscode
Function *string `required:"true"`
// 功能的参数模板ID,需要事先创建模板才可用,也可以使用预设模板,详细可通过DescribeFunctionTemplate接口查询
FunctionParamTemplateId *string `required:"true"`
// 源文件
SrcKey *string `required:"true"`
// 存储源
StorageBackend *string `required:"true"`
}
// CreateMediaTaskResponse is response schema for CreateMediaTask action
type CreateMediaTaskResponse struct {
response.CommonBase
// 任务ID
TaskId string
}
// NewCreateMediaTaskRequest will create request of CreateMediaTask action.
func (c *UDIClient) NewCreateMediaTaskRequest() *CreateMediaTaskRequest {
req := &CreateMediaTaskRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(false)
return req
}
/*
API: CreateMediaTask
创建一个多媒体任务
*/
func (c *UDIClient) CreateMediaTask(req *CreateMediaTaskRequest) (*CreateMediaTaskResponse, error) {
var err error
var res CreateMediaTaskResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateMediaTask", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DeleteFunctionTemplateRequest is request schema for DeleteFunctionTemplate action
type DeleteFunctionTemplateRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 要删除的模板ID
TemplateId *string `required:"true"`
}
// DeleteFunctionTemplateResponse is response schema for DeleteFunctionTemplate action
type DeleteFunctionTemplateResponse struct {
response.CommonBase
}
// NewDeleteFunctionTemplateRequest will create request of DeleteFunctionTemplate action.
func (c *UDIClient) NewDeleteFunctionTemplateRequest() *DeleteFunctionTemplateRequest {
req := &DeleteFunctionTemplateRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}
/*
API: DeleteFunctionTemplate
删除功能模板
*/
func (c *UDIClient) DeleteFunctionTemplate(req *DeleteFunctionTemplateRequest) (*DeleteFunctionTemplateResponse, error) {
var err error
var res DeleteFunctionTemplateResponse
reqCopier := *req
err = c.Client.InvokeAction("DeleteFunctionTemplate", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribeFunctionTemplateRequest is request schema for DescribeFunctionTemplate action
type DescribeFunctionTemplateRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 功能模板类型:预设(preset)自定义(custom),为空则获取两种类型
Type *string `required:"false"`
}
// DescribeFunctionTemplateResponse is response schema for DescribeFunctionTemplate action
type DescribeFunctionTemplateResponse struct {
response.CommonBase
// 功能模板
Templates []FunctionTemplate
}
// NewDescribeFunctionTemplateRequest will create request of DescribeFunctionTemplate action.
func (c *UDIClient) NewDescribeFunctionTemplateRequest() *DescribeFunctionTemplateRequest {
req := &DescribeFunctionTemplateRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}
/*
API: DescribeFunctionTemplate
获取功能模板
*/
func (c *UDIClient) DescribeFunctionTemplate(req *DescribeFunctionTemplateRequest) (*DescribeFunctionTemplateResponse, error) {
var err error
var res DescribeFunctionTemplateResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribeFunctionTemplate", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribeMediaFunctionsRequest is request schema for DescribeMediaFunctions action
type DescribeMediaFunctionsRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 要查询的Function名称,为空则返回所有支持的Function
Function *string `required:"false"`
}
// DescribeMediaFunctionsResponse is response schema for DescribeMediaFunctions action
type DescribeMediaFunctionsResponse struct {
response.CommonBase
// 功能列表
Functions []Function
}
// NewDescribeMediaFunctionsRequest will create request of DescribeMediaFunctions action.
func (c *UDIClient) NewDescribeMediaFunctionsRequest() *DescribeMediaFunctionsRequest {
req := &DescribeMediaFunctionsRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}
/*
API: DescribeMediaFunctions
描述当前支持的多媒体功能以及对应功能需要的参数信息
*/
func (c *UDIClient) DescribeMediaFunctions(req *DescribeMediaFunctionsRequest) (*DescribeMediaFunctionsResponse, error) {
var err error
var res DescribeMediaFunctionsResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribeMediaFunctions", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribeMediaTaskRequest is request schema for DescribeMediaTask action
type DescribeMediaTaskRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 要查询的任务ID,为空则查询所有
TaskId *string `required:"false"`
}
// DescribeMediaTaskResponse is response schema for DescribeMediaTask action
type DescribeMediaTaskResponse struct {
response.CommonBase
// 任务
Tasks []MediaTask
}
// NewDescribeMediaTaskRequest will create request of DescribeMediaTask action.
func (c *UDIClient) NewDescribeMediaTaskRequest() *DescribeMediaTaskRequest {
req := &DescribeMediaTaskRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}
/*
API: DescribeMediaTask
查询任务状态
*/
func (c *UDIClient) DescribeMediaTask(req *DescribeMediaTaskRequest) (*DescribeMediaTaskResponse, error) {
var err error
var res DescribeMediaTaskResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribeMediaTask", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}