// Path: src/main/java/com/github/ccob/bittrex4j/DateTimeDeserializer.java
// public class DateTimeDeserializer extends JsonDeserializer<ZonedDateTime> {
// 
//     @Override
//     public ZonedDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
// 
//         DateTimeFormatter formatter =
//                 DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[.SSS]").withZone(ZoneId.of("UTC"));
// 
//         String value = p.getValueAsString();
//         ZonedDateTime result = null;
// 
//         if(value.matches("[0-9]{12,}")){
//             Instant i = Instant.ofEpochMilli(Long.parseLong(value));
//             result = ZonedDateTime.ofInstant(i, ZoneId.of("UTC"));
//         }else{
// 
//             if (value != null) {
//                 int index;
//                 if ((index = value.indexOf('.')) > -1) {
//                     char[] chars = new char[4 - (value.length() - index)];
//                     Arrays.fill(chars, '0');
//                     value += new String(chars);
//                 }
//                 result = ZonedDateTime.from(formatter.parse(value));
//             }
//         }
// 
//         return result;
//     }
// }


import com.fasterxml.jackson.annotation.JsonAlias;
import com.github.ccob.bittrex4j.DateTimeDeserializer;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.math.BigDecimal;
import java.time.ZonedDateTime;
/*
 * *
 *  This file is part of the bittrex4j project.
 *
 *  @author CCob
 *
 *  For the full copyright and license information, please view the LICENSE
 *  file that was distributed with this source code.
 * /
 */

package com.github.ccob.bittrex4j.dao;



/**
 * Created by ceri on 09/09/2017.
 */
@JsonIgnoreProperties("DisplayMarketName")
public class MarketSummary {

    @JsonProperty("MarketName")
    @JsonAlias("M")
    String marketName;

    @JsonProperty("High")
    @JsonAlias("H")
    BigDecimal high;

    @JsonProperty("Low")
    @JsonAlias("L")
    BigDecimal low;

    @JsonProperty("Volume")
    @JsonAlias("V")
    BigDecimal volume;

    @JsonProperty("Last")
    @JsonAlias("l")
    BigDecimal last;

    @JsonProperty("BaseVolume")
    @JsonAlias("m")
    BigDecimal baseVolume;

    @JsonProperty("TimeStamp")
    @JsonAlias("T")
// Path: src/main/java/com/github/ccob/bittrex4j/DateTimeDeserializer.java
// public class DateTimeDeserializer extends JsonDeserializer<ZonedDateTime> {
// 
//     @Override
//     public ZonedDateTime deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
// 
//         DateTimeFormatter formatter =
//                 DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[.SSS]").withZone(ZoneId.of("UTC"));
// 
//         String value = p.getValueAsString();
//         ZonedDateTime result = null;
// 
//         if(value.matches("[0-9]{12,}")){
//             Instant i = Instant.ofEpochMilli(Long.parseLong(value));
//             result = ZonedDateTime.ofInstant(i, ZoneId.of("UTC"));
//         }else{
// 
//             if (value != null) {
//                 int index;
//                 if ((index = value.indexOf('.')) > -1) {
//                     char[] chars = new char[4 - (value.length() - index)];
//                     Arrays.fill(chars, '0');
//                     value += new String(chars);
//                 }
//                 result = ZonedDateTime.from(formatter.parse(value));
//             }
//         }
// 
//         return result;
//     }
// }


// Path: src/main/java/com/github/ccob/bittrex4j/dao/MarketSummary.java
import com.fasterxml.jackson.annotation.JsonAlias;
import com.github.ccob.bittrex4j.DateTimeDeserializer;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.math.BigDecimal;
import java.time.ZonedDateTime;

/*
 * *
 *  This file is part of the bittrex4j project.
 *
 *  @author CCob
 *
 *  For the full copyright and license information, please view the LICENSE
 *  file that was distributed with this source code.
 * /
 */

package com.github.ccob.bittrex4j.dao;



/**
 * Created by ceri on 09/09/2017.
 */
@JsonIgnoreProperties("DisplayMarketName")
public class MarketSummary {

    @JsonProperty("MarketName")
    @JsonAlias("M")
    String marketName;

    @JsonProperty("High")
    @JsonAlias("H")
    BigDecimal high;

    @JsonProperty("Low")
    @JsonAlias("L")
    BigDecimal low;

    @JsonProperty("Volume")
    @JsonAlias("V")
    BigDecimal volume;

    @JsonProperty("Last")
    @JsonAlias("l")
    BigDecimal last;

    @JsonProperty("BaseVolume")
    @JsonAlias("m")
    BigDecimal baseVolume;

    @JsonProperty("TimeStamp")
    @JsonAlias("T")
    @JsonDeserialize(using = DateTimeDeserializer.class)