All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tencent.ads.container.VideosApiContainer Maven / Gradle / Ivy

/*
 * Marketing API
 * Marketing API
 *
 * OpenAPI spec version: 1.3
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.tencent.ads.container;

import com.google.inject.Inject;
import com.tencent.ads.ApiContainer;
import com.tencent.ads.ApiException;
import com.tencent.ads.anno.*;
import com.tencent.ads.api.VideosApi;
import com.tencent.ads.exception.TencentAdsResponseException;
import com.tencent.ads.model.FilteringStruct;
import com.tencent.ads.model.VideosAddResponse;
import com.tencent.ads.model.VideosAddResponseData;
import com.tencent.ads.model.VideosDeleteRequest;
import com.tencent.ads.model.VideosDeleteResponse;
import com.tencent.ads.model.VideosDeleteResponseData;
import com.tencent.ads.model.VideosGetResponse;
import com.tencent.ads.model.VideosGetResponseData;
import com.tencent.ads.model.VideosUpdateRequest;
import com.tencent.ads.model.VideosUpdateResponse;
import com.tencent.ads.model.VideosUpdateResponseData;
import java.io.File;
import java.util.List;

public class VideosApiContainer extends ApiContainer {

  @Inject VideosApi api;

  /**
   * 添加视频文件
   *
   * @param accountId (required)
   * @param videoFile (required)
   * @param signature (required)
   * @param description (optional)
   * @param adcreativeTemplateId (optional)
   * @return VideosAddResponse
   * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
   *     response body
   */
  public VideosAddResponseData videosAdd(
      Long accountId,
      File videoFile,
      String signature,
      String description,
      Long adcreativeTemplateId)
      throws ApiException, TencentAdsResponseException {
    VideosAddResponse resp =
        api.videosAdd(accountId, videoFile, signature, description, adcreativeTemplateId);
    handleResponse(gson.toJson(resp));
    return resp.getData();
  }

  /**
   * 删除视频
   *
   * @param data (required)
   * @return VideosDeleteResponse
   * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
   *     response body
   */
  public VideosDeleteResponseData videosDelete(VideosDeleteRequest data)
      throws ApiException, TencentAdsResponseException {
    VideosDeleteResponse resp = api.videosDelete(data);
    handleResponse(gson.toJson(resp));
    return resp.getData();
  }

  /**
   * 获取视频文件
   *
   * @param accountId (required)
   * @param filtering (optional)
   * @param page (optional)
   * @param pageSize (optional)
   * @param fields 返回参数的字段列表 (optional)
   * @return VideosGetResponse
   * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
   *     response body
   */
  public VideosGetResponseData videosGet(
      Long accountId,
      List filtering,
      Long page,
      Long pageSize,
      List fields)
      throws ApiException, TencentAdsResponseException {
    VideosGetResponse resp = api.videosGet(accountId, filtering, page, pageSize, fields);
    handleResponse(gson.toJson(resp));
    return resp.getData();
  }

  /**
   * 修改视频信息
   *
   * @param data (required)
   * @return VideosUpdateResponse
   * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the
   *     response body
   */
  public VideosUpdateResponseData videosUpdate(VideosUpdateRequest data)
      throws ApiException, TencentAdsResponseException {
    VideosUpdateResponse resp = api.videosUpdate(data);
    handleResponse(gson.toJson(resp));
    return resp.getData();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy