Search in sources :

Example 86 with JsonResponseModel

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

the class VpcClient method CreateNatGateway.

/**
 *This API is used to create a NAT Gateway.
 *Before taking actions on a NAT Gateway, ensure that it has been successfully created, namely, the `State` field in the response of the `DescribeNatGateway` API is `AVAILABLE`.
 * @param req CreateNatGatewayRequest
 * @return CreateNatGatewayResponse
 * @throws TencentCloudSDKException
 */
public CreateNatGatewayResponse CreateNatGateway(CreateNatGatewayRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CreateNatGatewayResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CreateNatGatewayResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CreateNatGateway");
        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 87 with JsonResponseModel

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

the class VpcClient method DescribeNatGatewaySourceIpTranslationNatRules.

/**
 *This API is used to query the object arrays of SNAT forwarding rules of the NAT Gateway.
 * @param req DescribeNatGatewaySourceIpTranslationNatRulesRequest
 * @return DescribeNatGatewaySourceIpTranslationNatRulesResponse
 * @throws TencentCloudSDKException
 */
public DescribeNatGatewaySourceIpTranslationNatRulesResponse DescribeNatGatewaySourceIpTranslationNatRules(DescribeNatGatewaySourceIpTranslationNatRulesRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeNatGatewaySourceIpTranslationNatRulesResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeNatGatewaySourceIpTranslationNatRulesResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeNatGatewaySourceIpTranslationNatRules");
        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 88 with JsonResponseModel

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

the class VpcClient method CreateNatGatewayDestinationIpPortTranslationNatRule.

/**
 *This API (CreateNatGatewayDestinationIpPortTranslationNatRule) is used to create a port forwarding rule for a NAT gateway.
 * @param req CreateNatGatewayDestinationIpPortTranslationNatRuleRequest
 * @return CreateNatGatewayDestinationIpPortTranslationNatRuleResponse
 * @throws TencentCloudSDKException
 */
public CreateNatGatewayDestinationIpPortTranslationNatRuleResponse CreateNatGatewayDestinationIpPortTranslationNatRule(CreateNatGatewayDestinationIpPortTranslationNatRuleRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CreateNatGatewayDestinationIpPortTranslationNatRuleResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CreateNatGatewayDestinationIpPortTranslationNatRuleResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CreateNatGatewayDestinationIpPortTranslationNatRule");
        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 89 with JsonResponseModel

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

the class VpcClient method DescribeGatewayFlowQos.

/**
 *This API (DescribeGatewayFlowQos) is used to query the QoS bandwidth limit of inbound IP flow in a gateway.
 * @param req DescribeGatewayFlowQosRequest
 * @return DescribeGatewayFlowQosResponse
 * @throws TencentCloudSDKException
 */
public DescribeGatewayFlowQosResponse DescribeGatewayFlowQos(DescribeGatewayFlowQosRequest req) throws TencentCloudSDKException {
    JsonResponseModel<DescribeGatewayFlowQosResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<DescribeGatewayFlowQosResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "DescribeGatewayFlowQos");
        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 90 with JsonResponseModel

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

the class VpcClient method CreateNetworkAcl.

/**
 *This API is used to create a <a href="https://intl.cloud.tencent.com/document/product/215/20088?from_cn_redirect=1">network ACL</a>.
 * The inbound and outbound rules for a new network ACL are "Deny All" by default. You need to call `ModifyNetworkAclEntries` after creation to set rules for the network ACL as needed.
 * @param req CreateNetworkAclRequest
 * @return CreateNetworkAclResponse
 * @throws TencentCloudSDKException
 */
public CreateNetworkAclResponse CreateNetworkAcl(CreateNetworkAclRequest req) throws TencentCloudSDKException {
    JsonResponseModel<CreateNetworkAclResponse> rsp = null;
    String rspStr = "";
    try {
        Type type = new TypeToken<JsonResponseModel<CreateNetworkAclResponse>>() {
        }.getType();
        rspStr = this.internalRequest(req, "CreateNetworkAcl");
        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