Search in sources :

Example 1 with FunctionCodeMetadata

use of com.aliyuncs.fc.model.FunctionCodeMetadata 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)

Aggregations

HttpResponse (com.aliyuncs.fc.http.HttpResponse)1 FunctionCodeMetadata (com.aliyuncs.fc.model.FunctionCodeMetadata)1