use of com.tencentcloudapi.common.Credential in project tencentcloud-sdk-java by TencentCloud.
the class SubmitOneByOneClassTask method main.
public static void main(String[] args) {
try {
Credential cred = new Credential("", "");
HttpProfile httpProfile = new HttpProfile();
httpProfile.setReqMethod("POST");
httpProfile.setConnTimeout(60);
httpProfile.setEndpoint("tci.ap-beijing.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setUnsignedPayload(true);
clientProfile.setHttpProfile(httpProfile);
TciClient client = new TciClient(cred, "", clientProfile);
SubmitOneByOneClassTaskRequest req = new SubmitOneByOneClassTaskRequest();
req.setFileContent("https://edu-test-1253131631.cos.ap-guangzhou.myqcloud.com/aieduautotest/autotest_vedio.mp4");
req.setFileType("vod_url");
long lang = 0;
req.setLang(lang);
req.setLibrarySet(new String[] { "library_15603955264181591716" });
req.setVocabLibNameList(new String[] { "testlib2" });
long EncodeType = 1;
req.setVoiceEncodeType(EncodeType);
long FileType = 10;
req.setVoiceFileType(FileType);
SubmitOneByOneClassTaskResponse res = client.SubmitOneByOneClassTask(req);
System.out.println(SubmitOneByOneClassTaskResponse.toJsonString(res));
System.out.println(res.getRequestId());
} catch (TencentCloudSDKException e) {
e.printStackTrace();
}
}
use of com.tencentcloudapi.common.Credential in project tencentcloud-sdk-java by TencentCloud.
the class SubmitOpenClassTask method main.
public static void main(String[] args) {
try {
Credential cred = new Credential("", "");
HttpProfile httpProfile = new HttpProfile();
httpProfile.setReqMethod("POST");
httpProfile.setConnTimeout(60);
httpProfile.setEndpoint("tci.ap-beijing.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setUnsignedPayload(true);
clientProfile.setHttpProfile(httpProfile);
TciClient client = new TciClient(cred, "", clientProfile);
SubmitOpenClassTaskRequest req = new SubmitOpenClassTaskRequest();
req.setFileContent("https://edu-test-1253131631.cos.ap-guangzhou.myqcloud.com/aieduautotest/autotest_vedio.mp4");
req.setFileType("vod_url");
req.setLibrarySet(new String[] { "library_15603955264181591716" });
SubmitOpenClassTaskResponse res = client.SubmitOpenClassTask(req);
System.out.println(SubmitOpenClassTaskResponse.toJsonString(res));
System.out.println(res.getRequestId());
} catch (TencentCloudSDKException e) {
e.printStackTrace();
}
}
use of com.tencentcloudapi.common.Credential in project tencentcloud-sdk-java by TencentCloud.
the class SubmitPartialBodyClassTask method main.
public static void main(String[] args) {
try {
Credential cred = new Credential("", "");
HttpProfile httpProfile = new HttpProfile();
httpProfile.setReqMethod("POST");
httpProfile.setConnTimeout(60);
httpProfile.setEndpoint("tci.ap-beijing.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setUnsignedPayload(true);
clientProfile.setHttpProfile(httpProfile);
TciClient client = new TciClient(cred, "", clientProfile);
SubmitPartialBodyClassTaskRequest req = new SubmitPartialBodyClassTaskRequest();
req.setFileContent("https://edu-test-1253131631.cos.ap-guangzhou.myqcloud.com/aieduautotest/autotest_vedio.mp4");
req.setFileType("vod_url");
long lang = 0;
req.setLang(lang);
req.setLibrarySet(new String[] { "library_15603955264181591716" });
req.setVocabLibNameList(new String[] { "testlib2" });
long EncodeType = 1;
req.setVoiceEncodeType(EncodeType);
long FileType = 10;
req.setVoiceFileType(FileType);
SubmitPartialBodyClassTaskResponse res = client.SubmitPartialBodyClassTask(req);
System.out.println(SubmitPartialBodyClassTaskResponse.toJsonString(res));
System.out.println(res.getRequestId());
} catch (TencentCloudSDKException e) {
e.printStackTrace();
}
}
use of com.tencentcloudapi.common.Credential in project tencentcloud-sdk-java by TencentCloud.
the class SubmitTraditionalClassTask method main.
public static void main(String[] args) {
try {
Credential cred = new Credential("", "");
HttpProfile httpProfile = new HttpProfile();
httpProfile.setReqMethod("POST");
httpProfile.setConnTimeout(60);
httpProfile.setEndpoint("tci.ap-beijing.tencentcloudapi.com");
ClientProfile clientProfile = new ClientProfile();
clientProfile.setUnsignedPayload(true);
clientProfile.setHttpProfile(httpProfile);
TciClient client = new TciClient(cred, "", clientProfile);
SubmitTraditionalClassTaskRequest req = new SubmitTraditionalClassTaskRequest();
req.setFileContent("https://edu-test-1253131631.cos.ap-guangzhou.myqcloud.com/aieduautotest/autotest_vedio.mp4");
req.setFileType("vod_url");
req.setLibrarySet(new String[] { "library_15603955264181591716" });
SubmitTraditionalClassTaskResponse res = client.SubmitTraditionalClassTask(req);
System.out.println(SubmitTraditionalClassTaskResponse.toJsonString(res));
System.out.println(res.getRequestId());
} catch (TencentCloudSDKException e) {
e.printStackTrace();
}
}
use of com.tencentcloudapi.common.Credential in project tencentcloud-sdk-java by TencentCloud.
the class UploadDataFile method main.
public static void main(String[] args) {
try {
Credential cred = new Credential("secretId", "secretKey");
HttpProfile httpProfile = new HttpProfile();
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
CrClient crclient = new CrClient(cred, "ap-guangzhou", clientProfile);
UploadDataFileRequest udfreq = new UploadDataFileRequest();
udfreq.setModule("Data");
udfreq.setOperation("Upload");
udfreq.setFileName("中文文件名unicodeFileName.xlsx");
udfreq.setFile(Files.readAllBytes(Paths.get("E:\\data.xlsx")));
UploadDataFileResponse udfresp = crclient.UploadDataFile(udfreq);
System.out.println(UploadDataFileResponse.toJsonString(udfresp));
} catch (Exception e) {
System.out.println(e);
}
}
Aggregations