Search in sources :

Example 36 with JsonResponseModel

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

the class CdnClient method ManageClsTopicDomains.

/**
 *This API is used to manage the list of domain names bound to a log topic.
 * @param req ManageClsTopicDomainsRequest
 * @return ManageClsTopicDomainsResponse
 * @throws TencentCloudSDKException
 */
public ManageClsTopicDomainsResponse ManageClsTopicDomains(ManageClsTopicDomainsRequest req) throws TencentCloudSDKException {
    JsonResponseModel<ManageClsTopicDomainsResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<ManageClsTopicDomainsResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "ManageClsTopicDomains");
        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 37 with JsonResponseModel

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

the class CdnClient method AddCdnDomain.

/**
 *This API is used to add a CDN acceleration domain name.
 * @param req AddCdnDomainRequest
 * @return AddCdnDomainResponse
 * @throws TencentCloudSDKException
 */
public AddCdnDomainResponse AddCdnDomain(AddCdnDomainRequest req) throws TencentCloudSDKException {
    JsonResponseModel<AddCdnDomainResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<AddCdnDomainResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "AddCdnDomain");
        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 38 with JsonResponseModel

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

the class CdnClient method UpdateDomainConfig.

/**
 *This API is used to modify the configuration of CDN acceleration domain names.
 *Note: if you need to update complex configuration items, you must pass all the attributes of the entire object. The default value will be used for attributes that are not passed. We recommend calling the querying API to obtain the configuration attributes first. You can then modify and pass the attributes to the API. The certificate and key fields do not need to be passed for HTTPS configuration.
 * @param req UpdateDomainConfigRequest
 * @return UpdateDomainConfigResponse
 * @throws TencentCloudSDKException
 */
public UpdateDomainConfigResponse UpdateDomainConfig(UpdateDomainConfigRequest req) throws TencentCloudSDKException {
    JsonResponseModel<UpdateDomainConfigResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<UpdateDomainConfigResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "UpdateDomainConfig");
        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 39 with JsonResponseModel

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

the class CdnClient method DescribePushTasks.

/**
 *This API is used to query the submission record and progress of prefetch tasks.
 *This API is in beta test and not fully available yet. Please stay tuned.
 * @param req DescribePushTasksRequest
 * @return DescribePushTasksResponse
 * @throws TencentCloudSDKException
 */
public DescribePushTasksResponse DescribePushTasks(DescribePushTasksRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribePushTasksResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribePushTasksResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribePushTasks");
        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 40 with JsonResponseModel

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

the class CdnClient method DeleteClsLogTopic.

/**
 *This API is used to delete a log topic. Note: when a log topic is deleted, all logs of the domain names bound to it will no longer be published to the topic, and the logs previously published to the topic will be deleted. This action will take effect within 5-15 minutes.
 * @param req DeleteClsLogTopicRequest
 * @return DeleteClsLogTopicResponse
 * @throws TencentCloudSDKException
 */
public DeleteClsLogTopicResponse DeleteClsLogTopic(DeleteClsLogTopicRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DeleteClsLogTopicResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DeleteClsLogTopicResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DeleteClsLogTopic");
        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