list_job.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  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) ListJob(request *ListJobRequest) (response *ListJobResponse, err error) {
  21. response = CreateListJobResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) ListJobWithChan(request *ListJobRequest) (<-chan *ListJobResponse, <-chan error) {
  26. responseChan := make(chan *ListJobResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.ListJob(request)
  32. if err != nil {
  33. errChan <- err
  34. } else {
  35. responseChan <- response
  36. }
  37. })
  38. if err != nil {
  39. errChan <- err
  40. close(responseChan)
  41. close(errChan)
  42. }
  43. return responseChan, errChan
  44. }
  45. func (client *Client) ListJobWithCallback(request *ListJobRequest, callback func(response *ListJobResponse, err error)) <-chan int {
  46. result := make(chan int, 1)
  47. err := client.AddAsyncTask(func() {
  48. var response *ListJobResponse
  49. var err error
  50. defer close(result)
  51. response, err = client.ListJob(request)
  52. callback(response, err)
  53. result <- 1
  54. })
  55. if err != nil {
  56. defer close(result)
  57. callback(nil, err)
  58. result <- 0
  59. }
  60. return result
  61. }
  62. type ListJobRequest struct {
  63. *requests.RpcRequest
  64. StartOfJobCreatedTimeRange string `position:"Query" name:"StartOfJobCreatedTimeRange"`
  65. EndOfJobCreatedTimeRange string `position:"Query" name:"EndOfJobCreatedTimeRange"`
  66. PipelineId string `position:"Query" name:"PipelineId"`
  67. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  68. State string `position:"Query" name:"State"`
  69. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  70. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  71. MaximumPageSize requests.Integer `position:"Query" name:"MaximumPageSize"`
  72. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  73. NextPageToken string `position:"Query" name:"NextPageToken"`
  74. }
  75. type ListJobResponse struct {
  76. *responses.BaseResponse
  77. RequestId string `json:"RequestId" xml:"RequestId"`
  78. NextPageToken string `json:"NextPageToken" xml:"NextPageToken"`
  79. JobList struct {
  80. Job []struct {
  81. JobId string `json:"JobId" xml:"JobId"`
  82. State string `json:"State" xml:"State"`
  83. Code string `json:"Code" xml:"Code"`
  84. Message string `json:"Message" xml:"Message"`
  85. Percent int `json:"Percent" xml:"Percent"`
  86. PipelineId string `json:"PipelineId" xml:"PipelineId"`
  87. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  88. FinishTime string `json:"FinishTime" xml:"FinishTime"`
  89. Input struct {
  90. Bucket string `json:"Bucket" xml:"Bucket"`
  91. Location string `json:"Location" xml:"Location"`
  92. Object string `json:"Object" xml:"Object"`
  93. } `json:"Input" xml:"Input"`
  94. Output struct {
  95. TemplateId string `json:"TemplateId" xml:"TemplateId"`
  96. UserData string `json:"UserData" xml:"UserData"`
  97. Rotate string `json:"Rotate" xml:"Rotate"`
  98. VideoStreamMap string `json:"VideoStreamMap" xml:"VideoStreamMap"`
  99. AudioStreamMap string `json:"AudioStreamMap" xml:"AudioStreamMap"`
  100. DeWatermark string `json:"DeWatermark" xml:"DeWatermark"`
  101. Priority string `json:"Priority" xml:"Priority"`
  102. WaterMarkConfigUrl string `json:"WaterMarkConfigUrl" xml:"WaterMarkConfigUrl"`
  103. MergeConfigUrl string `json:"MergeConfigUrl" xml:"MergeConfigUrl"`
  104. OutputFile struct {
  105. Bucket string `json:"Bucket" xml:"Bucket"`
  106. Location string `json:"Location" xml:"Location"`
  107. Object string `json:"Object" xml:"Object"`
  108. RoleArn string `json:"RoleArn" xml:"RoleArn"`
  109. } `json:"OutputFile" xml:"OutputFile"`
  110. M3U8NonStandardSupport struct {
  111. TS struct {
  112. Md5Support bool `json:"Md5Support" xml:"Md5Support"`
  113. SizeSupport bool `json:"SizeSupport" xml:"SizeSupport"`
  114. } `json:"TS" xml:"TS"`
  115. } `json:"M3U8NonStandardSupport" xml:"M3U8NonStandardSupport"`
  116. Properties struct {
  117. Width string `json:"Width" xml:"Width"`
  118. Height string `json:"Height" xml:"Height"`
  119. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  120. Duration string `json:"Duration" xml:"Duration"`
  121. Fps string `json:"Fps" xml:"Fps"`
  122. FileSize string `json:"FileSize" xml:"FileSize"`
  123. FileFormat string `json:"FileFormat" xml:"FileFormat"`
  124. Streams struct {
  125. VideoStreamList struct {
  126. VideoStream []struct {
  127. Index string `json:"Index" xml:"Index"`
  128. CodecName string `json:"CodecName" xml:"CodecName"`
  129. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  130. Profile string `json:"Profile" xml:"Profile"`
  131. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  132. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  133. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  134. Width string `json:"Width" xml:"Width"`
  135. Height string `json:"Height" xml:"Height"`
  136. HasBFrames string `json:"HasBFrames" xml:"HasBFrames"`
  137. Sar string `json:"Sar" xml:"Sar"`
  138. Dar string `json:"Dar" xml:"Dar"`
  139. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  140. Level string `json:"Level" xml:"Level"`
  141. Fps string `json:"Fps" xml:"Fps"`
  142. AvgFPS string `json:"AvgFPS" xml:"AvgFPS"`
  143. Timebase string `json:"Timebase" xml:"Timebase"`
  144. StartTime string `json:"StartTime" xml:"StartTime"`
  145. Duration string `json:"Duration" xml:"Duration"`
  146. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  147. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  148. Lang string `json:"Lang" xml:"Lang"`
  149. NetworkCost struct {
  150. PreloadTime string `json:"PreloadTime" xml:"PreloadTime"`
  151. CostBandwidth string `json:"CostBandwidth" xml:"CostBandwidth"`
  152. AvgBitrate string `json:"AvgBitrate" xml:"AvgBitrate"`
  153. } `json:"NetworkCost" xml:"NetworkCost"`
  154. } `json:"VideoStream" xml:"VideoStream"`
  155. } `json:"VideoStreamList" xml:"VideoStreamList"`
  156. AudioStreamList struct {
  157. AudioStream []struct {
  158. Index string `json:"Index" xml:"Index"`
  159. CodecName string `json:"CodecName" xml:"CodecName"`
  160. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  161. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  162. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  163. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  164. SampleFmt string `json:"SampleFmt" xml:"SampleFmt"`
  165. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  166. Channels string `json:"Channels" xml:"Channels"`
  167. ChannelLayout string `json:"ChannelLayout" xml:"ChannelLayout"`
  168. Timebase string `json:"Timebase" xml:"Timebase"`
  169. StartTime string `json:"StartTime" xml:"StartTime"`
  170. Duration string `json:"Duration" xml:"Duration"`
  171. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  172. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  173. Lang string `json:"Lang" xml:"Lang"`
  174. } `json:"AudioStream" xml:"AudioStream"`
  175. } `json:"AudioStreamList" xml:"AudioStreamList"`
  176. SubtitleStreamList struct {
  177. SubtitleStream []struct {
  178. Index string `json:"Index" xml:"Index"`
  179. Lang string `json:"Lang" xml:"Lang"`
  180. } `json:"SubtitleStream" xml:"SubtitleStream"`
  181. } `json:"SubtitleStreamList" xml:"SubtitleStreamList"`
  182. } `json:"Streams" xml:"Streams"`
  183. Format struct {
  184. NumStreams string `json:"NumStreams" xml:"NumStreams"`
  185. NumPrograms string `json:"NumPrograms" xml:"NumPrograms"`
  186. FormatName string `json:"FormatName" xml:"FormatName"`
  187. FormatLongName string `json:"FormatLongName" xml:"FormatLongName"`
  188. StartTime string `json:"StartTime" xml:"StartTime"`
  189. Duration string `json:"Duration" xml:"Duration"`
  190. Size string `json:"Size" xml:"Size"`
  191. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  192. } `json:"Format" xml:"Format"`
  193. } `json:"Properties" xml:"Properties"`
  194. Clip struct {
  195. TimeSpan struct {
  196. Seek string `json:"Seek" xml:"Seek"`
  197. Duration string `json:"Duration" xml:"Duration"`
  198. } `json:"TimeSpan" xml:"TimeSpan"`
  199. } `json:"Clip" xml:"Clip"`
  200. SuperReso struct {
  201. IsHalfSample string `json:"IsHalfSample" xml:"IsHalfSample"`
  202. } `json:"SuperReso" xml:"SuperReso"`
  203. SubtitleConfig struct {
  204. SubtitleList struct {
  205. Subtitle []struct {
  206. Map string `json:"Map" xml:"Map"`
  207. } `json:"Subtitle" xml:"Subtitle"`
  208. } `json:"SubtitleList" xml:"SubtitleList"`
  209. ExtSubtitleList struct {
  210. ExtSubtitle []struct {
  211. FontName string `json:"FontName" xml:"FontName"`
  212. CharEnc string `json:"CharEnc" xml:"CharEnc"`
  213. Input1 struct {
  214. Bucket string `json:"Bucket" xml:"Bucket"`
  215. Location string `json:"Location" xml:"Location"`
  216. Object string `json:"Object" xml:"Object"`
  217. } `json:"Input" xml:"Input"`
  218. } `json:"ExtSubtitle" xml:"ExtSubtitle"`
  219. } `json:"ExtSubtitleList" xml:"ExtSubtitleList"`
  220. } `json:"SubtitleConfig" xml:"SubtitleConfig"`
  221. TransConfig struct {
  222. TransMode string `json:"TransMode" xml:"TransMode"`
  223. IsCheckReso string `json:"IsCheckReso" xml:"IsCheckReso"`
  224. IsCheckResoFail string `json:"IsCheckResoFail" xml:"IsCheckResoFail"`
  225. IsCheckVideoBitrate string `json:"IsCheckVideoBitrate" xml:"IsCheckVideoBitrate"`
  226. IsCheckAudioBitrate string `json:"IsCheckAudioBitrate" xml:"IsCheckAudioBitrate"`
  227. AdjDarMethod string `json:"AdjDarMethod" xml:"AdjDarMethod"`
  228. IsCheckVideoBitrateFail string `json:"IsCheckVideoBitrateFail" xml:"IsCheckVideoBitrateFail"`
  229. IsCheckAudioBitrateFail string `json:"IsCheckAudioBitrateFail" xml:"IsCheckAudioBitrateFail"`
  230. } `json:"TransConfig" xml:"TransConfig"`
  231. MuxConfig struct {
  232. Segment struct {
  233. Duration string `json:"Duration" xml:"Duration"`
  234. } `json:"Segment" xml:"Segment"`
  235. Gif struct {
  236. Loop string `json:"Loop" xml:"Loop"`
  237. FinalDelay string `json:"FinalDelay" xml:"FinalDelay"`
  238. IsCustomPalette string `json:"IsCustomPalette" xml:"IsCustomPalette"`
  239. DitherMode string `json:"DitherMode" xml:"DitherMode"`
  240. } `json:"Gif" xml:"Gif"`
  241. } `json:"MuxConfig" xml:"MuxConfig"`
  242. Audio struct {
  243. Codec string `json:"Codec" xml:"Codec"`
  244. Profile string `json:"Profile" xml:"Profile"`
  245. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  246. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  247. Channels string `json:"Channels" xml:"Channels"`
  248. Qscale string `json:"Qscale" xml:"Qscale"`
  249. Volume struct {
  250. Level string `json:"Level" xml:"Level"`
  251. Method string `json:"Method" xml:"Method"`
  252. } `json:"Volume" xml:"Volume"`
  253. } `json:"Audio" xml:"Audio"`
  254. Video struct {
  255. Codec string `json:"Codec" xml:"Codec"`
  256. Profile string `json:"Profile" xml:"Profile"`
  257. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  258. Crf string `json:"Crf" xml:"Crf"`
  259. Width string `json:"Width" xml:"Width"`
  260. Height string `json:"Height" xml:"Height"`
  261. Fps string `json:"Fps" xml:"Fps"`
  262. Gop string `json:"Gop" xml:"Gop"`
  263. Preset string `json:"Preset" xml:"Preset"`
  264. ScanMode string `json:"ScanMode" xml:"ScanMode"`
  265. Bufsize string `json:"Bufsize" xml:"Bufsize"`
  266. Maxrate string `json:"Maxrate" xml:"Maxrate"`
  267. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  268. Degrain string `json:"Degrain" xml:"Degrain"`
  269. Qscale string `json:"Qscale" xml:"Qscale"`
  270. Crop string `json:"Crop" xml:"Crop"`
  271. Pad string `json:"Pad" xml:"Pad"`
  272. MaxFps string `json:"MaxFps" xml:"MaxFps"`
  273. BitrateBnd struct {
  274. Max string `json:"Max" xml:"Max"`
  275. Min string `json:"Min" xml:"Min"`
  276. } `json:"BitrateBnd" xml:"BitrateBnd"`
  277. } `json:"Video" xml:"Video"`
  278. Container struct {
  279. Format string `json:"Format" xml:"Format"`
  280. } `json:"Container" xml:"Container"`
  281. Encryption struct {
  282. Type string `json:"Type" xml:"Type"`
  283. Id string `json:"Id" xml:"Id"`
  284. Key string `json:"Key" xml:"Key"`
  285. KeyUri string `json:"KeyUri" xml:"KeyUri"`
  286. KeyType string `json:"KeyType" xml:"KeyType"`
  287. SkipCnt string `json:"SkipCnt" xml:"SkipCnt"`
  288. } `json:"Encryption" xml:"Encryption"`
  289. WaterMarkList struct {
  290. WaterMark []struct {
  291. WaterMarkTemplateId string `json:"WaterMarkTemplateId" xml:"WaterMarkTemplateId"`
  292. Width string `json:"Width" xml:"Width"`
  293. Height string `json:"Height" xml:"Height"`
  294. Dx string `json:"Dx" xml:"Dx"`
  295. Dy string `json:"Dy" xml:"Dy"`
  296. ReferPos string `json:"ReferPos" xml:"ReferPos"`
  297. Type string `json:"Type" xml:"Type"`
  298. InputFile struct {
  299. Bucket string `json:"Bucket" xml:"Bucket"`
  300. Location string `json:"Location" xml:"Location"`
  301. Object string `json:"Object" xml:"Object"`
  302. } `json:"InputFile" xml:"InputFile"`
  303. } `json:"WaterMark" xml:"WaterMark"`
  304. } `json:"WaterMarkList" xml:"WaterMarkList"`
  305. MergeList struct {
  306. Merge []struct {
  307. MergeURL string `json:"MergeURL" xml:"MergeURL"`
  308. Start string `json:"Start" xml:"Start"`
  309. Duration string `json:"Duration" xml:"Duration"`
  310. RoleArn string `json:"RoleArn" xml:"RoleArn"`
  311. } `json:"Merge" xml:"Merge"`
  312. } `json:"MergeList" xml:"MergeList"`
  313. OpeningList struct {
  314. Opening []struct {
  315. OpenUrl string `json:"openUrl" xml:"openUrl"`
  316. Start string `json:"Start" xml:"Start"`
  317. Width string `json:"Width" xml:"Width"`
  318. Height string `json:"Height" xml:"Height"`
  319. } `json:"Opening" xml:"Opening"`
  320. } `json:"OpeningList" xml:"OpeningList"`
  321. TailSlateList struct {
  322. TailSlate []struct {
  323. TailUrl string `json:"TailUrl" xml:"TailUrl"`
  324. Start string `json:"Start" xml:"Start"`
  325. BlendDuration string `json:"BlendDuration" xml:"BlendDuration"`
  326. Width string `json:"Width" xml:"Width"`
  327. Height string `json:"Height" xml:"Height"`
  328. IsMergeAudio bool `json:"IsMergeAudio" xml:"IsMergeAudio"`
  329. BgColor string `json:"BgColor" xml:"BgColor"`
  330. } `json:"TailSlate" xml:"TailSlate"`
  331. } `json:"TailSlateList" xml:"TailSlateList"`
  332. } `json:"Output" xml:"Output"`
  333. MNSMessageResult struct {
  334. MessageId string `json:"MessageId" xml:"MessageId"`
  335. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  336. ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
  337. } `json:"MNSMessageResult" xml:"MNSMessageResult"`
  338. } `json:"Job" xml:"Job"`
  339. } `json:"JobList" xml:"JobList"`
  340. }
  341. func CreateListJobRequest() (request *ListJobRequest) {
  342. request = &ListJobRequest{
  343. RpcRequest: &requests.RpcRequest{},
  344. }
  345. request.InitWithApiInfo("Mts", "2014-06-18", "ListJob", "mts", "openAPI")
  346. return
  347. }
  348. func CreateListJobResponse() (response *ListJobResponse) {
  349. response = &ListJobResponse{
  350. BaseResponse: &responses.BaseResponse{},
  351. }
  352. return
  353. }