Search in sources :

Example 31 with JsonResponseModel

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

the class CdnClient method DescribePayType.

/**
 *This API (DescribePayType) is used to query billing information of the current account, such as billing mode and billing cycle.
 * @param req DescribePayTypeRequest
 * @return DescribePayTypeResponse
 * @throws TencentCloudSDKException
 */
public DescribePayTypeResponse DescribePayType(DescribePayTypeRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribePayTypeResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribePayTypeResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribePayType");
        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 32 with JsonResponseModel

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

the class CdbClient method DescribeDeployGroupList.

/**
 *This API is used to query the list of placement groups of a user. You can specify the placement group ID or name.
 * @param req DescribeDeployGroupListRequest
 * @return DescribeDeployGroupListResponse
 * @throws TencentCloudSDKException
 */
public DescribeDeployGroupListResponse DescribeDeployGroupList(DescribeDeployGroupListRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeDeployGroupListResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeDeployGroupListResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeDeployGroupList");
        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 33 with JsonResponseModel

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

the class CdnClient method DescribeCdnDomainLogs.

/**
 *This API is used to query the download link of an access log. You can use this API for access logs in the last 30 days either within or outside Mainland China.
 * @param req DescribeCdnDomainLogsRequest
 * @return DescribeCdnDomainLogsResponse
 * @throws TencentCloudSDKException
 */
public DescribeCdnDomainLogsResponse DescribeCdnDomainLogs(DescribeCdnDomainLogsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeCdnDomainLogsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeCdnDomainLogsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeCdnDomainLogs");
        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 34 with JsonResponseModel

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

the class CdnClient method EnableCaches.

/**
 *This API (EnableCaches) is used to unblock manually blocked URLs. After a URL is successfully unblocked, it takes about 5 to 10 minutes to take effect across the entire network. (This API is during beta test and not fully available now.)
 * @param req EnableCachesRequest
 * @return EnableCachesResponse
 * @throws TencentCloudSDKException
 */
public EnableCachesResponse EnableCaches(EnableCachesRequest req) throws TencentCloudSDKException {
    JsonResponseModel<EnableCachesResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<EnableCachesResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "EnableCaches");
        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 35 with JsonResponseModel

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

the class CdnClient method StopCdnDomain.

/**
 *This API is used to suspend the acceleration service for a domain name.
 *Note: after the acceleration service has been suspended, requests to the cache node will return a 404 error. In order to avoid impact to your business, please move the domain name to another service before suspending the acceleration service.
 * @param req StopCdnDomainRequest
 * @return StopCdnDomainResponse
 * @throws TencentCloudSDKException
 */
public StopCdnDomainResponse StopCdnDomain(StopCdnDomainRequest req) throws TencentCloudSDKException {
    JsonResponseModel<StopCdnDomainResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<StopCdnDomainResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "StopCdnDomain");
        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