Search in sources :

Example 51 with JsonResponseModel

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

the class MariadbClient method IsolateHourDBInstance.

/**
 *This API is used to isolate pay-as-you-go instances.
 * @param req IsolateHourDBInstanceRequest
 * @return IsolateHourDBInstanceResponse
 * @throws TencentCloudSDKException
 */
public IsolateHourDBInstanceResponse IsolateHourDBInstance(IsolateHourDBInstanceRequest req) throws TencentCloudSDKException {
    JsonResponseModel<IsolateHourDBInstanceResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<IsolateHourDBInstanceResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "IsolateHourDBInstance");
        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 52 with JsonResponseModel

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

the class MariadbClient method DescribeBackupTime.

/**
 *This API is used to get the backup time of a TencentDB instance. The backend system will perform instance backup regularly according to this configuration.
 * @param req DescribeBackupTimeRequest
 * @return DescribeBackupTimeResponse
 * @throws TencentCloudSDKException
 */
public DescribeBackupTimeResponse DescribeBackupTime(DescribeBackupTimeRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeBackupTimeResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeBackupTimeResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeBackupTime");
        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 53 with JsonResponseModel

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

the class MariadbClient method SwitchDBInstanceHA.

/**
 *This API is used to start a primary-replica switch of instances.
 * @param req SwitchDBInstanceHARequest
 * @return SwitchDBInstanceHAResponse
 * @throws TencentCloudSDKException
 */
public SwitchDBInstanceHAResponse SwitchDBInstanceHA(SwitchDBInstanceHARequest req) throws TencentCloudSDKException {
    JsonResponseModel<SwitchDBInstanceHAResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<SwitchDBInstanceHAResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "SwitchDBInstanceHA");
        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 54 with JsonResponseModel

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

the class MariadbClient method DescribeFlow.

/**
 *This API is used to query flow status.
 * @param req DescribeFlowRequest
 * @return DescribeFlowResponse
 * @throws TencentCloudSDKException
 */
public DescribeFlowResponse DescribeFlow(DescribeFlowRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeFlowResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeFlowResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeFlow");
        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 55 with JsonResponseModel

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

the class MariadbClient method ModifyBackupTime.

/**
 *This API is used to set the backup time of a TencentDB instance. The backend system will perform instance backup regularly according to this configuration.
 * @param req ModifyBackupTimeRequest
 * @return ModifyBackupTimeResponse
 * @throws TencentCloudSDKException
 */
public ModifyBackupTimeResponse ModifyBackupTime(ModifyBackupTimeRequest req) throws TencentCloudSDKException {
    JsonResponseModel<ModifyBackupTimeResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<ModifyBackupTimeResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "ModifyBackupTime");
        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