From 35c4907c76c9b57e23ff0c63214cbf737ddea5d5 Mon Sep 17 00:00:00 2001 From: sdk-team Date: Tue, 12 May 2020 11:27:54 +0800 Subject: [PATCH] Generated 2017-09-06 for imm. --- ChangeLog.txt | 4 + services/imm/get_content_key.go | 108 +++++++++++++++++++++++ services/imm/get_drm_license.go | 106 ++++++++++++++++++++++ services/imm/stop_stream_analyse_task.go | 105 ++++++++++++++++++++++ 4 files changed, 323 insertions(+) create mode 100644 services/imm/get_content_key.go create mode 100644 services/imm/get_drm_license.go create mode 100644 services/imm/stop_stream_analyse_task.go diff --git a/ChangeLog.txt b/ChangeLog.txt index cdd193c818..1f12a236cc 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2020-05-12 Version: v1.61.182 +- Generated 2017-09-06 for `imm`. +- Supported DRM. + 2020-05-11 Version: v1.61.181 - Generated 2018-04-12 for `EHPC`. - Add new openapi ApplyNodes. diff --git a/services/imm/get_content_key.go b/services/imm/get_content_key.go new file mode 100644 index 0000000000..9aeef6ac08 --- /dev/null +++ b/services/imm/get_content_key.go @@ -0,0 +1,108 @@ +package imm + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// GetContentKey invokes the imm.GetContentKey API synchronously +// api document: https://help.aliyun.com/api/imm/getcontentkey.html +func (client *Client) GetContentKey(request *GetContentKeyRequest) (response *GetContentKeyResponse, err error) { + response = CreateGetContentKeyResponse() + err = client.DoAction(request, response) + return +} + +// GetContentKeyWithChan invokes the imm.GetContentKey API asynchronously +// api document: https://help.aliyun.com/api/imm/getcontentkey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetContentKeyWithChan(request *GetContentKeyRequest) (<-chan *GetContentKeyResponse, <-chan error) { + responseChan := make(chan *GetContentKeyResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetContentKey(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetContentKeyWithCallback invokes the imm.GetContentKey API asynchronously +// api document: https://help.aliyun.com/api/imm/getcontentkey.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetContentKeyWithCallback(request *GetContentKeyRequest, callback func(response *GetContentKeyResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetContentKeyResponse + var err error + defer close(result) + response, err = client.GetContentKey(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetContentKeyRequest is the request struct for api GetContentKey +type GetContentKeyRequest struct { + *requests.RpcRequest + Project string `position:"Query" name:"Project"` + VersionId string `position:"Query" name:"VersionId"` + DRMServerId string `position:"Query" name:"DRMServerId"` + KeyIds string `position:"Query" name:"KeyIds"` +} + +// GetContentKeyResponse is the response struct for api GetContentKey +type GetContentKeyResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + VersionId string `json:"VersionId" xml:"VersionId"` + KeyInfos string `json:"KeyInfos" xml:"KeyInfos"` +} + +// CreateGetContentKeyRequest creates a request to invoke GetContentKey API +func CreateGetContentKeyRequest() (request *GetContentKeyRequest) { + request = &GetContentKeyRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("imm", "2017-09-06", "GetContentKey", "imm", "openAPI") + return +} + +// CreateGetContentKeyResponse creates a response to parse from GetContentKey response +func CreateGetContentKeyResponse() (response *GetContentKeyResponse) { + response = &GetContentKeyResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/imm/get_drm_license.go b/services/imm/get_drm_license.go new file mode 100644 index 0000000000..406d8534e7 --- /dev/null +++ b/services/imm/get_drm_license.go @@ -0,0 +1,106 @@ +package imm + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// GetDRMLicense invokes the imm.GetDRMLicense API synchronously +// api document: https://help.aliyun.com/api/imm/getdrmlicense.html +func (client *Client) GetDRMLicense(request *GetDRMLicenseRequest) (response *GetDRMLicenseResponse, err error) { + response = CreateGetDRMLicenseResponse() + err = client.DoAction(request, response) + return +} + +// GetDRMLicenseWithChan invokes the imm.GetDRMLicense API asynchronously +// api document: https://help.aliyun.com/api/imm/getdrmlicense.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetDRMLicenseWithChan(request *GetDRMLicenseRequest) (<-chan *GetDRMLicenseResponse, <-chan error) { + responseChan := make(chan *GetDRMLicenseResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.GetDRMLicense(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// GetDRMLicenseWithCallback invokes the imm.GetDRMLicense API asynchronously +// api document: https://help.aliyun.com/api/imm/getdrmlicense.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) GetDRMLicenseWithCallback(request *GetDRMLicenseRequest, callback func(response *GetDRMLicenseResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *GetDRMLicenseResponse + var err error + defer close(result) + response, err = client.GetDRMLicense(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// GetDRMLicenseRequest is the request struct for api GetDRMLicense +type GetDRMLicenseRequest struct { + *requests.RpcRequest + Project string `position:"Query" name:"Project"` + DRMType string `position:"Query" name:"DRMType"` + DRMLicense string `position:"Query" name:"DRMLicense"` +} + +// GetDRMLicenseResponse is the response struct for api GetDRMLicense +type GetDRMLicenseResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + DRMData string `json:"DRMData" xml:"DRMData"` +} + +// CreateGetDRMLicenseRequest creates a request to invoke GetDRMLicense API +func CreateGetDRMLicenseRequest() (request *GetDRMLicenseRequest) { + request = &GetDRMLicenseRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("imm", "2017-09-06", "GetDRMLicense", "imm", "openAPI") + return +} + +// CreateGetDRMLicenseResponse creates a response to parse from GetDRMLicense response +func CreateGetDRMLicenseResponse() (response *GetDRMLicenseResponse) { + response = &GetDRMLicenseResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +} diff --git a/services/imm/stop_stream_analyse_task.go b/services/imm/stop_stream_analyse_task.go new file mode 100644 index 0000000000..974ed664f6 --- /dev/null +++ b/services/imm/stop_stream_analyse_task.go @@ -0,0 +1,105 @@ +package imm + +//Licensed under the Apache License, Version 2.0 (the "License"); +//you may not use this file except in compliance with the License. +//You may obtain a copy of the License at +// +//http://www.apache.org/licenses/LICENSE-2.0 +// +//Unless required by applicable law or agreed to in writing, software +//distributed under the License is distributed on an "AS IS" BASIS, +//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//See the License for the specific language governing permissions and +//limitations under the License. +// +// Code generated by Alibaba Cloud SDK Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests" + "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses" +) + +// StopStreamAnalyseTask invokes the imm.StopStreamAnalyseTask API synchronously +// api document: https://help.aliyun.com/api/imm/stopstreamanalysetask.html +func (client *Client) StopStreamAnalyseTask(request *StopStreamAnalyseTaskRequest) (response *StopStreamAnalyseTaskResponse, err error) { + response = CreateStopStreamAnalyseTaskResponse() + err = client.DoAction(request, response) + return +} + +// StopStreamAnalyseTaskWithChan invokes the imm.StopStreamAnalyseTask API asynchronously +// api document: https://help.aliyun.com/api/imm/stopstreamanalysetask.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopStreamAnalyseTaskWithChan(request *StopStreamAnalyseTaskRequest) (<-chan *StopStreamAnalyseTaskResponse, <-chan error) { + responseChan := make(chan *StopStreamAnalyseTaskResponse, 1) + errChan := make(chan error, 1) + err := client.AddAsyncTask(func() { + defer close(responseChan) + defer close(errChan) + response, err := client.StopStreamAnalyseTask(request) + if err != nil { + errChan <- err + } else { + responseChan <- response + } + }) + if err != nil { + errChan <- err + close(responseChan) + close(errChan) + } + return responseChan, errChan +} + +// StopStreamAnalyseTaskWithCallback invokes the imm.StopStreamAnalyseTask API asynchronously +// api document: https://help.aliyun.com/api/imm/stopstreamanalysetask.html +// asynchronous document: https://help.aliyun.com/document_detail/66220.html +func (client *Client) StopStreamAnalyseTaskWithCallback(request *StopStreamAnalyseTaskRequest, callback func(response *StopStreamAnalyseTaskResponse, err error)) <-chan int { + result := make(chan int, 1) + err := client.AddAsyncTask(func() { + var response *StopStreamAnalyseTaskResponse + var err error + defer close(result) + response, err = client.StopStreamAnalyseTask(request) + callback(response, err) + result <- 1 + }) + if err != nil { + defer close(result) + callback(nil, err) + result <- 0 + } + return result +} + +// StopStreamAnalyseTaskRequest is the request struct for api StopStreamAnalyseTask +type StopStreamAnalyseTaskRequest struct { + *requests.RpcRequest + Project string `position:"Query" name:"Project"` + TaskId string `position:"Query" name:"TaskId"` +} + +// StopStreamAnalyseTaskResponse is the response struct for api StopStreamAnalyseTask +type StopStreamAnalyseTaskResponse struct { + *responses.BaseResponse + RequestId string `json:"RequestId" xml:"RequestId"` + TaskId string `json:"TaskId" xml:"TaskId"` +} + +// CreateStopStreamAnalyseTaskRequest creates a request to invoke StopStreamAnalyseTask API +func CreateStopStreamAnalyseTaskRequest() (request *StopStreamAnalyseTaskRequest) { + request = &StopStreamAnalyseTaskRequest{ + RpcRequest: &requests.RpcRequest{}, + } + request.InitWithApiInfo("imm", "2017-09-06", "StopStreamAnalyseTask", "imm", "openAPI") + return +} + +// CreateStopStreamAnalyseTaskResponse creates a response to parse from StopStreamAnalyseTask response +func CreateStopStreamAnalyseTaskResponse() (response *StopStreamAnalyseTaskResponse) { + response = &StopStreamAnalyseTaskResponse{ + BaseResponse: &responses.BaseResponse{}, + } + return +}