Search in sources :

Example 66 with TencentCloudSDKException

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

the class TdmqClient method DescribeSubscriptions.

/**
 *This API is used to query the list of subscribers under the specified environment and topic.
 * @param req DescribeSubscriptionsRequest
 * @return DescribeSubscriptionsResponse
 * @throws TencentCloudSDKException
 */
public DescribeSubscriptionsResponse DescribeSubscriptions(DescribeSubscriptionsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeSubscriptionsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeSubscriptionsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeSubscriptions");
        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 67 with TencentCloudSDKException

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

the class TdmqClient method DescribeCmqQueues.

/**
 *This API is used to query all CMQ queues.
 * @param req DescribeCmqQueuesRequest
 * @return DescribeCmqQueuesResponse
 * @throws TencentCloudSDKException
 */
public DescribeCmqQueuesResponse DescribeCmqQueues(DescribeCmqQueuesRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeCmqQueuesResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeCmqQueuesResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeCmqQueues");
        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 68 with TencentCloudSDKException

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

the class TdmqClient method DescribeRocketMQTopics.

/**
 *This API is used to get the list of RocketMQ topics.
 * @param req DescribeRocketMQTopicsRequest
 * @return DescribeRocketMQTopicsResponse
 * @throws TencentCloudSDKException
 */
public DescribeRocketMQTopicsResponse DescribeRocketMQTopics(DescribeRocketMQTopicsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeRocketMQTopicsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeRocketMQTopicsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeRocketMQTopics");
        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 69 with TencentCloudSDKException

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

the class TdmqClient method DescribeClusters.

/**
 *This API is used to get the list of clusters.
 * @param req DescribeClustersRequest
 * @return DescribeClustersResponse
 * @throws TencentCloudSDKException
 */
public DescribeClustersResponse DescribeClusters(DescribeClustersRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeClustersResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeClustersResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeClusters");
        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 70 with TencentCloudSDKException

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

the class TdmqClient method DescribeRocketMQNamespaces.

/**
 *This API is used to get the list of RocketMQ namespaces.
 * @param req DescribeRocketMQNamespacesRequest
 * @return DescribeRocketMQNamespacesResponse
 * @throws TencentCloudSDKException
 */
public DescribeRocketMQNamespacesResponse DescribeRocketMQNamespaces(DescribeRocketMQNamespacesRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeRocketMQNamespacesResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeRocketMQNamespacesResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeRocketMQNamespaces");
        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