Search in sources :

Example 1 with HcmClient

use of com.tencentcloudapi.hcm.v20181106.HcmClient in project tencentcloud-sdk-java by TencentCloud.

the class EvaluationExample method main.

public static void main(String[] args) {
    try {
        // 实例化一个认证对象,入参需要传入腾讯云账户secretId,secretKey
        Credential cred = new Credential("...", "...");
        // 实例化一个http选项,可选的,没有特殊需求可以跳过
        HttpProfile httpProfile = new HttpProfile();
        // post请求(默认为post请求)
        httpProfile.setReqMethod("POST");
        // 请求连接超时时间,单位为秒(默认60秒)
        httpProfile.setConnTimeout(60);
        // 指定接入地域域名(默认就近接入)
        httpProfile.setEndpoint("soe.ap-beijing.tencentcloudapi.com");
        ClientProfile clientProfile = new ClientProfile();
        clientProfile.setUnsignedPayload(true);
        clientProfile.setHttpProfile(httpProfile);
        HcmClient hcmClient = new HcmClient(cred, "");
        EvaluationRequest evaluationRequest = new EvaluationRequest();
        evaluationRequest.setSessionId("123456");
        evaluationRequest.setImage("iVBORw0KGgoAAAANSUhEUgAAAYsAAADSCAIAAAA0dHtXAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAa1SURBVHhe7d1hWtpMGIbRb10syPWwGjbDYvoFm9qqEELeTOYxOedf9Wor7zA3A0b87xdAKoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIpVBALoUCcikUkEuhgFwKBeRSKCCXQgG5FArIFVyo64fxA2xnnPxg/AB0EVqo6/n034fT2TbZkuG3dL1eLpfz283pm9tHz8PnPTB8CCzU9fz2zw4Z2CTbMfw2rkOUTp8n+9xQrPPl6OPPKtSwjndW0Sb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cfGn7atFaqdeYcndXpEoYoUiofmvfKkTlMUqkihuG/Wc7tT4q9uiKJQRQpVU/uRo9Wt9iNHM/Ik/nMoVJFC1cx7mWYz69zc5zdKneZSqCKFqtlhoZ4dn7zu9AqFKlKomr0V6tnt+Wl3je4UqkihavZVqCe3xuHpdQpVpFA1eyrU9G051LuLr0ehihSqZkeFmpjij7tH5FCoIoWqukYZv6jXTaVWn5ZTqCKF4sYIG1GoIoViMDFBrz+VKFSRQiFQDSlUkUIx9RqU+RUpVJFCMREoR6gqhSpSKIyvIYUqUqjDmzpC3d5dZTPj17MvClWkUIc3Vagt7XOpFKro7vsbdfjF5iUKVTExvU0pVFM2SUeGX6FQLSkUhl+jUC0pFIZfkvIylEK1ZZN0ZPgFCtWUQmH4JQrVlEJh+CUK1VRMoQC+USggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJBLoYBcCgXkUiggl0IBuRQKyKVQQC6FAnIpFJDq16//AcjLGczv/edxAAAAAElFTkSuQmCC");
        evaluationRequest.setUrl("");
        evaluationRequest.setHcmAppId("");
        EvaluationResponse evaluationResponse = hcmClient.Evaluation(evaluationRequest);
        System.out.println(evaluationResponse.getItems());
        System.out.println(evaluationResponse.getRequestId());
        System.out.println(evaluationResponse.getSessionId());
    } catch (TencentCloudSDKException e) {
        e.printStackTrace();
    }
}
Also used : Credential(com.tencentcloudapi.common.Credential) TencentCloudSDKException(com.tencentcloudapi.common.exception.TencentCloudSDKException) EvaluationRequest(com.tencentcloudapi.hcm.v20181106.models.EvaluationRequest) ClientProfile(com.tencentcloudapi.common.profile.ClientProfile) HttpProfile(com.tencentcloudapi.common.profile.HttpProfile) EvaluationResponse(com.tencentcloudapi.hcm.v20181106.models.EvaluationResponse) HcmClient(com.tencentcloudapi.hcm.v20181106.HcmClient)

Aggregations

Credential (com.tencentcloudapi.common.Credential)1 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)1 ClientProfile (com.tencentcloudapi.common.profile.ClientProfile)1 HttpProfile (com.tencentcloudapi.common.profile.HttpProfile)1 HcmClient (com.tencentcloudapi.hcm.v20181106.HcmClient)1 EvaluationRequest (com.tencentcloudapi.hcm.v20181106.models.EvaluationRequest)1 EvaluationResponse (com.tencentcloudapi.hcm.v20181106.models.EvaluationResponse)1