submit_analysis_job.go 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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) SubmitAnalysisJob(request *SubmitAnalysisJobRequest) (response *SubmitAnalysisJobResponse, err error) {
  21. response = CreateSubmitAnalysisJobResponse()
  22. err = client.DoAction(request, response)
  23. return
  24. }
  25. func (client *Client) SubmitAnalysisJobWithChan(request *SubmitAnalysisJobRequest) (<-chan *SubmitAnalysisJobResponse, <-chan error) {
  26. responseChan := make(chan *SubmitAnalysisJobResponse, 1)
  27. errChan := make(chan error, 1)
  28. err := client.AddAsyncTask(func() {
  29. defer close(responseChan)
  30. defer close(errChan)
  31. response, err := client.SubmitAnalysisJob(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) SubmitAnalysisJobWithCallback(request *SubmitAnalysisJobRequest, callback func(response *SubmitAnalysisJobResponse, err error)) <-chan int {
  43. result := make(chan int, 1)
  44. err := client.AddAsyncTask(func() {
  45. var response *SubmitAnalysisJobResponse
  46. var err error
  47. defer close(result)
  48. response, err = client.SubmitAnalysisJob(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 SubmitAnalysisJobRequest struct {
  60. *requests.RpcRequest
  61. Input string `position:"Query" name:"Input"`
  62. UserData string `position:"Query" name:"UserData"`
  63. ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
  64. AnalysisConfig string `position:"Query" name:"AnalysisConfig"`
  65. ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
  66. OwnerAccount string `position:"Query" name:"OwnerAccount"`
  67. OwnerId requests.Integer `position:"Query" name:"OwnerId"`
  68. Priority string `position:"Query" name:"Priority"`
  69. PipelineId string `position:"Query" name:"PipelineId"`
  70. }
  71. type SubmitAnalysisJobResponse struct {
  72. *responses.BaseResponse
  73. RequestId string `json:"RequestId" xml:"RequestId"`
  74. AnalysisJob struct {
  75. Id string `json:"Id" xml:"Id"`
  76. UserData string `json:"UserData" xml:"UserData"`
  77. State string `json:"State" xml:"State"`
  78. Code string `json:"Code" xml:"Code"`
  79. Message string `json:"Message" xml:"Message"`
  80. Percent int `json:"Percent" xml:"Percent"`
  81. CreationTime string `json:"CreationTime" xml:"CreationTime"`
  82. PipelineId string `json:"PipelineId" xml:"PipelineId"`
  83. Priority string `json:"Priority" xml:"Priority"`
  84. InputFile struct {
  85. Bucket string `json:"Bucket" xml:"Bucket"`
  86. Location string `json:"Location" xml:"Location"`
  87. Object string `json:"Object" xml:"Object"`
  88. } `json:"InputFile" xml:"InputFile"`
  89. AnalysisConfig struct {
  90. QualityControl struct {
  91. RateQuality string `json:"RateQuality" xml:"RateQuality"`
  92. MethodStreaming string `json:"MethodStreaming" xml:"MethodStreaming"`
  93. } `json:"QualityControl" xml:"QualityControl"`
  94. PropertiesControl struct {
  95. Deinterlace string `json:"Deinterlace" xml:"Deinterlace"`
  96. Crop struct {
  97. Mode string `json:"Mode" xml:"Mode"`
  98. Width string `json:"Width" xml:"Width"`
  99. Height string `json:"Height" xml:"Height"`
  100. Top string `json:"Top" xml:"Top"`
  101. Left string `json:"Left" xml:"Left"`
  102. } `json:"Crop" xml:"Crop"`
  103. } `json:"PropertiesControl" xml:"PropertiesControl"`
  104. } `json:"AnalysisConfig" xml:"AnalysisConfig"`
  105. MNSMessageResult struct {
  106. MessageId string `json:"MessageId" xml:"MessageId"`
  107. ErrorMessage string `json:"ErrorMessage" xml:"ErrorMessage"`
  108. ErrorCode string `json:"ErrorCode" xml:"ErrorCode"`
  109. } `json:"MNSMessageResult" xml:"MNSMessageResult"`
  110. TemplateList struct {
  111. Template []struct {
  112. Id string `json:"Id" xml:"Id"`
  113. Name string `json:"Name" xml:"Name"`
  114. State string `json:"State" xml:"State"`
  115. Container struct {
  116. Format string `json:"Format" xml:"Format"`
  117. } `json:"Container" xml:"Container"`
  118. Video struct {
  119. Codec string `json:"Codec" xml:"Codec"`
  120. Profile string `json:"Profile" xml:"Profile"`
  121. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  122. Crf string `json:"Crf" xml:"Crf"`
  123. Width string `json:"Width" xml:"Width"`
  124. Height string `json:"Height" xml:"Height"`
  125. Fps string `json:"Fps" xml:"Fps"`
  126. Gop string `json:"Gop" xml:"Gop"`
  127. Preset string `json:"Preset" xml:"Preset"`
  128. ScanMode string `json:"ScanMode" xml:"ScanMode"`
  129. Bufsize string `json:"Bufsize" xml:"Bufsize"`
  130. Maxrate string `json:"Maxrate" xml:"Maxrate"`
  131. PixFmt string `json:"PixFmt" xml:"PixFmt"`
  132. Degrain string `json:"Degrain" xml:"Degrain"`
  133. Qscale string `json:"Qscale" xml:"Qscale"`
  134. BitrateBnd struct {
  135. Max string `json:"Max" xml:"Max"`
  136. Min string `json:"Min" xml:"Min"`
  137. } `json:"BitrateBnd" xml:"BitrateBnd"`
  138. } `json:"Video" xml:"Video"`
  139. Audio struct {
  140. Codec string `json:"Codec" xml:"Codec"`
  141. Profile string `json:"Profile" xml:"Profile"`
  142. Samplerate string `json:"Samplerate" xml:"Samplerate"`
  143. Bitrate string `json:"Bitrate" xml:"Bitrate"`
  144. Channels string `json:"Channels" xml:"Channels"`
  145. Qscale string `json:"Qscale" xml:"Qscale"`
  146. } `json:"Audio" xml:"Audio"`
  147. TransConfig struct {
  148. TransMode string `json:"TransMode" xml:"TransMode"`
  149. } `json:"TransConfig" xml:"TransConfig"`
  150. MuxConfig struct {
  151. Segment struct {
  152. Duration string `json:"Duration" xml:"Duration"`
  153. } `json:"Segment" xml:"Segment"`
  154. Gif struct {
  155. Loop string `json:"Loop" xml:"Loop"`
  156. FinalDelay string `json:"FinalDelay" xml:"FinalDelay"`
  157. } `json:"Gif" xml:"Gif"`
  158. } `json:"MuxConfig" xml:"MuxConfig"`
  159. } `json:"Template" xml:"Template"`
  160. } `json:"TemplateList" xml:"TemplateList"`
  161. } `json:"AnalysisJob" xml:"AnalysisJob"`
  162. }
  163. func CreateSubmitAnalysisJobRequest() (request *SubmitAnalysisJobRequest) {
  164. request = &SubmitAnalysisJobRequest{
  165. RpcRequest: &requests.RpcRequest{},
  166. }
  167. request.InitWithApiInfo("Mts", "2014-06-18", "SubmitAnalysisJob", "mts", "openAPI")
  168. return
  169. }
  170. func CreateSubmitAnalysisJobResponse() (response *SubmitAnalysisJobResponse) {
  171. response = &SubmitAnalysisJobResponse{
  172. BaseResponse: &responses.BaseResponse{},
  173. }
  174. return
  175. }