Search in sources :

Example 76 with JsonResponseModel

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

the class RedisClient method DescribeProjectSecurityGroup.

/**
 *This API is used to query the security group information of a project.
 * @param req DescribeProjectSecurityGroupRequest
 * @return DescribeProjectSecurityGroupResponse
 * @throws TencentCloudSDKException
 */
public DescribeProjectSecurityGroupResponse DescribeProjectSecurityGroup(DescribeProjectSecurityGroupRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeProjectSecurityGroupResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeProjectSecurityGroupResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeProjectSecurityGroup");
        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 77 with JsonResponseModel

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

the class RedisClient method EnableReplicaReadonly.

/**
 *This API is used to enable read/write separation.
 * @param req EnableReplicaReadonlyRequest
 * @return EnableReplicaReadonlyResponse
 * @throws TencentCloudSDKException
 */
public EnableReplicaReadonlyResponse EnableReplicaReadonly(EnableReplicaReadonlyRequest req) throws TencentCloudSDKException {
    JsonResponseModel<EnableReplicaReadonlyResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<EnableReplicaReadonlyResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "EnableReplicaReadonly");
        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 78 with JsonResponseModel

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

the class PrivatednsClient method DescribePrivateZoneList.

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

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

the class PrivatednsClient method DescribePrivateZone.

/**
 *This API is used to get the private domain information.
 * @param req DescribePrivateZoneRequest
 * @return DescribePrivateZoneResponse
 * @throws TencentCloudSDKException
 */
public DescribePrivateZoneResponse DescribePrivateZone(DescribePrivateZoneRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribePrivateZoneResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribePrivateZoneResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribePrivateZone");
        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 80 with JsonResponseModel

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

the class PrivatednsClient method DeletePrivateZoneRecord.

/**
 *This API is used to delete a DNS record for a private domain.
 * @param req DeletePrivateZoneRecordRequest
 * @return DeletePrivateZoneRecordResponse
 * @throws TencentCloudSDKException
 */
public DeletePrivateZoneRecordResponse DeletePrivateZoneRecord(DeletePrivateZoneRecordRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DeletePrivateZoneRecordResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DeletePrivateZoneRecordResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DeletePrivateZoneRecord");
        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