public abstract class AbstractClient extends Object
Modifier and Type | Field and Description |
---|---|
com.google.gson.Gson |
gson |
static int |
HTTP_RSP_OK |
static String |
SDK_VERSION |
Constructor and Description |
---|
AbstractClient(String endpoint,
String version,
Credential credential,
String region) |
AbstractClient(String endpoint,
String version,
Credential credential,
String region,
ClientProfile profile) |
Modifier and Type | Method and Description |
---|---|
String |
call(String action,
String jsonPayload)
Use post/json with tc3-hmac-sha256 signature to call any action.
|
String |
callOctetStream(String action,
HashMap<String,String> headers,
byte[] body)
Use post application/octet-stream with tc3-hmac-sha256 signature to call specific action.
|
ClientProfile |
getClientProfile() |
Credential |
getCredential() |
String |
getRegion() |
protected String |
internalRequest(AbstractModel request,
String actionName) |
Object |
retry(AbstractModel req,
int retryTimes)
请注意购买类接口谨慎调用,可能导致多次购买
仅幂等接口推荐使用
|
void |
setClientProfile(ClientProfile profile) |
void |
setCredential(Credential credential) |
void |
setRegion(String region) |
public static final int HTTP_RSP_OK
public static final String SDK_VERSION
public com.google.gson.Gson gson
public AbstractClient(String endpoint, String version, Credential credential, String region)
public AbstractClient(String endpoint, String version, Credential credential, String region, ClientProfile profile)
public void setRegion(String region)
public String getRegion()
public void setClientProfile(ClientProfile profile)
public ClientProfile getClientProfile()
public void setCredential(Credential credential)
public Credential getCredential()
public String call(String action, String jsonPayload) throws TencentCloudSDKException
action
- Name of action to be called.jsonPayload
- Parameters of action serialized in json string format.TencentCloudSDKException
public String callOctetStream(String action, HashMap<String,String> headers, byte[] body) throws TencentCloudSDKException
action
- Name of action to be called.headers
- Parameters of the action, will be put in http header.body
- octet-stream binary body.TencentCloudSDKException
protected String internalRequest(AbstractModel request, String actionName) throws TencentCloudSDKException
TencentCloudSDKException
public Object retry(AbstractModel req, int retryTimes) throws TencentCloudSDKException
req
- retryTimes
- TencentCloudSDKException
Copyright © 2022. All rights reserved.