Search in sources :

Example 16 with TencentCloudSDKException

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

the class CwpClient method CloseProVersion.

/**
 *本接口 (CloseProVersion) 用于关闭专业版。
 * @param req CloseProVersionRequest
 * @return CloseProVersionResponse
 * @throws TencentCloudSDKException
 */
public CloseProVersionResponse CloseProVersion(CloseProVersionRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CloseProVersionResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CloseProVersionResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CloseProVersion");
        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 17 with TencentCloudSDKException

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

the class CwpClient method OpenProVersion.

/**
 *本接口 (OpenProVersion) 用于开通专业版。
 * @param req OpenProVersionRequest
 * @return OpenProVersionResponse
 * @throws TencentCloudSDKException
 */
public OpenProVersionResponse OpenProVersion(OpenProVersionRequest req) throws TencentCloudSDKException {
    JsonResponseModel<OpenProVersionResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<OpenProVersionResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "OpenProVersion");
        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 18 with TencentCloudSDKException

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

the class CwpClient method OpenProVersionPrepaid.

/**
 *本接口 (OpenProVersionPrepaid) 用于开通专业版(包年包月)。
 * @param req OpenProVersionPrepaidRequest
 * @return OpenProVersionPrepaidResponse
 * @throws TencentCloudSDKException
 */
public OpenProVersionPrepaidResponse OpenProVersionPrepaid(OpenProVersionPrepaidRequest req) throws TencentCloudSDKException {
    JsonResponseModel<OpenProVersionPrepaidResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<OpenProVersionPrepaidResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "OpenProVersionPrepaid");
        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 19 with TencentCloudSDKException

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

the class CwpClient method ModifyProVersionRenewFlag.

/**
 *本接口 (ModifyProVersionRenewFlag) 用于修改专业版包年包月续费标识。
 * @param req ModifyProVersionRenewFlagRequest
 * @return ModifyProVersionRenewFlagResponse
 * @throws TencentCloudSDKException
 */
public ModifyProVersionRenewFlagResponse ModifyProVersionRenewFlag(ModifyProVersionRenewFlagRequest req) throws TencentCloudSDKException {
    JsonResponseModel<ModifyProVersionRenewFlagResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<ModifyProVersionRenewFlagResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "ModifyProVersionRenewFlag");
        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 20 with TencentCloudSDKException

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

the class TsfClient method DescribeServerlessGroup.

/**
 *查询Serverless部署组明细
 * @param req DescribeServerlessGroupRequest
 * @return DescribeServerlessGroupResponse
 * @throws TencentCloudSDKException
 */
public DescribeServerlessGroupResponse DescribeServerlessGroup(DescribeServerlessGroupRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeServerlessGroupResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeServerlessGroupResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeServerlessGroup");
        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