package com.currencycloud.client.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import net.minidev.json.JSONObject;

@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Currency {

    private String code;
    private Integer decimalPlaces;
    private String name;
    private Boolean onlineTrading;

    public String getCode() {
        return code;
    }

    public Integer getDecimalPlaces() {
        return decimalPlaces;
    }

    public String getName() {
        return name;
    }

    public Boolean getOnlineTrading() {
        return onlineTrading;
    }

    @Override
    public String toString() {
        return new JSONObject()
                .appendField("code", code)
                .appendField("decimalPlaces", decimalPlaces)
                .appendField("name", name)
                .appendField("onlineTrading", onlineTrading)
                .toString();
    }
}

@@ -87,16 +87,127 @@
 nclude;%0A
+import com.fasterxml.jackson.core.JsonProcessingException;%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0A
 import c
@@ -260,16 +260,76 @@
 rategy;%0A
+import com.fasterxml.jackson.databind.SerializationFeature;%0A
 import c
@@ -385,42 +385,90 @@
 ng;%0A
+%0A
 import 
-net.minidev.json.JSONObject
+java.text.SimpleDateFormat;%0Aimport java.util.HashMap;%0Aimport java.util.Map
 ;%0A%0A@
@@ -713,16 +713,73 @@
 Trading;
+%0A    private Boolean canBuy;%0A    private Boolean canSell;
 %0A%0A    pu
@@ -1038,24 +1038,152 @@
 ing;%0A    %7D%0A%0A
+    public Boolean getCanBuy() %7B%0A        return canBuy;%0A    %7D%0A%0A    public Boolean getCanSell() %7B%0A        return canSell;%0A    %7D%0A%0A
     @Overrid
@@ -1227,31 +1227,55 @@
     
-return
+ObjectMapper objectMapper =
  new 
-JSON
 Object
+Mapper
 ()
+;
 %0A   
@@ -1283,59 +1283,252 @@
     
-        .appendField(%22code%22, code)%0A        
+objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);%0A        objectMapper.setDateFormat(new SimpleDateFormat(%22yyyy-MM-dd'T'HH:mm:ssX%22));%0A        Map%3CString, Object%3E map = new HashMap%3C%3E();%0A        map.put(%22code%22, code);%0A
         
 .app
@@ -1523,28 +1523,23 @@
         
-.appendField
+map.put
 (%22decima
@@ -1562,31 +1562,26 @@
 lPlaces)
+;
 %0A
-      
         
   .appen
@@ -1572,30 +1572,23 @@
         
-  .appendField
+map.put
 (%22name%22,
@@ -1593,16 +1593,17 @@
 %22, name)
+;
 %0A       
@@ -1607,28 +1607,15 @@
     
-        .appendField
+map.put
 (%22on
@@ -1642,16 +1642,17 @@
 Trading)
+;
 %0A       
@@ -1656,28 +1656,272 @@
     
-        .toString();
+map.put(%22canBuy%22, canBuy);%0A        map.put(%22canSell%22, canSell);%0A%0A        try %7B%0A            return objectMapper.writeValueAsString(map);%0A        %7D catch (JsonProcessingException e) %7B%0A            return String.format(%22%7B%5C%22error%5C%22: %5C%22%25s%5C%22%7D%22, e.getMessage());%0A        %7D
 %0A   

Add Currency missing fields