Java Code Examples for com.tencentcloudapi.common.profile.ClientProfile

The following examples show how to use com.tencentcloudapi.common.profile.ClientProfile. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tencentcloud-sdk-java   Source File: AbstractClient.java    License: Apache License 2.0 6 votes vote down vote up
public AbstractClient(
    String endpoint,
    String version,
    Credential credential,
    String region,
    ClientProfile profile) {
  this.credential = credential;
  this.profile = profile;
  this.endpoint = endpoint;
  this.region = region;
  this.path = "/";
  this.sdkVersion = AbstractClient.SDK_VERSION;
  this.apiVersion = version;
  this.gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
  this.log = new Log(getClass().getName(), profile.isDebug());
  warmup();
}
 
Example 2
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);
        SubmitFullBodyClassTaskRequest req = new SubmitFullBodyClassTaskRequest();
        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);
        SubmitFullBodyClassTaskResponse res = client.SubmitFullBodyClassTask(req);
        System.out.println(SubmitFullBodyClassTaskResponse.toJsonString(res));
        System.out.println(res.getRequestId());
    } catch (TencentCloudSDKException e) {
        e.printStackTrace();
    }
}
 
Example 3
Source Project: tencentcloud-sdk-java   Source File: EsClient.java    License: Apache License 2.0 4 votes vote down vote up
public EsClient(Credential credential, String region, ClientProfile profile) {
    super(EsClient.endpoint, EsClient.version, credential, region, profile);
}
 
Example 4
Source Project: tencentcloud-sdk-java   Source File: CisClient.java    License: Apache License 2.0 4 votes vote down vote up
public CisClient(Credential credential, String region, ClientProfile profile) {
    super(CisClient.endpoint, CisClient.version, credential, region, profile);
}
 
Example 5
Source Project: tencentcloud-sdk-java   Source File: EcdnClient.java    License: Apache License 2.0 4 votes vote down vote up
public EcdnClient(Credential credential, String region, ClientProfile profile) {
    super(EcdnClient.endpoint, EcdnClient.version, credential, region, profile);
}
 
Example 6
Source Project: tencentcloud-sdk-java   Source File: AaiClient.java    License: Apache License 2.0 4 votes vote down vote up
public AaiClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 7
Source Project: tencentcloud-sdk-java   Source File: TcbClient.java    License: Apache License 2.0 4 votes vote down vote up
public TcbClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 8
Source Project: tencentcloud-sdk-java   Source File: FmuClient.java    License: Apache License 2.0 4 votes vote down vote up
public FmuClient(Credential credential, String region, ClientProfile profile) {
    super(FmuClient.endpoint, FmuClient.version, credential, region, profile);
}
 
Example 9
Source Project: tencentcloud-sdk-java   Source File: YunsouClient.java    License: Apache License 2.0 4 votes vote down vote up
public YunsouClient(Credential credential, String region, ClientProfile profile) {
    super(YunsouClient.endpoint, YunsouClient.version, credential, region, profile);
}
 
Example 10
Source Project: tencentcloud-sdk-java   Source File: LiveClient.java    License: Apache License 2.0 4 votes vote down vote up
public LiveClient(Credential credential, String region, ClientProfile profile) {
    super(LiveClient.endpoint, LiveClient.version, credential, region, profile);
}
 
Example 11
Source Project: tencentcloud-sdk-java   Source File: IcClient.java    License: Apache License 2.0 4 votes vote down vote up
public IcClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 12
Source Project: tencentcloud-sdk-java   Source File: PullSmsReplyStatus.java    License: Apache License 2.0 4 votes vote down vote up
public static void main(String[] args) {
    try {
        /* 必要步骤:
         * 实例化一个认证对象,入参需要传入腾讯云账户密钥对secretId,secretKey。
         * 这里采用的是从环境变量读取的方式,需要在环境变量中先设置这两个值。
         * 你也可以直接在代码中写死密钥对,但是小心不要将代码复制、上传或者分享给他人,
         * 以免泄露密钥对危及你的财产安全。
         * CAM密匙查询: https://console.cloud.tencent.com/cam/capi*/
        Credential cred = new Credential("secretId", "secretKey");

        // 实例化一个http选项,可选,没有特殊需求可以跳过
        HttpProfile httpProfile = new HttpProfile();
        // 设置代理
        httpProfile.setProxyHost("host");
        httpProfile.setProxyPort(port);
        /* SDK默认使用POST方法。
         * 如果你一定要使用GET方法,可以在这里设置。GET方法无法处理一些较大的请求 */
        httpProfile.setReqMethod("POST");
        /* SDK有默认的超时时间,非必要请不要进行调整
         * 如有需要请在代码中查阅以获取最新的默认值 */
        httpProfile.setConnTimeout(60);
        /* SDK会自动指定域名。通常是不需要特地指定域名的,但是如果你访问的是金融区的服务
         * 则必须手动指定域名,例如sms的上海金融区域名: sms.ap-shanghai-fsi.tencentcloudapi.com */
        httpProfile.setEndpoint("sms.tencentcloudapi.com");

        /* 非必要步骤:
         * 实例化一个客户端配置对象,可以指定超时时间等配置 */
        ClientProfile clientProfile = new ClientProfile();
        /* SDK默认用TC3-HMAC-SHA256进行签名
         * 非必要请不要修改这个字段 */
        clientProfile.setSignMethod("HmacSHA256");
        clientProfile.setHttpProfile(httpProfile);

        /* 实例化要请求产品(以sms为例)的client对象
         * 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,或者引用预设的常量 */
        SmsClient client = new SmsClient(cred, "",clientProfile);

        /* 实例化一个请求对象,根据调用的接口和实际情况,可以进一步设置请求参数
         * 你可以直接查询SDK源码确定接口有哪些属性可以设置
         * 属性可能是基本类型,也可能引用了另一个数据结构
         * 推荐使用IDE进行开发,可以方便的跳转查阅各个接口和数据结构的文档说明 */
        PullSmsReplyStatus req = new PullSmsReplyStatus();

        /* 填充请求参数,这里request对象的成员变量即对应接口的入参
         * 你可以通过官网接口文档或跳转到request对象的定义处查看请求参数的定义
         * 基本类型的设置:
         * 帮助链接:
         * 短信控制台: https://console.cloud.tencent.com/sms/smslist
         * sms helper: https://cloud.tencent.com/document/product/382/3773 */

        /* 短信应用ID: 短信SdkAppid在 [短信控制台] 添加应用后生成的实际SdkAppid,示例如1400006666 */
        String appid = "1400009099";
        req.setSmsSdkAppid(appid);

        // 设置拉取最大条数,最多100条
        Long limit = 5L;
        req.setLimit(limit);

        /* 通过 client 对象调用 PullSmsReplyStatus 方法发起请求。注意请求方法名与请求对象是对应的
         * 返回的 res 是一个 PullSmsReplyStatusResponse 类的实例,与请求对象对应 */
        PullSmsReplyStatusResponse res = client.PullSmsReplyStatus(req);

        // 输出json格式的字符串回包
        System.out.println(PullSmsReplyStatusResponse.toJsonString(res));

    } catch (TencentCloudSDKException e) {
        e.printStackTrace();
    }
}
 
Example 13
public static void main(String[] args) {
    try {
        /* 必要步骤:
         * 实例化一个认证对象,入参需要传入腾讯云账户密钥对secretId,secretKey。
         * 这里采用的是从环境变量读取的方式,需要在环境变量中先设置这两个值。
         * 你也可以直接在代码中写死密钥对,但是小心不要将代码复制、上传或者分享给他人,
         * 以免泄露密钥对危及你的财产安全。
         * CAM密匙查询: https://console.cloud.tencent.com/cam/capi*/
        Credential cred = new Credential("secretId", "secretKey");

        // 实例化一个http选项,可选,没有特殊需求可以跳过
        HttpProfile httpProfile = new HttpProfile();
        // 设置代理
        httpProfile.setProxyHost("host");
        httpProfile.setProxyPort(port);
        /* SDK默认使用POST方法。
         * 如果你一定要使用GET方法,可以在这里设置。GET方法无法处理一些较大的请求 */
        httpProfile.setReqMethod("POST");
        /* SDK有默认的超时时间,非必要请不要进行调整
         * 如有需要请在代码中查阅以获取最新的默认值 */
        httpProfile.setConnTimeout(60);
        /* SDK会自动指定域名。通常是不需要特地指定域名的,但是如果你访问的是金融区的服务
         * 则必须手动指定域名,例如sms的上海金融区域名: sms.ap-shanghai-fsi.tencentcloudapi.com */
        httpProfile.setEndpoint("sms.tencentcloudapi.com");

        /* 非必要步骤:
         * 实例化一个客户端配置对象,可以指定超时时间等配置 */
        ClientProfile clientProfile = new ClientProfile();
        /* SDK默认用TC3-HMAC-SHA256进行签名
         * 非必要请不要修改这个字段 */
        clientProfile.setSignMethod("HmacSHA256");
        clientProfile.setHttpProfile(httpProfile);

        /* 实例化要请求产品(以sms为例)的client对象
         * 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,或者引用预设的常量 */
        SmsClient client = new SmsClient(cred, "",clientProfile);

        /* 实例化一个请求对象,根据调用的接口和实际情况,可以进一步设置请求参数
         * 你可以直接查询SDK源码确定接口有哪些属性可以设置
         * 属性可能是基本类型,也可能引用了另一个数据结构
         * 推荐使用IDE进行开发,可以方便的跳转查阅各个接口和数据结构的文档说明 */
        SmsPackagesStatisticsRequest req = new SmsPackagesStatisticsRequest();

        /* 填充请求参数,这里request对象的成员变量即对应接口的入参
         * 你可以通过官网接口文档或跳转到request对象的定义处查看请求参数的定义
         * 基本类型的设置:
         * 帮助链接:
         * 短信控制台: https://console.cloud.tencent.com/sms/smslist
         * sms helper: https://cloud.tencent.com/document/product/382/3773 */

        /* 短信应用ID: 短信SdkAppid在 [短信控制台] 添加应用后生成的实际SdkAppid,示例如1400006666 */
        String appid = "1400009099";
        req.setSmsSdkAppid(appid);

        // 最大上限(需要拉取的套餐包个数)
        Long limit = 5L;
        req.setLimit(limit);
        /* 偏移量 注:目前固定设置为0 */
        Long offset = 0L;
        req.setOffset(offset);

        /* 通过 client 对象调用 SmsPackagesStatistics 方法发起请求。注意请求方法名与请求对象是对应的
         * 返回的 res 是一个 SmsPackagesStatisticsResponse 类的实例,与请求对象对应 */
        SmsPackagesStatisticsResponse res = client.SmsPackagesStatisticsStatus(req);

        // 输出json格式的字符串回包
        System.out.println(SmsPackagesStatisticsStatusResponse.toJsonString(res));

    } catch (TencentCloudSDKException e) {
        e.printStackTrace();
    }
}
 
Example 14
Source Project: tencentcloud-sdk-java   Source File: AaClient.java    License: Apache License 2.0 4 votes vote down vote up
public AaClient(Credential credential, String region, ClientProfile profile) {
    super(AaClient.endpoint, AaClient.version, credential, region, profile);
}
 
Example 15
Source Project: tencentcloud-sdk-java   Source File: DsClient.java    License: Apache License 2.0 4 votes vote down vote up
public DsClient(Credential credential, String region, ClientProfile profile) {
    super(DsClient.endpoint, DsClient.version, credential, region, profile);
}
 
Example 16
Source Project: tencentcloud-sdk-java   Source File: ScfClient.java    License: Apache License 2.0 4 votes vote down vote up
public ScfClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 17
Source Project: tencentcloud-sdk-java   Source File: TiemsClient.java    License: Apache License 2.0 4 votes vote down vote up
public TiemsClient(Credential credential, String region, ClientProfile profile) {
    super(TiemsClient.endpoint, TiemsClient.version, credential, region, profile);
}
 
Example 18
Source Project: tencentcloud-sdk-java   Source File: SsmClient.java    License: Apache License 2.0 4 votes vote down vote up
public SsmClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 19
Source Project: tencentcloud-sdk-java   Source File: MspClient.java    License: Apache License 2.0 4 votes vote down vote up
public MspClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 20
Source Project: tencentcloud-sdk-java   Source File: TavClient.java    License: Apache License 2.0 4 votes vote down vote up
public TavClient(Credential credential, String region, ClientProfile profile) {
    super(TavClient.endpoint, TavClient.version, credential, region, profile);
}
 
Example 21
Source Project: tencentcloud-sdk-java   Source File: CrClient.java    License: Apache License 2.0 4 votes vote down vote up
public CrClient(Credential credential, String region, ClientProfile profile) {
    super(CrClient.endpoint, CrClient.version, credential, region, profile);
}
 
Example 22
Source Project: tencentcloud-sdk-java   Source File: NlpClient.java    License: Apache License 2.0 4 votes vote down vote up
public NlpClient(Credential credential, String region, ClientProfile profile) {
    super(NlpClient.endpoint, NlpClient.version, credential, region, profile);
}
 
Example 23
Source Project: tencentcloud-sdk-java   Source File: TbmClient.java    License: Apache License 2.0 4 votes vote down vote up
public TbmClient(Credential credential, String region, ClientProfile profile) {
    super(TbmClient.endpoint, TbmClient.version, credential, region, profile);
}
 
Example 24
Source Project: tencentcloud-sdk-java   Source File: HcmClient.java    License: Apache License 2.0 4 votes vote down vote up
public HcmClient(Credential credential, String region, ClientProfile profile) {
    super(HcmClient.endpoint, HcmClient.version, credential, region, profile);
}
 
Example 25
Source Project: tencentcloud-sdk-java   Source File: TioneClient.java    License: Apache License 2.0 4 votes vote down vote up
public TioneClient(Credential credential, String region, ClientProfile profile) {
    super(TioneClient.endpoint, TioneClient.version, credential, region, profile);
}
 
Example 26
Source Project: tencentcloud-sdk-java   Source File: HaboClient.java    License: Apache License 2.0 4 votes vote down vote up
public HaboClient(Credential credential, String region, ClientProfile profile) {
    super(HaboClient.endpoint, HaboClient.version, credential, region, profile);
}
 
Example 27
Source Project: tencentcloud-sdk-java   Source File: AfcClient.java    License: Apache License 2.0 4 votes vote down vote up
public AfcClient(Credential credential, String region, ClientProfile profile) {
    super(AfcClient.endpoint, AfcClient.version, credential, region, profile);
}
 
Example 28
Source Project: tencentcloud-sdk-java   Source File: TciClient.java    License: Apache License 2.0 4 votes vote down vote up
public TciClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 29
Source Project: tencentcloud-sdk-java   Source File: TioneClient.java    License: Apache License 2.0 4 votes vote down vote up
public TioneClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}
 
Example 30
Source Project: tencentcloud-sdk-java   Source File: CatClient.java    License: Apache License 2.0 4 votes vote down vote up
public CatClient(Credential credential, String region) {
    this(credential, region, new ClientProfile());
}