submit_jobs.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. package mts
  2. //Licensed under the Apache License, Version 2.0 (the "License");
  3. //you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software
  9. //distributed under the License is distributed on an "AS IS" BASIS,
  10. //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. //See the License for the specific language governing permissions and
  12. //limitations under the License.
  13. //
  14. // Code generated by Alibaba Cloud SDK Code Generator.
  15. // Changes may cause incorrect behavior and will be lost if the code is regenerated.
  16. import (
  17. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
  18. "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
  19. )
  20. func (client *Client) SubmitJobs(request *SubmitJobsRequest) (response *SubmitJobsResponse, err error) {
  21. response = CreateSubmitJobsResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) SubmitJobsWithChan(request *SubmitJobsRequest) (<-chan *SubmitJobsResponse, <-chan error) {
  26. responseChan := make(chan *SubmitJobsResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.SubmitJobs(request)
  32. responseChan <- response
  33. errChan <- err
  34. })
  35. if err != nil {
  36. errChan <- err
  37. close(responseChan)
  38. close(errChan)
  39. }
  40. return responseChan, errChan
  41. }
  42. func (client *Client) SubmitJobsWithCallback(request *SubmitJobsRequest, callback func(response *SubmitJobsResponse, err error)) <-chan int {
  43. result := make(chan int, 1)
  44. err := client.AddAsyncTask(func() {
  45. var response *SubmitJobsResponse
  46. var err error
  47. defer close(result)
  48. response, err = client.SubmitJobs(request)
  49. callback(response, err)
  50. result <- 1
  51. })
  52. if err != nil {
  53. defer close(result)
  54. callback(nil, err)
  55. result <- 0
  56. }
  57. return result
  58. }
  59. type SubmitJobsRequest struct {
  60. *requests.RpcRequest
  61. Outputs string `position:"Query" name:"Outputs"`
  62. Input string `position:"Query" name:"Input"`
  63. OutputBucket string `position:"Query" name:"OutputBucket"`
  64. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  65. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  66. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  67. OutputLocation string `position:"Query" name:"OutputLocation"`
  68. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  69. PipelineId string `position:"Query" name:"PipelineId"`
  70. }
  71. type SubmitJobsResponse struct {
  72. *responses.BaseResponse
  73. RequestId string `json:"RequestId" xml:"RequestId"`
  74. JobResultList struct {
  75. JobResult []struct {
  76. Success bool `json:"Success" xml:"Success"`
  77. Code string `json:"Code" xml:"Code"`
  78. Message string `json:"Message" xml:"Message"`
  79. Job struct {
  80. JobId string `json:"JobId" xml:"JobId"`
  81. State string `json:"State" xml:"State"`
  82. Code string `json:"Code" xml:"Code"`
  83. Message string `json:"Message" xml:"Message"`
  84. Percent int `json:"Percent" xml:"Percent"`
  85. PipelineId string `json:"PipelineId" xml:"PipelineId"`
  86. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  87. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  88. Input struct {
  89. Bucket string `json:"Bucket" xml:"Bucket"`
  90. Location string `json:"Location" xml:"Location"`
  91. Object string `json:"Object" xml:"Object"`
  92. } `json:"Input" xml:"Input"`
  93. Output struct {
  94. TemplateId string `json:"TemplateId" xml:"TemplateId"`
  95. UserData string `json:"UserData" xml:"UserData"`
  96. Rotate string `json:"Rotate" xml:"Rotate"`
  97. VideoStreamMap string `json:"VideoStreamMap" xml:"VideoStreamMap"`
  98. AudioStreamMap string `json:"AudioStreamMap" xml:"AudioStreamMap"`
  99. DeWatermark string `json:"DeWatermark" xml:"DeWatermark"`
  100. Priority string `json:"Priority" xml:"Priority"`
  101. WaterMarkConfigUrl string `json:"WaterMarkConfigUrl" xml:"WaterMarkConfigUrl"`
  102. MergeConfigUrl string `json:"MergeConfigUrl" xml:"MergeConfigUrl"`
  103. DigiWaterMark struct {
  104. Type string `json:"Type" xml:"Type"`
  105. Alpha string `json:"Alpha" xml:"Alpha"`
  106. InputFile1 struct {
  107. Bucket string `json:"Bucket" xml:"Bucket"`
  108. Location string `json:"Location" xml:"Location"`
  109. Object string `json:"Object" xml:"Object"`
  110. } `json:"InputFile" xml:"InputFile"`
  111. } `json:"DigiWaterMark" xml:"DigiWaterMark"`
  112. OutputFile struct {
  113. Bucket string `json:"Bucket" xml:"Bucket"`
  114. Location string `json:"Location" xml:"Location"`
  115. Object string `json:"Object" xml:"Object"`
  116. RoleArn string `json:"RoleArn" xml:"RoleArn"`
  117. } `json:"OutputFile" xml:"OutputFile"`
  118. M3U8NonStandardSupport struct {
  119. TS struct {
  120. Md5Support bool `json:"Md5Support" xml:"Md5Support"`
  121. SizeSupport bool `json:"SizeSupport" xml:"SizeSupport"`
  122. } `json:"TS" xml:"TS"`
  123. } `json:"M3U8NonStandardSupport" xml:"M3U8NonStandardSupport"`
  124. Properties struct {
  125. Width string `json:"Width" xml:"Width"`
  126. Height string `json:"Height" xml:"Height"`
  127. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  128. Duration string `json:"Duration" xml:"Duration"`
  129. Fps string `json:"Fps" xml:"Fps"`
  130. FileSize string `json:"FileSize" xml:"FileSize"`
  131. FileFormat string `json:"FileFormat" xml:"FileFormat"`
  132. Streams struct {
  133. VideoStreamList struct {
  134. VideoStream []struct {
  135. Index string `json:"Index" xml:"Index"`
  136. CodecName string `json:"CodecName" xml:"CodecName"`
  137. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  138. Profile string `json:"Profile" xml:"Profile"`
  139. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  140. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  141. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  142. Width string `json:"Width" xml:"Width"`
  143. Height string `json:"Height" xml:"Height"`
  144. HasBFrames string `json:"HasBFrames" xml:"HasBFrames"`
  145. Sar string `json:"Sar" xml:"Sar"`
  146. Dar string `json:"Dar" xml:"Dar"`
  147. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  148. Level string `json:"Level" xml:"Level"`
  149. Fps string `json:"Fps" xml:"Fps"`
  150. AvgFPS string `json:"AvgFPS" xml:"AvgFPS"`
  151. Timebase string `json:"Timebase" xml:"Timebase"`
  152. StartTime string `json:"StartTime" xml:"StartTime"`
  153. Duration string `json:"Duration" xml:"Duration"`
  154. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  155. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  156. Lang string `json:"Lang" xml:"Lang"`
  157. NetworkCost struct {
  158. PreloadTime string `json:"PreloadTime" xml:"PreloadTime"`
  159. CostBandwidth string `json:"CostBandwidth" xml:"CostBandwidth"`
  160. AvgBitrate string `json:"AvgBitrate" xml:"AvgBitrate"`
  161. } `json:"NetworkCost" xml:"NetworkCost"`
  162. } `json:"VideoStream" xml:"VideoStream"`
  163. } `json:"VideoStreamList" xml:"VideoStreamList"`
  164. AudioStreamList struct {
  165. AudioStream []struct {
  166. Index string `json:"Index" xml:"Index"`
  167. CodecName string `json:"CodecName" xml:"CodecName"`
  168. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  169. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  170. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  171. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  172. SampleFmt string `json:"SampleFmt" xml:"SampleFmt"`
  173. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  174. Channels string `json:"Channels" xml:"Channels"`
  175. ChannelLayout string `json:"ChannelLayout" xml:"ChannelLayout"`
  176. Timebase string `json:"Timebase" xml:"Timebase"`
  177. StartTime string `json:"StartTime" xml:"StartTime"`
  178. Duration string `json:"Duration" xml:"Duration"`
  179. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  180. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  181. Lang string `json:"Lang" xml:"Lang"`
  182. } `json:"AudioStream" xml:"AudioStream"`
  183. } `json:"AudioStreamList" xml:"AudioStreamList"`
  184. SubtitleStreamList struct {
  185. SubtitleStream []struct {
  186. Index string `json:"Index" xml:"Index"`
  187. Lang string `json:"Lang" xml:"Lang"`
  188. } `json:"SubtitleStream" xml:"SubtitleStream"`
  189. } `json:"SubtitleStreamList" xml:"SubtitleStreamList"`
  190. } `json:"Streams" xml:"Streams"`
  191. Format struct {
  192. NumStreams string `json:"NumStreams" xml:"NumStreams"`
  193. NumPrograms string `json:"NumPrograms" xml:"NumPrograms"`
  194. FormatName string `json:"FormatName" xml:"FormatName"`
  195. FormatLongName string `json:"FormatLongName" xml:"FormatLongName"`
  196. StartTime string `json:"StartTime" xml:"StartTime"`
  197. Duration string `json:"Duration" xml:"Duration"`
  198. Size string `json:"Size" xml:"Size"`
  199. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  200. } `json:"Format" xml:"Format"`
  201. } `json:"Properties" xml:"Properties"`
  202. Clip struct {
  203. TimeSpan struct {
  204. Seek string `json:"Seek" xml:"Seek"`
  205. Duration string `json:"Duration" xml:"Duration"`
  206. } `json:"TimeSpan" xml:"TimeSpan"`
  207. } `json:"Clip" xml:"Clip"`
  208. SuperReso struct {
  209. IsHalfSample string `json:"IsHalfSample" xml:"IsHalfSample"`
  210. } `json:"SuperReso" xml:"SuperReso"`
  211. SubtitleConfig struct {
  212. SubtitleList struct {
  213. Subtitle []struct {
  214. Map string `json:"Map" xml:"Map"`
  215. } `json:"Subtitle" xml:"Subtitle"`
  216. } `json:"SubtitleList" xml:"SubtitleList"`
  217. ExtSubtitleList struct {
  218. ExtSubtitle []struct {
  219. FontName string `json:"FontName" xml:"FontName"`
  220. CharEnc string `json:"CharEnc" xml:"CharEnc"`
  221. Input2 struct {
  222. Bucket string `json:"Bucket" xml:"Bucket"`
  223. Location string `json:"Location" xml:"Location"`
  224. Object string `json:"Object" xml:"Object"`
  225. } `json:"Input" xml:"Input"`
  226. } `json:"ExtSubtitle" xml:"ExtSubtitle"`
  227. } `json:"ExtSubtitleList" xml:"ExtSubtitleList"`
  228. } `json:"SubtitleConfig" xml:"SubtitleConfig"`
  229. TransConfig struct {
  230. TransMode string `json:"TransMode" xml:"TransMode"`
  231. IsCheckReso string `json:"IsCheckReso" xml:"IsCheckReso"`
  232. IsCheckResoFail string `json:"IsCheckResoFail" xml:"IsCheckResoFail"`
  233. IsCheckVideoBitrate string `json:"IsCheckVideoBitrate" xml:"IsCheckVideoBitrate"`
  234. IsCheckAudioBitrate string `json:"IsCheckAudioBitrate" xml:"IsCheckAudioBitrate"`
  235. AdjDarMethod string `json:"AdjDarMethod" xml:"AdjDarMethod"`
  236. IsCheckVideoBitrateFail string `json:"IsCheckVideoBitrateFail" xml:"IsCheckVideoBitrateFail"`
  237. IsCheckAudioBitrateFail string `json:"IsCheckAudioBitrateFail" xml:"IsCheckAudioBitrateFail"`
  238. } `json:"TransConfig" xml:"TransConfig"`
  239. MuxConfig struct {
  240. Segment struct {
  241. Duration string `json:"Duration" xml:"Duration"`
  242. } `json:"Segment" xml:"Segment"`
  243. Gif struct {
  244. Loop string `json:"Loop" xml:"Loop"`
  245. FinalDelay string `json:"FinalDelay" xml:"FinalDelay"`
  246. IsCustomPalette string `json:"IsCustomPalette" xml:"IsCustomPalette"`
  247. DitherMode string `json:"DitherMode" xml:"DitherMode"`
  248. } `json:"Gif" xml:"Gif"`
  249. } `json:"MuxConfig" xml:"MuxConfig"`
  250. Audio struct {
  251. Codec string `json:"Codec" xml:"Codec"`
  252. Profile string `json:"Profile" xml:"Profile"`
  253. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  254. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  255. Channels string `json:"Channels" xml:"Channels"`
  256. Qscale string `json:"Qscale" xml:"Qscale"`
  257. Volume struct {
  258. Level string `json:"Level" xml:"Level"`
  259. Method string `json:"Method" xml:"Method"`
  260. } `json:"Volume" xml:"Volume"`
  261. } `json:"Audio" xml:"Audio"`
  262. Video struct {
  263. Codec string `json:"Codec" xml:"Codec"`
  264. Profile string `json:"Profile" xml:"Profile"`
  265. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  266. Crf string `json:"Crf" xml:"Crf"`
  267. Width string `json:"Width" xml:"Width"`
  268. Height string `json:"Height" xml:"Height"`
  269. Fps string `json:"Fps" xml:"Fps"`
  270. Gop string `json:"Gop" xml:"Gop"`
  271. Preset string `json:"Preset" xml:"Preset"`
  272. ScanMode string `json:"ScanMode" xml:"ScanMode"`
  273. Bufsize string `json:"Bufsize" xml:"Bufsize"`
  274. Maxrate string `json:"Maxrate" xml:"Maxrate"`
  275. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  276. Degrain string `json:"Degrain" xml:"Degrain"`
  277. Qscale string `json:"Qscale" xml:"Qscale"`
  278. Crop string `json:"Crop" xml:"Crop"`
  279. Pad string `json:"Pad" xml:"Pad"`
  280. MaxFps string `json:"MaxFps" xml:"MaxFps"`
  281. BitrateBnd struct {
  282. Max string `json:"Max" xml:"Max"`
  283. Min string `json:"Min" xml:"Min"`
  284. } `json:"BitrateBnd" xml:"BitrateBnd"`
  285. } `json:"Video" xml:"Video"`
  286. Container struct {
  287. Format string `json:"Format" xml:"Format"`
  288. } `json:"Container" xml:"Container"`
  289. Encryption struct {
  290. Type string `json:"Type" xml:"Type"`
  291. Id string `json:"Id" xml:"Id"`
  292. Key string `json:"Key" xml:"Key"`
  293. KeyUri string `json:"KeyUri" xml:"KeyUri"`
  294. KeyType string `json:"KeyType" xml:"KeyType"`
  295. SkipCnt string `json:"SkipCnt" xml:"SkipCnt"`
  296. } `json:"Encryption" xml:"Encryption"`
  297. WaterMarkList struct {
  298. WaterMark []struct {
  299. WaterMarkTemplateId string `json:"WaterMarkTemplateId" xml:"WaterMarkTemplateId"`
  300. Width string `json:"Width" xml:"Width"`
  301. Height string `json:"Height" xml:"Height"`
  302. Dx string `json:"Dx" xml:"Dx"`
  303. Dy string `json:"Dy" xml:"Dy"`
  304. ReferPos string `json:"ReferPos" xml:"ReferPos"`
  305. Type string `json:"Type" xml:"Type"`
  306. InputFile struct {
  307. Bucket string `json:"Bucket" xml:"Bucket"`
  308. Location string `json:"Location" xml:"Location"`
  309. Object string `json:"Object" xml:"Object"`
  310. } `json:"InputFile" xml:"InputFile"`
  311. } `json:"WaterMark" xml:"WaterMark"`
  312. } `json:"WaterMarkList" xml:"WaterMarkList"`
  313. MergeList struct {
  314. Merge []struct {
  315. MergeURL string `json:"MergeURL" xml:"MergeURL"`
  316. Start string `json:"Start" xml:"Start"`
  317. Duration string `json:"Duration" xml:"Duration"`
  318. RoleArn string `json:"RoleArn" xml:"RoleArn"`
  319. } `json:"Merge" xml:"Merge"`
  320. } `json:"MergeList" xml:"MergeList"`
  321. OpeningList struct {
  322. Opening []struct {
  323. OpenUrl string `json:"openUrl" xml:"openUrl"`
  324. Start string `json:"Start" xml:"Start"`
  325. Width string `json:"Width" xml:"Width"`
  326. Height string `json:"Height" xml:"Height"`
  327. } `json:"Opening" xml:"Opening"`
  328. } `json:"OpeningList" xml:"OpeningList"`
  329. TailSlateList struct {
  330. TailSlate []struct {
  331. TailUrl string `json:"TailUrl" xml:"TailUrl"`
  332. Start string `json:"Start" xml:"Start"`
  333. BlendDuration string `json:"BlendDuration" xml:"BlendDuration"`
  334. Width string `json:"Width" xml:"Width"`
  335. Height string `json:"Height" xml:"Height"`
  336. IsMergeAudio bool `json:"IsMergeAudio" xml:"IsMergeAudio"`
  337. BgColor string `json:"BgColor" xml:"BgColor"`
  338. } `json:"TailSlate" xml:"TailSlate"`
  339. } `json:"TailSlateList" xml:"TailSlateList"`
  340. } `json:"Output" xml:"Output"`
  341. MNSMessageResult struct {
  342. MessageId string `json:"MessageId" xml:"MessageId"`
  343. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  344. ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
  345. } `json:"MNSMessageResult" xml:"MNSMessageResult"`
  346. } `json:"Job" xml:"Job"`
  347. } `json:"JobResult" xml:"JobResult"`
  348. } `json:"JobResultList" xml:"JobResultList"`
  349. }
  350. func CreateSubmitJobsRequest() (request *SubmitJobsRequest) {
  351. request = &SubmitJobsRequest{
  352. RpcRequest: &requests.RpcRequest{},
  353. }
  354. request.InitWithApiInfo("Mts", "2014-06-18", "SubmitJobs", "mts", "openAPI")
  355. return
  356. }
  357. func CreateSubmitJobsResponse() (response *SubmitJobsResponse) {
  358. response = &SubmitJobsResponse{
  359. BaseResponse: &responses.BaseResponse{},
  360. }
  361. return
  362. }