Search in sources :

Example 1 with StsClient

use of com.tencentcloudapi.sts.v20180813.StsClient in project cloud-sdk by mizhousoft.

the class TencentOCRServiceImpl method init.

public void init(OCRProfile config) throws CloudSDKException {
    validate(config);
    Credential cred = new Credential(config.getAccessKey(), config.getSecretKey());
    StsClient cosClient = new StsClient(cred, config.getRegion());
    HttpProfile httpProfile = new HttpProfile();
    httpProfile.setEndpoint("ocr.tencentcloudapi.com");
    ClientProfile clientProfile = new ClientProfile();
    clientProfile.setHttpProfile(httpProfile);
    OcrClient ocrClient = new OcrClient(cred, config.getRegion(), clientProfile);
    this.cosClient = cosClient;
    this.ocrClient = ocrClient;
    LOG.info("Init sts and ocr client successfully.");
}
Also used : StsClient(com.tencentcloudapi.sts.v20180813.StsClient) TempCredential(com.mizhousoft.cloudsdk.TempCredential) Credential(com.tencentcloudapi.common.Credential) ClientProfile(com.tencentcloudapi.common.profile.ClientProfile) HttpProfile(com.tencentcloudapi.common.profile.HttpProfile) OcrClient(com.tencentcloudapi.ocr.v20181119.OcrClient)

Aggregations

TempCredential (com.mizhousoft.cloudsdk.TempCredential)1 Credential (com.tencentcloudapi.common.Credential)1 ClientProfile (com.tencentcloudapi.common.profile.ClientProfile)1 HttpProfile (com.tencentcloudapi.common.profile.HttpProfile)1 OcrClient (com.tencentcloudapi.ocr.v20181119.OcrClient)1 StsClient (com.tencentcloudapi.sts.v20180813.StsClient)1