package com.lanyuanxiaoyao.service.loki.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.eclipse.collections.api.list.ImmutableList;
import org.eclipse.collections.api.map.ImmutableMap;

import java.util.Map;

/**
 * Loki 查询接收
 *
 * @author lanyuanxiaoyao
 * @date 2023-05-25
 */
public final class LokiQueryRangeResponse {
    private String status;
    private Result data;

    public String getStatus() {
        return status;
    }

    public Result getData() {
        return data;
    }

    @Override
    public String toString() {
        return "LokiQueryRangeResponse{" +
                "status='" + status + '\'' +
                ", data=" + data +
                '}';
    }

    public static final class Result {
        @JsonProperty("resultType")
        private String type;
        private ImmutableList<Line> result;

        public String getType() {
            return type;
        }

        public ImmutableList<Line> getResult() {
            return result;
        }

        @Override
        public String toString() {
            return "Result{" +
                    "type='" + type + '\'' +
                    ", result=" + result +
                    '}';
        }

        public static final class Line {
            private ImmutableMap<String, String> stream;
            private ImmutableList<ImmutableList<String>> values;

            public ImmutableMap<String, String> getStream() {
                return stream;
            }

            public ImmutableList<ImmutableList<String>> getValues() {
                return values;
            }

            @Override
            public String toString() {
                return "Line{" +
                        "stream=" + stream +
                        ", values=" + values +
                        '}';
            }
        }
    }
}
