// Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
// 
//     private Integer total;
// 
//     private Integer successful;
// 
//     private Integer failed;
// 
//     public Integer getTotal() {
//         return total;
//     }
// 
//     public Integer getSuccessful() {
//         return successful;
//     }
// 
//     public Integer getFailed() {
//         return failed;
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/model/search/Facets.java
// public class Facets extends HashMap<String, JsonNode> {
// 
//     public <T extends Facet> T get(String facetName, Class<T> klass) {
//         return ObjectMappers.fromJson(get(facetName), klass);
//     }
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/model/search/Hit.java
// public class Hit {
// 
//     @JsonProperty("_index")
//     private String index;
// 
//     @JsonProperty("_type")
//     private String type;
// 
//     @JsonProperty("_id")
//     private String id;
// 
//     @JsonProperty("_score")
//     private Double score;
// 
//     @JsonProperty("_source")
//     private JsonNode source;
// 
// 
//     public String getIndex() {
//         return index;
//     }
// 
//     public String getType() {
//         return type;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public Double getScore() {
//         return score;
//     }
// 
//     public JsonNode getSource() {
//         return source;
//     }
// 
//     /**
//      * May return <code>null</code> if source was not available.
//      */
//     public <T> T getSourceAsType(Class<T> klass) {
//         return source == null ? null : ObjectMappers.fromJson(source, klass);
//     }
// 
//     /**
//      * May return <code>null</code> if source was not available.
//      */
//     public <T> T getSourceAsType(TypeReference<T> typeReference) {
//         return source == null ? null : ObjectMappers.fromJson(source, typeReference);
//     }
// 
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("index", index)
//                 .add("type", type)
//                 .add("id", id)
//                 .add("score", score)
//                 .add("source", ObjectMappers.toJsonPretty(source))
//                 .toString();
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/model/search/Hits.java
// public class Hits {
// 
//     private Long total;
// 
//     @JsonProperty("max_score")
//     private Double maxScore;
// 
//     private List<Hit> hits;
// 
//     public Long getTotal() {
//         return total;
//     }
// 
//     public Double getMaxScore() {
//         return maxScore;
//     }
// 
//     public List<Hit> getHits() {
//         return hits;
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java
// public class JresJsonReply implements JresReply {
// 
//     private JsonNode node;
// 
//     @Override
//     public JsonNode node() {
//         return node;
//     }
// 
//     public JresJsonReply node(JsonNode node) {
//         this.node = node;
//         return this;
//     }
// 
//     @Override
//     public String toString() {
//         try {
//             return ObjectMappers.PRETTY.writeValueAsString(node());
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
// }


import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.model.search.Facets;
import com.blacklocus.jres.model.search.Hit;
import com.blacklocus.jres.model.search.Hits;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import java.util.List;
/**
 * Copyright 2015 BlackLocus
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.blacklocus.jres.response.search;



public class JresSearchReply extends JresJsonReply {

    private Integer took;

    @JsonProperty("timed_out")
    private Boolean timedOut;

    @JsonProperty("_shards")
// Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
// 
//     private Integer total;
// 
//     private Integer successful;
// 
//     private Integer failed;
// 
//     public Integer getTotal() {
//         return total;
//     }
// 
//     public Integer getSuccessful() {
//         return successful;
//     }
// 
//     public Integer getFailed() {
//         return failed;
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/model/search/Facets.java
// public class Facets extends HashMap<String, JsonNode> {
// 
//     public <T extends Facet> T get(String facetName, Class<T> klass) {
//         return ObjectMappers.fromJson(get(facetName), klass);
//     }
// 
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/model/search/Hit.java
// public class Hit {
// 
//     @JsonProperty("_index")
//     private String index;
// 
//     @JsonProperty("_type")
//     private String type;
// 
//     @JsonProperty("_id")
//     private String id;
// 
//     @JsonProperty("_score")
//     private Double score;
// 
//     @JsonProperty("_source")
//     private JsonNode source;
// 
// 
//     public String getIndex() {
//         return index;
//     }
// 
//     public String getType() {
//         return type;
//     }
// 
//     public String getId() {
//         return id;
//     }
// 
//     public Double getScore() {
//         return score;
//     }
// 
//     public JsonNode getSource() {
//         return source;
//     }
// 
//     /**
//      * May return <code>null</code> if source was not available.
//      */
//     public <T> T getSourceAsType(Class<T> klass) {
//         return source == null ? null : ObjectMappers.fromJson(source, klass);
//     }
// 
//     /**
//      * May return <code>null</code> if source was not available.
//      */
//     public <T> T getSourceAsType(TypeReference<T> typeReference) {
//         return source == null ? null : ObjectMappers.fromJson(source, typeReference);
//     }
// 
// 
//     @Override
//     public String toString() {
//         return MoreObjects.toStringHelper(this)
//                 .add("index", index)
//                 .add("type", type)
//                 .add("id", id)
//                 .add("score", score)
//                 .add("source", ObjectMappers.toJsonPretty(source))
//                 .toString();
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/model/search/Hits.java
// public class Hits {
// 
//     private Long total;
// 
//     @JsonProperty("max_score")
//     private Double maxScore;
// 
//     private List<Hit> hits;
// 
//     public Long getTotal() {
//         return total;
//     }
// 
//     public Double getMaxScore() {
//         return maxScore;
//     }
// 
//     public List<Hit> getHits() {
//         return hits;
//     }
// }
// 
// Path: jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java
// public class JresJsonReply implements JresReply {
// 
//     private JsonNode node;
// 
//     @Override
//     public JsonNode node() {
//         return node;
//     }
// 
//     public JresJsonReply node(JsonNode node) {
//         this.node = node;
//         return this;
//     }
// 
//     @Override
//     public String toString() {
//         try {
//             return ObjectMappers.PRETTY.writeValueAsString(node());
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
// }


// Path: jres-core/src/main/java/com/blacklocus/jres/response/search/JresSearchReply.java
import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.model.search.Facets;
import com.blacklocus.jres.model.search.Hit;
import com.blacklocus.jres.model.search.Hits;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import java.util.List;

/**
 * Copyright 2015 BlackLocus
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.blacklocus.jres.response.search;



public class JresSearchReply extends JresJsonReply {

    private Integer took;

    @JsonProperty("timed_out")
    private Boolean timedOut;

    @JsonProperty("_shards")
    private Shards shards;