// Path: src/main/java/eu/luminis/elastic/search/response/aggregations/Aggregation.java
// public class Aggregation {
//     private String name;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// }
// 
// Path: src/main/java/eu/luminis/elastic/search/response/aggregations/AggregationKeyDeserializer.java
// public class AggregationKeyDeserializer extends KeyDeserializer {
//     @Override
//     public String deserializeKey(String key, DeserializationContext ctxt) throws IOException {
//         int position = key.indexOf('#');
//         if (position == -1) {
//             throw ctxt.mappingException(String.format("Key %s should have structure type#key for aggregations", key));
//         }
//         return key.substring(position + 1);
//     }
// }


import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import eu.luminis.elastic.search.response.aggregations.Aggregation;
import eu.luminis.elastic.search.response.aggregations.AggregationKeyDeserializer;
import java.util.Map;
package eu.luminis.elastic.search.response;



/**
 * Main response class for aggregations response. Can contain hits and aggregations
 */
public class HitsAggsResponse<T> extends HitsResponse<T> {

    @JsonProperty
// Path: src/main/java/eu/luminis/elastic/search/response/aggregations/Aggregation.java
// public class Aggregation {
//     private String name;
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// }
// 
// Path: src/main/java/eu/luminis/elastic/search/response/aggregations/AggregationKeyDeserializer.java
// public class AggregationKeyDeserializer extends KeyDeserializer {
//     @Override
//     public String deserializeKey(String key, DeserializationContext ctxt) throws IOException {
//         int position = key.indexOf('#');
//         if (position == -1) {
//             throw ctxt.mappingException(String.format("Key %s should have structure type#key for aggregations", key));
//         }
//         return key.substring(position + 1);
//     }
// }


// Path: src/main/java/eu/luminis/elastic/search/response/HitsAggsResponse.java
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import eu.luminis.elastic.search.response.aggregations.Aggregation;
import eu.luminis.elastic.search.response.aggregations.AggregationKeyDeserializer;
import java.util.Map;

package eu.luminis.elastic.search.response;



/**
 * Main response class for aggregations response. Can contain hits and aggregations
 */
public class HitsAggsResponse<T> extends HitsResponse<T> {

    @JsonProperty
    @JsonDeserialize(keyUsing = AggregationKeyDeserializer.class)