Search in sources :

Example 21 with TencentCloudSDKException

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

the class TsfClient method DescribeServerlessGroups.

/**
 *查询Serverless部署组列表
 * @param req DescribeServerlessGroupsRequest
 * @return DescribeServerlessGroupsResponse
 * @throws TencentCloudSDKException
 */
public DescribeServerlessGroupsResponse DescribeServerlessGroups(DescribeServerlessGroupsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeServerlessGroupsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeServerlessGroupsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeServerlessGroups");
        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 22 with TencentCloudSDKException

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

the class NlpClient method DescribeTriple.

/**
 *此接口正在维护升级,后续上线另行通知。
 * @param req DescribeTripleRequest
 * @return DescribeTripleResponse
 * @throws TencentCloudSDKException
 */
public DescribeTripleResponse DescribeTriple(DescribeTripleRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeTripleResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeTripleResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeTriple");
        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 23 with TencentCloudSDKException

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

the class ClsClient method CreateAsyncSearchTask.

/**
 *This API is used to create an offline search task.
 * @param req CreateAsyncSearchTaskRequest
 * @return CreateAsyncSearchTaskResponse
 * @throws TencentCloudSDKException
 */
public CreateAsyncSearchTaskResponse CreateAsyncSearchTask(CreateAsyncSearchTaskRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CreateAsyncSearchTaskResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CreateAsyncSearchTaskResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CreateAsyncSearchTask");
        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 24 with TencentCloudSDKException

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

the class ClsClient method CreateAsyncContextTask.

/**
 *This API is used to create an offline context search task.
 * @param req CreateAsyncContextTaskRequest
 * @return CreateAsyncContextTaskResponse
 * @throws TencentCloudSDKException
 */
public CreateAsyncContextTaskResponse CreateAsyncContextTask(CreateAsyncContextTaskRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CreateAsyncContextTaskResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CreateAsyncContextTaskResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CreateAsyncContextTask");
        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 25 with TencentCloudSDKException

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

the class CdnClient method DescribeDomainsConfig.

/**
 *This API is used to query the complete configuration information of CDN acceleration domain names (inside and outside mainland China).
 * @param req DescribeDomainsConfigRequest
 * @return DescribeDomainsConfigResponse
 * @throws TencentCloudSDKException
 */
public DescribeDomainsConfigResponse DescribeDomainsConfig(DescribeDomainsConfigRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeDomainsConfigResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeDomainsConfigResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeDomainsConfig");
        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