Search in sources :

Example 11 with TencentCloudSDKException

use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java by TencentCloud.

the class TrtcClient method DescribeTrtcInteractiveTime.

/**
 *查询音视频互动计费时长。
 *- 查询时间小于等于1天时,返回每5分钟粒度的数据;查询时间大于1天时,返回按天汇总的数据。
 *- 单次查询统计区间最多不能超过31天。
 *- 若查询当天用量,由于统计延迟等原因,返回数据可能不够准确。
 *- 日结后付费将于次日上午推送账单,建议次日上午9点以后再来查询前一天的用量。
 * @param req DescribeTrtcInteractiveTimeRequest
 * @return DescribeTrtcInteractiveTimeResponse
 * @throws TencentCloudSDKException
 */
public DescribeTrtcInteractiveTimeResponse DescribeTrtcInteractiveTime(DescribeTrtcInteractiveTimeRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeTrtcInteractiveTimeResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeTrtcInteractiveTimeResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeTrtcInteractiveTime");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 12 with TencentCloudSDKException

use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java by TencentCloud.

the class IaiClient method EstimateCheckSimilarPersonCostTime.

/**
 *获取若要开始一个人员查重任务,这个任务结束的预估时间。
 *
 *若EndTimestamp符合您预期,请您尽快发起人员查重请求,否则导致可能需要更多处理时间。
 *
 *若预估时间超过5小时,则无法使用人员查重功能。
 * @param req EstimateCheckSimilarPersonCostTimeRequest
 * @return EstimateCheckSimilarPersonCostTimeResponse
 * @throws TencentCloudSDKException
 */
public EstimateCheckSimilarPersonCostTimeResponse EstimateCheckSimilarPersonCostTime(EstimateCheckSimilarPersonCostTimeRequest req) throws TencentCloudSDKException {
    JsonResponseModel<EstimateCheckSimilarPersonCostTimeResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<EstimateCheckSimilarPersonCostTimeResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "EstimateCheckSimilarPersonCostTime");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 13 with TencentCloudSDKException

use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java by TencentCloud.

the class IaiClient method GetSimilarPersonResult.

/**
 *获取人员查重接口(CheckSimilarPerson)结果。
 * @param req GetSimilarPersonResultRequest
 * @return GetSimilarPersonResultResponse
 * @throws TencentCloudSDKException
 */
public GetSimilarPersonResultResponse GetSimilarPersonResult(GetSimilarPersonResultRequest req) throws TencentCloudSDKException {
    JsonResponseModel<GetSimilarPersonResultResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<GetSimilarPersonResultResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "GetSimilarPersonResult");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 14 with TencentCloudSDKException

use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java by TencentCloud.

the class IaiClient method CheckSimilarPerson.

/**
 *对指定的人员库进行人员查重,给出疑似相同人的信息。
 *
 *可以使用本接口对已有的单个人员库进行人员查重,避免同一人在单个人员库中拥有多个身份;也可以使用本接口对已有的多个人员库进行人员查重,查询同一人是否同时存在多个人员库中。
 *
 *不支持跨算法模型版本查重,且目前仅支持算法模型为3.0的人员库使用查重功能。
 *
 *>
 *- 若对完全相同的指定人员库进行查重操作,需等待上次操作完成才可。即,若两次请求输入的 GroupIds 相同,第一次请求若未完成,第二次请求将返回失败。
 *
 *>
 *- 查重的人员库状态为腾讯云开始进行查重任务的那一刻,即您可以理解为当您发起查重请求后,若您的查重任务需要排队,在排队期间您对人员库的增删操作均会会影响查重的结果。腾讯云将以开始进行查重任务的那一刻人员库的状态进行查重。查重任务开始后,您对人员库的任何操作均不影响查重任务的进行。但建议查重任务开始后,请不要对人员库中人员和人脸进行增删操作。
 * @param req CheckSimilarPersonRequest
 * @return CheckSimilarPersonResponse
 * @throws TencentCloudSDKException
 */
public CheckSimilarPersonResponse CheckSimilarPerson(CheckSimilarPersonRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CheckSimilarPersonResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CheckSimilarPersonResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CheckSimilarPerson");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Example 15 with TencentCloudSDKException

use of com.tencentcloudapi.common.exception.TencentCloudSDKException in project tencentcloud-sdk-java by TencentCloud.

the class IaiClient method GetCheckSimilarPersonJobIdList.

/**
 *获取人员查重任务列表,按任务创建时间逆序(最新的在前面)。
 *
 *只保留最近1年的数据。
 * @param req GetCheckSimilarPersonJobIdListRequest
 * @return GetCheckSimilarPersonJobIdListResponse
 * @throws TencentCloudSDKException
 */
public GetCheckSimilarPersonJobIdListResponse GetCheckSimilarPersonJobIdList(GetCheckSimilarPersonJobIdListRequest req) throws TencentCloudSDKException {
    JsonResponseModel<GetCheckSimilarPersonJobIdListResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<GetCheckSimilarPersonJobIdListResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "GetCheckSimilarPersonJobIdList");
        rsp = gson.fromJson(rspStr, type);
    } catch (JsonSyntaxException e) {
        throw new TencentCloudSDKException("response message: " + rspStr + ".\n Error message: " + e.getMessage());
    }
    return rsp.response;
}
Also used : JsonResponseModel(com.tencentcloudapi.common.JsonResponseModel) Type(java.lang.reflect.Type) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) JsonSyntaxException(com.google.gson.JsonSyntaxException)

Aggregations

TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)10463 JsonSyntaxException (com.google.gson.JsonSyntaxException)10379 Type (java.lang.reflect.Type)10377 JsonResponseModel (com.tencentcloudapi.common.JsonResponseModel)10373 Credential (com.tencentcloudapi.common.Credential)39 ClientProfile (com.tencentcloudapi.common.profile.ClientProfile)26 HttpProfile (com.tencentcloudapi.common.profile.HttpProfile)26 CloudSDKException (com.mizhousoft.cloudsdk.CloudSDKException)12 CvmClient (com.tencentcloudapi.cvm.v20170312.CvmClient)12 DescribeInstancesRequest (com.tencentcloudapi.cvm.v20170312.models.DescribeInstancesRequest)12 HashMap (java.util.HashMap)12 DescribeInstancesResponse (com.tencentcloudapi.cvm.v20170312.models.DescribeInstancesResponse)10 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)9 IOException (java.io.IOException)8 CommonClient (com.tencentcloudapi.common.CommonClient)7 Test (org.junit.Test)7 MediaType (com.squareup.okhttp.MediaType)6 Request (com.squareup.okhttp.Request)6 TciClient (com.tencentcloudapi.tci.v20190318.TciClient)6 UnsupportedEncodingException (java.io.UnsupportedEncodingException)6