Search in sources :

Example 61 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel 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 62 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel 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 63 with JsonResponseModel

use of com.tencentcloudapi.common.JsonResponseModel 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)

Example 64 with JsonResponseModel

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

the class TdmqClient method DescribeRocketMQGroups.

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

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

the class TdmqClient method DescribeTopics.

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

JsonSyntaxException (com.google.gson.JsonSyntaxException)10373 JsonResponseModel (com.tencentcloudapi.common.JsonResponseModel)10373 TencentCloudSDKException (com.tencentcloudapi.common.exception.TencentCloudSDKException)10373 Type (java.lang.reflect.Type)10373