package com.github.onsdigital.perkin.helpers;

import com.github.davidcarboni.httpino.Endpoint;
import com.github.davidcarboni.httpino.Http;
import com.github.davidcarboni.httpino.Response;
import com.github.onsdigital.perkin.json.EncryptedPayload;
import com.github.onsdigital.perkin.json.Result;

import java.io.IOException;

/**
 * Decrypt via HTTP.
 */
public class HttpTransform {

    public Response<Result> transform(final String data) throws IOException {

        Endpoint endpoint = new Endpoint("/transform");
        System.out.println("transform endpoint " + endpoint);

        EncryptedPayload payload = new EncryptedPayload();
        payload.setContents(data);
        System.out.println("transform data " + data);

        return new Http().postJson(endpoint, data, Result.class);
    }
}

@@ -612,20 +612,16 @@
 ayload =
- new
  Encrypt
@@ -633,32 +633,20 @@
 load
-();%0A        payload.setC
+.builder().c
 onte
@@ -654,16 +654,24 @@
 ts(data)
+.build()
 ;%0A      
@@ -764,20 +764,23 @@
 dpoint, 
-data
+payload
 , Result

fix compile error, oops