Search in sources :

Example 1 with GsonTransformer

use of com.thoughtworks.go.api.util.GsonTransformer in project gocd by gocd.

the class PipelineOperationsControllerV1Delegate method getScheduleOptions.

private PipelineScheduleOptions getScheduleOptions(Request req) {
    if (StringUtils.isBlank(req.body())) {
        return new PipelineScheduleOptions();
    }
    GsonTransformer gsonTransformer = GsonTransformer.getInstance();
    JsonReader jsonReader = gsonTransformer.jsonReaderFrom(req.body());
    return PipelineScheduleOptionsRepresenter.fromJSON(jsonReader);
}
Also used : GsonTransformer(com.thoughtworks.go.api.util.GsonTransformer) PipelineScheduleOptions(com.thoughtworks.go.server.domain.PipelineScheduleOptions) JsonReader(com.thoughtworks.go.api.representers.JsonReader)

Example 2 with GsonTransformer

use of com.thoughtworks.go.api.util.GsonTransformer in project gocd by gocd.

the class PipelineOperationsControllerV1 method getScheduleOptions.

private PipelineScheduleOptions getScheduleOptions(Request req) {
    if (StringUtils.isBlank(req.body())) {
        return new PipelineScheduleOptions();
    }
    GsonTransformer gsonTransformer = GsonTransformer.getInstance();
    JsonReader jsonReader = gsonTransformer.jsonReaderFrom(req.body());
    return PipelineScheduleOptionsRepresenter.fromJSON(jsonReader);
}
Also used : GsonTransformer(com.thoughtworks.go.api.util.GsonTransformer) PipelineScheduleOptions(com.thoughtworks.go.server.domain.PipelineScheduleOptions) JsonReader(com.thoughtworks.go.api.representers.JsonReader)

Aggregations

JsonReader (com.thoughtworks.go.api.representers.JsonReader)2 GsonTransformer (com.thoughtworks.go.api.util.GsonTransformer)2 PipelineScheduleOptions (com.thoughtworks.go.server.domain.PipelineScheduleOptions)2