use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.
the class FunctionComputeClient method listServices.
public ListServicesResponse listServices(ListServicesRequest request) throws ClientException, ServerException {
HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "GET");
ListServicesResponse listServicesResponse = GSON.fromJson(new String(response.getContent()), ListServicesResponse.class);
listServicesResponse.setHeader(response.getHeaders());
listServicesResponse.setContent(response.getContent());
listServicesResponse.setStatus(response.getStatus());
return listServicesResponse;
}
use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.
the class FunctionComputeClient method createFunction.
public CreateFunctionResponse createFunction(CreateFunctionRequest request) throws ClientException, ServerException {
HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "POST");
FunctionMetadata functionMetadata = GSON.fromJson(new String(response.getContent()), FunctionMetadata.class);
CreateFunctionResponse createFunctionResponse = new CreateFunctionResponse();
createFunctionResponse.setFunctionMetadata(functionMetadata);
createFunctionResponse.setHeader(response.getHeaders());
createFunctionResponse.setContent(response.getContent());
createFunctionResponse.setStatus(response.getStatus());
return createFunctionResponse;
}
use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.
the class FunctionComputeClient method updateTrigger.
public UpdateTriggerResponse updateTrigger(UpdateTriggerRequest request) throws ClientException, ServerException {
HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "PUT");
TriggerMetadata triggerMetadata = GSON.fromJson(new String(response.getContent()), TriggerMetadata.class);
UpdateTriggerResponse updateTriggerResponse = new UpdateTriggerResponse();
updateTriggerResponse.setTriggerMetadata(triggerMetadata);
updateTriggerResponse.setHeader(response.getHeaders());
updateTriggerResponse.setContent(response.getContent());
updateTriggerResponse.setStatus(response.getStatus());
return updateTriggerResponse;
}
Aggregations