package vod //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" ) // DescribeUserVvByDay invokes the vod.DescribeUserVvByDay API synchronously // api document: https://help.aliyun.com/api/vod/describeuservvbyday.html func (client *Client) DescribeUserVvByDay(request *DescribeUserVvByDayRequest) (response *DescribeUserVvByDayResponse, err error) { response = CreateDescribeUserVvByDayResponse() err = client.DoAction(request, response) return } // DescribeUserVvByDayWithChan invokes the vod.DescribeUserVvByDay API asynchronously // api document: https://help.aliyun.com/api/vod/describeuservvbyday.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeUserVvByDayWithChan(request *DescribeUserVvByDayRequest) (<-chan *DescribeUserVvByDayResponse, <-chan error) { responseChan := make(chan *DescribeUserVvByDayResponse, 1) errChan := make(chan error, 1) err := client.AddAsyncTask(func() { defer close(responseChan) defer close(errChan) response, err := client.DescribeUserVvByDay(request) if err != nil { errChan <- err } else { responseChan <- response } }) if err != nil { errChan <- err close(responseChan) close(errChan) } return responseChan, errChan } // DescribeUserVvByDayWithCallback invokes the vod.DescribeUserVvByDay API asynchronously // api document: https://help.aliyun.com/api/vod/describeuservvbyday.html // asynchronous document: https://help.aliyun.com/document_detail/66220.html func (client *Client) DescribeUserVvByDayWithCallback(request *DescribeUserVvByDayRequest, callback func(response *DescribeUserVvByDayResponse, err error)) <-chan int { result := make(chan int, 1) err := client.AddAsyncTask(func() { var response *DescribeUserVvByDayResponse var err error defer close(result) response, err = client.DescribeUserVvByDay(request) callback(response, err) result <- 1 }) if err != nil { defer close(result) callback(nil, err) result <- 0 } return result } // DescribeUserVvByDayRequest is the request struct for api DescribeUserVvByDay type DescribeUserVvByDayRequest struct { *requests.RpcRequest VideoType string `position:"Query" name:"VideoType"` SecurityToken string `position:"Query" name:"SecurityToken"` EndTime string `position:"Query" name:"EndTime"` StartTime string `position:"Query" name:"StartTime"` OwnerId requests.Integer `position:"Query" name:"OwnerId"` } // DescribeUserVvByDayResponse is the response struct for api DescribeUserVvByDay type DescribeUserVvByDayResponse struct { *responses.BaseResponse RequestId string `json:"RequestId" xml:"RequestId"` UserPlayStatisticsInfos UserPlayStatisticsInfosInDescribeUserVvByDay `json:"UserPlayStatisticsInfos" xml:"UserPlayStatisticsInfos"` } // CreateDescribeUserVvByDayRequest creates a request to invoke DescribeUserVvByDay API func CreateDescribeUserVvByDayRequest() (request *DescribeUserVvByDayRequest) { request = &DescribeUserVvByDayRequest{ RpcRequest: &requests.RpcRequest{}, } request.InitWithApiInfo("vod", "2017-03-21", "DescribeUserVvByDay", "vod", "openAPI") return } // CreateDescribeUserVvByDayResponse creates a response to parse from DescribeUserVvByDay response func CreateDescribeUserVvByDayResponse() (response *DescribeUserVvByDayResponse) { response = &DescribeUserVvByDayResponse{ BaseResponse: &responses.BaseResponse{}, } return }