query_media_list.go 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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) QueryMediaList(request *QueryMediaListRequest) (response *QueryMediaListResponse, err error) {
  21. response = CreateQueryMediaListResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) QueryMediaListWithChan(request *QueryMediaListRequest) (<-chan *QueryMediaListResponse, <-chan error) {
  26. responseChan := make(chan *QueryMediaListResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.QueryMediaList(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) QueryMediaListWithCallback(request *QueryMediaListRequest, callback func(response *QueryMediaListResponse, err error)) <-chan int {
  46. result := make(chan int, 1)
  47. err := client.AddAsyncTask(func() {
  48. var response *QueryMediaListResponse
  49. var err error
  50. defer close(result)
  51. response, err = client.QueryMediaList(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 QueryMediaListRequest struct {
  63. *requests.RpcRequest
  64. IncludeMediaInfo requests.Boolean `position:"Query" name:"IncludeMediaInfo"`
  65. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  66. IncludeSnapshotList requests.Boolean `position:"Query" name:"IncludeSnapshotList"`
  67. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  68. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  69. IncludePlayList requests.Boolean `position:"Query" name:"IncludePlayList"`
  70. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  71. MediaIds string `position:"Query" name:"MediaIds"`
  72. }
  73. type QueryMediaListResponse struct {
  74. *responses.BaseResponse
  75. RequestId string `json:"RequestId" xml:"RequestId"`
  76. NonExistMediaIds struct {
  77. MediaId []string `json:"MediaId" xml:"MediaId"`
  78. } `json:"NonExistMediaIds" xml:"NonExistMediaIds"`
  79. MediaList struct {
  80. Media []struct {
  81. MediaId string `json:"MediaId" xml:"MediaId"`
  82. Title string `json:"Title" xml:"Title"`
  83. Description string `json:"Description" xml:"Description"`
  84. CoverURL string `json:"CoverURL" xml:"CoverURL"`
  85. CateId int `json:"CateId" xml:"CateId"`
  86. Duration string `json:"Duration" xml:"Duration"`
  87. Format string `json:"Format" xml:"Format"`
  88. Size string `json:"Size" xml:"Size"`
  89. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  90. Width string `json:"Width" xml:"Width"`
  91. Height string `json:"Height" xml:"Height"`
  92. Fps string `json:"Fps" xml:"Fps"`
  93. PublishState string `json:"PublishState" xml:"PublishState"`
  94. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  95. Tags struct {
  96. Tag []string `json:"Tag" xml:"Tag"`
  97. } `json:"Tags" xml:"Tags"`
  98. RunIdList struct {
  99. RunId []string `json:"RunId" xml:"RunId"`
  100. } `json:"RunIdList" xml:"RunIdList"`
  101. File struct {
  102. URL string `json:"URL" xml:"URL"`
  103. State string `json:"State" xml:"State"`
  104. } `json:"File" xml:"File"`
  105. MediaInfo struct {
  106. Streams struct {
  107. VideoStreamList struct {
  108. VideoStream []struct {
  109. Index string `json:"Index" xml:"Index"`
  110. CodecName string `json:"CodecName" xml:"CodecName"`
  111. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  112. Profile string `json:"Profile" xml:"Profile"`
  113. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  114. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  115. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  116. Width string `json:"Width" xml:"Width"`
  117. Height string `json:"Height" xml:"Height"`
  118. HasBFrames string `json:"HasBFrames" xml:"HasBFrames"`
  119. Sar string `json:"Sar" xml:"Sar"`
  120. Dar string `json:"Dar" xml:"Dar"`
  121. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  122. Level string `json:"Level" xml:"Level"`
  123. Fps string `json:"Fps" xml:"Fps"`
  124. AvgFPS string `json:"AvgFPS" xml:"AvgFPS"`
  125. Timebase string `json:"Timebase" xml:"Timebase"`
  126. StartTime string `json:"StartTime" xml:"StartTime"`
  127. Duration string `json:"Duration" xml:"Duration"`
  128. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  129. NumFrames string `json:"NumFrames" xml:"NumFrames"`
  130. Lang string `json:"Lang" xml:"Lang"`
  131. Rotate string `json:"Rotate" xml:"Rotate"`
  132. NetworkCost struct {
  133. PreloadTime string `json:"PreloadTime" xml:"PreloadTime"`
  134. CostBandwidth string `json:"CostBandwidth" xml:"CostBandwidth"`
  135. AvgBitrate string `json:"AvgBitrate" xml:"AvgBitrate"`
  136. } `json:"NetworkCost" xml:"NetworkCost"`
  137. } `json:"VideoStream" xml:"VideoStream"`
  138. } `json:"VideoStreamList" xml:"VideoStreamList"`
  139. AudioStreamList struct {
  140. AudioStream []struct {
  141. Index string `json:"Index" xml:"Index"`
  142. CodecName string `json:"CodecName" xml:"CodecName"`
  143. CodecTimeBase string `json:"CodecTimeBase" xml:"CodecTimeBase"`
  144. CodecLongName string `json:"CodecLongName" xml:"CodecLongName"`
  145. CodecTagString string `json:"CodecTagString" xml:"CodecTagString"`
  146. CodecTag string `json:"CodecTag" xml:"CodecTag"`
  147. SampleFmt string `json:"SampleFmt" xml:"SampleFmt"`
  148. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  149. Channels string `json:"Channels" xml:"Channels"`
  150. ChannelLayout string `json:"ChannelLayout" xml:"ChannelLayout"`
  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. } `json:"AudioStream" xml:"AudioStream"`
  158. } `json:"AudioStreamList" xml:"AudioStreamList"`
  159. SubtitleStreamList struct {
  160. SubtitleStream []struct {
  161. Index string `json:"Index" xml:"Index"`
  162. Lang string `json:"Lang" xml:"Lang"`
  163. } `json:"SubtitleStream" xml:"SubtitleStream"`
  164. } `json:"SubtitleStreamList" xml:"SubtitleStreamList"`
  165. } `json:"Streams" xml:"Streams"`
  166. Format struct {
  167. NumStreams string `json:"NumStreams" xml:"NumStreams"`
  168. NumPrograms string `json:"NumPrograms" xml:"NumPrograms"`
  169. FormatName string `json:"FormatName" xml:"FormatName"`
  170. FormatLongName string `json:"FormatLongName" xml:"FormatLongName"`
  171. StartTime string `json:"StartTime" xml:"StartTime"`
  172. Duration string `json:"Duration" xml:"Duration"`
  173. Size string `json:"Size" xml:"Size"`
  174. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  175. } `json:"Format" xml:"Format"`
  176. } `json:"MediaInfo" xml:"MediaInfo"`
  177. PlayList struct {
  178. Play []struct {
  179. ActivityName string `json:"ActivityName" xml:"ActivityName"`
  180. MediaWorkflowId string `json:"MediaWorkflowId" xml:"MediaWorkflowId"`
  181. MediaWorkflowName string `json:"MediaWorkflowName" xml:"MediaWorkflowName"`
  182. Duration string `json:"Duration" xml:"Duration"`
  183. Format string `json:"Format" xml:"Format"`
  184. Size string `json:"Size" xml:"Size"`
  185. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  186. Width string `json:"Width" xml:"Width"`
  187. Height string `json:"Height" xml:"Height"`
  188. Fps string `json:"Fps" xml:"Fps"`
  189. Encryption string `json:"Encryption" xml:"Encryption"`
  190. File1 struct {
  191. URL string `json:"URL" xml:"URL"`
  192. State string `json:"State" xml:"State"`
  193. } `json:"File" xml:"File"`
  194. } `json:"Play" xml:"Play"`
  195. } `json:"PlayList" xml:"PlayList"`
  196. SnapshotList struct {
  197. Snapshot []struct {
  198. Type string `json:"Type" xml:"Type"`
  199. MediaWorkflowId string `json:"MediaWorkflowId" xml:"MediaWorkflowId"`
  200. MediaWorkflowName string `json:"MediaWorkflowName" xml:"MediaWorkflowName"`
  201. ActivityName string `json:"ActivityName" xml:"ActivityName"`
  202. Count string `json:"Count" xml:"Count"`
  203. File2 struct {
  204. URL string `json:"URL" xml:"URL"`
  205. State string `json:"State" xml:"State"`
  206. } `json:"File" xml:"File"`
  207. } `json:"Snapshot" xml:"Snapshot"`
  208. } `json:"SnapshotList" xml:"SnapshotList"`
  209. } `json:"Media" xml:"Media"`
  210. } `json:"MediaList" xml:"MediaList"`
  211. }
  212. func CreateQueryMediaListRequest() (request *QueryMediaListRequest) {
  213. request = &QueryMediaListRequest{
  214. RpcRequest: &requests.RpcRequest{},
  215. }
  216. request.InitWithApiInfo("Mts", "2014-06-18", "QueryMediaList", "mts", "openAPI")
  217. return
  218. }
  219. func CreateQueryMediaListResponse() (response *QueryMediaListResponse) {
  220. response = &QueryMediaListResponse{
  221. BaseResponse: &responses.BaseResponse{},
  222. }
  223. return
  224. }