// Path: api/src/main/java/com/jfrog/bintray/client/api/ObjectMapperHelper.java
// public class ObjectMapperHelper {
// 
//     public static ObjectMapper get() {
//         return buildDetailsMapper();
//     }
// 
//     private static ObjectMapper buildDetailsMapper() {
//         ObjectMapper mapper = new ObjectMapper(new JsonFactory());
// 
//         // TODO: when moving to Jackson 2.x these can be replaced with JodaModule
//         mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false);
// 
//         //Don't include keys with null values implicitly, only explicitly set values should be sent over
//         mapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
//         mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
//         return mapper;
//     }
// }


import com.jfrog.bintray.client.api.ObjectMapperHelper;
import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.ObjectMapper;
import org.joda.time.DateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
package com.jfrog.bintray.client.api.details;



/**
 * This class is used to serialize and deserialize the needed json to
 * pass to or receive from Bintray when performing actions on a subject
 * NOTE: when serializing this class use getObjectMapper to obtain a suitable mapper for this class
 *
 * @author Dan Feldman
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class SubjectDetails {

    @JsonProperty("name")
    String name;
    @JsonProperty("full_name")
    String fullName;
    @JsonProperty("gravatar_id")
    String gravatarId;
    @JsonProperty("repos")
    List<String> repos;
    @JsonProperty("organizations")
    List<String> organizations;
    @JsonProperty("followers_count")
    Integer followersCount;
    @JsonProperty("registered")
    DateTime registered;
    @JsonProperty("quota_used_bytes")
    Long quotaUsedBytes;

    //All other props that don't have specific fields
    private Map<String, Object> other = new HashMap<>();

    @JsonAnySetter
    public void set(String name, Object value) {
        other.put(name, value);
    }

    @JsonAnyGetter
    public Map<String, Object> other() {
        return other;
    }

    public static ObjectMapper getObjectMapper() {
// Path: api/src/main/java/com/jfrog/bintray/client/api/ObjectMapperHelper.java
// public class ObjectMapperHelper {
// 
//     public static ObjectMapper get() {
//         return buildDetailsMapper();
//     }
// 
//     private static ObjectMapper buildDetailsMapper() {
//         ObjectMapper mapper = new ObjectMapper(new JsonFactory());
// 
//         // TODO: when moving to Jackson 2.x these can be replaced with JodaModule
//         mapper.configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_DATE_KEYS_AS_TIMESTAMPS, false);
// 
//         //Don't include keys with null values implicitly, only explicitly set values should be sent over
//         mapper.configure(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY, false);
//         mapper.configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
//         mapper.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
//         return mapper;
//     }
// }


// Path: api/src/main/java/com/jfrog/bintray/client/api/details/SubjectDetails.java
import com.jfrog.bintray.client.api.ObjectMapperHelper;
import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.ObjectMapper;
import org.joda.time.DateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

package com.jfrog.bintray.client.api.details;



/**
 * This class is used to serialize and deserialize the needed json to
 * pass to or receive from Bintray when performing actions on a subject
 * NOTE: when serializing this class use getObjectMapper to obtain a suitable mapper for this class
 *
 * @author Dan Feldman
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class SubjectDetails {

    @JsonProperty("name")
    String name;
    @JsonProperty("full_name")
    String fullName;
    @JsonProperty("gravatar_id")
    String gravatarId;
    @JsonProperty("repos")
    List<String> repos;
    @JsonProperty("organizations")
    List<String> organizations;
    @JsonProperty("followers_count")
    Integer followersCount;
    @JsonProperty("registered")
    DateTime registered;
    @JsonProperty("quota_used_bytes")
    Long quotaUsedBytes;

    //All other props that don't have specific fields
    private Map<String, Object> other = new HashMap<>();

    @JsonAnySetter
    public void set(String name, Object value) {
        other.put(name, value);
    }

    @JsonAnyGetter
    public Map<String, Object> other() {
        return other;
    }

    public static ObjectMapper getObjectMapper() {
        return ObjectMapperHelper.get();