// Path: src/main/java/me/pagar/model/Transaction.java
// public enum PaymentMethod {
// 
//     @SerializedName("credit_card")
//     CREDIT_CARD,
// 
//     @SerializedName("boleto")
//     BOLETO,
// 
//     @SerializedName("debit_card")
//     DEBIT_CARD,
// 
//     @SerializedName("pix")
//     PIX
// }
// 
// Path: src/main/java/me/pagar/model/filter/QueriableFields.java
// public interface QueriableFields extends PagarmeRelatable {
// 
//     public Map<String, Object> toMap();
// }
// 
// Path: src/main/java/me/pagar/util/JSONUtils.java
// public class JSONUtils {
// 
//     public static final Gson getInterpreter() {
//         return getNewDefaultGsonBuilder().create();
//     }
// 
//     public static <T> T getAsObject(JsonObject json, Class<T> clazz) {
//         return getNewDefaultGsonBuilder().create().fromJson(json, clazz);
//     }
// 
//     public static <T> T getAsObject(JsonObject json, DateTimeAdapter adapter, Class<T> clazz) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         return builder.create().fromJson(json, clazz);
//     }
// 
//     public static <T> Collection<T> getAsList(JsonArray json, Type listType) {
//         return getNewDefaultGsonBuilder().create().fromJson(json, listType);
//     }
// 
//     public static <T> Collection<T> getAsList(JsonArray json, DateTimeAdapter adapter, Type listType) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         return builder.create().fromJson(json, listType);
//     }
// 
//     public static String getAsJson(Object object) {
//         return getNewDefaultGsonBuilder().create().toJson(object);
//     }
// 
//     public static String getAsJson(Object object, DateTimeAdapter adapter) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         return builder.create().toJson(object);
//     }
// 
//     public static Map<String, Object> objectToMap(Object object) {
//         GsonBuilder builder = getNewDefaultGsonBuilder();
//         final String json = builder.create().toJson(object);
//         return builder.create().fromJson(json, new TypeToken<HashMap<String, Object>>() {
//         }.getType());
//     }
// 
//     public static Map<String, Object> objectToMap(Object object, DateTimeAdapter adapter) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         final String json = builder.create().toJson(object);
//         return builder.create().fromJson(json, new TypeToken<HashMap<String, Object>>() {
//         }.getType());
//     }
// 
//     public static JsonObject treeToJson(Object object) {
//         return getNewDefaultGsonBuilder().create().toJsonTree(object).getAsJsonObject();
//     }
// 
//     private static GsonBuilder getNewDefaultGsonBuilder(){
//         return new GsonBuilder()
//             .excludeFieldsWithoutExposeAnnotation()
//             .registerTypeAdapter(DateTime.class, new DateTimeIsodateAdapter())
//             .registerTypeAdapter(LocalDate.class, new LocalDateAdapter())
//             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//             .setExclusionStrategies(new ExclusionStrategy(){
// 
//                 public boolean shouldSkipClass(Class<?> clazz) {
//                     return false;
//                 }
// 
//                 public boolean shouldSkipField(FieldAttributes fieldAttrs) {
//                     return fieldAttrs.equals(null);
//                 }
//                 
//             });
//     }
// }


import java.util.Collection;
import java.util.Date;
import javax.ws.rs.HttpMethod;
import org.joda.time.DateTime;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import me.pagar.model.Transaction.PaymentMethod;
import me.pagar.model.filter.QueriableFields;
import me.pagar.util.JSONUtils;
    @Expose
    private String recipientId;

    @Expose
    private String anticipationFee;

    @Expose
    private String bulkAnticipationId;

    @Expose
    private Date originalPaymentDate;

    @Expose
    private PaymentMethod paymentMethod;

    public Payable() {
        super();
    }

    public Payable find(Integer id) throws PagarMeException {

        final PagarMeRequest request = new PagarMeRequest(HttpMethod.GET, String.format("/%s/%s", getClassName(), id));

        final Payable other = JSONUtils.getAsObject((JsonObject) request.execute(), Payable.class);
        copy(other);
        flush();

        return other;
    }

// Path: src/main/java/me/pagar/model/Transaction.java
// public enum PaymentMethod {
// 
//     @SerializedName("credit_card")
//     CREDIT_CARD,
// 
//     @SerializedName("boleto")
//     BOLETO,
// 
//     @SerializedName("debit_card")
//     DEBIT_CARD,
// 
//     @SerializedName("pix")
//     PIX
// }
// 
// Path: src/main/java/me/pagar/model/filter/QueriableFields.java
// public interface QueriableFields extends PagarmeRelatable {
// 
//     public Map<String, Object> toMap();
// }
// 
// Path: src/main/java/me/pagar/util/JSONUtils.java
// public class JSONUtils {
// 
//     public static final Gson getInterpreter() {
//         return getNewDefaultGsonBuilder().create();
//     }
// 
//     public static <T> T getAsObject(JsonObject json, Class<T> clazz) {
//         return getNewDefaultGsonBuilder().create().fromJson(json, clazz);
//     }
// 
//     public static <T> T getAsObject(JsonObject json, DateTimeAdapter adapter, Class<T> clazz) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         return builder.create().fromJson(json, clazz);
//     }
// 
//     public static <T> Collection<T> getAsList(JsonArray json, Type listType) {
//         return getNewDefaultGsonBuilder().create().fromJson(json, listType);
//     }
// 
//     public static <T> Collection<T> getAsList(JsonArray json, DateTimeAdapter adapter, Type listType) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         return builder.create().fromJson(json, listType);
//     }
// 
//     public static String getAsJson(Object object) {
//         return getNewDefaultGsonBuilder().create().toJson(object);
//     }
// 
//     public static String getAsJson(Object object, DateTimeAdapter adapter) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         return builder.create().toJson(object);
//     }
// 
//     public static Map<String, Object> objectToMap(Object object) {
//         GsonBuilder builder = getNewDefaultGsonBuilder();
//         final String json = builder.create().toJson(object);
//         return builder.create().fromJson(json, new TypeToken<HashMap<String, Object>>() {
//         }.getType());
//     }
// 
//     public static Map<String, Object> objectToMap(Object object, DateTimeAdapter adapter) {
//         GsonBuilder builder = getNewDefaultGsonBuilder().registerTypeAdapter(DateTime.class, adapter);
//         final String json = builder.create().toJson(object);
//         return builder.create().fromJson(json, new TypeToken<HashMap<String, Object>>() {
//         }.getType());
//     }
// 
//     public static JsonObject treeToJson(Object object) {
//         return getNewDefaultGsonBuilder().create().toJsonTree(object).getAsJsonObject();
//     }
// 
//     private static GsonBuilder getNewDefaultGsonBuilder(){
//         return new GsonBuilder()
//             .excludeFieldsWithoutExposeAnnotation()
//             .registerTypeAdapter(DateTime.class, new DateTimeIsodateAdapter())
//             .registerTypeAdapter(LocalDate.class, new LocalDateAdapter())
//             .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
//             .setExclusionStrategies(new ExclusionStrategy(){
// 
//                 public boolean shouldSkipClass(Class<?> clazz) {
//                     return false;
//                 }
// 
//                 public boolean shouldSkipField(FieldAttributes fieldAttrs) {
//                     return fieldAttrs.equals(null);
//                 }
//                 
//             });
//     }
// }


// Path: src/main/java/me/pagar/model/Payable.java
import java.util.Collection;
import java.util.Date;
import javax.ws.rs.HttpMethod;
import org.joda.time.DateTime;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import me.pagar.model.Transaction.PaymentMethod;
import me.pagar.model.filter.QueriableFields;
import me.pagar.util.JSONUtils;

    @Expose
    private String recipientId;

    @Expose
    private String anticipationFee;

    @Expose
    private String bulkAnticipationId;

    @Expose
    private Date originalPaymentDate;

    @Expose
    private PaymentMethod paymentMethod;

    public Payable() {
        super();
    }

    public Payable find(Integer id) throws PagarMeException {

        final PagarMeRequest request = new PagarMeRequest(HttpMethod.GET, String.format("/%s/%s", getClassName(), id));

        final Payable other = JSONUtils.getAsObject((JsonObject) request.execute(), Payable.class);
        copy(other);
        flush();

        return other;
    }

    public Collection<Payable> findCollection(final Integer totalPerPage, Integer page) throws PagarMeException {