Search in sources :

Example 1 with PullEventsRequest

use of com.tencentcloudapi.vod.v20180717.models.PullEventsRequest in project cloud-sdk by mizhousoft.

the class QCloudVODServiceImpl method pullEvents.

/**
 * {@inheritDoc}
 */
@Override
public List<VodEvent> pullEvents() throws CloudSDKException {
    try {
        PullEventsRequest req = new PullEventsRequest();
        PullEventsResponse resp = vodClient.PullEvents(req);
        EventContent[] list = resp.getEventSet();
        if (null != list) {
            List<VodEvent> events = new ArrayList<>(list.length);
            for (EventContent item : list) {
                VodEvent event = convertToEvent(item);
                events.add(event);
            }
            return events;
        }
        return new ArrayList<>(0);
    } catch (TencentCloudSDKException e) {
        throw new CloudSDKException(e.getErrorCode(), e.getMessage(), e);
    }
}
Also used : CloudSDKException(com.mizhousoft.cloudsdk.CloudSDKException) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) ArrayList(java.util.ArrayList) EventContent(com.tencentcloudapi.vod.v20180717.models.EventContent) PullEventsResponse(com.tencentcloudapi.vod.v20180717.models.PullEventsResponse) PullEventsRequest(com.tencentcloudapi.vod.v20180717.models.PullEventsRequest) VodEvent(com.mizhousoft.cloudsdk.vod.event.VodEvent)

Aggregations

CloudSDKException (com.mizhousoft.cloudsdk.CloudSDKException)1 VodEvent (com.mizhousoft.cloudsdk.vod.event.VodEvent)1 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)1 EventContent (com.tencentcloudapi.vod.v20180717.models.EventContent)1 PullEventsRequest (com.tencentcloudapi.vod.v20180717.models.PullEventsRequest)1 PullEventsResponse (com.tencentcloudapi.vod.v20180717.models.PullEventsResponse)1 ArrayList (java.util.ArrayList)1