Search in sources :

Example 6 with HttpResponse

use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.

the class FunctionComputeClient method listTriggers.

public ListTriggersResponse listTriggers(ListTriggersRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "GET");
    ListTriggersResponse listTriggersResponse = GSON.fromJson(new String(response.getContent()), ListTriggersResponse.class);
    listTriggersResponse.setHeader(response.getHeaders());
    listTriggersResponse.setContent(response.getContent());
    listTriggersResponse.setStatus(response.getStatus());
    return listTriggersResponse;
}
Also used : HttpResponse(com.aliyuncs.fc.http.HttpResponse)

Example 7 with HttpResponse

use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.

the class FunctionComputeClient method updateFunction.

public UpdateFunctionResponse updateFunction(UpdateFunctionRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "PUT");
    FunctionMetadata functionMetadata = GSON.fromJson(new String(response.getContent()), FunctionMetadata.class);
    UpdateFunctionResponse updateFunctionResponse = new UpdateFunctionResponse();
    updateFunctionResponse.setFunctionMetadata(functionMetadata);
    updateFunctionResponse.setHeader(response.getHeaders());
    updateFunctionResponse.setContent(response.getContent());
    updateFunctionResponse.setStatus(response.getStatus());
    return updateFunctionResponse;
}
Also used : FunctionMetadata(com.aliyuncs.fc.model.FunctionMetadata) HttpResponse(com.aliyuncs.fc.http.HttpResponse)

Example 8 with HttpResponse

use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.

the class FunctionComputeClient method getFunctionCode.

public GetFunctionCodeResponse getFunctionCode(GetFunctionCodeRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "GET");
    FunctionCodeMetadata functionCodeMetadata = GSON.fromJson(new String(response.getContent()), FunctionCodeMetadata.class);
    GetFunctionCodeResponse getFunctionCodeResponse = new GetFunctionCodeResponse();
    getFunctionCodeResponse.setFunctionCodeMetadata(functionCodeMetadata);
    getFunctionCodeResponse.setHeader(response.getHeaders());
    getFunctionCodeResponse.setContent(response.getContent());
    getFunctionCodeResponse.setStatus(response.getStatus());
    return getFunctionCodeResponse;
}
Also used : HttpResponse(com.aliyuncs.fc.http.HttpResponse) FunctionCodeMetadata(com.aliyuncs.fc.model.FunctionCodeMetadata)

Example 9 with HttpResponse

use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.

the class FunctionComputeClient method listFunctions.

public ListFunctionsResponse listFunctions(ListFunctionsRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "GET");
    ListFunctionsResponse listFunctionsResponse = GSON.fromJson(new String(response.getContent()), ListFunctionsResponse.class);
    listFunctionsResponse.setHeader(response.getHeaders());
    listFunctionsResponse.setContent(response.getContent());
    listFunctionsResponse.setStatus(response.getStatus());
    return listFunctionsResponse;
}
Also used : HttpResponse(com.aliyuncs.fc.http.HttpResponse)

Example 10 with HttpResponse

use of com.aliyuncs.fc.http.HttpResponse in project fc-java-sdk by aliyun.

the class FunctionComputeClient method getFunction.

public GetFunctionResponse getFunction(GetFunctionRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "GET");
    FunctionMetadata functionMetadata = GSON.fromJson(new String(response.getContent()), FunctionMetadata.class);
    GetFunctionResponse getFunctionResponse = new GetFunctionResponse();
    getFunctionResponse.setFunctionMetadata(functionMetadata);
    getFunctionResponse.setHeader(response.getHeaders());
    getFunctionResponse.setContent(response.getContent());
    getFunctionResponse.setStatus(response.getStatus());
    return getFunctionResponse;
}
Also used : FunctionMetadata(com.aliyuncs.fc.model.FunctionMetadata) HttpResponse(com.aliyuncs.fc.http.HttpResponse)

Aggregations

HttpResponse (com.aliyuncs.fc.http.HttpResponse)18 FunctionMetadata (com.aliyuncs.fc.model.FunctionMetadata)3 ServiceMetadata (com.aliyuncs.fc.model.ServiceMetadata)3 TriggerMetadata (com.aliyuncs.fc.model.TriggerMetadata)3 ClientException (com.aliyuncs.fc.exceptions.ClientException)1 ServerException (com.aliyuncs.fc.exceptions.ServerException)1 FunctionCodeMetadata (com.aliyuncs.fc.model.FunctionCodeMetadata)1 PrepareUrl (com.aliyuncs.fc.model.PrepareUrl)1 Gson (com.google.gson.Gson)1 JsonParseException (com.google.gson.JsonParseException)1 IOException (java.io.IOException)1 SocketTimeoutException (java.net.SocketTimeoutException)1 InvalidKeyException (java.security.InvalidKeyException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1