Search in sources :

Example 1 with ServiceMetadata

use of com.aliyuncs.fc.model.ServiceMetadata in project fc-java-sdk by aliyun.

the class FunctionComputeClient method getService.

public GetServiceResponse getService(GetServiceRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "GET");
    ServiceMetadata serviceMetadata = GSON.fromJson(new String(response.getContent()), ServiceMetadata.class);
    GetServiceResponse getServiceResponse = new GetServiceResponse();
    getServiceResponse.setServiceMetadata(serviceMetadata);
    getServiceResponse.setHeader(response.getHeaders());
    getServiceResponse.setContent(response.getContent());
    getServiceResponse.setStatus(response.getStatus());
    return getServiceResponse;
}
Also used : HttpResponse(com.aliyuncs.fc.http.HttpResponse) ServiceMetadata(com.aliyuncs.fc.model.ServiceMetadata)

Example 2 with ServiceMetadata

use of com.aliyuncs.fc.model.ServiceMetadata in project fc-java-sdk by aliyun.

the class FunctionComputeClient method createService.

public CreateServiceResponse createService(CreateServiceRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "POST");
    ServiceMetadata serviceMetadata = GSON.fromJson(new String(response.getContent()), ServiceMetadata.class);
    CreateServiceResponse createServiceResponse = new CreateServiceResponse();
    createServiceResponse.setServiceMetadata(serviceMetadata);
    createServiceResponse.setHeaders(response.getHeaders());
    createServiceResponse.setContent(response.getContent());
    createServiceResponse.setStatus(response.getStatus());
    return createServiceResponse;
}
Also used : HttpResponse(com.aliyuncs.fc.http.HttpResponse) ServiceMetadata(com.aliyuncs.fc.model.ServiceMetadata)

Example 3 with ServiceMetadata

use of com.aliyuncs.fc.model.ServiceMetadata in project fc-java-sdk by aliyun.

the class FunctionComputeClient method updateService.

public UpdateServiceResponse updateService(UpdateServiceRequest request) throws ClientException, ServerException {
    HttpResponse response = client.doAction(request, CONTENT_TYPE_APPLICATION_JSON, "PUT");
    ServiceMetadata serviceMetadata = GSON.fromJson(new String(response.getContent()), ServiceMetadata.class);
    UpdateServiceResponse updateServiceResponse = new UpdateServiceResponse();
    updateServiceResponse.setServiceMetadata(serviceMetadata);
    updateServiceResponse.setHeader(response.getHeaders());
    updateServiceResponse.setContent(response.getContent());
    updateServiceResponse.setStatus(response.getStatus());
    return updateServiceResponse;
}
Also used : HttpResponse(com.aliyuncs.fc.http.HttpResponse) ServiceMetadata(com.aliyuncs.fc.model.ServiceMetadata)

Aggregations

HttpResponse (com.aliyuncs.fc.http.HttpResponse)3 ServiceMetadata (com.aliyuncs.fc.model.ServiceMetadata)3